comparison gpp/news/forms.py @ 493:bdcce55f137e

For #235, some minor news tweaks. The submitted by text is now a link to the author's profile. Only show 1 textarea to the user when submitting a new news story. The admin can paste into the 2nd one if needed.
author Brian Neal <bgneal@gmail.com>
date Sat, 22 Oct 2011 00:48:45 +0000
parents 88b2b9cb8c1f
children
comparison
equal deleted inserted replaced
492:3c48a555298d 493:bdcce55f137e
1 """ 1 """
2 Forms for the news application. 2 Forms for the news application.
3
3 """ 4 """
4
5 from django import forms 5 from django import forms
6 from django.conf import settings 6 from django.conf import settings
7 7
8 from news.models import PendingStory 8 from news.models import PendingStory
9 from news.models import Category 9 from news.models import Category
10 10
11 11
12 class AddNewsForm(forms.ModelForm): 12 class AddNewsForm(forms.ModelForm):
13 """Form for a user to submit a news story to the admins for review.""" 13 """Form for a user to submit a news story to the admins for review."""
14 title = forms.CharField(widget=forms.TextInput(attrs={'size': 52})) 14 title = forms.CharField(widget=forms.TextInput(attrs={'size': 52}))
15 short_text = forms.CharField(widget=forms.Textarea(attrs={'rows': 20, 'cols': 80})) 15 short_text = forms.CharField(
16 long_text = forms.CharField(required=False, widget=forms.Textarea(attrs={'rows': 20, 'cols': 80})) 16 label="Article text",
17 widget=forms.Textarea(
18 attrs={'rows': 60, 'cols': 80, 'style': 'height:500px'}))
17 19
18 class Meta: 20 class Meta:
19 model = PendingStory 21 model = PendingStory
20 fields = ('title', 'category', 'short_text', 'long_text') 22 fields = ['title', 'category', 'short_text']
21 23
22 class Media: 24 class Media:
23 js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] 25 js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
24 26
25 27