diff --git a/news/forms.py b/news/forms.py index 386bdc7..bcfda52 100644 --- a/news/forms.py +++ b/news/forms.py @@ -13,7 +13,7 @@ class PostForm(forms.Form): title = forms.CharField(label='Title (required for slug/SEO)', max_length=200, required=True) url = forms.CharField(label='URL', max_length=200, required=False) - body = forms.CharField(label='Optional body', max_length=10000, required=False) + body = forms.CharField(label='Body (optional)', max_length=10000, required=False) today = datetime.today() # + datetime.timedelta(days=1) today_formatted = today.strftime("%Y-%m-%d %H:%M:%S") diff --git a/news/templates/news/index.html b/news/templates/news/index.html index 675e4c2..0e5afbf 100644 --- a/news/templates/news/index.html +++ b/news/templates/news/index.html @@ -5,6 +5,15 @@ {% block title %}Poker Rumble - Your source of great poker content{% endblock %} {% block content %} + +{% if messages %} +
+ {% for message in messages %} + {{ message }} + {% endfor %} +
+{% endif %} + {% if latest_post_list %} {% for post in latest_post_list %} diff --git a/news/views.py b/news/views.py index 55045c6..0b7ad98 100644 --- a/news/views.py +++ b/news/views.py @@ -131,7 +131,12 @@ def submission(request): post.state = PostState.USER_SUBMITTED.value post.save() - return HttpResponseRedirect(reverse('news:submitted')) + messages.success(request, 'GG! Thanks for posting!') + + #return render(request, 'news/index.html', context) + return HttpResponseRedirect(reverse('news:index')) + + #return HttpResponseRedirect(reverse('news:submitted')) # if a GET (or any other method) we'll create a blank form else: form = PostForm()