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
81ec45c3
Commit
81ec45c3
authored
May 12, 2023
by
Andrew Justin C. Idquival
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created event-add page html with create view
parent
84f882ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
9 deletions
+35
-9
calendar.html
...o/widget_calendar/templates/widget_calendar/calendar.html
+1
-1
event-add.html
.../widget_calendar/templates/widget_calendar/event-add.html
+16
-0
event-details.html
...get_calendar/templates/widget_calendar/event-details.html
+8
-7
urls.py
widget_vincentdjango/widget_calendar/urls.py
+2
-1
views.py
widget_vincentdjango/widget_calendar/views.py
+8
-0
No files found.
widget_vincentdjango/widget_calendar/templates/widget_calendar/calendar.html
View file @
81ec45c3
...
...
@@ -14,7 +14,7 @@
{% endfor %}
</ul>
<button
onclick=
"window.location.href='
#
';"
>
<button
onclick=
"window.location.href='
{% url 'calendar:event-add' %}
';"
>
New Activity
</button>
...
...
widget_vincentdjango/widget_calendar/templates/widget_calendar/event-add.html
0 → 100644
View file @
81ec45c3
+{% extends 'base.html' %}
{% load static %}
{% block title %} Add Activity {% endblock %}
{% block heading %}
<h1
class=
"subheader"
>
Add a new activity:
</h1>
{% endblock %}
{% block content %}
<form
method=
"post"
>
{% csrf_token %}
<div
class=
"form-fields"
>
{{ form.as_p }}
</div>
<div
class=
"separator-bar"
></div>
<input
class=
"action-button"
type=
"submit"
value=
"Save New Activity"
>
</form>
{% endblock %}
\ No newline at end of file
widget_vincentdjango/widget_calendar/templates/widget_calendar/event-details.html
View file @
81ec45c3
+{% extends 'base.html' %}
{% load static %}
{% block title %} {{
even
t.activity }} {% endblock %}
{% block title %} {{
objec
t.activity }} {% endblock %}
{% block heading %}
<p
id=
"uppercase"
>
<span
id=
"white"
>
{{
event.activity
}}
{{
object.activity
}}
</span>
</p>
{% endblock %}
{% block content %}
<div
id=
"main"
>
<p
id=
"subheading"
>
{{ event.target_datetime }}
</p>
<p>
{{ event.estimated_hours }}
</p>
<p>
{{ event.course }}
</p>
<p>
{{ event.estimated_hours }}
</p>
<p>
{{ event.location }}
</p>
{% for event in object.events.all %}
<p
id=
"subheading"
>
{{ event.target_datetime }}
</p>
<p>
{{ event.estimated_hours }}
</p>
<p>
{{ event.course }}
</p>
<p>
{{ event.estimated_hours }}
</p>
<p>
{{ event.location }}
</p>
</div>
<button
onclick=
"window.location.href='#';"
>
...
...
widget_vincentdjango/widget_calendar/urls.py
View file @
81ec45c3
from
django.urls
import
path
from
.views
import
index
,
EventDetailView
from
.views
import
index
,
EventDetailView
,
EventCreateView
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
'calendar/'
,
index
,
name
=
'index'
),
path
(
'events/<int:pk>/details'
,
EventDetailView
.
as_view
(),
name
=
'user-details'
),
path
(
'events/add'
,
EventCreateView
.
as_view
(),
name
=
'forumpost-add'
),
]
...
...
widget_vincentdjango/widget_calendar/views.py
View file @
81ec45c3
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Event
,
Location
...
...
@@ -13,3 +15,9 @@ def index(request):
class
EventDetailView
(
DetailView
):
model
=
Event
template_name
=
'calendar/event-details.html'
class
EventCreateView
(
CreateView
):
model
=
Event
template_name
=
'calendar/event-add.html'
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