Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_casanatics
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
John Aidan Vincent M. Ng
midterm_casanatics
Commits
fc14d6bf
Commit
fc14d6bf
authored
May 01, 2023
by
Angelo Alvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Calendar Homepage
parent
7a68e88b
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
7 deletions
+45
-7
models.cpython-310.pyc
...asanatics/calendar_app/__pycache__/models.cpython-310.pyc
+0
-0
urls.cpython-310.pyc
..._casanatics/calendar_app/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
...casanatics/calendar_app/__pycache__/views.cpython-310.pyc
+0
-0
models.py
widget_casanatics/calendar_app/models.py
+4
-0
calendar.html
...anatics/calendar_app/templates/calendar_app/calendar.html
+23
-0
urls.py
widget_casanatics/calendar_app/urls.py
+3
-2
views.py
widget_casanatics/calendar_app/views.py
+15
-1
style.css
widget_casanatics/static/style.css
+0
-4
settings.cpython-310.pyc
...cs/widget_casanatics/__pycache__/settings.cpython-310.pyc
+0
-0
No files found.
widget_casanatics/calendar_app/__pycache__/models.cpython-310.pyc
View file @
fc14d6bf
No preview for this file type
widget_casanatics/calendar_app/__pycache__/urls.cpython-310.pyc
View file @
fc14d6bf
No preview for this file type
widget_casanatics/calendar_app/__pycache__/views.cpython-310.pyc
View file @
fc14d6bf
No preview for this file type
widget_casanatics/calendar_app/models.py
View file @
fc14d6bf
from
django.db
import
models
from
django.db
import
models
from
assignments.models
import
Course
from
assignments.models
import
Course
from
django.urls
import
reverse
# Create your models here.
# Create your models here.
class
Location
(
models
.
Model
):
class
Location
(
models
.
Model
):
...
@@ -27,3 +28,6 @@ class Event(models.Model):
...
@@ -27,3 +28,6 @@ class Event(models.Model):
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
activity
return
self
.
activity
def
get_absolute_url
(
self
):
return
reverse
(
'calendar_app:events-details'
,
kwargs
=
{
'pk'
:
self
.
pk
})
widget_casanatics/calendar_app/templates/calendar_app/calendar.html
0 → 100644
View file @
fc14d6bf
{% extends 'base.html' %}
{% load static %}
{% block title %}Widget's Calendar of Activities{% endblock %}
{% block content %}
<h1>
Widget's Calendar of Activities
</h1>
<ul>
{% for object in object_list %}
<li
style=
"list-style-type: circle;"
><a
href=
"{{ object.get_absolute_url }}"
>
{{ object.activity }}
</a></li>
{% endfor %}
</ul>
<form
action=
"./events/add"
>
<button
type=
"Submit"
>
New Activity
</button>
</form>
<a
href=
"../dashboard/"
>
Dashboard
</a>
<br>
<a
href=
"../announcements/"
>
Announcements
</a>
<br>
<a
href=
"../forum/"
>
Forum
</a>
<br>
<a
href=
"../assignments/"
>
Assignments
</a>
<br>
{% endblock %}
\ No newline at end of file
widget_casanatics/calendar_app/urls.py
View file @
fc14d6bf
# <appname>/urls.py
# <appname>/urls.py
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
index
from
.views
import
calendar
,
EventDetailView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
calendar
,
name
=
'calendar'
),
path
(
'events/<int:pk>/details/'
,
EventDetailView
.
as_view
(),
name
=
'events-details'
),
]
]
app_name
=
"calendar_app"
app_name
=
"calendar_app"
\ No newline at end of file
widget_casanatics/calendar_app/views.py
View file @
fc14d6bf
...
@@ -2,8 +2,21 @@ from django.shortcuts import render
...
@@ -2,8 +2,21 @@ from django.shortcuts import render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
Event
from
.models
import
Event
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.views.generic.detail
import
DetailView
# Create your views here.
# Create your views here.
def
calendar
(
request
):
context
=
{}
context
[
"object_list"
]
=
Event
.
objects
.
all
()
return
render
(
request
,
'calendar_app/calendar.html'
,
context
)
class
EventDetailView
(
DetailView
):
template_name
=
'calendar_app/event-detail.html'
model
=
Event
"""
def index(request):
def index(request):
eventInfo = ""
eventInfo = ""
events = Event.objects.all()
events = Event.objects.all()
...
@@ -32,3 +45,4 @@ def index(request):
...
@@ -32,3 +45,4 @@ def index(request):
<br>
<br>
{}
{}
'''.format(eventInfo))
'''.format(eventInfo))
"""
\ No newline at end of file
widget_casanatics/static/style.css
View file @
fc14d6bf
*
{
font-family
:
Arial
,
sans-serif
;
font-size
:
16px
;
}
\ No newline at end of file
widget_casanatics/widget_casanatics/__pycache__/settings.cpython-310.pyc
View file @
fc14d6bf
No preview for this file type
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