added New Announcement link and form correlating to it

parent d10526f0
/* body
{
background-color: black;
} */
h1 h1
{ {
color: pink; color: pink;
......
{% 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 @@ ...@@ -10,7 +10,8 @@
<img src="/static/announcements/indexMegaphoneIcon.jpg" class="indexMegaphoneIcon"> <img src="/static/announcements/indexMegaphoneIcon.jpg" class="indexMegaphoneIcon">
{% endfor %} {% endfor %}
</ul> </ul>
<h2><a href="/announcements/add">New Announcement</a></h2>
{% else %} {% else %}
<p>No Announcements are available</p> <p>No Announcements are available</p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -3,5 +3,6 @@ from . import views ...@@ -3,5 +3,6 @@ from . import views
urlpatterns = [ urlpatterns = [
path('', views.index, name="announcements"), path('', views.index, name="announcements"),
path('add/', views.add, name="add"),
path('<int:announcement_id>/details/', views.details, name="details"), path('<int:announcement_id>/details/', views.details, name="details"),
] ]
...@@ -11,6 +11,9 @@ def index(request): ...@@ -11,6 +11,9 @@ def index(request):
"announcement_list": announcement_list, "announcement_list": announcement_list,
} }
return render(request, "announcements/index.html", context) 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 # helper function that iterates through every reaction of an announcement, adds it to an array, then returns it
def getReactions(pk): 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