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
ccee7e03
Commit
ccee7e03
authored
May 23, 2022
by
Alia Lawraine Olay
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'olay/announcementboard'
parents
1c633889
4bde8a3b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
185 additions
and
38 deletions
+185
-38
forms.py
widget_group_25/announcementboard/forms.py
+13
-0
urls.py
widget_group_25/announcementboard/urls.py
+4
-4
views.py
widget_group_25/announcementboard/views.py
+11
-5
create_styles.css
...t_group_25/static/announcementboard/css/create_styles.css
+41
-0
detail_styles.css
...t_group_25/static/announcementboard/css/detail_styles.css
+42
-13
list_styles.css
...get_group_25/static/announcementboard/css/list_styles.css
+30
-5
announcement_detail.html
...p_25/templates/announcementboard/announcement_detail.html
+6
-2
announcement_form.html
...oup_25/templates/announcementboard/announcement_form.html
+26
-0
announcement_list.html
...oup_25/templates/announcementboard/announcement_list.html
+12
-8
base.html
widget_group_25/widget_group_25/templates/base.html
+0
-1
No files found.
widget_group_25/announcementboard/forms.py
0 → 100644
View file @
ccee7e03
from
django
import
forms
from
.models
import
Announcement
class
AnnouncementForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Announcement
fields
=
[
'announcement_title'
,
'announcement_body'
,
'author'
,
]
\ No newline at end of file
widget_group_25/announcementboard/urls.py
View file @
ccee7e03
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
announcement_list_v
iew
,
announcement_detail_view
from
.views
import
AnnouncementListView
,
AnnouncementCreateV
iew
,
announcement_detail_view
urlpatterns
=
[
urlpatterns
=
[
# path('', index, name='index')
path
(
''
,
AnnouncementListView
.
as_view
(),
name
=
'announcement-list'
),
path
(
'
'
,
announcement_list_view
,
name
=
'announcement-list
'
),
path
(
'
<int:pk>/details/'
,
announcement_detail_view
,
name
=
'announcement-detail
'
),
path
(
'
<int:pk>/details'
,
announcement_detail_view
,
name
=
'announcement-detail
'
),
path
(
'
add/'
,
AnnouncementCreateView
.
as_view
(),
name
=
'announcement-create
'
),
]
]
app_name
=
"announcementboard"
app_name
=
"announcementboard"
\ No newline at end of file
widget_group_25/announcementboard/views.py
View file @
ccee7e03
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.urls
import
reverse
from
django.views.generic.list
import
ListView
from
django.views.generic.edit
import
CreateView
from
.models
import
Announcement
from
.models
import
Announcement
def
announcement_list_view
(
request
):
class
AnnouncementListView
(
ListView
):
context
=
{}
queryset
=
Announcement
.
objects
.
order_by
(
'-pub_date'
)
context
[
'object_list'
]
=
Announcement
.
objects
.
order_by
(
'-pub_date'
)
.
all
()
return
render
(
request
,
'announcementboard/announcement_list.html'
,
context
)
class
AnnouncementCreateView
(
CreateView
):
model
=
Announcement
fields
=
'__all__'
def
get_success_url
(
self
):
return
reverse
(
'announcementboard:announcement-list'
)
def
announcement_detail_view
(
request
,
pk
):
def
announcement_detail_view
(
request
,
pk
):
announcement
=
Announcement
.
objects
.
get
(
pk
=
pk
)
announcement
=
Announcement
.
objects
.
get
(
pk
=
pk
)
...
...
widget_group_25/widget_group_25/static/announcementboard/css/create_styles.css
0 → 100644
View file @
ccee7e03
h1
{
color
:
#33415c
;
border-bottom
:
solid
;
font-family
:
'Tahoma'
;
font-size
:
40pt
;
}
h4
a
{
background-color
:
#dae8ea
;
padding
:
15px
;
text-decoration
:
none
;
border-style
:
solid
;
}
body
{
background-color
:
#fefefe
;
font-family
:
'Trebuchet MS'
;
font-size
:
12pt
;
padding
:
20pt
;
}
p
{
padding-left
:
15pt
;
color
:
#8e574c
;
}
a
:link
{
color
:
#33415c
;
text-decoration
:
none
;
}
a
:visited
{
color
:
#5c677d
;
}
#submit_button
{
background-color
:
white
;
font-family
:
'Trebuchet MS'
;
color
:
#33415c
;
border-color
:
#33415c
;
}
\ No newline at end of file
widget_group_25/widget_group_25/static/announcementboard/css/detail_styles.css
View file @
ccee7e03
h1
{
h1
{
color
:
#393d3f
;
color
:
#fefefe
;
background-color
:
#6c7a84
;
font-family
:
'Tahoma'
;
font-family
:
'Tahoma'
;
font-size
:
35pt
;
font-size
:
35pt
;
line-height
:
10px
;
line-height
:
70pt
;
padding-left
:
10pt
;
}
}
h2
{
h2
{
color
:
#546a7b
;
color
:
#4f5b63
;
font-family
:
'Tahoma'
;
font-size
:
25pt
;
font-size
:
20pt
;
line-height
:
0pt
;
padding-left
:
10pt
;
}
}
h3
{
h3
{
color
:
#546a7b
;
color
:
#8e574c
;
font-family
:
'Trebuchet MS'
;
font-size
:
16pt
;
font-style
:
italic
;
font-style
:
italic
;
font-family
:
'Trebuchet MS'
;
font-size
:
18pt
;
line-height
:
0pt
;
padding-left
:
15pt
;
}
h4
a
{
background-color
:
#d4d9da
;
padding
:
15px
;
text-decoration
:
none
;
border-style
:
solid
;
}
}
body
{
body
{
color
:
#393d3f
;
background-color
:
#fefefe
;
font-family
:
'Trebuchet MS'
;
font-family
:
'Trebuchet MS'
;
font-size
:
12pt
;
font-size
:
12pt
;
line-height
:
15px
;
}
}
img
{
p
{
height
:
2cm
;
padding-left
:
20pt
;
color
:
rgb
(
51
,
53
,
53
);
}
a
:link
{
color
:
#33415c
;
text-decoration
:
none
;
}
a
:visited
{
color
:
#5c677d
}
img
{
height
:
80px
;
float
:
left
;
padding-left
:
10pt
;
padding-right
:
10pt
;
padding-top
:
5pt
;
}
}
\ No newline at end of file
widget_group_25/widget_group_25/static/announcementboard/css/list_styles.css
View file @
ccee7e03
h1
{
h1
{
color
:
#22223b
;
color
:
#454545
;
background-color
:
#93b7be
;
font-family
:
'Tahoma'
;
font-family
:
'Tahoma'
;
font-size
:
38pt
;
font-size
:
45pt
;
line-height
:
80pt
;
text-align
:
center
;
}
}
h3
{
h3
{
color
:
#4a4e69
;
color
:
#4a4e69
;
font-family
:
'Trebuchet MS'
;
font-family
:
'Trebuchet MS'
;
font-size
:
18pt
;
font-size
:
25pt
;
line-height
:
10pt
;
}
h4
a
{
background-color
:
#dae8ea
;
padding
:
15px
;
text-decoration
:
none
;
border-style
:
solid
;
}
}
body
{
body
{
color
:
#4a4e69
;
background-color
:
#fefefe
;
font-family
:
'Trebuchet MS'
;
font-family
:
'Trebuchet MS'
;
font-size
:
12pt
;
font-size
:
12pt
;
}
}
a
:visited
{
ul
{
margin-left
:
15px
;
line-height
:
30px
;
}
a
:link
{
color
:
#33415c
;
text-decoration
:
none
;
}
a
:hover
{
color
:
#723d46
;
color
:
#723d46
;
}
a
:visited
{
color
:
#5c677d
}
}
\ No newline at end of file
widget_group_25/widget_group_25/templates/announcementboard/announcement_detail.html
View file @
ccee7e03
...
@@ -21,10 +21,14 @@
...
@@ -21,10 +21,14 @@
<h2>
<h2>
by {{ announcement.author.first_name }} {{ announcement.author.last_name }}, {{ announcement.pub_date|date:'d/m/Y' }}
by {{ announcement.author.first_name }} {{ announcement.author.last_name }}, {{ announcement.pub_date|date:'d/m/Y' }}
</h2>
</h2>
{{ announcement.announcement_body }}
<p>
{{ announcement.announcement_body }}
</p>
<h3>
Reactions:
</h3>
<br><h3>
Reactions
</h3>
<p>
Like: {{ count_like }}
<br>
Like: {{ count_like }}
<br>
Love: {{ count_love }}
<br>
Love: {{ count_love }}
<br>
Angry: {{ count_angry }}
Angry: {{ count_angry }}
</p>
<br><br><br>
<h4><a
href=
"{% url 'announcementboard:announcement-list' %}"
>
Back to Announcement Board
</a></h4>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_group_25/widget_group_25/templates/announcementboard/announcement_form.html
0 → 100644
View file @
ccee7e03
{% extends 'base.html' %}
{% load static %}
{% block title %}Create Announcement{% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static 'announcementboard/css/create_styles.css' %}"
>
{% endblock %}
{% block content %}
<h1>
New Announcement
</h1>
<p>
<form
method=
"POST"
>
{% csrf_token %}
<label
for=
"{{ form.announcement_title.id_for_label }}"
>
Announcement Title
</label><br>
{{ form.announcement_title }}
<br><br>
<label
for=
"{{ form.announcement_body.id_for_label }}"
>
Announcement Body
</label><br>
{{ form.announcement_body }}
<br><br>
<label
for=
"{{ form.authot.id_for_label }}"
>
Author
</label><br>
{{ form.author }}
<br><br>
<input
type=
"submit"
value=
"Save Announcement"
id=
"submit_button"
>
</form>
</p>
<br><h4><a
href=
"{% url 'announcementboard:announcement-list' %}"
>
Back to Announcement Board
</a></h4>
{% endblock %}
widget_group_25/widget_group_25/templates/announcementboard/announcement_list.html
View file @
ccee7e03
...
@@ -10,12 +10,16 @@
...
@@ -10,12 +10,16 @@
{% block content %}
{% block content %}
<h1>
Announcement Board
</h1>
<h1>
Announcement Board
</h1>
<h3>
Important announcements:
</h3>
<h3>
Important Announcements
</h3>
{% for object in object_list %}
<ul>
<li>
{% for object in object_list %}
<a
href=
"{% url 'announcementboard:announcement-detail' pk=object.pk %}"
>
<li>
{{ object.announcement_title }} by {{ object.author.first_name }} {{ object.author.last_name }} dated {{ object.pub_date|date:"d/m/Y" }}
<a
href=
"{% url 'announcementboard:announcement-detail' pk=object.pk %}"
>
</a>
{{ object.announcement_title }} by {{ object.author.first_name }} {{ object.author.last_name }} dated {{ object.pub_date|date:"d/m/Y" }}
</li>
</a>
{% endfor %}
</li>
{% endfor %}
</ul>
<br>
<h4><a
href=
"{% url 'announcementboard:announcement-create' %}"
>
Add New Announcement
</a></h4>
{% endblock %}
{% endblock %}
widget_group_25/widget_group_25/templates/base.html
View file @
ccee7e03
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<link
rel=
"stylesheet"
href=
"styles.css"
>
<title>
{% block title %}{% endblock %}
</title>
<title>
{% block title %}{% endblock %}
</title>
{% block styles %}{% endblock %}
{% block styles %}{% endblock %}
</head>
</head>
...
...
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