comparison gpp/bio/forms.py @ 390:e0523e17ea43

Fixing #175; add an auto-subscribe and auto-favorite forum topic feature. Added 2 flags to the user profile. Added 2 functions that are called on the post post-save signal that auto-favorite and auto-subscribe the post creator if they have requested this service.
author Brian Neal <bgneal@gmail.com>
date Mon, 21 Mar 2011 00:39:52 +0000
parents e28aee19f7c9
children 452835f4429f
comparison
equal deleted inserted replaced
389:3fa61786abf1 390:e0523e17ea43
30 occupation = forms.CharField(required=False, widget=forms.TextInput(attrs={'size' : 64 })) 30 occupation = forms.CharField(required=False, widget=forms.TextInput(attrs={'size' : 64 }))
31 interests = forms.CharField(required=False, widget=forms.TextInput(attrs={'size' : 64 })) 31 interests = forms.CharField(required=False, widget=forms.TextInput(attrs={'size' : 64 }))
32 time_zone = forms.CharField(required=False, widget=forms.HiddenInput()) 32 time_zone = forms.CharField(required=False, widget=forms.HiddenInput())
33 use_24_time = forms.BooleanField(label='Show times in 24-hour mode', required=False) 33 use_24_time = forms.BooleanField(label='Show times in 24-hour mode', required=False)
34 profile_text = forms.CharField(required=False, 34 profile_text = forms.CharField(required=False,
35 widget=forms.Textarea(attrs={'class': 'markItUp'})) 35 widget=forms.Textarea(attrs={'class': 'markItUp'}))
36 signature = forms.CharField(required=False, 36 signature = forms.CharField(required=False,
37 widget=forms.Textarea(attrs={'class': 'markItUp'})) 37 widget=forms.Textarea(attrs={'class': 'markItUp'}))
38 auto_favorite = forms.BooleanField(
39 label='Automatically favorite every forum topic I create or reply to', required=False)
40 auto_subscribe = forms.BooleanField(
41 label='Automatically subscribe to every forum topic I create or reply to', required=False)
38 42
39 class Meta: 43 class Meta:
40 model = UserProfile 44 model = UserProfile
41 fields = ('location', 'birthday', 'occupation', 'interests', 45 fields = ('location', 'birthday', 'occupation', 'interests',
42 'profile_text', 'hide_email', 'signature', 'time_zone', 46 'profile_text', 'hide_email', 'signature', 'time_zone',
43 'use_24_time', ) 47 'use_24_time', 'auto_favorite', 'auto_subscribe')
44 48
45 class Media: 49 class Media:
46 css = { 50 css = {
47 'all': settings.GPP_THIRD_PARTY_CSS['markitup'] + \ 51 'all': settings.GPP_THIRD_PARTY_CSS['markitup'] + \
48 settings.GPP_THIRD_PARTY_CSS['jquery-ui'] 52 settings.GPP_THIRD_PARTY_CSS['jquery-ui']