Commit 5a4dbbee authored by Jiuvi Anne Hu's avatar Jiuvi Anne Hu

Fixes for typos and missed errors.

parent a27d1e06
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<p>{{ announcement.body }}</p><br> <p>{{ announcement.body }}</p><br>
<p> <p>
{% for reaction in reaction.model.all %} {% for reaction in reaction.model.all %}
{{ reaction. name }}: {{ reaction.tally }}<br> {{ reaction.name }}: {{ reaction.tally }}<br>
{% endfor %} {% endfor %}
</p> </p>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<title>Edit Announcement</title> <title>Edit Announcement</title>
<h1>Edit announcement:</h1> <h1>Edit announcement:</h1>
<form action="/" method="post"> <form action="/" method=POST>
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<input type="submit" value="Save Changes to Announcement"> <input type="submit" value="Save Changes to Announcement">
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
<h3>Announcements:</h3> <h3>Announcements:</h3>
{% for announcement in announcements %} {% for announcement in announcements %}
<a href = "{{announcement.pk}}/details/">{{ announcement.title }} by {{ announcement.author.first_name }} {{ announcement.author.last_name }}</a><br> <a href = "announcements/{{ announcedetails.pk }}/details/">{{ announcement.title }} by {{ announcement.author.first_name }} {{ announcement.author.last_name }}</a><br>
{% endfor %} <br> {% endfor %} <br>
<a href="announcements/add/"><button value="click here">Add Announcement</button></a><br> <a href="add/"><button value="click here">Add Announcement</button></a><br><br>
<a href = "/Dashboard/">Dashboard</a><br> <a href = "/Dashboard/">Dashboard</a><br>
<a href = "/forum/">Forum</a><br> <a href = "/forum/">Forum</a><br>
......
...@@ -3,7 +3,7 @@ from .views import index, AnnouncementDetailView, AnnouncementAddView, Announcem ...@@ -3,7 +3,7 @@ from .views import index, AnnouncementDetailView, AnnouncementAddView, Announcem
urlpatterns = [ urlpatterns = [
path('announcements/', index, name='index'), path('announcements/', index, name='index'),
path('announcements/<int:pk>/details/', AnnouncementDetailView.as_view(), name='announcement-detail'), path('announcements/<int:pk>/details/', AnnouncementDetailView.as_view(), name='announcementdetailview'),
path('announcements/add/', AnnouncementAddView.as_view(), name='announcement-add'), path('announcements/add/', AnnouncementAddView.as_view(), name='announcement-add'),
path('announcements/<int:pk>/edit/', AnnouncementEditView.as_view(), name='announcement-edit'), path('announcements/<int:pk>/edit/', AnnouncementEditView.as_view(), name='announcement-edit'),
] ]
......
...@@ -23,14 +23,14 @@ def index(request): ...@@ -23,14 +23,14 @@ def index(request):
class AnnouncementDetailView(DetailView): class AnnouncementDetailView(DetailView):
model = Announcement model = Announcement
template_name = 'announcements/announcement-detail.html' template_name = 'announcements/announcement-details.html'
queryset = Announcement.objects.all() queryset = Announcement.objects.all()
context_object_name = 'annoucement-details' context_object_name = 'annoucedetails'
class AnnouncementAddView(CreateView): class AnnouncementAddView(CreateView):
model = Announcement model = Announcement
fields = '__all__' fields = '__all__'
template_name = 'announcement-add.html' template_name = 'announcements/announcement-add.html'
def get_success_url(self): def get_success_url(self):
return reverse('announcement:announcementdetailview', kwargs={'pk': self.object.id}, return reverse('announcement:announcementdetailview', kwargs={'pk': self.object.id},
...@@ -38,7 +38,7 @@ class AnnouncementAddView(CreateView): ...@@ -38,7 +38,7 @@ class AnnouncementAddView(CreateView):
class AnnouncementEditView(UpdateView): class AnnouncementEditView(UpdateView):
model = Announcement model = Announcement
template_name = 'announcements/announcement-edit' template_name = 'announcements/announcement-edit.html'
def get_success_url(self): def get_success_url(self):
return reverse('announcement:announcementdetailview', kwargs={'pk': self.object.id}, return reverse('announcement:announcementdetailview', kwargs={'pk': self.object.id},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment