comparison sat_website/views.py @ 78:6250b65523c6

categories' aliases can be defined to be able to use "French" links like adhesion.html
author souliane <souliane@mailoo.org>
date Tue, 09 Jun 2015 15:19:50 +0200
parents 13ebb548f234
children 4b4a5d7602f8
comparison
equal deleted inserted replaced
77:13ebb548f234 78:6250b65523c6
50 50
51 CATEGORIES_RIGHT = OrderedDict([("membership", _(u"Membership")), 51 CATEGORIES_RIGHT = OrderedDict([("membership", _(u"Membership")),
52 ("social_contract", _(u"Social contract")), 52 ("social_contract", _(u"Social contract")),
53 ]) 53 ])
54 54
55 CATEGORIES_ALIASES = {"adhesion": "membership",
56 "adhesion_form": "membership_form",
57 }
58
55 CATEGORIES_HIDDEN = ('membership_form', 'thank_you') 59 CATEGORIES_HIDDEN = ('membership_form', 'thank_you')
56 60
57 PROJECTS_INFOS = {'sat': _(u'contains the backend, Primitivus and Jp'), 61 PROJECTS_INFOS = {'sat': _(u'contains the backend, Primitivus and Jp'),
58 'sat_media': _(u'Images and other media needed to launch SàT'), 62 'sat_media': _(u'Images and other media needed to launch SàT'),
59 'urwid_satext': _(u'console display library needed by Primitivus'), 63 'urwid_satext': _(u'console display library needed by Primitivus'),
63 67
64 def overview(request): 68 def overview(request):
65 return render_to_response('sat_website/overview.html') 69 return render_to_response('sat_website/overview.html')
66 70
67 def generic_cat(request, category): 71 def generic_cat(request, category):
72 if category in CATEGORIES_ALIASES:
73 category = CATEGORIES_ALIASES[category]
74
68 context = RequestContext(request, { 75 context = RequestContext(request, {
69 "available_languages": ['fr', 'en'], 76 "available_languages": ['fr', 'en'],
70 "categories": CATEGORIES, 77 "categories": CATEGORIES,
71 "categories_right": CATEGORIES_RIGHT, 78 "categories_right": CATEGORIES_RIGHT,
72 "category": category, 79 "category": category,