Giter VIP home page Giter VIP logo

grappelli-safe's Introduction

grappelli-safe's People

Contributors

akhayyat avatar alexhill avatar anweshadas avatar christianwgd avatar dbischof avatar dpnova avatar drfraser avatar dsanders11 avatar duduklein avatar gavinwahl avatar gradel avatar haganf avatar huxley avatar ivanvpan avatar jcartmell avatar jerivas avatar joshcartme avatar kenbolton avatar makarenya avatar nikolas avatar poptosic avatar rundll avatar ryneeverett avatar simenheg avatar sjkingo avatar stephenmcd avatar theju avatar zgohr avatar zmetcalf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

grappelli-safe's Issues

Correct the usage of static tags

In templates/admin/login.html and other pages, the static tags are used like:

{% static "grappelli/" %}css/login.css"

If one is using django-storages alongside S3, then this url will get output like:

https://bucket-name.s3.amazonaws.com/grappelli?Signature=AWZ...&Expires=1364844543&AWSAccessKeyId=AKI...css/login.css

instead of

https://bucket-name.s3.amazonaws.com/grappelli/css/login.css?Signature=AWZ...&Expires=1364844543&AWSAccessKeyId=AKI...

I think the usage should be {% static "grappelli/css/login.css" %}. There are a few other templates that need to be fixed with for these as well.

Can you please confirm this change and if you wish I can send you a pull request.

Django 2.1+ compatibility

There are some minor css issues:

  • the horizontal filter widget css makes the widget too small
  • there's no css for the new autocomplete widgets (select2)

Style tel input fields the same as text/email/etc.

Now that input[type="tel"] fields are becoming more common, ideally they would be styled the same as similar fields (namely in height & padding).

This can be achieved with adding a line to /grappelli_safe/static/grappelli/css/forms.css:

/*  Text inputs ................................................... */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],       /* Add this line */
input[type="number"] {
    padding: 5px 3px 4px;
    height: 14px;
}

Database returned an invalid datetime value. Are time zone definitions for your database and pytz installed?

Template error:

In template /usr/local/lib/python3.5/dist-packages/grappelli_safe/templates/admin/change_list.html, error at line 146
   Database returned an invalid datetime value. Are time zone definitions for your database and pytz installed?   136 :                                 <p>{% blocktrans with cl.result_count as counter %}{{ counter }} found{% endblocktrans %}</p>
   137 :                                 <a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a>
   138 :                             </div>
   139 :                         </div>
   140 :                         {% endifnotequal %}
   141 : 
   142 :                         <!-- Search -->
   143 :                         {% block search %}{% search_form cl %}{% endblock %}
   144 : 
   145 :                         <!-- Date Hierarchy -->
   146 :                         {% block date_hierarchy %} {% date_hierarchy cl %} {% endblock %}
   147 : 
   148 :                         {% if cl.has_filters %}
   149 :                         <!-- Filter -->
   150 :                         <div class="module filter">
   151 :                             <h2>{% trans 'Filter' %}</h2>
   152 :                             {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
   153 :                         </div>
   154 :                         {% endif %}
   155 : 
   156 :                     </div>

Traceback:

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py" in inner
  42.             response = get_response(request)

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _get_response
  217.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _get_response
  215.                 response = response.render()

File "/usr/local/lib/python3.5/dist-packages/django/template/response.py" in render
  109.             self.content = self.rendered_content

File "/usr/local/lib/python3.5/dist-packages/django/template/response.py" in rendered_content
  86.         content = template.render(context, self._request)

File "/usr/local/lib/python3.5/dist-packages/django/template/backends/django.py" in render
  66.             return self.template.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  208.                     return self._render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/loader_tags.py" in render
  174.         return compiled_parent._render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/loader_tags.py" in render
  174.         return compiled_parent._render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/loader_tags.py" in render
  70.                 result = block.nodelist.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/loader_tags.py" in render
  70.                 result = block.nodelist.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/defaulttags.py" in render
  315.                 return nodelist.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/loader_tags.py" in render
  70.                 result = block.nodelist.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/usr/local/lib/python3.5/dist-packages/django/template/library.py" in render
  225.         _dict = self.func(*resolved_args, **resolved_kwargs)

File "/usr/local/lib/python3.5/dist-packages/django/contrib/admin/templatetags/admin_list.py" in date_hierarchy
  417.                 } for year in years]

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __iter__
  256.         self._fetch_all()

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in _fetch_all
  1087.             self._result_cache = list(self.iterator())

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __iter__
  155.         for row in compiler.results_iter():

