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
ee2a8d9e
Commit
ee2a8d9e
authored
May 01, 2023
by
Angelo Alvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Feature: Edit Activity
parent
feb3c692
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
4 deletions
+24
-4
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
event-details.html
...cs/calendar_app/templates/calendar_app/event-details.html
+1
-1
event-edit.html
...atics/calendar_app/templates/calendar_app/event-edit.html
+14
-0
urls.py
widget_casanatics/calendar_app/urls.py
+2
-1
views.py
widget_casanatics/calendar_app/views.py
+7
-2
No files found.
widget_casanatics/calendar_app/__pycache__/urls.cpython-310.pyc
View file @
ee2a8d9e
No preview for this file type
widget_casanatics/calendar_app/__pycache__/views.cpython-310.pyc
View file @
ee2a8d9e
No preview for this file type
widget_casanatics/calendar_app/templates/calendar_app/event-details.html
View file @
ee2a8d9e
...
...
@@ -10,7 +10,7 @@
<b>
Mode:
</b>
{{ object.location.mode }}
<br>
<b>
Venue:
</b>
{{ object.location|urlize }}
<br>
<form
action=
"../e
vents/e
dit"
>
<form
action=
"../edit"
>
<button
type=
"Submit"
>
Edit Activity
</button>
</form>
...
...
widget_casanatics/calendar_app/templates/calendar_app/event-edit.html
0 → 100644
View file @
ee2a8d9e
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Activity {% endblock %}
{% block content %}
<h1>
Edit Activity
</h1>
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<button
type=
"Submit"
>
Save New Activity
</button>
</form>
{% endblock %}
\ No newline at end of file
widget_casanatics/calendar_app/urls.py
View file @
ee2a8d9e
# <appname>/urls.py
from
django.urls
import
path
from
.views
import
calendar
,
EventDetailView
,
EventCreateView
from
.views
import
calendar
,
EventDetailView
,
EventCreateView
,
EventUpdateView
urlpatterns
=
[
path
(
''
,
calendar
,
name
=
'calendar'
),
path
(
'events/<int:pk>/details/'
,
EventDetailView
.
as_view
(),
name
=
'events-details'
),
path
(
'events/add/'
,
EventCreateView
.
as_view
(),
name
=
'add-event'
),
path
(
'events/<int:pk>/edit/'
,
EventUpdateView
.
as_view
(),
name
=
'edit-event'
),
]
app_name
=
"calendar_app"
\ No newline at end of file
widget_casanatics/calendar_app/views.py
View file @
ee2a8d9e
...
...
@@ -3,7 +3,7 @@ from django.http import HttpResponse
from
.models
import
Event
from
django.utils
import
timezone
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
from
django.views.generic.edit
import
CreateView
,
UpdateView
# Create your views here.
...
...
@@ -20,4 +20,9 @@ class EventDetailView(DetailView):
class
EventCreateView
(
CreateView
):
template_name
=
'calendar_app/event-add.html'
model
=
Event
fields
=
[
'activity'
,
'target_datetime'
,
'estimated_hours'
,
'location'
,
'course'
]
\ No newline at end of file
fields
=
[
'activity'
,
'target_datetime'
,
'estimated_hours'
,
'location'
,
'course'
]
class
EventUpdateView
(
UpdateView
):
template_name
=
'calendar_app/event-edit.html'
model
=
Event
fields
=
[
'activity'
,
'target_datetime'
,
'estimated_hours'
,
'location'
,
'course'
]
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