Commit 6c68fdc2 authored by iyamiks's avatar iyamiks

Created announcement templates and added styling

parent cf47e2da
{% extends 'base.html' %}
{% load static %}
{% block title %}Add Announcement{% endblock %}
{% block content %}
{{ form.non_field_errors }}
<div class="container-fluid p-3 bg-dark text-white text-center">
<br>
<h1 class="display-4">Add a New Announcement:</h1>
<br>
</div>
<div class="container my-5 text-center">
<form method="post">
{% csrf_token %}
{% for field in form %}
<p> {{ field.label }} : {{ field }} </p><br>
{% endfor %}
<div class="container">
<div class="row">
<div class="col-6">
<input type="submit" value="Add Announcement">
</div>
</div>
</div>
</form>
</div>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ object.title }} {% endblock %}
{% block content %}
<div class="container-fluid p-4 bg-dark text-white text-center">
<h1>{{ object.title }}</h1>
<br>
<div class="container p-4">
<div class="row">
<div class="col-2">
</div>
<div class="col-4">
<p> by {{object.author.first_name }} {{object.author.last_name}} </p>
</div>
<div class="col-4">
<p> {{ object.getFormattedDateTime }} </p> <br><br>
</div>
<div class="col-12">
<h4> {{ object.body }} </h4> <br><br>
</div>
<div class="col-4">
<p> Like: {{object.getLikeReacts}} </p>
</div>
<div class="col-4">
<p> Love: {{object.getLoveReacts}} </p>
</div>
<div class="col-4">
<p> Angry: {{object.getAngryReacts}} </p>
</div>
<div class="col-2">
</div>
</div>
</div>
<a href="/announcements/{{ object.pk }}/edit/" class="btn btn-primary">Edit Announcement</a>
</div>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block title %}Edit Announcement{% endblock %}
{% block content %}
{{ form.non_field_errors }}
<div class="container-fluid p-3 bg-dark text-white text-center">
<br>
<h1 class="display-4">Edit Announcement</h1>
<br>
</div>
<div class="container my-5 text-center">
<form method="post">
{% csrf_token %}
{% for field in form %}
{{field.label}}: <br> {{field}} <br> <br>
{% endfor %}
<div class="container">
<div class="row">
<div class="col-12">
<input type="submit" value="Save Changes to Announcement" class="btn btn-primary">
</div>
</div>
</div>
</form>
</div>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block title %}Widget's Announcement Board{% endblock %}
{% block content %}
<div class="container-fluid p-3 bg-dark text-white text-center">
<br>
<h1 class="display-4">Welcome to Widget's Announcement Board!</h1>
<br>
</div>
<div class="container my-5 text-center">
<h3 class="display-6">Announcements:</h3>
<br>
{% for object in announcements %}
<p><a href="{{ object.get_absolute_url }}">{{ object.title }} by {{ object.author.first_name }} {{ object.author.last_name }} </a></p>
{% endfor %}
<br><br>
<div class="container">
<div class="row">
<div class="col-6">
<a href="/announcements/add"><button type="button" class="btn btn-primary">New Announcement</button></a>
</div>
<div class="col-6">
<a href="/dashboard/"><button type="button" class="btn btn-primary">Dashboard</button></a>
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -28,7 +28,7 @@
<a href="/dashboard"><button type="button" class="btn btn-primary">Dashboard</button></a>
</div>
<div class="col-6">
<a href="/Announcements"><button type="button" class="btn btn-primary">Announcements</button></a>
<a href="/announcements"><button type="button" class="btn btn-primary">Announcements</button></a>
</div>
</div>
</div>
......
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