Responsive admin

294 views
Skip to first unread message

elky

unread,
Jan 9, 2017, 5:59:39 AM1/9/17
to Django developers (Contributions to Django itself)
Hi guys,

Few months ago I released django-flat-responsive app - a simple extension for admin that makes interface mobile and tablet friendly. I tested it on few complex projects using major mobile browsers and it works good. Now I'm going to make pull request to Django repo but before I want to ask community -- is it necessary to have responsive admin?

My thoughts:

Pros:
- It's modern
- Few times I really needed to make some edits inside admin through my mobile (it was painful), so I think some people want admin to be responsive

Cons:
- New admin features should be always tested on mobile devices (or on different screen sizes at least). It also uses CSS3 flexbox so developers shoul learn how it works
- 3rd party apps should care about responsive layout. It's not so easy for some apps like Django Admin Tools or some CMS based on admin

As fas as django-flat-responsive just adds one CSS file to static folder, what if to have an option in settings.py that enables responsive admin?

I would glad to hear your thoughts

Thank you

Aymeric Augustin

unread,
Jan 9, 2017, 6:50:35 AM1/9/17
to django-d...@googlegroups.com
Hello Elky,

I’d love to see this responsive design merged in Django. I’m using the admin from my phone quite often and the lack of a responsive design makes that painful.

The admin gets very few CSS changes. I don’t think we should refrain from adding a useful responsive design out of fear that it will be hard to maintain.

An opt-out mechanisms for third-party apps that don’t want the responsive styles will a nice touch (but not absolutely necessary in my opinion). I don’t think a setting is appropriate. I’d rather use the template or static file overriding mechanisms, for example:
- perhaps supplying an empty CSS file with the same name overrides the file provided by the admin? (I’m not sure)
- alternatively responsive styles could apply only within body.responsive; the admin’s template would have a <body class=“responsive”>; third party apps could override that template and remove the class

Thanks for you work on the admin’s style,

-- 
Aymeric.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/dd915c1d-d8a8-4f91-a223-268e17044cd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Johnson

unread,
Jan 9, 2017, 6:59:48 AM1/9/17
to django-d...@googlegroups.com
- perhaps supplying an empty CSS file with the same name overrides the file provided by the admin? (I’m not sure)

It does, as long as the app it's in is before django.contrib.admin in INSTALLED_APPS, django-grappelli uses this mechanism to extend/replace the admin's javascript and styles.

I'm totally +1 for the responsive CSS too, thanks for your work on django-flat-theme!

-- 
Aymeric.

To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Adam

Marc Tamlyn

unread,
Jan 9, 2017, 8:26:56 AM1/9/17
to django-d...@googlegroups.com
I'd suggest including this with a mechanism (on the admin site?) to disable it for a while if that causes problems for existing custom setups?

Marc

Collin Anderson

unread,
Jan 10, 2017, 9:31:24 PM1/10/17
to django-d...@googlegroups.com
I think for the admin fonts, we put those in a separate css file: fonts.css, so you could easily disable them by replacing that file with a blank file. We could probably do the same thing with a responsive.css file.

(Though if we do give the option to switch, do we now need to support and test every change for both cases? or maybe from now on we only touch responsive.css?)

Collin

elky

unread,
May 28, 2017, 6:46:40 AM5/28/17
to Django developers (Contributions to Django itself)
Bump!

Sorry for so long silence. Seems it's done - I added some more tweaks to the app.

Regarding third-party apps, I think the most less-painful ways to disable responsive css are:
- override responsive.css or make it empty;
- override admin base.html to remove <meta name="viewport"> tag which enables responsive stuff for devices (it won't help for desktop browsers).


I prepared demo site for quick testing, it contains few models with some non-trivial admin features. Feel free to test it on your device!   

login: demo
password: demo

Any CSS problems? Please report here.
If you think to add more admin features to test (I missed something or you have complex example) please create an issue or submit pull request here.

Thanks

Óscar M. Lage

unread,
May 30, 2017, 4:04:51 AM5/30/17
to Django developers (Contributions to Django itself)
Nice suggestion!, imho something like a specific settings RESPONSIVE_ADMIN=True (or False) would be nice to let the people choose.

Thanks Elky for the effort!.


El lunes, 9 de enero de 2017, 14:26:56 (UTC+1), Marc Tamlyn escribió:
I'd suggest including this with a mechanism (on the admin site?) to disable it for a while if that causes problems for existing custom setups?

Marc
On 9 January 2017 at 11:59, Adam Johnson <m...@adamj.eu> wrote:
- perhaps supplying an empty CSS file with the same name overrides the file provided by the admin? (I’m not sure)

It does, as long as the app it's in is before django.contrib.admin in INSTALLED_APPS, django-grappelli uses this mechanism to extend/replace the admin's javascript and styles.

I'm totally +1 for the responsive CSS too, thanks for your work on django-flat-theme!
-- 
Aymeric.

To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.



--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.

Tim Graham

unread,
Jun 8, 2017, 3:11:44 PM6/8/17
to Django developers (Contributions to Django itself)
A pull request is available for review: https://github.com/django/django/pull/8610

I don't have any experience writing responsive CSS so reviews from experts in that area would be welcome.
Reply all
Reply to author
Forward
0 new messages