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
0f8ec36f
Commit
0f8ec36f
authored
May 01, 2023
by
Angelo Alvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Event Details pages
parent
fc14d6bf
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
32 deletions
+22
-32
models.cpython-310.pyc
...casanatics/assignments/__pycache__/models.cpython-310.pyc
+0
-0
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
+3
-1
event-details.html
...cs/calendar_app/templates/calendar_app/event-details.html
+18
-0
views.py
widget_casanatics/calendar_app/views.py
+1
-31
No files found.
widget_casanatics/assignments/__pycache__/models.cpython-310.pyc
View file @
0f8ec36f
No preview for this file type
widget_casanatics/calendar_app/__pycache__/models.cpython-310.pyc
View file @
0f8ec36f
No preview for this file type
widget_casanatics/calendar_app/__pycache__/urls.cpython-310.pyc
View file @
0f8ec36f
No preview for this file type
widget_casanatics/calendar_app/__pycache__/views.cpython-310.pyc
View file @
0f8ec36f
No preview for this file type
widget_casanatics/calendar_app/models.py
View file @
0f8ec36f
...
@@ -14,7 +14,9 @@ class Location(models.Model):
...
@@ -14,7 +14,9 @@ class Location(models.Model):
venue
=
models
.
TextField
(
max_length
=
255
)
venue
=
models
.
TextField
(
max_length
=
255
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
venue
return
self
.
venue
.
replace
(
'
\r\n
'
,
' or '
)
class
Event
(
models
.
Model
):
class
Event
(
models
.
Model
):
...
...
widget_casanatics/calendar_app/templates/calendar_app/event-details.html
0 → 100644
View file @
0f8ec36f
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ object.title }}{% endblock %}
{% block content %}
<h1>
{{ object.activity }}
</h1>
<b>
Date and Time:
</b>
{{ object.target_datetime|date:"m/d/Y, h:i A" }}
<br>
<b>
Estimated Hours:
</b>
{{ object.estimated_hours }}
<br>
<b>
Course:
</b>
{{ object.course.code }} {{ object.course.title }} - {{ object.course.section }}
<br>
<b>
Mode:
</b>
{{ object.location.mode }}
<br>
<b>
Venue:
</b>
{{ object.location|urlize }}
<br>
<form
action=
"../events/edit"
>
<button
type=
"Submit"
>
Edit Activity
</button>
</form>
{% endblock %}
widget_casanatics/calendar_app/views.py
View file @
0f8ec36f
...
@@ -13,36 +13,6 @@ def calendar(request):
...
@@ -13,36 +13,6 @@ def calendar(request):
return
render
(
request
,
'calendar_app/calendar.html'
,
context
)
return
render
(
request
,
'calendar_app/calendar.html'
,
context
)
class
EventDetailView
(
DetailView
):
class
EventDetailView
(
DetailView
):
template_name
=
'calendar_app/event-detail.html'
template_name
=
'calendar_app/event-detail
s
.html'
model
=
Event
model
=
Event
"""
def index(request):
eventInfo = ""
events = Event.objects.all()
for event in events:
localdatetime = timezone.localtime(event.target_datetime)
eventInfo += '''
Date and Time: {} <br>
Activity: {} <br>
Estimated Hours: {} <br>
Course/Section: {} {}-{} <br>
Mode: {} <br>
Venue: {} <br>
<br>
'''.format(
localdatetime.strftime("
%
m/
%
d/
%
Y,
%
I:
%
M
%
p"),
event.activity,
event.estimated_hours,
event.course.code, event.course.title, event.course.section,
event.location.mode,
event.location.venue
)
return HttpResponse('''
Widget's Calendar of Activities <br>
<br>
{}
'''.format(eventInfo))
"""
\ No newline at end of file
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