Commit b6995a3c authored by Michael Lopez's avatar Michael Lopez

fixed the edit announcement button, created and edited the announcement-edit.html

parent 109e1fb8
......@@ -15,7 +15,7 @@
Love: {{love_count}} <br><br>
Angry: {{angry_count}}</p>
<br>
<form action='edit'>
<input type="submit" value="Edit Announcement"/>
<form method="get" action="{% url 'announcements:announcement_edit' pk=object.pk %}">
<button type="submit">Edit Announcement</button>
</form>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Announcement {% endblock %}
{% block content %}
<h2>Edit announcement:</h2>
<p>
<form action='' method="POST">
{% csrf_token %}
<p>Title: {{form.title}}</p><br>
<p>Body: <br> {{form.body}}</p><br>
<p>Author: {{form.author}}</p><br>
<input type="submit" value="Save Changes to Announcement">
</form>
</p>
{% endblock %}
\ No newline at end of file
......@@ -5,7 +5,7 @@ urlpatterns = [
path('', pageview, name='pageview'),
path('<int:pk>/details/', AnnouncementDetailView.as_view(), name="announcement_details"),
path('add/', AnnouncementCreateView.as_view(), name='announcement_add'),
path('<int:pk>/edit', AnnouncementEditView.as_view(), name='announcement_edit'),
path('<int:pk>/edit/', AnnouncementEditView.as_view(), name='announcement_edit'),
]
app_name = "announcements"
\ No newline at end of file
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