Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_gitgud
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
Neal Luigi D. Rodriguez
midterm_gitgud
Commits
f92324d6
Commit
f92324d6
authored
May 15, 2023
by
Neal Luigi D. Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File location of templates have been fixed
parent
295a2ac1
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
49 deletions
+5
-49
views.cpython-311.pyc
widget_gitgud/Forum/__pycache__/views.cpython-311.pyc
+0
-0
forumpost-add.html
widget_gitgud/Forum/templates/Forum/forumpost-add.html
+0
-0
forumpost-details.html
widget_gitgud/Forum/templates/Forum/forumpost-details.html
+0
-0
forumpost-edit.html
widget_gitgud/Forum/templates/Forum/forumpost-edit.html
+0
-0
forum.html
widget_gitgud/Forum/templates/forum.html
+0
-44
views.py
widget_gitgud/Forum/views.py
+5
-5
db.sqlite3
widget_gitgud/db.sqlite3
+0
-0
No files found.
widget_gitgud/Forum/__pycache__/views.cpython-311.pyc
View file @
f92324d6
No preview for this file type
widget_gitgud/Forum/templates/forumpost-add.html
→
widget_gitgud/Forum/templates/
Forum/
forumpost-add.html
View file @
f92324d6
File moved
widget_gitgud/Forum/templates/forumpost-details.html
→
widget_gitgud/Forum/templates/
Forum/
forumpost-details.html
View file @
f92324d6
File moved
widget_gitgud/Forum/templates/forumpost-edit.html
→
widget_gitgud/Forum/templates/
Forum/
forumpost-edit.html
View file @
f92324d6
File moved
widget_gitgud/Forum/templates/forum.html
deleted
100644 → 0
View file @
295a2ac1
{% extends 'base.html' %}
{% load static %}
<title>
{% block title %}Widget's Forum{% endblock %}
</title>
{% block styles %}
<style>
body
{
background-color
:
rgb
(
253
,
222
,
207
);
font-family
:
Georgia
,
serif
;
font-size
:
16px
;
color
:
rgb
(
206
,
132
,
100
);
}
</style>
{% endblock %}
{% block content %}
<div
style=
"text-align: center;"
>
<h1>
Welcome to Widget's Forum
</h1>
</div>
<p1>
Forum posts:
</p1>
{% for post in posts %}
<li><a
href=
"{% url 'Forum:forumpost-details' pk=post.pk %}"
>
{{ post.title }} by {{ post.author }}
</a></li>
{% endfor %}
<br>
<button
type=
"submit"
>
<a
href=
"{% url 'Forum:forumpost-add' %}"
>
New Post
</a>
</button>
<br>
<br>
<a
href=
"http://127.0.0.1:8000/Dashboard/dashboard"
>
Dashboard
</a>
<br>
<a
href=
"http://127.0.0.1:8000/Announcements/announcements"
>
Announcements
</a>
<br>
<a
href=
"http://127.0.0.1:8000/Assignments/assignments"
>
Assignments
</a>
<br>
<a
href=
"http://127.0.0.1:8000/widgetcalendar/calendar"
>
Calendar
</a>
{% endblock %}
\ No newline at end of file
widget_gitgud/Forum/views.py
View file @
f92324d6
...
@@ -23,17 +23,17 @@ def index(request):
...
@@ -23,17 +23,17 @@ def index(request):
def
forum
(
request
):
def
forum
(
request
):
posts
=
ForumPost
.
objects
.
all
()
posts
=
ForumPost
.
objects
.
all
()
context
=
{
'posts'
:
posts
}
context
=
{
'posts'
:
posts
}
return
render
(
request
,
'forum.html'
,
context
)
return
render
(
request
,
'forum
/forum
.html'
,
context
)
class
ForumListView
(
ListView
):
class
ForumListView
(
ListView
):
model
=
ForumPost
model
=
ForumPost
template_name
=
'forum.html'
template_name
=
'forum
/forum
.html'
context_object_name
=
'posts'
context_object_name
=
'posts'
ordering
=
[
'-pub_datetime'
]
# sort by newest to oldest
ordering
=
[
'-pub_datetime'
]
# sort by newest to oldest
class
ForumDetailView
(
DetailView
):
class
ForumDetailView
(
DetailView
):
model
=
ForumPost
model
=
ForumPost
template_name
=
'forumpost-details.html'
template_name
=
'forum
/forum
post-details.html'
context_object_name
=
'post'
context_object_name
=
'post'
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
@@ -44,9 +44,9 @@ class ForumDetailView(DetailView):
...
@@ -44,9 +44,9 @@ class ForumDetailView(DetailView):
class
AddForumPostView
(
CreateView
):
class
AddForumPostView
(
CreateView
):
model
=
ForumPost
model
=
ForumPost
fields
=
[
'title'
,
'body'
,
'author'
]
fields
=
[
'title'
,
'body'
,
'author'
]
template_name
=
'forumpost-add.html'
template_name
=
'forum
/forum
post-add.html'
class
EditForumPostView
(
UpdateView
):
class
EditForumPostView
(
UpdateView
):
model
=
ForumPost
model
=
ForumPost
fields
=
[
'title'
,
'body'
,
'author'
]
fields
=
[
'title'
,
'body'
,
'author'
]
template_name
=
'forumpost-edit.html'
template_name
=
'forum/forumpost-edit.html'
\ No newline at end of file
\ No newline at end of file
widget_gitgud/db.sqlite3
View file @
f92324d6
No preview for this file type
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