comparison gpp/forums/forms.py @ 123:3ae999b0c53b

Forums: added a jquery ui dialog of extra smileys.
author Brian Neal <bgneal@gmail.com>
date Sun, 08 Nov 2009 21:15:31 +0000
parents 0ce0104c7df3
children 13330e1836f3
comparison
equal deleted inserted replaced
122:b28d30848c57 123:3ae999b0c53b
15 topic_id = forms.IntegerField(widget=forms.HiddenInput) 15 topic_id = forms.IntegerField(widget=forms.HiddenInput)
16 topic = None 16 topic = None
17 17
18 class Media: 18 class Media:
19 css = { 19 css = {
20 'all': settings.GPP_THIRD_PARTY_CSS['markitup'], 20 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] +
21 settings.GPP_THIRD_PARTY_CSS['jquery-ui']),
21 } 22 }
22 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \ 23 js = (settings.GPP_THIRD_PARTY_JS['markitup'] +
23 ('js/forums.js', ) 24 settings.GPP_THIRD_PARTY_JS['jquery-ui'] +
25 ('js/forums.js', ))
24 26
25 def clean_topic_id(self): 27 def clean_topic_id(self):
26 id = self.cleaned_data['topic_id'] 28 id = self.cleaned_data['topic_id']
27 try: 29 try:
28 self.topic = Topic.objects.select_related().get(pk=id) 30 self.topic = Topic.objects.select_related().get(pk=id)
53 forum = None 55 forum = None
54 has_mod_fields = False 56 has_mod_fields = False
55 57
56 class Media: 58 class Media:
57 css = { 59 css = {
58 'all': settings.GPP_THIRD_PARTY_CSS['markitup'], 60 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] +
61 settings.GPP_THIRD_PARTY_CSS['jquery-ui']),
59 } 62 }
60 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \ 63 js = (settings.GPP_THIRD_PARTY_JS['markitup'] +
61 ('js/forums.js', ) 64 settings.GPP_THIRD_PARTY_JS['jquery-ui'] +
65 ('js/forums.js', ))
62 66
63 def __init__(self, user, forum, *args, **kwargs): 67 def __init__(self, user, forum, *args, **kwargs):
64 super(NewTopicForm, self).__init__(*args, **kwargs) 68 super(NewTopicForm, self).__init__(*args, **kwargs)
65 self.user = user 69 self.user = user
66 self.forum = forum 70 self.forum = forum
100 model = Post 104 model = Post
101 fields = ('body', ) 105 fields = ('body', )
102 106
103 class Media: 107 class Media:
104 css = { 108 css = {
105 'all': settings.GPP_THIRD_PARTY_CSS['markitup'], 109 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] +
110 settings.GPP_THIRD_PARTY_CSS['jquery-ui']),
106 } 111 }
107 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \ 112 js = (settings.GPP_THIRD_PARTY_JS['markitup'] +
108 ('js/forums.js', ) 113 settings.GPP_THIRD_PARTY_JS['jquery-ui'] +
114 ('js/forums.js', ))
109 115
110 116
111 class MoveTopicForm(forms.Form): 117 class MoveTopicForm(forms.Form):
112 """ 118 """
113 Form for a moderator to move a topic to a forum. 119 Form for a moderator to move a topic to a forum.