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,7 +10,8 @@
<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 %}
{% endblock %}
\ No newline at end of file
{% endblock %}
......@@ -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"),
]
......@@ -11,6 +11,9 @@ def index(request):
"announcement_list": announcement_list,
}
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):
......
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