Commit be1a2373 authored by Javi Ng's avatar Javi Ng

created announcement-add template, NOTE: post-merge change announcement's body field into textfield

parent 72f9c57e
{% extends 'base.html' %}
{% load static %}
{% block title %} Add Announcement {% endblock %}
{% block content %}
<h1> Add a new announcement: </h1>
<form method="POST">
{% csrf_token %}
{% for field in form%}
<b>{{ field.label }}:</b> {{ field }} <br>
{% endfor %}
<button type="submit">Add Announcement</button>
</form>
{% endblock %}
\ No newline at end of file
......@@ -7,6 +7,8 @@ from django.views.generic.edit import CreateView, UpdateView
from django.shortcuts import render
def announcements(request):
# use context to pass announcements sorted by pubdate
context = {
"announcement_list" : Announcement.objects.all().order_by('pub_datetime'),
}
......
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