Mercurial > public > sg101
changeset 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 | 3c48a555298d |
children | 3800f3bcf4a8 |
files | gpp/news/forms.py gpp/templates/news/story.html gpp/templates/news/story_summary.html |
diffstat | 3 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/news/forms.py Sat Oct 22 00:07:50 2011 +0000 +++ b/gpp/news/forms.py Sat Oct 22 00:48:45 2011 +0000 @@ -1,7 +1,7 @@ """ Forms for the news application. + """ - from django import forms from django.conf import settings @@ -12,12 +12,14 @@ class AddNewsForm(forms.ModelForm): """Form for a user to submit a news story to the admins for review.""" title = forms.CharField(widget=forms.TextInput(attrs={'size': 52})) - short_text = forms.CharField(widget=forms.Textarea(attrs={'rows': 20, 'cols': 80})) - long_text = forms.CharField(required=False, widget=forms.Textarea(attrs={'rows': 20, 'cols': 80})) + short_text = forms.CharField( + label="Article text", + widget=forms.Textarea( + attrs={'rows': 60, 'cols': 80, 'style': 'height:500px'})) class Meta: model = PendingStory - fields = ('title', 'category', 'short_text', 'long_text') + fields = ['title', 'category', 'short_text'] class Media: js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
--- a/gpp/templates/news/story.html Sat Oct 22 00:07:50 2011 +0000 +++ b/gpp/templates/news/story.html Sat Oct 22 00:48:45 2011 +0000 @@ -1,6 +1,7 @@ {% extends 'news/base.html' %} {% load url from future %} {% load tagging_tags %} +{% load bio_tags %} {% load comment_tags %} {% load script_tags %} {% load core_tags %} @@ -22,7 +23,7 @@ <div class="solid-background"> <h3>{{ story.title }}</h3> <div class="news-details"> - Submitted by {{ story.submitter.username }} on {{ story.date_submitted|date:"F d, Y" }}. + Submitted by {% profile_link story.submitter.username %} on {{ story.date_submitted|date:"F d, Y" }}. </div> <hr /> <div class="news-content">
--- a/gpp/templates/news/story_summary.html Sat Oct 22 00:07:50 2011 +0000 +++ b/gpp/templates/news/story_summary.html Sat Oct 22 00:48:45 2011 +0000 @@ -1,5 +1,6 @@ {% load url from future %} {% load tagging_tags %} +{% load bio_tags %} {% load comment_tags %} {% load core_tags %} <div class="news-story-container solid-background"> @@ -9,7 +10,7 @@ <h4><a href="{{ story.get_absolute_url }}">{{ story.title }}</a></h4> {% endif %} <div class="news-details"> - Submitted by {{ story.submitter.username }} on {{ story.date_submitted|date:"F d, Y" }}. + Submitted by {% profile_link story.submitter.username %} on {{ story.date_submitted|date:"F d, Y" }}. </div> <a href="{% url 'news-category' slug=story.category.slug %}"> <img src="{{ story.category.icon.url }}" alt="{{ story.category.title }}" title="{{ story.category.title }}"