Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group17
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
Vaughn Nephi Fajardo
widget_group17
Commits
1bb55877
Commit
1bb55877
authored
May 22, 2022
by
Neal Berones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted announcements index view into CBV, tested populating announcements model using forms
parent
3c4a7fcf
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
8 deletions
+15
-8
urls.cpython-310.pyc
...t_group_17/announcements/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
..._group_17/announcements/__pycache__/views.cpython-310.pyc
+0
-0
style.css
widget_group_17/announcements/static/announcements/style.css
+6
-6
urls.py
widget_group_17/announcements/urls.py
+1
-1
views.py
widget_group_17/announcements/views.py
+8
-1
db.sqlite3
widget_group_17/db.sqlite3
+0
-0
freemusic.jpeg
widget_group_17/static/announcements/freemusic.jpeg
+0
-0
No files found.
widget_group_17/announcements/__pycache__/urls.cpython-310.pyc
View file @
1bb55877
No preview for this file type
widget_group_17/announcements/__pycache__/views.cpython-310.pyc
View file @
1bb55877
No preview for this file type
widget_group_17/announcements/static/announcements/style.css
View file @
1bb55877
p
{
color
:
white
;
color
:
black
;
font-weight
:
bold
;
font-family
:
Helvetica
;
font-size
:
25px
;
...
...
@@ -7,12 +7,12 @@ p{
h1
{
position
:
sticky
;
text-align
:
left
;
color
:
white
;
color
:
black
;
font-size
:
55px
;
font-family
:
Helvetica
;
}
body
{
background-image
:
url("/static/bg.png")
;
background-image
:
url("/static/
announcements/
bg.png")
;
background-repeat
:
no-repeat
;
background-size
:
cover
;
background-position
:
center
;
...
...
@@ -20,14 +20,14 @@ body {
font-family
:
Helvetica
;
}
a
{
color
:
white
;
color
:
black
;
font-family
:
Helvetica
;
font-weight
:
bold
;
}
ol
{
font-size
:
35px
;
font-family
:
Helvetica
;
color
:
white
;
color
:
black
;
font-weight
:
bold
;
}
a
:link
{
...
...
widget_group_17/announcements/urls.py
View file @
1bb55877
...
...
@@ -3,7 +3,7 @@ from . import views
app_name
=
"announcements"
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
'index'
),
path
(
''
,
views
.
IndexView
.
as_view
()
,
name
=
'index'
),
path
(
'add/'
,
views
.
add
,
name
=
'add'
),
path
(
'<int:announcement_id>/details'
,
views
.
detail
,
name
=
"detail"
)
#path('welcome', views.welcome, name='welcome')
...
...
widget_group_17/announcements/views.py
View file @
1bb55877
...
...
@@ -4,8 +4,15 @@ from django.shortcuts import render, redirect
from
.models
import
WidgetUser
,
Announcement
,
Reaction
from
.forms
import
AnnouncementForm
from
django.template
import
loader
from
django.views
import
View
# Create your views here.
class
IndexView
(
View
):
def
get
(
self
,
request
):
announcements_list
=
Announcement
.
objects
.
all
()
.
order_by
(
"pub_date"
)
return
render
(
request
,
"announcements/index.html"
,
{
"announcements_list"
:
announcements_list
})
'''
def index(request):
announcements_list = Announcement.objects.all().order_by("pub_date")
#template = loader.get_template("announcements/index.html")
...
...
@@ -13,7 +20,7 @@ def index(request):
"announcements_list":announcements_list
}
return render(request, "announcements/index.html", context)
'''
#HttpResponse(template.render(context, request))
def
detail
(
request
,
announcement_id
):
...
...
widget_group_17/db.sqlite3
View file @
1bb55877
No preview for this file type
widget_group_17/static/announcements/freemusic.jpeg
0 → 100644
View file @
1bb55877
155 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