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
e8f4b864
Commit
e8f4b864
authored
May 12, 2023
by
Eury See
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created an Edit Forum Post Page for the Forum Application.
parent
ec031afe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
+31
-5
forumpost-edit.html
widget_gitgud/Forum/templates/forumpost-edit.html
+26
-0
urls.py
widget_gitgud/Forum/urls.py
+2
-2
views.py
widget_gitgud/Forum/views.py
+3
-3
db.sqlite3
widget_gitgud/db.sqlite3
+0
-0
No files found.
widget_gitgud/Forum/templates/forumpost-edit.html
0 → 100644
View file @
e8f4b864
<title>
{% block title %} Edit Post {% endblock %}
</title>
{% block styles %}
<style>
body
{
background-color
:
#E8D1C5
;
font-family
:
Georgia
,
serif
;
font-size
:
16px
;
font-weight
:
bold
;
color
:
#a77f6a
;
}
</style>
{% endblock %}
{% block content %}
<div
style=
"text-align: left;"
>
<h1>
Edit Post
</h1>
</div>
<form
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<button
type=
"submit"
>
Save Changes to Post
</button>
</form>
{% endblock %}
\ No newline at end of file
widget_gitgud/Forum/urls.py
View file @
e8f4b864
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
(
from
.views
import
(
index
,
forum
,
ForumDetailView
,
AddForumPostView
)
index
,
forum
,
ForumDetailView
,
AddForumPostView
,
EditForumPostView
)
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
...
@@ -8,7 +8,7 @@ urlpatterns = [
...
@@ -8,7 +8,7 @@ urlpatterns = [
path
(
'forum/'
,
forum
,
name
=
'forum'
),
path
(
'forum/'
,
forum
,
name
=
'forum'
),
path
(
'forum/forumposts/<int:pk>/details/'
,
ForumDetailView
.
as_view
(),
name
=
'forumpost-details'
),
path
(
'forum/forumposts/<int:pk>/details/'
,
ForumDetailView
.
as_view
(),
name
=
'forumpost-details'
),
path
(
'forum/forumposts/add/'
,
AddForumPostView
.
as_view
(),
name
=
'forumpost-add'
),
path
(
'forum/forumposts/add/'
,
AddForumPostView
.
as_view
(),
name
=
'forumpost-add'
),
path
(
'forum/forumposts/<pk>/edit/'
,
EditForumPostView
.
as_view
(),
name
=
'forumpost-edit'
),
]
]
app_name
=
"Forum"
app_name
=
"Forum"
\ No newline at end of file
widget_gitgud/Forum/views.py
View file @
e8f4b864
...
@@ -3,6 +3,7 @@ from django.http import HttpResponse
...
@@ -3,6 +3,7 @@ from django.http import HttpResponse
from
django.views
import
View
from
django.views
import
View
from
django.views.generic.detail
import
DetailView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
from
django.views.generic.edit
import
CreateView
from
django.views.generic.edit
import
UpdateView
from
.models
import
ForumPost
,
Reply
from
.models
import
ForumPost
,
Reply
...
@@ -37,8 +38,7 @@ class AddForumPostView(CreateView):
...
@@ -37,8 +38,7 @@ class AddForumPostView(CreateView):
fields
=
[
'title'
,
'body'
,
'author'
]
fields
=
[
'title'
,
'body'
,
'author'
]
template_name
=
'forumpost-add.html'
template_name
=
'forumpost-add.html'
class
AddForumPostView
(
Cre
ateView
):
class
EditForumPostView
(
Upd
ateView
):
model
=
ForumPost
model
=
ForumPost
fields
=
[
'title'
,
'body'
,
'author'
]
fields
=
[
'title'
,
'body'
,
'author'
]
template_name
=
'forumpost-add.html'
template_name
=
'forumpost-edit.html'
widget_gitgud/db.sqlite3
View file @
e8f4b864
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