Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_robo_mommy
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Raul Jarod Conanan
midterm_robo_mommy
Commits
70a9d461
Commit
70a9d461
authored
May 13, 2023
by
Al Vincent E. Bomediano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated templates to match project specifications
parent
b9f2ee58
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
16 deletions
+29
-16
db.sqlite3
widget_robo_mommy/db.sqlite3
+0
-0
models.cpython-311.pyc
..._mommy/widget_Calendar/__pycache__/models.cpython-311.pyc
+0
-0
views.cpython-311.pyc
...o_mommy/widget_Calendar/__pycache__/views.cpython-311.pyc
+0
-0
models.py
widget_robo_mommy/widget_Calendar/models.py
+7
-2
event-add.html
.../widget_Calendar/templates/widget_Calendar/event-add.html
+4
-2
event-details.html
...get_Calendar/templates/widget_Calendar/event-details.html
+9
-9
event-edit.html
...widget_Calendar/templates/widget_Calendar/event-edit.html
+5
-2
views.py
widget_robo_mommy/widget_Calendar/views.py
+4
-1
No files found.
widget_robo_mommy/db.sqlite3
View file @
70a9d461
No preview for this file type
widget_robo_mommy/widget_Calendar/__pycache__/models.cpython-311.pyc
View file @
70a9d461
No preview for this file type
widget_robo_mommy/widget_Calendar/__pycache__/views.cpython-311.pyc
View file @
70a9d461
No preview for this file type
widget_robo_mommy/widget_Calendar/models.py
View file @
70a9d461
...
@@ -19,14 +19,19 @@ class Location(models.Model):
...
@@ -19,14 +19,19 @@ class Location(models.Model):
class
Event
(
models
.
Model
):
class
Event
(
models
.
Model
):
target_datetime
=
models
.
DateTimeField
()
activity
=
models
.
CharField
(
max_length
=
100
)
activity
=
models
.
CharField
(
max_length
=
100
)
target_datetime
=
models
.
DateTimeField
()
estimated_hours
=
models
.
FloatField
()
estimated_hours
=
models
.
FloatField
()
location
=
models
.
ForeignKey
(
location
=
models
.
ForeignKey
(
Location
,
Location
,
on_delete
=
models
.
CASCADE
on_delete
=
models
.
CASCADE
)
)
course
=
models
.
ForeignKey
(
Course
,
related_name
=
'event'
,
on_delete
=
models
.
CASCADE
,
null
=
True
)
course
=
models
.
ForeignKey
(
Course
,
related_name
=
'event'
,
on_delete
=
models
.
CASCADE
,
null
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{} on {}'
.
format
(
self
.
activity
,
self
.
target_datetime
)
return
'{} on {}'
.
format
(
self
.
activity
,
self
.
target_datetime
)
...
...
widget_robo_mommy/widget_Calendar/templates/widget_Calendar/event-add.html
View file @
70a9d461
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
{% load static %}
{% load static %}
{% block content %}
{% block content %}
<h1>
Add Event
</h1>
<title>
Add Activity
</title>
Add a new activity:
<form
method=
"post"
>
<form
method=
"post"
>
...
@@ -12,7 +14,7 @@
...
@@ -12,7 +14,7 @@
<a
href=
"/Events/{{Event.pk}}/details"
>
<a
href=
"/Events/{{Event.pk}}/details"
>
<button
type=
"submit"
>
Add Event
</button>
<button
type=
"submit"
>
Save New Activity
</button>
</a>
</a>
...
...
widget_robo_mommy/widget_Calendar/templates/widget_Calendar/event-details.html
View file @
70a9d461
...
@@ -3,17 +3,17 @@
...
@@ -3,17 +3,17 @@
{% load static %}
{% load static %}
{% block content %}
{% block content %}
<title>
Event
</title>
<title>
{{object.activity}}
</title>
<br><br>
<h2>
{{object.activity}}
</h2>
<h2>
{{object.activity}}
</h2>
<
h3>
Date and Time: {{object.target_datetime}}
</h3
>
<
br>
Date and Time: {{object.target_datetime|date:"m/d/y, h:i A"}}
<br
>
<
h3>
Estimated Hours: {{object.estimated_hours}}
</h3
>
<
br>
Estimated Hours: {{object.estimated_hours}}
<br
>
<
h3>
{{course}}
</h3
>
<
br>
{{object.course.code}} {{object.course.title}} - {{object.course.section}}
<br
>
<
h3>
Mode: {{location.mode}}
</h3
>
<
br>
Mode: {{object.location.mode}}
<br
>
<
h3>
Venue: {{location.venue}}
</h3
>
<
br>
Venue: {{object.location.venue}}
<br
>
<br><br>
<a
href=
"edit"
>
<a
href=
"edit"
>
<input
type=
"button"
value=
"Edit
Event
"
>
<input
type=
"button"
value=
"Edit
Activity
"
>
</a>
"
</a>
{% endblock content %}
{% endblock content %}
\ No newline at end of file
widget_robo_mommy/widget_Calendar/templates/widget_Calendar/event-edit.html
View file @
70a9d461
...
@@ -3,13 +3,16 @@
...
@@ -3,13 +3,16 @@
{% load static %}
{% load static %}
{% block content %}
{% block content %}
<h1>
Edit Event
</h1>
<title>
Edit Activity
</title>
Edit Activity:
<br>
<form
method=
"post"
>
<form
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
{{ form.as_p }}
{{ form.as_p }}
<input
type=
"submit"
value=
"
Edit Event
"
/>
<input
type=
"submit"
value=
"
Save New Activity
"
/>
</a>
</a>
</form>
</form>
{% endblock content %}
{% endblock content %}
\ No newline at end of file
widget_robo_mommy/widget_Calendar/views.py
View file @
70a9d461
...
@@ -6,7 +6,10 @@ from django.urls import reverse
...
@@ -6,7 +6,10 @@ from django.urls import reverse
def
index
(
request
):
def
index
(
request
):
html_string
=
'robo_mommy’s Calendar of Activities<br><ul>'
html_string
=
'''
<title>robo_mommy’s Calendar of Activities</title>
<h2>robo_mommy’s Calendar of Activities</h2><ul>
'''
for
eventItem
in
Event
.
objects
.
all
():
for
eventItem
in
Event
.
objects
.
all
():
eventId
=
str
(
eventItem
.
pk
)
eventId
=
str
(
eventItem
.
pk
)
href
=
'<a href="widget_Calendar/Events/'
+
eventId
+
'/details">'
href
=
'<a href="widget_Calendar/Events/'
+
eventId
+
'/details">'
...
...
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