Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_aguandhischipmunks
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
Adrian Lance Damalerio
midterm_aguandhischipmunks
Commits
5a1c22ea
Commit
5a1c22ea
authored
May 14, 2023
by
Jan Ericsson Ong Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated views.py and event_details.py
parent
c4b9253c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
event-details.html
...andhischipmunks/calendar_app/templates/event-details.html
+23
-0
views.py
widget_aguandhischipmunks/calendar_app/views.py
+4
-4
No files found.
widget_aguandhischipmunks/calendar_app/templates/event-details.html
View file @
5a1c22ea
{% extends 'base.html'%}
{% block title %} {{event.activity}} {% endblock %}
{% block content %}
{% if assignment %}
<h1>
{{assignment.name}}
</h1>
<ul>
<p>
Date and Time: {{event.target_datetime}}
</p><br>
<p>
Estimated Hours: {{event.target_datetime}}
</p><br>
<p>
{{event.course}}
</p><br>
<p>
Mode: {{location.mode}}
</p><br>
<p>
Venue: {{location.venue}}
</p><br>
</ul>
{% else %}
<p>
No Available Books.
</p>
{% endif %}
<ul>
<li
><button
type=
"button"
onclick=
"window.location.href='/calendar/{{event.pk}}/edit'"
>
Edit Event
</button></li>
</ul>
{% endblock %}
widget_aguandhischipmunks/calendar_app/views.py
View file @
5a1c22ea
from
django.shortcuts
import
render
,
redirect
from
django.views.generic
import
DetailView
,
CreateView
,
UpdateView
from
.models
import
Event
from
.models
import
Event
,
Location
from
.forms
import
AddEventForm
...
...
@@ -11,12 +11,12 @@ def calendar_view(request):
#calendar Detail View for CBV Implementation
class
EventDetailView
(
DetailView
):
model
=
Event
model
=
Event
,
Location
template_name
=
'event-details.html'
context_object_name
=
'event'
class
EventAddListView
(
CreateView
):
model
=
Event
model
=
Event
,
Location
form_class
=
AddEventForm
template_name
=
"event-add.html"
...
...
@@ -32,7 +32,7 @@ class EventAddListView(CreateView):
# calendar for editing CBV implementation.
class
EventEditView
(
UpdateView
):
model
=
Event
model
=
Event
,
Location
form_class
=
AddEventForm
template_name
=
'event-edit.html'
...
...
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