Development

#2203 ([PATCH] sf_admin css loads after custom css: can't custom easily)

You must first sign up to be able to contribute.

Ticket #2203 (new defect)

Opened 11 months ago

Last modified 7 months ago

[PATCH] sf_admin css loads after custom css: can't custom easily

Reported by: dehy Assigned to: fabien
Priority: minor Milestone:
Component: generator Version: 1.0.7
Keywords: admin generator css Cc:
Qualification: Design decision

Description

I've noticed a little annoying visual "bug". I'm using the admin generator to administrate my users. I've also done a custom design for my backend (fixed witdh and so on). Filter div doesn't display correctly (position absolute). "Ok, let's custom the style in my own css file."

It actually doesn't custom anything because the /sf/sf_admin/css/main.css loads after my own css.

It would be better if it loads BEFORE then we could adapt the sf_admin style with our own design.

Here is the actuel load order in dev mode:

<link rel="stylesheet" type="text/css" media="screen" href="/sf/sf_web_debug/css/main.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/css/layout.css" /> <link rel="stylesheet" type="text/css" media="screen" href="/sf/sf_admin/css/main.css" />

Attachments

admin-css-first.patch (1.3 kB) - added by chrono on 12/20/07 17:52:26.

Change History

12/20/07 17:52:26 changed by chrono

  • attachment admin-css-first.patch added.

12/20/07 17:55:21 changed by chrono

  • keywords set to admin generator css.
  • component changed from view to generator.
  • qualification set to Accepted.
  • summary changed from sf_admin css loads after custom css: can't custom easily to [PATCH] sf_admin css loads after custom css: can't custom easily.

imho, the idea is correct. the attached patch modifies the default list & edit admin templates to include the admin main.css before the others.

12/24/07 10:22:02 changed by Pascal.Borreli

  • qualification changed from Accepted to Design decision.

If you want to custom admin generator css, you should just use the css option in generator.yml as in:

generator:
  class:              sfPropelAdminGenerator
  param:
    model_class:      Model
    theme:            default
    css:              your_css_in_web_css_folder

So, with that method only one css will be loaded and not problem with loading order..

12/24/07 10:59:38 changed by chrono

Do i understand this correct:

  • put /css/main.css in that config
  • that main.css is included exactly once, no matter where and how often it is included elsewhere
  • then implement everything you need from admin/main.css in main.css, applying your overrides

12/24/07 11:09:23 changed by Pascal.Borreli

Not exactly, i would say :

  • put css: admin (config will look for admin.css in your css folder)
  • yes, admin.css will be included only once.
  • no, more overiding since you copy/rename the original admin main.css to /web/css/admin.css so now if you need to change something, just do it inside your own, the original won't be used.