File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in results_iter
  795.                     row = self.apply_converters(row, converters)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in apply_converters
  779.                 value = converter(value, expression, self.connection, self.query.context)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/functions/datetime.py" in convert_value
  181.                         "Database returned an invalid datetime value. "

Exception Type: ValueError at /admin/blog/blogpost/
Exception Value: Database returned an invalid datetime value. Are time zone definitions for your database and pytz installed?

For temporary solution, you can use USE_TZ = False in your settings file.

Two deprecated template tags should be removed

pip install will install two files that are not in the code:
/Python/2.7/site-packages/grappelli_safe/templates/registration/logged_out.html
/Python/2.7/site-packages/grappelli_safe/templates/registration/password_reset_email.html

However, if I pip install directly from master branch, those two files will not be created, so there must be something broken when the package was put on PyPi.

future and crispy_forms_tags should be removed from the following templates.

Invalid template /local/lib/python2.7/site-packages/grappelli_safe/templates/registration/password_reset_email.html: 'future' is not a registered tag library.
Invalid template /local/lib/python2.7/site-packages/rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html: 'crispy_forms_tags' is not a registered tag library.

Javascript files not loading properly (with trunk/devel Mezzanine)

On Windows, with Python 2.7.1, and the development snapshots of today for grappelli, grappelli_safe and mezzanine, the jQuery and other javascript files are not loading properly:

"c:\python271\lib\site-packages\grappelli_safe-0.1.8-py2.7.egg\grappelli_safe\media\js/jquery.min.js" does not exist

The settings file contains the defaults for the relevant bits.

tiny_mce image plugin

Mezzanine ver 3.1.10 and grappelli-safe ver 0.3.13

From a fresh install of mezzanine, i'm running into minor annoyance with tiny_mce's popup insert/edit image view. There is just a blank gray square where i think an icon should appear.
screen shot 2015-01-13 at 9 36 38 am

I think this might be missing some css, perhaps 'advimage.css' from the admin's base.html.. I'd love to fix this as we need the icon for usablility and i'd rather keep this version of tiny_mce and avoid more work.

Any idea's?

thanks,

-hagan

Django 1.11.11 - broken "Select All" checkbox

Hey,
After upgrading to Django 1.11 our "Select All" checkbox is not selecting all items on the page.
I've spend some time debugging the issue and it looks like it's related to 4c90351
which seems to be out of date in newer Django.
From Django 1.9 actions.js file looks like: https://github.com/django/django/blob/stable/1.11.x/django/contrib/admin/static/admin/js/actions.js
and when using this code it works again.
If you want I can prepare pull request which deletes actions.js (I think it is not needed anymore?)
Thanks

Incorrect "Cancel" link on delete_selected_confirmation.html

When I select a few objects in admin mode and click "Delete selected objects", I am presented with 2 options:

  1. "Yes, I'm sure", which brings me back to the page where I selected the objects.
  2. "Cancel", which sends me one step back in the page hierarchy: https://github.com/stephenmcd/grappelli-safe/blob/master/grappelli_safe/templates/admin/delete_selected_confirmation.html#L47

I would expect (2) to send me to the same page as (1) after completing the operation. Looking at the latest Django template, this seems to be working properly by using the "window.history.back()" event: https://github.com/django/django/blob/stable/1.9.x/django/contrib/admin/templates/admin/delete_selected_confirmation.html#L45 Would you consider fixing this in "grappelli-safe"?

Very slow admin when using grappelli safe

