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 @@
...
@@ -14,7 +14,7 @@
{% endfor %}
{% endfor %}
</ul>
</ul>
<button
onclick=
"window.location.href='
#
';"
>
<button
onclick=
"window.location.href='
{% url 'calendar:event-add' %}
';"
>
New Activity
New Activity
</button>
</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' %}
+{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %} {{
even
t.activity }} {% endblock %}
{% block title %} {{
objec
t.activity }} {% endblock %}
{% block heading %}
{% block heading %}
<p
id=
"uppercase"
>
<p
id=
"uppercase"
>
<span
id=
"white"
>
<span
id=
"white"
>
{{
event.activity
}}
{{
object.activity
}}
</span>
</span>
</p>
</p>
{% endblock %}
{% endblock %}
{% block content %}
{% block content %}
<div
id=
"main"
>
<div
id=
"main"
>
<p
id=
"subheading"
>
{{ event.target_datetime }}
</p>
{% for event in object.events.all %}
<p>
{{ event.estimated_hours }}
</p>
<p
id=
"subheading"
>
{{ event.target_datetime }}
</p>
<p>
{{ event.course }}
</p>
<p>
{{ event.estimated_hours }}
</p>
<p>
{{ event.estimated_hours }}
</p>
<p>
{{ event.course }}
</p>
<p>
{{ event.location }}
</p>
<p>
{{ event.estimated_hours }}
</p>
<p>
{{ event.location }}
</p>
</div>
</div>
<button
onclick=
"window.location.href='#';"
>
<button
onclick=
"window.location.href='#';"
>
...
...
widget_vincentdjango/widget_calendar/urls.py
View file @
81ec45c3
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
index
,
EventDetailView
from
.views
import
index
,
EventDetailView
,
EventCreateView
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
=
'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.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.views.generic.detail
import
DetailView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Event
,
Location
from
.models
import
Event
,
Location
...
@@ -13,3 +15,9 @@ def index(request):
...
@@ -13,3 +15,9 @@ def index(request):
class
EventDetailView
(
DetailView
):
class
EventDetailView
(
DetailView
):
model
=
Event
model
=
Event
template_name
=
'calendar/event-details.html'
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