google-code-export / django-profile

Automatically exported from code.google.com/p/django-profile
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Patch for working fine without blueprint #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As i said on the mailing-list
(https://groups.google.com/group/django-profile/browse_thread/thread/9b1545447b2
825e8),
i've done some work for using another css framework instead of blueprint,
or whatever css classes you want.

I've done this by using a context processor, which check a settings
variable for choosing a dict to use in templates (do not forget to declare
the processor in your settings too !)

User can set either a string, to refer to one of the defined dicts, or a
dict to set it's own classes.

Here the dict for blueprint (the default one) :

-----------
        # for "blueprint css", all width
        'blueprint': {
                'content_main_2col':    'span-13 prepend-1 colborder',
                'content_related':      'span-8 last',
                'content_main':         'span-22 prepend-1 append-1',
                'nav':                  'span-24 last',
                'public_vcard_content': 'span-10',
                'public_vcard_map':     'span-10',
                'overview_avatar':      'span-3',
                'overview_details':     'span-9 last',
                'overview_location':    'span-12 last',
        },
------------

And for 960gs :
------------
        # for "960gs" with 12 columns, all width
        '960gs-12': {
                'content_main_2col':    'grid_8',
                'content_related':      'grid_4',
                'content_main':         'grid_12',
                'nav':                  'grid_12',
                'public_vcard_content': 'grid_6 alpha',
                'public_vcard_map':     'grid_6 omega',
                'overview_avatar':      'grid_2 alpha',
                'overview_details':     'grid_6 omega',
                'overview_location':    'grid_8 alpha omega',
        },
------------

I've just worked with "span-*", "last", "prepend-*", "append-*" and
"colborer" classes because all others are comprehensive enough to be
defined in a css ("box", "notice"...) 

Patches are attached

Twidi

PS : an idea to avoid declaring the processor in the settings if you want
to use blueprint ? Without overloading the templates by doing stuff like this :
-------
class="{% if css_frm %}{{css_frm.content_main}}{% else %}span-22 prepend-1
append-1{% endif %}
-------
which is ugly for me :)

Original issue reported on code.google.com by stephane.angel on 7 Apr 2009 at 9:00

Attachments:

GoogleCodeExporter commented 9 years ago
I've commited my work in rev 391, after renaming "css_framework" and "css_frm" 
by
"css_classes"
In rev 390 i've added a new css file "django-profile-basics.css" for classes 
defined
in blueprint that must be redefined if another framework or set of classes is 
used
(error, quiet, success...)

Original comment by stephane.angel on 8 Apr 2009 at 9:21