comparison sat_website/forms.py @ 147:d0cd185f9b61

replace apayer with liberapay
author souliane <souliane@mailoo.org>
date Tue, 17 Oct 2017 06:01:01 +0200
parents c868187b8d00
children 75a95a1dfeb6
comparison
equal deleted inserted replaced
146:1ab868ec224a 147:d0cd185f9b61
94 jid = EmailField(required=False, label=_(u'Jabber ID (for example your SàT login)')) 94 jid = EmailField(required=False, label=_(u'Jabber ID (for example your SàT login)'))
95 95
96 section_3 = Section(label=_(u'Subscription')) 96 section_3 = Section(label=_(u'Subscription'))
97 subscription_amount = ChoiceField(choices=[(amount, u"%s €" % amount) for amount in utils.get_asso_subscr_amounts()]) 97 subscription_amount = ChoiceField(choices=[(amount, u"%s €" % amount) for amount in utils.get_asso_subscr_amounts()])
98 98
99 section_3b = Section(label="") 99 section_4 = Section(label=_(u'Reference'))
100 payment_method = ChoiceField(choices=[(u"transfer", _(u"Bank transfer")), (u"card", _(u"Credit or debit card"))],
101 help_text=_(u'Choose "Bank transfer" to proceed manually with the association\'s IBAN/BIC numbers. Choose "Credit or debit card" to pay via CB, Visa or Mastercard using a secure banking service. For both methods, we will first send you an email containing all the details.'), widget=forms.RadioSelect)
102
103 section_5 = Section(label=_(u'Reference'))
104 reference = CharField(required=False, label=_(u"Reference"), placeholder=_(u"Adherent number in case of a renewal")) 100 reference = CharField(required=False, label=_(u"Reference"), placeholder=_(u"Adherent number in case of a renewal"))
105 101
106 section_6 = Section(label=_(u'Comment')) 102 section_5 = Section(label=_(u'Comment'))
107 comment = CharField(required=False, label=_(u"Comment"), placeholder="", widget=forms.Textarea(attrs={'rows': 3})) 103 comment = CharField(required=False, label=_(u"Comment"), placeholder="", widget=forms.Textarea(attrs={'rows': 3}))
108 104
109 mailing = BooleanField(required=False, label=_(u"I would like to subscribe to the adherents' mailing list.")) 105 mailing = BooleanField(required=False, label=_(u"I would like to subscribe to the adherents' mailing list."))
110 106
111 def html_link(url, label): 107 def html_link(url, label):
165 continue # filter out section fields 161 continue # filter out section fields
166 if field.name in ('email_confirmation', 'agreement_confirmation'): 162 if field.name in ('email_confirmation', 'agreement_confirmation'):
167 continue # filter out confirmation fields 163 continue # filter out confirmation fields
168 if user_readable and not field.value(): 164 if user_readable and not field.value():
169 continue # filter out empty value 165 continue # filter out empty value
170 if user_readable and field.name == "payment_method" and self['subscription_amount'].value() == "0":
171 continue # filter out fields that are not pertinent for the user
172 key = field.name 166 key = field.name
173 if isinstance(field.field, BooleanField) and user_readable: 167 if isinstance(field.field, BooleanField) and user_readable:
174 value = ugettext(u"yes") if field.value() else ugettext(u"no") 168 value = ugettext(u"yes") if field.value() else ugettext(u"no")
175 else: 169 else:
176 value = re.sub(r"[\n\r]+", ", ", unicode(field.value())) 170 value = re.sub(r"[\n\r]+", ", ", unicode(field.value()))
231 Payee: Salut à Toi 225 Payee: Salut à Toi
232 IBAN: {iban} 226 IBAN: {iban}
233 BIC: {bic} 227 BIC: {bic}
234 Reason: subscription of {name} {surname} {ref_info} 228 Reason: subscription of {name} {surname} {ref_info}
235 229
236 Or, if you prefer, you can proceed with a credit or debit card: 230 If you prefer, you can use the open funding platform Liberapay (since the donations there are anonymous, please reply to this email to inform us if you select this option):
237 231
238 https://www.apayer.fr/salut-a-toi 232 https://liberapay.com/salut_a_toi
239 233
240 """) 234 """)
241 FOOTER = ugettext(u"""Below a copy of the information we received: 235 FOOTER = ugettext(u"""Below a copy of the information we received:
242 236
243 {result} 237 {result}