comparison sat_website/forms.py @ 74:651c4049f32b

rename "Newsletter" to "Mailing list" in the adhesion form
author souliane <souliane@mailoo.org>
date Thu, 28 May 2015 01:46:45 +0200
parents 64977f537e9b
children 13ebb548f234
comparison
equal deleted inserted replaced
73:da355fb3a9ab 74:651c4049f32b
103 reference = CharField(required=False, label=_(u"Reference"), placeholder=_(u"Adherent number in case of a renewal")) 103 reference = CharField(required=False, label=_(u"Reference"), placeholder=_(u"Adherent number in case of a renewal"))
104 104
105 section_6 = Section(label=_(u'Comment')) 105 section_6 = Section(label=_(u'Comment'))
106 comment = CharField(required=False, label=_(u"Comment"), placeholder="", widget=forms.Textarea(attrs={'rows': 3})) 106 comment = CharField(required=False, label=_(u"Comment"), placeholder="", widget=forms.Textarea(attrs={'rows': 3}))
107 107
108 newsletter = BooleanField(required=False, label=_(u'I would like to receive the newsletter.')) 108 mailing = BooleanField(required=False, label=_(u"I would like to subscribe to the adherents' mailing list."))
109 109
110 def html_link(url, label): 110 def html_link(url, label):
111 return string_concat('<a target="#" href="', url, '">', label, '</a>') 111 return string_concat('<a target="#" href="', url, '">', label, '</a>')
112 112
113 agreement_label = [_(u"I read the "), 113 agreement_label = [_(u"I read the "),
166 value = ugettext(u"yes") if field.value() else ugettext(u"no") 166 value = ugettext(u"yes") if field.value() else ugettext(u"no")
167 else: 167 else:
168 value = re.sub(r"[\n\r]+", ", ", unicode(field.value())) 168 value = re.sub(r"[\n\r]+", ", ", unicode(field.value()))
169 if user_readable: 169 if user_readable:
170 if isinstance(field.field, BooleanField): 170 if isinstance(field.field, BooleanField):
171 key = key.capitalize() # to get Newsletter instead of "Please add me..." 171 key = key.capitalize() # to get Mailing instead of "I would like..."
172 else: 172 else:
173 key = field.label 173 key = field.label
174 if isinstance(field.field, ChoiceField): 174 if isinstance(field.field, ChoiceField):
175 value = field.field.choice_label(value) 175 value = field.field.choice_label(value)
176 results.append((key, value)) 176 results.append((key, value))