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

Removed commented lines and styled template files.

parent bbb1efd5
<h1> <h1 style="background-color:DodgerBlue;">
{{post.post_title}} {{post.post_title}}
</h1> </h1>
<h4> <h4 style="background-color:Aquamarine;">
{{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 style="background-color:Aquamarine;">
{{post.post_body}} {{post.post_body}}
</h3> </h3>
...@@ -32,4 +32,7 @@ ...@@ -32,4 +32,7 @@
{% endfor %} {% endfor %}
{% load static %}
<marquee behavior="alternate" scrollamount="200"><img src="{% static 'forum/hypers.jpg' %}" alt="image">
</ul> </ul>
{% extends 'base.html' %} {% extends 'base.html' %}
{% block content %} {% block content %}
<h1>Welcome to the Widget's Forum!</h1> <h1 style="background-color:DodgerBlue;"><center>Welcome to the Widget's Forum!</center></h1>
{% if object_list %} {% if object_list %}
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
{% for post in object_list %} {% for post in object_list %}
<h3> <h3 style="background-color:Aquamarine;">
<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>
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
{% else %} {% else %}
<p> <p style="background-color:Tomato;">
No posts available. No posts available.
</p> </p>
{% endif %} {% endif %}
<a href="{% url 'forum:post-add' %}"><button>New Forum Post</button></a> <h1 style="background-color:Aquamarine;"><center><a href="{% url 'forum:post-add' %}"><button style="background-color:Tomato;"><h1>New Forum Post</button></a></h1>
{% endblock content %} {% endblock content %}
...@@ -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