Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widgets_FEKK
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kyla Martin
widgets_FEKK
Commits
32d35732
Commit
32d35732
authored
May 04, 2022
by
Emmanuel Linus T. Evangelista
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pub_date format in Forum post details, use newest first order in replies
parent
6cebb156
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
details.html
WidgetFEKK/Forum/templates/Forum/details.html
+3
-3
views.py
WidgetFEKK/Forum/views.py
+1
-1
No files found.
WidgetFEKK/Forum/templates/Forum/details.html
View file @
32d35732
...
...
@@ -14,12 +14,12 @@
<article>
<img
id=
"thumbnail"
src=
"{% static 'Forum/thumbnail.jpg' %}"
alt=
"placeholder image"
/>
<h1
id=
"title"
>
{{ post.post_title }}
</h1>
<h4
id=
"subtitle"
>
by {{ post.author.first_name }} {{ post.author.last_name }}, {{ post.pub_date|date:"
m/d
/Y" }}
</h4>
<h4
id=
"subtitle"
>
by {{ post.author.first_name }} {{ post.author.last_name }}, {{ post.pub_date|date:"
d/m
/Y" }}
</h4>
<p
class=
"body-text"
>
{{ post.post_body }}
</p>
<ul
class=
"replies"
>
{% for reply in
post.reply_set.all
%}
<li><strong>
{{ reply.author.first_name }} {{ reply.author.last_name }}, {{ reply.pub_date|date:"
m/d
/Y" }}:
</strong>
{{ reply.reply_body }}
</li>
{% for reply in
replies_sorted
%}
<li><strong>
{{ reply.author.first_name }} {{ reply.author.last_name }}, {{ reply.pub_date|date:"
d/m
/Y" }}:
</strong>
{{ reply.reply_body }}
</li>
{% endfor %}
</ul>
</article>
...
...
WidgetFEKK/Forum/views.py
View file @
32d35732
...
...
@@ -29,4 +29,4 @@ def details(request, post_id):
post
=
Post
.
objects
.
get
(
pk
=
post_id
)
except
Post
.
DoesNotExist
:
raise
Http404
(
'Post does not exist'
)
return
render
(
request
,
'Forum/details.html'
,
{
'post'
:
post
})
\ No newline at end of file
return
render
(
request
,
'Forum/details.html'
,
{
'post'
:
post
,
'replies_sorted'
:
post
.
reply_set
.
order_by
(
'-pub_date'
)})
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment