Commit e51551c9 authored by Ysabella Panghulan's avatar Ysabella Panghulan

Merge branch 'forumv2'

parents fd0861ab 8c6b1465
body {
height: 100vh;
background-color: #E9E3FE;
display: flex;
align-items: center;
justify-content: center;
}
.forum-content {
margin-top: auto;
padding: 2rem;
border-radius: 0.5rem;
background-color: white
}
......@@ -2,6 +2,10 @@
{% load static %}
{% block stylesheets %}
<link rel = "stylesheet" type ="text/css" href = "{% static 'stylesheets/forms.css' %}">
{% endblock %}
{% block title %}Add Post{% endblock %}
{% block content %}
......@@ -18,9 +22,12 @@
{% endfor %}
<h1>Add a new post: </h1>
<div class = "form">
<form method = 'POST'>
{% csrf_token %}
{{ form.as_p }}
<input type = "submit" value = "Save New Post">
</form>
</div>
{% endblock %}
\ No newline at end of file
......@@ -2,27 +2,32 @@
{% load static %}
{% block stylesheets %}
<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">
{% endblock %}
{% block title %} {{ object.title }} {% endblock %}
{% block content %}
<h1>{{ object.title }}</h1>
<h2>by {{ object.author.first_name }} {{ object.author.last_name }}</h2>
<h3>{{ object.pub_datetime|date:'m/d/Y, H:i A' }}</h2>
<p>{{ object.body }}</h2>
<h2>POST REPLIES:</h2>
<ul>
{% for reply in object.replies.all %}
<li>
<h2>by {{ reply.author.first_name }} {{ reply.author.last_name }}</h2>
<h3>by {{ reply.pub_datetime|date:'m/d/Y, H:i A' }}</h3>
<p>{{ reply.body }}</p>
</li>
{% endfor %}
</ul>
<div class ="forum-content">
{% block content %}
<h1>{{ object.title }}</h1>
<h2>by {{ object.author.first_name }} {{ object.author.last_name }}</h2>
<h3>{{ object.pub_datetime|date:'m/d/Y, H:i A' }}</h2>
<p>{{ object.body }}</h2>
<h2>POST REPLIES:</h2>
<ul>
{% for reply in object.replies.all %}
<li>
<h2>by {{ reply.author.first_name }} {{ reply.author.last_name }}</h2>
<h3>by {{ reply.pub_datetime|date:'m/d/Y, H:i A' }}</h3>
<p>{{ reply.body }}</p>
</li>
{% endfor %}
</ul>
<form action = "./edit">
<input type = "submit" value = "Edit Post">
</form>
<a href = "{% url 'forum:forumpost-edit' forumpost.id %}" class = "edit-btn" ><i class = "fa fa-edit"></i>Edit Post</a>
</div>
{% endblock %}
\ No newline at end of file
......@@ -2,6 +2,10 @@
{% load static %}
{% block stylesheets %}
<link rel="stylesheet" type="text/css" href="{% static 'stylesheets/forms.css' %}">
{% endblock %}
{% block title %}Edit Post{% endblock %}
{% block content %}
......@@ -18,9 +22,12 @@
{% endfor %}
<h1>Edit Post:</h1>
<div class = "forum">
<form method = 'POST'>
{% csrf_token %}
{{ form.as_p }}
<input type = "submit" value = "Save Changes to Post">
</form>
</div>
{% endblock %}
\ No newline at end of file
......@@ -5,7 +5,7 @@ urlpatterns = [
path('', forum, name = "forum"),
path("forum/forumposts/<int:pk>/details/", ForumPostDetailView.as_view(), name = "forumpost-details"),
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")
]
app_name = "forum"
\ No newline at end of file
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