added New Announcement link and form correlating to it

parent d10526f0
{% extends "announcements/base.html" %}
{% block content %}
<div class="indexRectangularShadow"></div>
<h1 style="text-align: center">New Announcement</h1>
<form action="">
<p>Enter Title: <input type="text" name="title"></p>
<p>Enter Body: <input type="text" name="body"></p>
<p>Choose author: <input type="text" name="author"></p>
<p>Image (optional): <input type="image" name="image"></p>
<input type="Submit">
</form>
{% endblock %}
\ No newline at end of file
......@@ -10,6 +10,7 @@
<img src="/static/announcements/indexMegaphoneIcon.jpg" class="indexMegaphoneIcon">
{% endfor %}
</ul>
<h2><a href="/announcements/add">New Announcement</a></h2>
{% else %}
<p>No Announcements are available</p>
{% endif %}
......
......@@ -3,5 +3,6 @@ from . import views
urlpatterns = [
path('', views.index, name="announcements"),
path('add/', views.add, name="add"),
path('<int:announcement_id>/details/', views.details, name="details"),
]
......@@ -12,6 +12,9 @@ def index(request):
}
return render(request, "announcements/index.html", context)
def add(request):
return render(request, "announcements/announcements.html")
# helper function that iterates through every reaction of an announcement, adds it to an array, then returns it
def getReactions(pk):
announcementReactions = []
......
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