comparison gpp/forums/forms.py @ 135:13330e1836f3

Cutting forums over to the new common way to add markItUp, extra smileys, and markdown help.
author Brian Neal <bgneal@gmail.com>
date Fri, 27 Nov 2009 03:30:15 +0000
parents 3ae999b0c53b
children 8fd4984d5c3b
comparison
equal deleted inserted replaced
134:b8474ffe76d9 135:13330e1836f3
9 from forums.models import Post 9 from forums.models import Post
10 10
11 11
12 class NewPostForm(forms.Form): 12 class NewPostForm(forms.Form):
13 """Form for creating a new post.""" 13 """Form for creating a new post."""
14 body = forms.CharField(label='', widget=forms.Textarea) 14 body = forms.CharField(label='',
15 widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'}))
15 topic_id = forms.IntegerField(widget=forms.HiddenInput) 16 topic_id = forms.IntegerField(widget=forms.HiddenInput)
16 topic = None 17 topic = None
17 18
18 class Media: 19 class Media:
19 css = { 20 css = {
48 Superusers and moderators can also create the topic as a sticky or initially 49 Superusers and moderators can also create the topic as a sticky or initially
49 locked. 50 locked.
50 """ 51 """
51 name = forms.CharField(label='Subject', max_length=255, 52 name = forms.CharField(label='Subject', max_length=255,
52 widget=forms.TextInput(attrs={'size': 64})) 53 widget=forms.TextInput(attrs={'size': 64}))
53 body = forms.CharField(label='', widget=forms.Textarea) 54 body = forms.CharField(label='',
55 widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'}))
54 user = None 56 user = None
55 forum = None 57 forum = None
56 has_mod_fields = False 58 has_mod_fields = False
57 59
58 class Media: 60 class Media:
96 98
97 class PostForm(forms.ModelForm): 99 class PostForm(forms.ModelForm):
98 """ 100 """
99 Form for editing an existing post or a new, non-quick post. 101 Form for editing an existing post or a new, non-quick post.
100 """ 102 """
101 body = forms.CharField(label='', widget=forms.Textarea) 103 body = forms.CharField(label='',
104 widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'}))
102 105
103 class Meta: 106 class Meta:
104 model = Post 107 model = Post
105 fields = ('body', ) 108 fields = ('body', )
106 109