Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group 25
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
Andre Matthew Dumandan
widget_group 25
Commits
ffaa93d0
Commit
ffaa93d0
authored
May 24, 2022
by
Andre Matthew Dumandan
😴
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.discs.ateneo.edu/andredumandan/widget_group-25
parents
79b2a22e
8ff26d55
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
128 additions
and
26 deletions
+128
-26
db.sqlite3
widget_group_25/db.sqlite3
+0
-0
forms.py
widget_group_25/forum/forms.py
+7
-0
urls.py
widget_group_25/forum/urls.py
+3
-2
views.py
widget_group_25/forum/views.py
+14
-9
forum_create_styles.css
.../widget_group_25/static/forum/css/forum_create_styles.css
+36
-0
forum_details_styles.css
...widget_group_25/static/forum/css/forum_details_styles.css
+13
-7
forum_list_styles.css
...25/widget_group_25/static/forum/css/forum_list_styles.css
+16
-7
announcement_form.html
...oup_25/templates/announcementboard/announcement_form.html
+1
-1
forum_details.html
...oup_25/widget_group_25/templates/forum/forum_details.html
+3
-0
forum_list.html
..._group_25/widget_group_25/templates/forum/forum_list.html
+3
-0
post_form.html
...t_group_25/widget_group_25/templates/forum/post_form.html
+32
-0
No files found.
widget_group_25/db.sqlite3
View file @
ffaa93d0
No preview for this file type
widget_group_25/forum/forms.py
0 → 100644
View file @
ffaa93d0
from
django
import
forms
from
.models
import
Post
class
PostForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Post
fields
=
[
'post_title'
,
'post_body'
,
'author'
]
\ No newline at end of file
widget_group_25/forum/urls.py
View file @
ffaa93d0
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
post_list_view
,
post_detail_view
from
.views
import
post_list_view
,
post_detail_view
,
post_create_view
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
post_list_view
,
name
=
'post-list'
),
path
(
''
,
post_list_view
.
as_view
()
,
name
=
'post-list'
),
path
(
'posts/<int:post_id>/details'
,
post_detail_view
,
name
=
'post-details'
),
path
(
'posts/<int:post_id>/details'
,
post_detail_view
,
name
=
'post-details'
),
path
(
'posts/add'
,
post_create_view
.
as_view
(),
name
=
'post-create'
)
]
]
app_name
=
'forum'
app_name
=
'forum'
\ No newline at end of file
widget_group_25/forum/views.py
View file @
ffaa93d0
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views
import
View
from
django.views.generic.list
import
ListView
from
django.views.generic.edit
import
CreateView
from
django.views.generic.detail
import
DetailView
from
.models
import
Post
,
Reply
from
.models
import
Post
,
Reply
class
post_list_view
(
View
):
def
post_list_view
(
request
):
def
get
(
self
,
request
):
context
=
{}
post_list
=
Post
.
objects
.
order_by
(
'-pub_date'
)
.
all
()
context
[
'post_list'
]
=
Post
.
objects
.
order_by
(
'-pub_date'
)
.
all
()
return
render
(
request
,
'forum/forum_list.html'
,
{
return
render
(
request
,
'forum/forum_list.html'
,
context
)
"post_list"
:
post_list
})
def
post_detail_view
(
request
,
post_id
):
def
post_detail_view
(
request
,
post_id
):
post
=
Post
.
objects
.
get
(
id
=
post_id
)
post
=
Post
.
objects
.
get
(
id
=
post_id
)
...
@@ -18,3 +17,9 @@ def post_detail_view(request, post_id):
...
@@ -18,3 +17,9 @@ def post_detail_view(request, post_id):
'reply_list'
:
reply_list
'reply_list'
:
reply_list
}
}
return
render
(
request
,
'forum/forum_details.html'
,
context
)
return
render
(
request
,
'forum/forum_details.html'
,
context
)
class
post_create_view
(
CreateView
):
model
=
Post
fields
=
'__all__'
success_url
=
'/forum/'
\ No newline at end of file
widget_group_25/widget_group_25/static/forum/css/forum_create_styles.css
0 → 100644
View file @
ffaa93d0
*
{
font-family
:
'Futura'
;
text-align
:
center
;
}
header
{
color
:
white
;
background-color
:
#9BB8ED
;
font-size
:
50px
;
text-align
:
center
;
}
body
{
background-color
:
#FFDDE4
;
}
label
{
color
:
#A39FE1
;
font-size
:
25px
;
}
#submit_button
{
color
:
white
;
background-color
:
#9BB8ED
;
font-size
:
15px
;
}
a
:link
{
padding
:
5px
;
text-decoration
:
none
;
border-style
:
dotted
;
background-color
:
#9BB8ED
;
}
widget_group_25/widget_group_25/static/forum/css/forum_details_styles.css
View file @
ffaa93d0
*
{
font-family
:
'Futura'
;
}
.center
{
.center
{
display
:
block
;
display
:
block
;
margin-left
:
auto
;
margin-left
:
auto
;
...
@@ -7,31 +10,27 @@
...
@@ -7,31 +10,27 @@
h1
{
h1
{
color
:
cornflowerblue
;
color
:
cornflowerblue
;
font-family
:
'Futura'
;
text-align
:
center
;
text-align
:
center
;
}
}
h3
{
h3
{
color
:
rgb
(
45
,
101
,
205
);
color
:
rgb
(
45
,
101
,
205
);
font-family
:
'Futura'
;
text-align
:
center
;
text-align
:
center
;
}
}
h4
{
h4
{
color
:
black
;
color
:
black
;
font-family
:
'Futura'
;
text-align
:
center
;
text-align
:
center
;
font-weight
:
200
;
font-weight
:
200
;
}
}
.replies
{
.replies
{
text-align
:
left
;
text-align
:
left
;
font-family
:
'Futura'
;
}
}
h2
{
h2
{
font-size
:
22px
;
font-size
:
22px
;
color
:
rgb
(
94
,
214
,
218
)
;
color
:
darkslateblue
;
}
}
li
{
li
{
...
@@ -40,10 +39,17 @@ li {
...
@@ -40,10 +39,17 @@ li {
}
}
p
{
p
{
color
:
darkslate
grey
;
color
:
darkslate
blue
;
font-size
:
14px
;
font-size
:
14px
;
}
}
#backtoforum
a
:link
{
padding
:
5px
;
text-decoration
:
none
;
border-style
:
dotted
;
background-color
:
cornflowerblue
;
}
body
{
body
{
background-color
:
rgb
(
221
,
249
,
249
)
;
background-color
:
#c2c0ef
;
}
}
\ No newline at end of file
widget_group_25/widget_group_25/static/forum/css/forum_list_styles.css
View file @
ffaa93d0
*
{
text-align
:
center
;
font-family
:
'Futura'
;
}
header
{
header
{
color
:
white
;
color
:
white
;
background-color
:
pink
;
background-color
:
pink
;
font-family
:
'Futura'
;
font-size
:
50px
;
font-size
:
50px
;
text-align
:
center
;
}
}
h1
{
h1
{
color
:
rgb
(
94
,
214
,
218
);
color
:
rgb
(
94
,
214
,
218
);
font-family
:
'Futura'
;
text-align
:
center
;
}
}
li
{
li
{
color
:
cornflowerblue
;
color
:
cornflowerblue
;
font-family
:
'Futura'
;
font-size
:
18px
;
font-size
:
18px
;
text-align
:
center
;
}
a
:link
{
color
:
cornflowerblue
;
}
}
a
:visited
{
a
:visited
{
color
:
black
;
color
:
rgb
(
81
,
116
,
182
);
}
#addnewpost
a
:link
{
padding
:
5px
;
text-decoration
:
none
;
border-style
:
dotted
;
background-color
:
rgb
(
94
,
214
,
218
);
}
}
body
{
body
{
...
...
widget_group_25/widget_group_25/templates/announcementboard/announcement_form.html
View file @
ffaa93d0
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
{{ form.announcement_title }}
<br><br>
{{ form.announcement_title }}
<br><br>
<label
for=
"{{ form.announcement_body.id_for_label }}"
>
Announcement Body
</label><br>
<label
for=
"{{ form.announcement_body.id_for_label }}"
>
Announcement Body
</label><br>
{{ form.announcement_body }}
<br><br>
{{ form.announcement_body }}
<br><br>
<label
for=
"{{ form.autho
t
.id_for_label }}"
>
Author
</label><br>
<label
for=
"{{ form.autho
r
.id_for_label }}"
>
Author
</label><br>
{{ form.author }}
<br><br>
{{ form.author }}
<br><br>
<input
type=
"submit"
value=
"Save Announcement"
id=
"submit_button"
>
<input
type=
"submit"
value=
"Save Announcement"
id=
"submit_button"
>
</form>
</form>
...
...
widget_group_25/widget_group_25/templates/forum/forum_details.html
View file @
ffaa93d0
...
@@ -35,5 +35,8 @@
...
@@ -35,5 +35,8 @@
<p>
{{ reply.reply_body }}
</p>
<p>
{{ reply.reply_body }}
</p>
{% endfor %}
{% endfor %}
</div>
</div>
<div
id =
"backtoforum"
>
<p><a
href=
"{% url 'forum:post-list' %}"
>
Back to main forum
</a></p>
</div>
</body>
</body>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_group_25/widget_group_25/templates/forum/forum_list.html
View file @
ffaa93d0
...
@@ -16,5 +16,8 @@
...
@@ -16,5 +16,8 @@
</a>
</a>
</li>
</li>
{% endfor %}
{% endfor %}
<div
id=
"addnewpost"
>
<p><a
href=
"{% url 'forum:post-create' %}"
>
New Forum Post
</a></p>
</div>
</body>
</body>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_group_25/widget_group_25/templates/forum/post_form.html
0 → 100644
View file @
ffaa93d0
{% extends 'base.html' %}
{% load static %}
{% block title %}Create Post{% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static 'forum/css/forum_create_styles.css' %}"
>
{% endblock %}
{% block content %}
<body>
<header>
New Forum Post
</header>
<br>
<form
method=
"POST"
action=
""
>
{% csrf_token %}
<label
for=
"{{ form.post_title.auto_id }}"
>
Title
</label>
<br>
{{ form.post_title }}
<br>
<label
for=
"{{ form.post_body.auto_id }}"
>
Body
</label>
<br>
{{ form.post_body }}
<br>
<label
for=
"{{ form.author.auto_id }}"
>
Author
</label>
<br>
{{ form.author }}
<br><br>
<input
type=
"submit"
value=
"Save Post"
id=
"submit_button"
href=
"{% url 'forum:post-list' %}"
>
<br>
</form>
<br>
<p><a
href=
"{% url 'forum:post-list' %}"
>
Back to main forum
</a></p>
</body>
{% endblock %}
\ 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