Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_Alipins
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
Angelico Ruiz T. Teaño
widget_Alipins
Commits
b2a35959
Commit
b2a35959
authored
May 14, 2022
by
Carlo Joseph Echon
🐟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added images to Announcements and setup separate style.css per app
parent
211a8543
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
105 additions
and
8 deletions
+105
-8
0005_announcement_announcement_image.py
...ements/migrations/0005_announcement_announcement_image.py
+18
-0
models.py
widget_alipins/announcements/models.py
+1
-0
detail.html
...alipins/announcements/templates/announcements/detail.html
+12
-2
index.html
..._alipins/announcements/templates/announcements/index.html
+7
-1
urls.py
widget_alipins/announcements/urls.py
+0
-1
detail.html
widget_alipins/assignments/templates/assignments/detail.html
+5
-0
index.html
widget_alipins/assignments/templates/assignments/index.html
+6
-0
db.sqlite3
widget_alipins/db.sqlite3
+0
-0
announcementImage1.jpg
widget_alipins/media/announcements/announcementImage1.jpg
+0
-0
announcementImage2.jpg
widget_alipins/media/announcements/announcementImage2.jpg
+0
-0
announcementImage3.jpg
widget_alipins/media/announcements/announcementImage3.jpg
+0
-0
style.css
widget_alipins/static/announcements/style.css
+44
-0
style.css
widget_alipins/static/assignments/style.css
+0
-0
base.html
widget_alipins/templates/base.html
+2
-1
settings.py
widget_alipins/widget_alipins/settings.py
+6
-2
urls.py
widget_alipins/widget_alipins/urls.py
+4
-1
No files found.
widget_alipins/announcements/migrations/0005_announcement_announcement_image.py
0 → 100644
View file @
b2a35959
# Generated by Django 4.0.3 on 2022-05-13 13:02
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'announcements'
,
'0004_auto_20220403_1509'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'announcement'
,
name
=
'announcement_image'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
'announcements/'
),
),
]
widget_alipins/announcements/models.py
View file @
b2a35959
...
@@ -8,6 +8,7 @@ class Announcement(models.Model):
...
@@ -8,6 +8,7 @@ class Announcement(models.Model):
announcement_body
=
models
.
TextField
(
max_length
=
1500
)
announcement_body
=
models
.
TextField
(
max_length
=
1500
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
)
announcement_image
=
models
.
ImageField
(
null
=
True
,
blank
=
True
,
upload_to
=
"announcements/"
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
announcement_title
return
self
.
announcement_title
...
...
widget_alipins/announcements/templates/announcements/detail.html
View file @
b2a35959
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block styles %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'announcements/style.css' %}"
>
{% endblock %}
{% block title %}{{announcement.announcement_title}}{% endblock %}
{% block title %}{{announcement.announcement_title}}{% endblock %}
{% block content %}
{% block content %}
<h1>
{{announcement.announcement_title}}
</h1>
<h1>
{{announcement.announcement_title}}
</h1>
<
div
>
<
h2>
by {{announcement.author.first_name}} {{announcement.author.last_name}}, {{announcement.pub_date|date:"d/m/Y"}}
</h2
>
<h2>
by {{announcement.author.first_name}} {{announcement.author.last_name}}, {{announcement.pub_date}}
</h2>
<div>
<p>
<p>
Description: {{announcement.announcement_body}}
<br><br>
Description: {{announcement.announcement_body}}
<br><br>
{% if announcement.announcement_image %}
<img
src =
"{{ announcement.announcement_image.url }}"
><br>
{% endif %}
Reaction:
<br>
Reaction:
<br>
{% for reaction in reaction_list %}
{% for reaction in reaction_list %}
{% if reaction.announcement.id == announcement.id %}
{% if reaction.announcement.id == announcement.id %}
{{reaction.reaction_name}}: {{reaction.tally}}
<br>
{{reaction.reaction_name}}: {{reaction.tally}}
<br>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
</div>
</div>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_alipins/announcements/templates/announcements/index.html
View file @
b2a35959
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block styles %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'announcements/style.css' %}"
>
{% endblock %}
{% block title %}Announcements{% endblock %}
{% block title %}Announcements{% endblock %}
{% block content %}
{% block content %}
<h1>
Announcement Board
</h1>
<h1>
Announcement Board
</h1>
...
@@ -7,7 +13,7 @@
...
@@ -7,7 +13,7 @@
{% if announcement_list %}
{% if announcement_list %}
<ul>
<ul>
{% for announcement in announcement_list %}
{% for announcement in announcement_list %}
<li><a
href=
"{% url 'announcements:details' announcement.id %}"
>
{{announcement.announcement_title}}
</a>
by {{announcement.author.first_name}} {{announcement.author.last_name}} dated {{announcement.pub_date}}
</li>
<li><a
href=
"{% url 'announcements:details' announcement.id %}"
>
{{announcement.announcement_title}}
</a>
by {{announcement.author.first_name}} {{announcement.author.last_name}} dated {{announcement.pub_date
|date:"d/m/Y"
}}
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
{% else %}
{% else %}
...
...
widget_alipins/announcements/urls.py
View file @
b2a35959
from
django.urls
import
path
from
django.urls
import
path
from
.
import
views
from
.
import
views
app_name
=
"announcements"
app_name
=
"announcements"
...
...
widget_alipins/assignments/templates/assignments/detail.html
View file @
b2a35959
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block styles %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'assignments/style.css' %}"
>
{% endblock %}
{% block title %}{{assignment.name}} | {{assignment.course.course_code}}{% endblock %}
{% block title %}{{assignment.name}} | {{assignment.course.course_code}}{% endblock %}
{% block content %}
{% block content %}
<h1>
{{assignment.course.course_code}} | {{assignment.course.course_title}} - {{assignment.course.section}}
</h1>
<h1>
{{assignment.course.course_code}} | {{assignment.course.course_title}} - {{assignment.course.section}}
</h1>
...
...
widget_alipins/assignments/templates/assignments/index.html
View file @
b2a35959
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block styles %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'assignments/style.css' %}"
>
{% endblock %}
{% block title %}Assignments{% endblock %}
{% block title %}Assignments{% endblock %}
{% block content %}
{% block content %}
<h1>
Assignments Per Course
</h1>
<h1>
Assignments Per Course
</h1>
...
...
widget_alipins/db.sqlite3
View file @
b2a35959
No preview for this file type
widget_alipins/media/announcements/announcementImage1.jpg
0 → 100644
View file @
b2a35959
574 KB
widget_alipins/media/announcements/announcementImage2.jpg
0 → 100644
View file @
b2a35959
70.7 KB
widget_alipins/media/announcements/announcementImage3.jpg
0 → 100644
View file @
b2a35959
189 KB
widget_alipins/static/announcements/style.css
0 → 100644
View file @
b2a35959
body
{
font-family
:
sans-serif
,
Arial
,
Helvetica
;
color
:
#066438
;
margin
:
40px
;
line-height
:
2
;
}
div
{
margin
:
auto
;
width
:
50%
;
border
:
3px
solid
rgb
(
5
,
119
,
85
);
padding
:
20px
40px
40px
80px
;
}
h1
{
font-size
:
50px
;
text-align
:
center
;
text-decoration
:
underline
;
}
h2
{
font-size
:
28px
;
text-align
:
center
;
}
li
{
font-size
:
20px
;
}
p
{
font-size
:
20px
;
}
span
{
font-weight
:
bold
;
}
span
.perfect
{
color
:
rgb
(
96
,
189
,
96
);
}
span
.passing
{
color
:
#bb5959
}
\ No newline at end of file
widget_alipins/
assignments/
static/assignments/style.css
→
widget_alipins/static/assignments/style.css
View file @
b2a35959
File moved
widget_alipins/templates/base.html
View file @
b2a35959
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'assignments/style.css' %}"
>
{% block styles %}
{% endblock %}
<title>
{% block title %} Alipins {% endblock %}
</title>
<title>
{% block title %} Alipins {% endblock %}
</title>
</head>
</head>
<body>
<body>
...
...
widget_alipins/widget_alipins/settings.py
View file @
b2a35959
...
@@ -123,8 +123,12 @@ USE_TZ = True
...
@@ -123,8 +123,12 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0/howto/static-files/
# https://docs.djangoproject.com/en/4.0/howto/static-files/
STATIC_URL
=
'static/'
STATIC_URL
=
'/static/'
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'media'
)
MEDIA_URL
=
'/media/'
STATICFILES_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
'static'
),
)
# Default primary key field type
# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
...
...
widget_alipins/widget_alipins/urls.py
View file @
b2a35959
...
@@ -16,10 +16,13 @@ Including another URLconf
...
@@ -16,10 +16,13 @@ Including another URLconf
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.urls
import
include
,
path
from
django.urls
import
include
,
path
from
django.conf
import
settings
from
django.conf.urls.static
import
static
urlpatterns
=
[
urlpatterns
=
[
path
(
'assignments/'
,
include
(
'assignments.urls'
)),
path
(
'assignments/'
,
include
(
'assignments.urls'
)),
path
(
'announcements/'
,
include
(
'announcements.urls'
)),
path
(
'announcements/'
,
include
(
'announcements.urls'
)),
path
(
'forum/'
,
include
(
'forum.urls'
)),
path
(
'forum/'
,
include
(
'forum.urls'
)),
path
(
'homepage/'
,
include
(
'homepage.urls'
)),
path
(
'homepage/'
,
include
(
'homepage.urls'
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
]
]
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
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