Commit aeae53ea authored by Mario Franco C. Deuna's avatar Mario Franco C. Deuna

Updated views.py and fixed template files and added image.

parent bbb1efd5
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
</h1> </h1>
<h4> <h4>
{{post.post_author.first_name}} {{post.post_author.last_name}}, {{post.pub_date.day}}/{{post.pub_date.month}}/{{post.pub_date.year}} {{post.author.first_name}} {{post.author.last_name}}, {{post.pub_date.day}}/{{post.pub_date.month}}/{{post.pub_date.year}}
</h4> </h4>
<h3> <h3>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<li> <li>
<u> <u>
Reply by {{reply.reply_author.first_name}} {{reply.reply_author.last_name}} dated {{reply.pub_date.day}}/{{reply.pub_date.month}}/{{reply.pub_date.year}}: Reply by {{reply.author.first_name}} {{reply.author.last_name}} dated {{reply.pub_date.day}}/{{reply.pub_date.month}}/{{reply.pub_date.year}}:
</u> </u>
<br> <br>
{{reply.reply_body}} {{reply.reply_body}}
...@@ -32,4 +32,7 @@ ...@@ -32,4 +32,7 @@
{% endfor %} {% endfor %}
{% load static %}
<img src="{% static 'forum/hypers.jpg' %}" alt="image">
</ul> </ul>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<h3> <h3>
<li> <li>
<a href ="{% url 'forum:forum-detail' post.id %}">{{post.post_title}}</a> <a href ="{% url 'forum:forum-detail' post.id %}">{{post.post_title}}</a>
<br> by {{post.post_author.first_name}} {{post.post_author.last_name}} dated {{post.pub_date.day}}/{{post.pub_date.month}}/{{post.pub_date.year}} <br> by {{post.author.first_name}} {{post.author.last_name}} dated {{post.pub_date.day}}/{{post.pub_date.month}}/{{post.pub_date.year}}
</li> </li>
</h3> </h3>
......
...@@ -6,39 +6,6 @@ from django.views.generic.detail import DetailView ...@@ -6,39 +6,6 @@ from django.views.generic.detail import DetailView
from django.views.generic.list import ListView from django.views.generic.list import ListView
from .forms import PostForm from .forms import PostForm
#def get_reply():
#
# text=''
# for reply in Reply.objects.all():
# text += (
# 'Reply by {} {} '.format(reply.author.first_name,
# reply.author.last_name)
# + 'dated {}').format(reply.pub_date.strftime('%x')
# + ':<br>'
# + '{}<br>'.format(reply.reply_body)
# )
# return text
#
#def forum(request):
#
# text = '<h1>FORUM POSTS:</h1>'
#
# for post in Post.objects.all():
# text += (
# '{} '.format(post.post_title)
# + 'by {} {} '.format(post.author.first_name,
# post.author.last_name)
# + 'dated {}').format(post.pub_date.strftime('%x')
# + ':<br>'
# + '{}<br>'.format(post.post_body)
# + get_reply()
# + '<br>'
# )
#
# return HttpResponse(text)
class ForumListView(ListView): class ForumListView(ListView):
model = Post model = Post
ordering = ["-pub_date"] ordering = ["-pub_date"]
......
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