Commit 4417587c authored by Ysabella Panghulan's avatar Ysabella Panghulan

Merge branch 'forumv2'

parents 2ae4db13 65736c8b
...@@ -11,4 +11,4 @@ body { ...@@ -11,4 +11,4 @@ body {
padding: 2rem; padding: 2rem;
border-radius: 0.5rem; border-radius: 0.5rem;
background-color: white background-color: white
} }
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
{% load static %} {% load static %}
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" href="{% static 'forum.css' %}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
{% endblock %} {% endblock %}
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
{% endblock %} {% endblock %}
<div class="links"> <div class="links">
<a href="../dashboard/" class="btn-primary">Dashboard</a> <a href="../dashboard/" class="btn-primary">Dashboard</a>
<a href="../announcements/" class="btn-primary">Announcement Board</a> <a href="../announcements/" class="btn-primary">Announcements</a>
<a href="../assignments/" class="btn-primary">Assignments</a> <a href="../assignments/" class="btn-primary">Assignments</a>
<a href="../calendar/" class="btn-primary">Calendar</a> <a href="../calendar/" class="btn-primary">Calendar</a>
</div> </div>
......
...@@ -8,26 +8,30 @@ ...@@ -8,26 +8,30 @@
{% block title %}Add Post{% endblock %} {% block title %}Add Post{% endblock %}
{% block content %} {% block header %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
<p>{{ field.label }}has the following errors:</p>
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<h1>Add a new post: </h1> <h1>Add a new post: </h1>
{% endblock %}
{% block body %}
{% block content %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
<p>{{ field.label }}has the following errors:</p>
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<div class = "form"> <div class = "form">
<form method = 'POST'> <form method = 'POST'>
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<input type = "submit" value = "Save New Post"> <input type = "submit" value = "Save New Post">
</form> </form>
</div> </div>
{% endblock %}
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" type="text/css" href="{% static 'forum/forum.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'forum/forum.css' %}">
<link rel="stylesheet" href="'https://cdnjs.cloudfare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
{% endblock %} {% endblock %}
{% block title %} {{ object.title }} {% endblock %} {% block title %} {{ object.title }} {% endblock %}
<div class ="forum-content"> {% block body %}
<div class ="forum-content">
{% block content %} {% block content %}
<h1>{{ object.title }}</h1> <h1>{{ object.title }}</h1>
<h2>by {{ object.author.first_name }} {{ object.author.last_name }}</h2> <h2>by {{ object.author.first_name }} {{ object.author.last_name }}</h2>
...@@ -26,8 +27,8 @@ ...@@ -26,8 +27,8 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endblock %}
<a href = "{% url 'forum:forumpost-edit' forumpost.id %}" class = "edit-btn" ><i class = "fa fa-edit"></i>Edit Post</a>
</div> <a href = "{% url 'forum:forumpost-edit' forumpost.id %}" class = "edit-btn" ><i class = "fa fa-edit"></i>Edit Post</a>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -8,26 +8,30 @@ ...@@ -8,26 +8,30 @@
{% block title %}Edit Post{% endblock %} {% block title %}Edit Post{% endblock %}
{% block content %} {% block header %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
<p>{{ field.label }}has the following errors:</p>
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<h1>Edit Post:</h1> <h1>Edit Post:</h1>
{% endblock %}
{% block body %}
{% block content %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
<p>{{ field.label }}has the following errors:</p>
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<div class = "forum"> <div class = "form">
<form method = 'POST'> <form method = 'POST'>
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<input type = "submit" value = "Save Changes to Post"> <input type = "submit" value = "Save Changes to Post">
</form> </form>
</div> </div>
{% endblock %}
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -3,7 +3,7 @@ from .views import forum, ForumPostDetailView, ForumPostCreateView, ForumPostUpd ...@@ -3,7 +3,7 @@ from .views import forum, ForumPostDetailView, ForumPostCreateView, ForumPostUpd
urlpatterns = [ urlpatterns = [
path('', forum, name = "forum"), path('', forum, name = "forum"),
path('forum/forumposts/<int:pk>/details/', ForumPostDetailView.as_view(), name = "forumpost-details"), path('forumposts/<int:pk>/details/', ForumPostDetailView.as_view(), name = "forumpost-details"),
path('forumposts/add', ForumPostCreateView.as_view(), name = "forumpost-add"), path('forumposts/add', ForumPostCreateView.as_view(), name = "forumpost-add"),
path('forumposts/<int:pk>/edit', ForumPostUpdateView.as_view(), name = "forumpost-edit") path('forumposts/<int:pk>/edit', ForumPostUpdateView.as_view(), name = "forumpost-edit")
] ]
......
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