Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
final_quintupoltrobol
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
Matthew Karl David P. Arpas
final_quintupoltrobol
Commits
7dbc4c4f
Commit
7dbc4c4f
authored
May 15, 2023
by
Matthew Karl David P. Arpas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented Edit and Add pages by using forms and templates
parent
5ef953fd
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
16 deletions
+67
-16
models.cpython-311.pyc
...trobol/widget_calendar/__pycache__/models.cpython-311.pyc
+0
-0
0004_course_course_title.py
...ol/widget_calendar/migrations/0004_course_course_title.py
+19
-0
models.py
widget_quintupoltrobol/widget_calendar/models.py
+1
-0
event-add.html
.../widget_calendar/templates/widget_calendar/event-add.html
+17
-0
event-details.html
...get_calendar/templates/widget_calendar/event-details.html
+5
-2
event-edit.html
...widget_calendar/templates/widget_calendar/event-edit.html
+17
-0
views.py
widget_quintupoltrobol/widget_calendar/views.py
+8
-14
No files found.
widget_quintupoltrobol/widget_calendar/__pycache__/models.cpython-311.pyc
View file @
7dbc4c4f
No preview for this file type
widget_quintupoltrobol/widget_calendar/migrations/0004_course_course_title.py
0 → 100644
View file @
7dbc4c4f
# Generated by Django 4.1.6 on 2023-05-15 14:03
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'widget_calendar'
,
'0003_course_alter_event_course'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'course'
,
name
=
'course_title'
,
field
=
models
.
CharField
(
default
=
'a'
,
max_length
=
50
),
preserve_default
=
False
,
),
]
widget_quintupoltrobol/widget_calendar/models.py
View file @
7dbc4c4f
...
@@ -19,6 +19,7 @@ class Location(models.Model):
...
@@ -19,6 +19,7 @@ class Location(models.Model):
class
Course
(
models
.
Model
):
class
Course
(
models
.
Model
):
course_code
=
models
.
CharField
(
max_length
=
10
)
course_code
=
models
.
CharField
(
max_length
=
10
)
course_title
=
models
.
CharField
(
max_length
=
50
)
section
=
models
.
CharField
(
max_length
=
5
)
section
=
models
.
CharField
(
max_length
=
5
)
class
Event
(
models
.
Model
):
class
Event
(
models
.
Model
):
...
...
widget_quintupoltrobol/widget_calendar/templates/widget_calendar/event-add.html
0 → 100644
View file @
7dbc4c4f
{% extends 'base.html' %}
{% load static %}
{% block title %}Add Activity{% endblock %}
{% block content %}
<h2>
Add a new activity:
</h2>
<p>
<form
action=
''
method=
"POST"
>
{% csrf_token %}
Activity: {{ form.activity }}
<br><br>
Target Date/Time: {{ form.target_datetime }}
Estimated Hours: {{ form.estimated_hours }}
Location: {{ form.location }}
Course: {{ form.course }}
<input
type=
"submit"
value=
"Save New Activity"
>
</form>
</p>
{% endblock %}
\ No newline at end of file
widget_quintupoltrobol/widget_calendar/templates/widget_calendar/event-details.html
View file @
7dbc4c4f
...
@@ -4,10 +4,13 @@
...
@@ -4,10 +4,13 @@
{% block content %}
{% block content %}
<h2>
{{ event.activity }}
</h2>
<h2>
{{ event.activity }}
</h2>
<h3>
Date and Time: {{ event.target_datetime }}
</h3>
<h3>
Date and Time: {{ event.target_datetime }}
</h3>
<h3>
{{ department.home_unit }}
</h3>
<h3>
Estimated Hours: {{ event.estimated_hours }}
</h3>
<h3>
{{ course.course_code }} {{ course.course_title }} - {{ course.section }}
</h3>
<h3>
Mode: {{ location.mode }}
</h3>
<h3>
Venue: {{ location.venue }}
</h3>
<br>
<br>
<form
action=
'edit'
>
<form
action=
'edit'
>
<input
type=
"submit"
value=
"Edit
Widget User
"
/>
<input
type=
"submit"
value=
"Edit
Activity
"
/>
</form>
</form>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_quintupoltrobol/widget_calendar/templates/widget_calendar/event-edit.html
0 → 100644
View file @
7dbc4c4f
{% extends 'base.html' %}
{% load static %}
{% block title %}Edit Activity{% endblock %}
{% block content %}
<h2>
Edit Activity
</h2>
<p>
<form
action=
''
method=
"POST"
>
{% csrf_token %}
Activity: {{ form.activity }}
<br><br>
Target Date/Time: {{ form.target_datetime }}
Estimated Hours: {{ form.estimated_hours }}
Location: {{ form.location }}
Course: {{ form.course }}
<input
type=
"submit"
value=
"Save New Activity"
>
</form>
</p>
{% endblock %}
\ No newline at end of file
widget_quintupoltrobol/widget_calendar/views.py
View file @
7dbc4c4f
...
@@ -13,22 +13,16 @@ class Widget_CalendarDetailView(DetailView):
...
@@ -13,22 +13,16 @@ class Widget_CalendarDetailView(DetailView):
def
get
(
self
,
request
,
pk
):
def
get
(
self
,
request
,
pk
):
event
=
Event
.
objects
.
get
(
pk
=
pk
)
event
=
Event
.
objects
.
get
(
pk
=
pk
)
course
=
event
.
course
course
=
event
.
course
venue
=
event
.
location
location
=
event
.
location
return
render
(
request
,
'widget_calendar/event-details.html'
,
{
'event'
:
event
,
'course'
:
course
,
'
venue'
:
venue
})
return
render
(
request
,
'widget_calendar/event-details.html'
,
{
'event'
:
event
,
'course'
:
course
,
'
location'
:
location
})
class
Widget_CalendarCreateView
(
CreateView
):
class
Widget_CalendarCreateView
(
CreateView
):
def
get
(
self
,
request
,
pk
):
model
=
Event
event
=
Event
.
objects
.
get
(
pk
=
pk
)
fields
=
'__all__'
course
=
event
.
course
template_name
=
'widget_calendar/event-add.html'
venue
=
event
.
location
return
render
(
request
,
'widget_calendar/event-details.html'
,
{
'event'
:
event
,
'course'
:
course
,
'venue'
:
venue
})
class
Widget_CalendarEventUpdateView
(
UpdateView
):
class
Widget_CalendarEventUpdateView
(
UpdateView
):
def
get
(
self
,
request
,
pk
):
model
=
Event
event
=
Event
.
objects
.
get
(
pk
=
pk
)
fields
=
'__all__'
course
=
event
.
course
template_name
=
'widget_calendar/event-edit.html'
venue
=
event
.
location
\ No newline at end of file
return
render
(
request
,
'widget_calendar/event-details.html'
,
{
'event'
:
event
,
'course'
:
course
,
'venue'
:
venue
})
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