Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
final_quintupoltrobol
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
Matthew Karl David P. Arpas
final_quintupoltrobol
Commits
d63291a8
Commit
d63291a8
authored
May 15, 2023
by
karin-kurusu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created forumpost-details and fixed typos in views.py
parent
d158e881
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
forumpost-details.html
...ntupoltrobol/forum/templates/forum/forumpost-details.html
+28
-0
views.py
widget_quintupoltrobol/forum/views.py
+2
-2
No files found.
widget_quintupoltrobol/forum/templates/forum/forumpost-details.html
0 → 100644
View file @
d63291a8
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ forumpost.title}} (% endblock %)
{% block content %}
<h2>
{{ forumpost.title }}
</h2>
<h3>
by {{forumpost.author.first_name}} {{ forumpost.author.last_name }}
</h3>
<p>
{{forumpost.pub_datetime}}
</p>
<br>
<p>
{{forumpost.body}}
</p>
<br>
<h2>
POST REPLIES:
</h2>
<br>
{% for reply in replys %}
<h3>
by {{reply.author.first_name}} {{ reply.author.last_name }}
</h3>
<p>
{{reply.pub_datetime}}
</p>
<br>
<p>
{{reply.body}}
</p>
<br>
{% endfor %}
<form
action=
"edit"
>
<input
type=
"submit"
value=
"Edit Post"
/>
</form>
{% endblock %}
\ No newline at end of file
widget_quintupoltrobol/forum/views.py
View file @
d63291a8
...
...
@@ -12,8 +12,8 @@ def pageview(request):
class
ForumpostDetailView
(
DetailView
):
def
get
(
self
,
request
,
pk
):
forumpost
=
ForumPost
.
objects
.
get
(
pk
=
pk
)
reply
=
Reply
.
objects
.
filter
(
forum_post
=
forumpost
)
return
render
(
request
,
'forum/forumpost-details.html'
,
{
'forumpost'
:
forumpost
,
'reply
'
:
reply
})
reply
s
=
Reply
.
objects
.
filter
(
forum_post
=
forumpost
)
return
render
(
request
,
'forum/forumpost-details.html'
,
{
'forumpost'
:
forumpost
,
'reply
s'
:
replys
})
class
ForumpostCreateView
(
CreateView
):
model
=
ForumPost
...
...
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