Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_vincentdjango
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
1
Merge Requests
1
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
Almira Redoble
midterm_vincentdjango
Commits
181ca089
Commit
181ca089
authored
May 12, 2023
by
Andrew Justin C. Idquival
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created the UpdateView page for calendar
parent
81ec45c3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
10 deletions
+32
-10
calendar.html
...o/widget_calendar/templates/widget_calendar/calendar.html
+1
-1
event-add.html
.../widget_calendar/templates/widget_calendar/event-add.html
+1
-1
event-details.html
...get_calendar/templates/widget_calendar/event-details.html
+2
-2
event-edit.html
...widget_calendar/templates/widget_calendar/event-edit.html
+15
-0
urls.py
widget_vincentdjango/widget_calendar/urls.py
+4
-3
views.py
widget_vincentdjango/widget_calendar/views.py
+9
-3
No files found.
widget_vincentdjango/widget_calendar/templates/widget_calendar/calendar.html
View file @
181ca089
+
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %}Widget's Calendar of Activities{% endblock %}
{% block title %}Widget's Calendar of Activities{% endblock %}
...
...
widget_vincentdjango/widget_calendar/templates/widget_calendar/event-add.html
View file @
181ca089
+
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %} Add Activity {% endblock %}
{% block title %} Add Activity {% endblock %}
...
...
widget_vincentdjango/widget_calendar/templates/widget_calendar/event-details.html
View file @
181ca089
+
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %} {{ object.activity }} {% endblock %}
{% block title %} {{ object.activity }} {% endblock %}
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<p>
{{ event.location }}
</p>
<p>
{{ event.location }}
</p>
</div>
</div>
<button
onclick=
"window.location.href='
#
';"
>
<button
onclick=
"window.location.href='
{% url 'forum:forumpost-edit' pk=object.pk %}
';"
>
Edit Activity
Edit Activity
</button>
</button>
...
...
widget_vincentdjango/widget_calendar/templates/widget_calendar/event-edit.html
0 → 100644
View file @
181ca089
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Activity {% endblock %}
{% block heading %}
<h1
class=
"subheader"
>
Edit Activity:
</h1>
{% endblock %}
{% block content %}
<form
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<div
class=
"separator-bar"
></div>
<input
type=
"submit"
value=
"Save New Activity"
class=
"action-button"
>
</form>
{% endblock %}
\ No newline at end of file
widget_vincentdjango/widget_calendar/urls.py
View file @
181ca089
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
index
,
EventDetailView
,
EventCreateView
from
.views
import
index
,
EventDetailView
,
EventCreateView
,
EventUpdateView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
index
,
name
=
'index'
),
path
(
'calendar/'
,
index
,
name
=
'index'
),
path
(
'calendar/'
,
index
,
name
=
'index'
),
path
(
'events/<int:pk>/details'
,
EventDetailView
.
as_view
(),
name
=
'user-details'
),
path
(
'events/<int:pk>/details'
,
EventDetailView
.
as_view
(),
name
=
'event-details'
),
path
(
'events/add'
,
EventCreateView
.
as_view
(),
name
=
'forumpost-add'
),
path
(
'events/add'
,
EventCreateView
.
as_view
(),
name
=
'event-add'
),
path
(
'events/<int:pk>/edit'
,
EventUpdateView
.
as_view
(),
name
=
'event-edit'
),
]
]
...
...
widget_vincentdjango/widget_calendar/views.py
View file @
181ca089
...
@@ -8,16 +8,22 @@ from .models import Event, Location
...
@@ -8,16 +8,22 @@ from .models import Event, Location
def
index
(
request
):
def
index
(
request
):
events
=
Event
.
objects
.
all
()
events
=
Event
.
objects
.
all
()
return
render
(
request
,
'calendar/calendar.html'
,
return
render
(
request
,
'
widget_
calendar/calendar.html'
,
{
'events'
:
events
,
})
{
'events'
:
events
,
})
class
EventDetailView
(
DetailView
):
class
EventDetailView
(
DetailView
):
model
=
Event
model
=
Event
template_name
=
'calendar/event-details.html'
template_name
=
'
widget_
calendar/event-details.html'
class
EventCreateView
(
CreateView
):
class
EventCreateView
(
CreateView
):
model
=
Event
model
=
Event
template_name
=
'calendar/event-add.html'
template_name
=
'
widget_
calendar/event-add.html'
fields
=
[
"activity"
,
"target_datetime"
,
"estimated_hours"
,
"location"
,
"course"
]
fields
=
[
"activity"
,
"target_datetime"
,
"estimated_hours"
,
"location"
,
"course"
]
class
EventUpdateView
(
UpdateView
):
model
=
Event
template_name
=
'widget_calendar/event-edit.html'
fields
=
'__all__'
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