comparison sat_website/views.py @ 55:a1e457ac6871

split adhesion.html between adhesion.html and association.html
author souliane <souliane@mailoo.org>
date Tue, 05 May 2015 15:02:50 +0200
parents cc099372a9ac
children 01e9c646999f
comparison
equal deleted inserted replaced
54:d54f2f09a73a 55:a1e457ac6871
39 ("downloads", _(u"Downloads")), 39 ("downloads", _(u"Downloads")),
40 ("developers", _(u"Developers corner")), 40 ("developers", _(u"Developers corner")),
41 ]))), 41 ]))),
42 ('community', (_(u"Community"), 42 ('community', (_(u"Community"),
43 OrderedDict([("community", _(u"Get in touch")), 43 OrderedDict([("community", _(u"Get in touch")),
44 #("association", _(u"Association")), 44 ("association", _(u"Association")),
45 ("links", _(u"Links")), 45 ("links", _(u"Links")),
46 ]))), 46 ]))),
47 ]) 47 ])
48 48
49 CATEGORIES_RIGHT = OrderedDict([("adhesion", _(u"Adhesion")), 49 CATEGORIES_RIGHT = OrderedDict([("adhesion", _(u"Adhesion")),
82 context["screenshots_tech"] = screenshots.screenshots_tech 82 context["screenshots_tech"] = screenshots.screenshots_tech
83 elif category == "social_contract": 83 elif category == "social_contract":
84 context["SOCIAL_CONTRACT"] = social_contract.get_social_contract() 84 context["SOCIAL_CONTRACT"] = social_contract.get_social_contract()
85 elif category == "downloads": 85 elif category == "downloads":
86 context["projects_infos"] = utils.get_projects_infos(PROJECTS_INFOS) 86 context["projects_infos"] = utils.get_projects_infos(PROJECTS_INFOS)
87 elif category == "adhesion": 87 elif category in ("association", "adhesion"):
88 context.update(utils.get_asso_finance_status()) 88 context.update(utils.get_asso_finance_status())
89 context.update(utils.get_asso_urls()) 89 context.update(utils.get_asso_urls())
90 elif category == "adhesion_form": 90 elif category == "adhesion_form":
91 if request.method == 'POST': 91 if request.method == 'POST':
92 form = forms.RegistrationForm(request.POST) 92 form = forms.RegistrationForm(request.POST)
93 form.process_submitted_data() 93 form.process_submitted_data()
94 if form.is_valid(): 94 if form.is_valid():
95 category = 'thank_you' 95 category = 'thank_you'
96 else: 96 else:
97 form = forms.RegistrationForm(initial={'subscription_amount': 10, 97 form = forms.RegistrationForm(initial={'subscription_amount': 10,
98 'payment_method': 'card'}) 98 'payment_method': 'transfer'})
99 context['form'] = form 99 context['form'] = form
100 context.update(utils.get_asso_urls()) 100 context.update(utils.get_asso_urls())
101 101
102 def all_keys(cats): 102 def all_keys(cats):
103 subcats = [value[1].keys() for value in cats.values() if isinstance(value, tuple)] 103 subcats = [value[1].keys() for value in cats.values() if isinstance(value, tuple)]