comparison gpp/messages/forms.py @ 133:c515b7401078

Use the new common way to apply markItUp to textareas and to get the smiley and markdown help dialogs for all the remaining apps except for forums and comments.
author Brian Neal <bgneal@gmail.com>
date Fri, 27 Nov 2009 00:21:47 +0000
parents b6263ac72052
children 88b2b9cb8c1f
comparison
equal deleted inserted replaced
132:06503edcc56b 133:c515b7401078
22 """ 22 """
23 receiver = forms.CharField(label='To', 23 receiver = forms.CharField(label='To',
24 max_length=30, 24 max_length=30,
25 widget=AutoCompleteUserInput()) 25 widget=AutoCompleteUserInput())
26 subject = forms.CharField(max_length=120, widget=forms.TextInput(attrs={'size': 52})) 26 subject = forms.CharField(max_length=120, widget=forms.TextInput(attrs={'size': 52}))
27 message = forms.CharField(widget=forms.Textarea(attrs={'rows': 20, 'cols': 80})) 27 message = forms.CharField(widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'}))
28 attach_signature = forms.BooleanField(label='Attach Signature?', required=False) 28 attach_signature = forms.BooleanField(label='Attach Signature?', required=False)
29 29
30 def __init__(self, user, *args, **kwargs): 30 def __init__(self, user, *args, **kwargs):
31 forms.Form.__init__(self, *args, **kwargs) 31 forms.Form.__init__(self, *args, **kwargs)
32 self.user = user 32 self.user = user
65 if receiver_opts.notify_email: 65 if receiver_opts.notify_email:
66 notify_receiver(new_msg) 66 notify_receiver(new_msg)
67 67
68 class Media: 68 class Media:
69 css = { 69 css = {
70 'all': settings.GPP_THIRD_PARTY_CSS['markitup'], 70 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] +
71 settings.GPP_THIRD_PARTY_CSS['jquery-ui'])
71 } 72 }
72 js = ('js/messages/compose.js', ) + settings.GPP_THIRD_PARTY_JS['markitup'] 73 js = (settings.GPP_THIRD_PARTY_JS['markitup'] +
74 settings.GPP_THIRD_PARTY_JS['jquery-ui'])
73 75
74 76
75 class OptionsForm(forms.ModelForm): 77 class OptionsForm(forms.ModelForm):
76 class Meta: 78 class Meta:
77 model = Options 79 model = Options