Django admin is very slow when using grappelli safe. Does any have same issue ? It is taking 26 to 56 seconds when grappelli safe is added to installed apps. But when it is commented, its fast.

localized datetime format in object history seems to be incorrect

for example in german localization this is rendered as:
"Dinachm.CEST1464117217MaithMai+0200RMainachm.CEST"

I suppose this is because the action_time field is treated as a translated string:

{{ action.action_time|date:**_("DATETIME_FORMAT")** }}

When i change that to simple "DATETIME_FORMAT" i get the correct german localized datetime string:
"24. Mai 2016 21:13"

Add User form in Admin shows two field blocks

I am not doing anything special or customized - when I click on the "Add User" button in the Admin site, the resulting page has two fieldsets:

the top is for adding username, password, password confirm and there are text fields like I'd expect

the bottom half shows another block like the top, but without text fields, along with a message about "First, enter a username and password. Then, you'll be able to edit more user options."

looking at the templates, the admin/auth/user/add_form.html overrides the admin/change_form.html and adds content for block after_fields_sets - and this block uses template variable 'form'. Since form is not defined, there are no text fields generated

admin/change_form.html is the template handling the top block, which uses variable adminform. Thus the input text fields get generated. On submittal of this form, a new form gets shown, one with all the user related fields. So functionality isn't impaired

My inclination is to guess that auth/user/add_form.html hasn't been updated to deal with some new logic, given it's 3 years old. Or is there somewhere else where adminform never gets set, and instead template variable 'form' gets set?

right now, having two formsets that show the same set of fields, and one doesn't have text fields, makes things look quite broken

Unlocalize pk in delete_selected_confirmation.html template

Object's pk should be unlocalized in delete_selected_confirmation.html because it raises an error when localization is turned on, for numbers above 999 when there is a thousand separator. I think this was corrected in django-grapelli.

Tabular inlines > filebrowser-safe

Hello,

I'm trying to use FileBrowser-Safe into tabular inlines.
The inline generated on page loading is ok : I can display FileBrowser window which makes me able to select a file.
Without loading the page, if I continue to add a file in a second inline, I can display the FileBrowser window but NOT selecting a file.

Here is the link generated on the second inline which makes me able to show FileBrowser window :
javascript:FileBrowser.show('id_images-__prefix__-file',%20'/admin/media-library/browse/?pop=1&dir=images&type=Image');

__prefix__should be replaced by the current item id.

It works for other sibling fields (input, textarea and select) on the second inlines.

Django==1.9.7
grappelli-safe==0.4.4 (branch dynamic_stacked)
filebrowser-safe==0.4.5

Executable bit set on js/css files

Hi,

The executable bit is set on these ressources filles, it is not necessary

grappelli_safe/static/grappelli/css/modules.css
grappelli_safe/static/grappelli/css/typography.css
grappelli_safe/static/grappelli/css/tables.css
grappelli_safe/static/grappelli/css/reset.css
grappelli_safe/static/grappelli/css/webkit-gradients.css

grappelli_safe/static/grappelli/js/admin/CollapsedInlineFieldsets.js

You should remove it.

view.bookmarks.get_bookmark csrf warning

The grp_csrf_tag emits a warning since it can't find the csrf_tag in the context when trying to render this view.

As the warning message helpfully suggests, the view indeed doesn't use RequestContext. Wrapping the dictionary in the render_to_response call in a RequestContext fixed this bug.

Errors not displayed properly in fieldsets.

As can be seen in the image, the error is being displayed on the wrong field.

I've tested on other rows of fields and as far as I can tell if there is one error on a row all the inputs on that row get highlighted. If that's the case then this fix should fix it: dpnova@bc10ea1 check line 513 (sorry about the IDE white space fixes)

If you think that's the right fix I'll issue a pull request.

Screen Shot 2013-01-14 at 7 20 41 PM

collectstatic error after installing 0.5.0

running collectstatic this error occurs:

Found another file with the destination path 'admin/js/actions.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
Found another file with the destination path 'admin/js/actions.min.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.