Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#349 closed (fixed)

[patch] Bad styling in Admin interface

Reported by: eugene@… Owned by: Jacob
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Both Internet Explorer 6 and Firefox 1.0.6 (on PC) have visualization problems with Admin interface.

1) FF doesn't show default button (Save in my example). It draws it white on white making text invisible. Screenshot: http://www.lazutkin.com/ff.jpg

2) IE shows buttons but as far as I can tell while it is not shown correctly, it is visible and usable. The bigger problem is incomplete background of collapsed fieldset ("Date information" in my example). Screenshot: http://www.lazutkin.com/ie6.jpg

3) Both browsers have almost invisible text for collapsed fieldsets. See examples above.

Change History (14)

comment:1 Changed 11 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

Looks like an image problem -- your admin media files don't appear to be loading.

comment:2 Changed 11 years ago by Wilson Miner

Resolution: invalid
Status: closedreopened

I'll look into this - I can at least set the fallback background colors to make the buttons and headers readable when the images don't load.

comment:3 Changed 11 years ago by Wilson Miner

Owner: changed from Adrian Holovaty to Wilson Miner
Status: reopenednew

comment:4 Changed 11 years ago by eugene@…

If my admin media files are not being loaded, it should be explained somewhere how to do it correctly. FAQ mentions MEDIA_ROOT only in unrelated context. Should I fiddle with MEDIA_URL? How to do it with "django-admin.py runserver" web server?

Nevertheless, if you look at examples again, you will see that some images are there (like red cross before "Delete"). It means that css from media directory is loaded along with the red cross image.

In any case it doesn't explain shifted background in ff. And it doesn't explain choice of color for collapsed fieldset.

comment:5 Changed 11 years ago by Wilson Miner

Resolution: fixed
Status: newclosed

Since there are a few separate issues here, let me respond to each of them individually

  • I've modified the admin styles to make things more readable with images off See [537].
  • I can't duplicate the situation you've shown where some images load and others do not in Firefox or IE on any platform.
  • The issue with unstyled form buttons in IE is known. It's a cosmetic issue related to IE's lack of support for form button styling. The buttons work in IE, they're just not pretty. It's a wontfix for now.

comment:6 Changed 11 years ago by eugene@…

Thank you. Now it is fully usable. I'll try to investigated bizarre behaviour on my own (some pictures are loaded, while some are not). If I find the reason, I'll open new ticket.

What worries me a little bit is the example was the plain vanilla tutorial Polls example, which was done according to the letter of tutorials. Tutorials are supposed to work from the first go without any hiccups.

comment:7 Changed 11 years ago by eugene@…

Hmm. It looks like media files are sent but they are garbled.

When I try to access file directly with ff I am getting error like that:

The image “http://localhost:8000/media/img/admin/icon_searchbox.png” cannot be displayed, because it contains errors.

If I try to access non-existent file, I am getting something like that:

Page not found: C:\Projects\Django\django/conf/admin_media\img/admin/icon_searchbox_ABC.png

Which is correct.

I venture to say that "django-admin.py runserver" doesn't set correct mime type for media files and/or send them as text files. The latter case would garble images by replacing \n with \r\n on Windows platform, which is my case.

Does it help?

comment:8 Changed 11 years ago by ibatugow@…

Resolution: fixed
Status: closedreopened

Media files should be opened in binary mode. Seems important on Windows.
Maybe there are other places were this change is needed too ?

Index: trunk/django/core/servers/basehttp.py
===================================================================
--- trunk/django/core/servers/basehttp.py       (r├®vision 537)
+++ trunk/django/core/servers/basehttp.py       (copie de travail)
@@ -623,7 +623,7 @@
             output = ['Page not found: %s' % file_path]
         else:
             try:
-                fp = open(file_path, 'r')
+                fp = open(file_path, 'rb')
             except IOError:
                 status = '401 UNAUTHORIZED'
                 headers = {'Content-type': 'text/plain'}

comment:9 Changed 11 years ago by mgood

I was having the same problem with runserver on Windows and the patch above for reading media files in binary mode seems to work.

comment:10 Changed 11 years ago by Jacob

Owner: changed from Wilson Miner to Jacob
Status: reopenednew
Summary: Bad styling in Admin interface[patch] Bad styling in Admin interface

comment:11 Changed 11 years ago by Jacob

Status: newassigned

comment:12 Changed 11 years ago by Adrian Holovaty

Resolution: fixed
Status: assignedclosed

Fixed in [575].

comment:13 Changed 11 years ago by Home

Type: defect

comment:14 Changed 10 years ago by (none)

milestone: Version 1.0

Milestone Version 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top