comparison sat_website/utils.py @ 40:dfe7139dae0a

add links to the statutes and rules of the association in the adhesion form
author souliane <souliane@mailoo.org>
date Tue, 03 Feb 2015 15:14:42 +0100
parents d2c45f4ba57e
children 1a0f24401866
comparison
equal deleted inserted replaced
39:d2c45f4ba57e 40:dfe7139dae0a
47 result[name] = (ext_path, version, infos[name] if name in infos else '') 47 result[name] = (ext_path, version, infos[name] if name in infos else '')
48 48
49 return result 49 return result
50 50
51 def get_libervia_demo_url(): 51 def get_libervia_demo_url():
52 """Return the URL to Libervia online demo""" 52 """Returns the URL to Libervia online demo."""
53 return settings.LIBERVIA_DEMO_URL 53 return settings.LIBERVIA_DEMO_URL
54 54
55 def get_asso_urls():
56 """Returns URLs related to the association"""
57 return {'asso_url_statutes': settings.ASSO_URL_STATUTES,
58 'asso_url_rules': settings.ASSO_URL_RULES
59 }
60
55 def get_asso_finance_status(): 61 def get_asso_finance_status():
56 """Returns information about the financement of the association""" 62 """Returns information about the financing of the association."""
57 def get_items(actual, target, prefix): 63 def get_items(actual, target, prefix):
58 actual = int(actual) 64 actual = int(actual)
59 target = int(target) 65 target = int(target)
60 perc = actual * 100 / target 66 perc = actual * 100 / target
61 return {prefix + 'actual': actual, 67 return {prefix + 'actual': actual,
68 items = get_items(settings.ASSO_FINANCE_ACTUAL, settings.ASSO_FINANCE_TARGET, 'asso_finance_') 74 items = get_items(settings.ASSO_FINANCE_ACTUAL, settings.ASSO_FINANCE_TARGET, 'asso_finance_')
69 items.update(get_items(settings.ASSO_MEMBERS_ACTUAL, settings.ASSO_MEMBERS_TARGET, 'asso_members_')) 75 items.update(get_items(settings.ASSO_MEMBERS_ACTUAL, settings.ASSO_MEMBERS_TARGET, 'asso_members_'))
70 return items 76 return items
71 77
72 def get_asso_subscr_amounts(): 78 def get_asso_subscr_amounts():
79 """Returns the subscription amounts as defined in the Rules of the association."""
73 return settings.ASSO_SUBSCR_AMOUNTS 80 return settings.ASSO_SUBSCR_AMOUNTS