Changeset 17968d469c9f73e1db9c669ea9958d8bfe2a0094


Ignore:
Timestamp:
12/23/09 00:34:29 (2 years ago)
Author:
Flupke <luper.rouch@…>
Children:
980abcd884374656c6988c9b856917e35bf19d69
Parents:
1fc1a76f248140aa640ebd8c2aec18af407860a4
git-committer:
Flupke <luper.rouch@…> (12/23/09 00:34:29)
Message:

derez: added controls to select the current language

Location:
derez
Files:
6 added
7 edited

Legend:

Unmodified
Added
Removed
  • derez/derez.egg-info/SOURCES.txt

    r1fc1a76 r17968d4  
    77derez/apps/__init__.py 
    88derez/apps/derezapp/__init__.py 
     9derez/apps/derezapp/admin.py 
    910derez/apps/derezapp/context_processors.py 
    1011derez/apps/derezapp/models.py 
  • derez/derez/apps/derezapp/context_processors.py

    r30e2c39 r17968d4  
     1from django.conf import settings 
     2from derezapp import settings 
     3 
     4 
    15def location(request): 
     6    # Compute location from the beginning of the URL 
    27    location = None 
    38    if request.path == "/" or request.path.startswith("/news"): 
     
    914    elif request.path.startswith("/contact"): 
    1015        location = "contact" 
    11     return {"LOCATION": location} 
     16    # Compute french and english locations of the current page 
     17    fr_location = settings.FR_HOST + request.path 
     18    en_location = settings.EN_HOST + request.path 
     19    return { 
     20            "LOCATION": location, 
     21            "FR_LOCATION": fr_location, 
     22            "EN_LOCATION": en_location, 
     23        } 
  • derez/derez/apps/derezapp/templates/base.html

    r1fc1a76 r17968d4  
    1717            {% block content %}{% endblock %} 
    1818        </div> 
     19        <div id="langs"> 
     20            <a id="fr-flag" href="{{ FR_LOCATION }}" {% ifequal LANGUAGE_CODE "fr-fr" %}class="selected"{% endifequal %}></a> 
     21            <a id="eu-flag" href="{{ EN_LOCATION }}" {% ifequal LANGUAGE_CODE "en-us" %}class="selected"{% endifequal %}></a> 
     22        </div> 
    1923    </body> 
    2024</html> 
  • derez/derez/projects/dev/manage

    r58ed492 r17968d4  
    11#!/bin/sh 
    22 
    3 ./manage.py $@ --settings=derez.projects.dev.settings_fr 
     3django-admin.py $@ --settings=derez.projects.dev.settings_fr 
  • derez/derez/projects/settings_base.py

    r1fc1a76 r17968d4  
    5050    "django.core.context_processors.request", 
    5151    "django.core.context_processors.media", 
     52    "django.core.context_processors.i18n", 
    5253    "derezapp.context_processors.location", 
    5354) 
     
    112113    } 
    113114} 
    114  
  • derez/static/css/derez.css

    r1fc1a76 r17968d4  
    312312    background: transparent url(../images/sprites.png) 0px -485px no-repeat; 
    313313} 
     314 
     315/** 
     316 * Flags 
     317 */ 
     318 
     319#fr-flag { 
     320    position: fixed; 
     321    right: 60px; 
     322    bottom: 5px; 
     323    width: 50px; 
     324    height: 36px; 
     325    background: transparent url(../images/sprites.png) -143px -21px no-repeat; 
     326} 
     327 
     328#fr-flag:hover, #fr-flag.selected { 
     329    position: fixed; 
     330    right: 60px; 
     331    bottom: 5px; 
     332    width: 50px; 
     333    height: 36px; 
     334    background: transparent url(../images/sprites.png) -75px -21px no-repeat; 
     335} 
     336 
     337#eu-flag { 
     338    position: fixed; 
     339    right: 5px; 
     340    bottom: 5px; 
     341    width: 50px; 
     342    height: 36px; 
     343    background: transparent url(../images/sprites.png) -143px -79px no-repeat; 
     344} 
     345 
     346#eu-flag:hover, #eu-flag.selected { 
     347    position: fixed; 
     348    right: 5px; 
     349    bottom: 5px; 
     350    width: 50px; 
     351    height: 36px; 
     352    background: transparent url(../images/sprites.png) -75px -79px no-repeat; 
     353} 
     354 
Note: See TracChangeset for help on using the changeset viewer.