Mercurial > public > sg101
comparison gpp/gcalendar/forms.py @ 131:5b69d6e01fd4
Creating a common way to display the smiley and markdown help dialogs for a markItUp textarea input form. Converted gcalendar over to it as a trial.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 26 Nov 2009 22:47:17 +0000 |
parents | c0d3b09c9b95 |
children | 7e3ed3eb9b99 |
comparison
equal
deleted
inserted
replaced
130:a4635c094f24 | 131:5b69d6e01fd4 |
---|---|
67 start_time = forms.TimeField(required=False, widget=forms.Select(choices=TIME_CHOICES)) | 67 start_time = forms.TimeField(required=False, widget=forms.Select(choices=TIME_CHOICES)) |
68 end_date = forms.DateField(widget=forms.TextInput(attrs={'size': 10})) | 68 end_date = forms.DateField(widget=forms.TextInput(attrs={'size': 10})) |
69 end_time = forms.TimeField(required=False, widget=forms.Select(choices=TIME_CHOICES)) | 69 end_time = forms.TimeField(required=False, widget=forms.Select(choices=TIME_CHOICES)) |
70 time_zone = forms.CharField(required=False, widget=forms.HiddenInput()) | 70 time_zone = forms.CharField(required=False, widget=forms.HiddenInput()) |
71 where = forms.CharField(required=False, widget=forms.TextInput(attrs={'size': 60})) | 71 where = forms.CharField(required=False, widget=forms.TextInput(attrs={'size': 60})) |
72 description = forms.CharField(required=False, | |
73 widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'})) | |
72 | 74 |
73 TIME_FORMAT = '%H:%M' | 75 TIME_FORMAT = '%H:%M' |
74 DEFAULT_START_TIME = '19:00' | 76 DEFAULT_START_TIME = '19:00' |
75 DEFAULT_END_TIME = '20:00' | 77 DEFAULT_END_TIME = '20:00' |
76 | 78 |
79 fields = ('what', 'start_date', 'start_time', 'end_date', 'end_time', | 81 fields = ('what', 'start_date', 'start_time', 'end_date', 'end_time', |
80 'all_day', 'time_zone', 'where', 'description') | 82 'all_day', 'time_zone', 'where', 'description') |
81 | 83 |
82 class Media: | 84 class Media: |
83 css = { | 85 css = { |
84 'all': settings.GPP_THIRD_PARTY_CSS['markitup'] + \ | 86 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + |
85 settings.GPP_THIRD_PARTY_CSS['jquery-ui'] + \ | 87 settings.GPP_THIRD_PARTY_CSS['jquery-ui'] + |
86 ('css/gcalendar.css', ) | 88 ('css/gcalendar.css', )) |
87 } | 89 } |
88 js = settings.GPP_THIRD_PARTY_JS['markitup'] + \ | 90 js = (settings.GPP_THIRD_PARTY_JS['markitup'] + |
89 settings.GPP_THIRD_PARTY_JS['jquery-ui'] + \ | 91 settings.GPP_THIRD_PARTY_JS['jquery-ui'] + |
90 ('js/timezone.js', 'js/gcalendar.js', ) | 92 ('js/timezone.js', 'js/gcalendar.js', )) |
91 | 93 |
92 def __init__(self, *args, **kwargs): | 94 def __init__(self, *args, **kwargs): |
93 initial = kwargs.get('initial', {}) | 95 initial = kwargs.get('initial', {}) |
94 instance = kwargs.get('instance', None) | 96 instance = kwargs.get('instance', None) |
95 | 97 |
148 | 150 |
149 | 151 |
150 class PasswordForm(forms.Form): | 152 class PasswordForm(forms.Form): |
151 password = forms.CharField(widget=forms.PasswordInput()) | 153 password = forms.CharField(widget=forms.PasswordInput()) |
152 | 154 |
153 | |
154 # vim: ts=4 sw=4 |