Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_django unchained
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
1
Merge Requests
1
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
Jose Emmanuel B. Laurel
widget_django unchained
Commits
2565072e
Commit
2565072e
authored
May 20, 2022
by
Joshua Son
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvement: New and improved announcement page with images and style
parent
3d2d6be6
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
39 additions
and
29 deletions
+39
-29
models.cpython-39.pyc
...unchained/announcements/__pycache__/models.cpython-39.pyc
+0
-0
views.cpython-39.pyc
..._unchained/announcements/__pycache__/views.cpython-39.pyc
+0
-0
0017_announcement_announce_image.py
...ouncements/migrations/0017_announcement_announce_image.py
+18
-0
0017_announcement_announce_image.cpython-39.pyc
...pycache__/0017_announcement_announce_image.cpython-39.pyc
+0
-0
models.py
widget_django_unchained/announcements/models.py
+1
-1
style.css
...ngo_unchained/announcements/static/announcement/style.css
+4
-1
announcement_board.html
...ouncements/templates/announcement/announcement_board.html
+10
-8
announcement_page.html
...nouncements/templates/announcement/announcement_page.html
+1
-1
reactions_list.html
.../announcements/templates/announcement/reactions_list.html
+0
-14
views.py
widget_django_unchained/announcements/views.py
+4
-3
db.sqlite3
widget_django_unchained/db.sqlite3
+0
-0
replychain_listing.html
..._django_unchained/forum/templates/replychain_listing.html
+1
-1
79-790839_graphic-royalty-free-effect-alphabet-gold-big-image.png
...9_graphic-royalty-free-effect-alphabet-gold-big-image.png
+0
-0
Kirby_and_The_Forgotten_Land_Icon.jpg
...tic/homepage/images/Kirby_and_The_Forgotten_Land_Icon.jpg
+0
-0
hide-the-pain-stockphoto-840x560.jpg
...atic/homepage/images/hide-the-pain-stockphoto-840x560.jpg
+0
-0
No files found.
widget_django_unchained/announcements/__pycache__/models.cpython-39.pyc
View file @
2565072e
No preview for this file type
widget_django_unchained/announcements/__pycache__/views.cpython-39.pyc
View file @
2565072e
No preview for this file type
widget_django_unchained/announcements/migrations/0017_announcement_announce_image.py
0 → 100644
View file @
2565072e
# Generated by Django 3.2.12 on 2022-05-20 11:19
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'announcements'
,
'0016_alter_announcement_author'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'announcement'
,
name
=
'announce_image'
,
field
=
models
.
ImageField
(
blank
=
True
,
default
=
'faceless_9ltCukV.png'
,
null
=
True
,
upload_to
=
''
),
),
]
widget_django_unchained/announcements/migrations/__pycache__/0017_announcement_announce_image.cpython-39.pyc
0 → 100644
View file @
2565072e
File added
widget_django_unchained/announcements/models.py
View file @
2565072e
...
@@ -8,7 +8,7 @@ class Announcement(models.Model):
...
@@ -8,7 +8,7 @@ class Announcement(models.Model):
announcement_body
=
models
.
CharField
(
max_length
=
500
)
announcement_body
=
models
.
CharField
(
max_length
=
500
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
reaction_list
=
models
.
ForeignKey
(
'Reaction'
,
on_delete
=
models
.
CASCADE
,
related_name
=
'+'
,
default
=
1
)
reaction_list
=
models
.
ForeignKey
(
'Reaction'
,
on_delete
=
models
.
CASCADE
,
related_name
=
'+'
,
default
=
1
)
announce_image
=
models
.
ImageField
(
default
=
"faceless_9ltCukV.png"
,
null
=
True
,
blank
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
announcement_title
return
self
.
announcement_title
...
...
widget_django_unchained/announcements/static/announcement/style.css
View file @
2565072e
h1
{
h1
{
color
:
purple
;
color
:
purple
;
font-weight
:
bold
;
font-weight
:
bold
;
font-family
:
'Franklin Gothic Medium'
,
'Arial Narrow'
,
Arial
,
sans-serif
;
}
}
p
{
p
{
color
:
orange
;
color
:
orange
;
font-weight
:
bold
;
font-weight
:
bold
;
font-family
:
'Courier New'
,
Courier
,
monospace
;
}
}
body
{
body
{
background-color
:
beige
;
background-color
:
beige
;
font-family
:
'Courier New'
,
Courier
,
monospace
;
}
}
a
{
a
{
color
:
orangered
;
color
:
orangered
;
...
...
widget_django_unchained/announcements/templates/announcement/announcement_board.html
View file @
2565072e
{% extends "announcement/base.html" %}
{% extends "announcement/base.html" %}
{% block content %}
{% block content %}
<img
src=
"{{announce.announce_image.url}}"
>
<h1>
{{ announce.announcement_title }}
</h1>
<h1>
{{ announce.announcement_title }}
</h1>
<p>
<em>
by {{ announce.author.first_name}} {{announce.author.last_name}}, {{announce.pub_date}}
</em>
</p>
<p>
<em>
by {{ announce.author.first_name}} {{announce.author.last_name}}, {{announce.pub_date|date:"d/m/Y h:i:s A"}}
</em>
</p>
<p>
{{announce.announcement_body}}
</p>
<p>
{{announce.announcement_body}}
</p>
<ul>
{% for react in reacts %}
<p>
{% include "announcement/reactions_list.html" with reactions=announce.reaction_list %}
</p>
<li>
{{react.reaction_name}}:{{react.tally}}
</li>
{% endfor %}
</ul>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_django_unchained/announcements/templates/announcement/announcement_page.html
View file @
2565072e
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
{% if announce_list %}
{% if announce_list %}
<ul>
<ul>
{% for announce in announce_list %}
{% for announce in announce_list %}
<li>
<a
href =
"{% url 'detail' announce.id %}"
>
{{ announce.announcement_title }} by {{announce.author.first_name}} {{announce.author.last_name}} dated {{announce.pub_date}}
</a></li>
<li>
<a
href =
"{% url 'detail' announce.id %}"
>
{{ announce.announcement_title }} by {{announce.author.first_name}} {{announce.author.last_name}} dated {{announce.pub_date
|date:"d/m/Y h:i:s A"
}}
</a></li>
{% endfor %}
{% endfor %}
</ul>
</ul>
{% else %}
{% else %}
...
...
widget_django_unchained/announcements/templates/announcement/reactions_list.html
deleted
100644 → 0
View file @
3d2d6be6
{% extends "announcement/base.html" %}
<p>
<p>
{{ reactions.reaction_name }} : {{reactions.tally}}
</p>
{% if reactions.reaction_self != NULL %}
<p>
{% include "announcement/reactions_list.html" with reactions=reactions.reaction_self %}
</p>
{% endif %}
</p>
\ No newline at end of file
widget_django_unchained/announcements/views.py
View file @
2565072e
from
django.http
import
Http404
from
django.http
import
Http404
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
.models
import
Announcement
from
.models
import
Announcement
,
Reaction
# Create your views here.
# Create your views here.
...
@@ -22,4 +22,5 @@ def detail(request, announcement_id):
...
@@ -22,4 +22,5 @@ def detail(request, announcement_id):
except
Announcement
.
DoesNotExist
:
except
Announcement
.
DoesNotExist
:
raise
Http404
(
"Announcement does not exist!"
)
raise
Http404
(
"Announcement does not exist!"
)
return
render
(
request
,
"announcement/announcement_board.html"
,
{
"announce"
:
announce
})
reacts
=
Reaction
.
objects
.
filter
(
announcement_id
=
announce
)
.
order_by
(
"reaction_name"
)
\ No newline at end of file
return
render
(
request
,
"announcement/announcement_board.html"
,
{
"announce"
:
announce
,
"reacts"
:
reacts
})
\ No newline at end of file
widget_django_unchained/db.sqlite3
View file @
2565072e
No preview for this file type
widget_django_unchained/forum/templates/replychain_listing.html
View file @
2565072e
<p>
<p>
<i>
Reply by {{post.author.first_name}} {{post.author.last_name}} dated {{reply.pub_date}}:
</i>
<i>
Reply by {{post.author.first_name}} {{post.author.last_name}} dated {{reply.pub_date
|date:"d/m/Y h:i:s A"
}}:
</i>
</p>
</p>
<p>
{{reply.reply_body}}
</p>
<p>
{{reply.reply_body}}
</p>
...
...
widget_django_unchained/homepage/static/homepage/images/79-790839_graphic-royalty-free-effect-alphabet-gold-big-image.png
0 → 100644
View file @
2565072e
44.7 KB
widget_django_unchained/homepage/static/homepage/images/Kirby_and_The_Forgotten_Land_Icon.jpg
0 → 100644
View file @
2565072e
121 KB
widget_django_unchained/homepage/static/homepage/images/hide-the-pain-stockphoto-840x560.jpg
0 → 100644
View file @
2565072e
27.5 KB
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