Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_aguandhischipmunks
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
Adrian Lance Damalerio
midterm_aguandhischipmunks
Commits
6c40e867
Commit
6c40e867
authored
May 15, 2023
by
Deokhyun Lee
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/calendarv2'
parents
90ab54e7
9ddc9801
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
161 additions
and
15 deletions
+161
-15
README.txt
README.txt
+26
-1
models.cpython-310.pyc
...chipmunks/calendar_app/__pycache__/models.cpython-310.pyc
+0
-0
forms.py
widget_aguandhischipmunks/calendar_app/forms.py
+7
-0
models.py
widget_aguandhischipmunks/calendar_app/models.py
+8
-0
calendar.html
...t_aguandhischipmunks/calendar_app/templates/calendar.html
+24
-0
event-add.html
..._aguandhischipmunks/calendar_app/templates/event-add.html
+15
-0
event-details.html
...andhischipmunks/calendar_app/templates/event-details.html
+19
-0
event-edit.html
...aguandhischipmunks/calendar_app/templates/event-edit.html
+15
-0
urls.py
widget_aguandhischipmunks/calendar_app/urls.py
+6
-2
views.py
widget_aguandhischipmunks/calendar_app/views.py
+22
-11
db.sqlite3
widget_aguandhischipmunks/db.sqlite3
+0
-0
base.html
widget_aguandhischipmunks/templates/base.html
+1
-1
urls.cpython-310.pyc
...idget_aguandhischipmunks/__pycache__/urls.cpython-310.pyc
+0
-0
settings.py
..._aguandhischipmunks/widget_aguandhischipmunks/settings.py
+15
-0
urls.py
widget_aguandhischipmunks/widget_aguandhischipmunks/urls.py
+3
-0
No files found.
README.txt
View file @
6c40e867
...
...
@@ -7,10 +7,13 @@ Damalerio, Adrian Lance T. , 211778
Lee, DeokHyun , 195736
Salvador, Jan Enzo C. , 215218
Syquia Luis Augusto A. , 215670
<<<<<<< HEAD
=======
>>>>>>> origin/calendarv2
Midterm Proj: Widget v1
<<<<<<< HEAD
App Assignments:
Lance: Dashboard
Agu: Announcement Board
...
...
@@ -29,6 +32,28 @@ https://stackoverflow.com/questions/3876977/update-git-branches-from-master
https://stackoverflow.com/questions/64208678/hiding-secret-key-in-django-project-on-github-after-uploading-project
https://docs.djangoproject.com/en/4.1/
=======
Final Project: Widget v2
App Assignments:
Lance: Dashboard
Agu: Announcement Board
Enzo: Forum
Deokhyun: Assignments
Jan: Calendar
Date of Submission: May 15, 2023
This project was done only by members of this group. It was done without the aid of others.
We consulted sources provided and online materials.
References:
https://www.geeksforgeeks.org/django-model-data-types-and-fields-list/
https://stackoverflow.com/questions/3876977/update-git-branches-from-master
https://stackoverflow.com/questions/64208678/hiding-secret-key-in-django-project-on-github-after-uploading-project
https://docs.djangoproject.com/en/4.1/
>>>>>>> origin/calendarv2
(sgd) Jan Ericsson O. Ang
(sgd) Adrian Lance T. Damalerio
...
...
widget_aguandhischipmunks/calendar_app/__pycache__/models.cpython-310.pyc
0 → 100644
View file @
6c40e867
File added
widget_aguandhischipmunks/calendar_app/forms.py
0 → 100644
View file @
6c40e867
from
django
import
forms
from
.models
import
Event
class
AddEventForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Event
fields
=
"__all__"
widget_aguandhischipmunks/calendar_app/models.py
View file @
6c40e867
from
django.db
import
models
from
assignments.models
import
Course
from
django.urls
import
reverse
# Location Choices
location_choices
=
[
...
...
@@ -20,7 +21,11 @@ class Location(models.Model):
# Event
# target_datetime; activity; estimated_hours; location; course
class
Event
(
models
.
Model
):
<<<<<<<
HEAD
target_datetime
=
models
.
DateTimeField
(
"Date and Time: "
,
max_length
=
50
)
=======
target_datetime
=
models
.
DateTimeField
(
"Date and Time: "
,
max_length
=
50
,
)
>>>>>>>
origin
/
calendarv2
activity
=
models
.
CharField
(
"Activity: "
,
max_length
=
50
)
estimated_hours
=
models
.
FloatField
(
"Estimated Hours: "
,
max_length
=
50
)
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
...
...
@@ -29,4 +34,7 @@ class Event(models.Model):
def
__str__
(
self
):
return
self
.
activity
def
get_absolute_url
(
self
):
return
(
reverse
(
'calendar_app:event_details'
,
kwargs
=
{
'pk'
:
self
.
pk
}))
#refernce for location_choices: https://stackoverflow.com/questions/31130706/dropdown-in-django-model
\ No newline at end of file
widget_aguandhischipmunks/calendar_app/templates/calendar.html
0 → 100644
View file @
6c40e867
{% extends 'base.html' %}
{% load static %}
{% block title %}Widget's Calendar of Activities{% endblock %}
{% block content %}
{% block header %}
<h1>
Widget's Calendar of Activities
</h1>
{% endblock %}
{% for event in events %}
<a
href=
"{{event.get_absolute_url}}"
>
{{event.activity}}
</a><br>
{% endfor %}
<br>
<form
action=
"events/add"
>
<button
type=
"submit"
>
New Activity
</button>
</form>
<br>
<a
href=
"/dashboard"
>
Dashboard
</a><br>
<a
href=
"/announcements"
>
Announcements
</a><br>
<a
href=
"/forum"
>
Forum
</a><br>
<a
href=
"/assignments"
>
Assignments
</a><br>
{% endblock %}
\ No newline at end of file
widget_aguandhischipmunks/calendar_app/templates/event-add.html
0 → 100644
View file @
6c40e867
{% extends 'base.html'%}
{% load static %}
{% block title %}
Add Activity
{% endblock %}
{% block content %}
<p>
Add a new activity:
</p>
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<button
type=
"submit"
>
Save New Activity
</button>
</form>
{% endblock %}
widget_aguandhischipmunks/calendar_app/templates/event-details.html
0 → 100644
View file @
6c40e867
{% extends 'base.html'%}
{% block title %} {{object.activity}} {% endblock %}
{% block content %}
<h1>
{{object.activity}}
</h1>
<ul>
Date and Time: {{object.target_datetime|date:'m/d/Y, h:i A'}}
<br>
Estimated Hours: {{object.estimated_hours}}
<br>
{{object.course.code}} {{object.course.title}} - {{object.course.section}}
<br>
Mode: {{object.location.mode}}
<br>
Venue: {{object.location.venue}}
<br>
</ul>
<form
action=
"./edit"
>
<button
type=
"submit"
>
Edit Activity
</button>
</form>
{% endblock %}
widget_aguandhischipmunks/calendar_app/templates/event-edit.html
0 → 100644
View file @
6c40e867
{% extends 'base.html'%}
{% load static %}
{% block title %}
Edit Activity
{% endblock %}
{% block content %}
<p>
Edit Activity:
</p>
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<button
type=
"submit"
>
Save New Activity
</button>
</form>
{% endblock %}
\ No newline at end of file
widget_aguandhischipmunks/calendar_app/urls.py
View file @
6c40e867
...
...
@@ -3,5 +3,9 @@ from . import views
# url for calendar
urlpatterns
=
[
path
(
''
,
views
.
calendarIndex
,
name
=
'calendarIndex'
),
]
\ No newline at end of file
path
(
''
,
views
.
calendar_view
,
name
=
'calendar_app'
),
path
(
'events/<int:pk>/details'
,
views
.
EventDetailView
.
as_view
(),
name
=
'event_details'
),
path
(
'events/add'
,
views
.
EventAddListView
.
as_view
(),
name
=
"new_event"
),
path
(
'events/<int:pk>/edit'
,
views
.
EventEditView
.
as_view
(),
name
=
'update_event'
),
]
app_name
=
"calendar_app"
\ No newline at end of file
widget_aguandhischipmunks/calendar_app/views.py
View file @
6c40e867
from
django.http
import
HttpResponse
from
django.shortcuts
import
render
,
redirect
from
django.views.generic
import
DetailView
,
CreateView
,
UpdateView
from
.models
import
Event
,
Location
<<<<<<<
HEAD
# calendar view from .models
def
calendarIndex
(
request
):
title
=
'Widget’s Calendar of Activities<br><br>'
=======
# calendar view for FBV implmentation
def
calendar_view
(
request
):
>>>>>>>
origin
/
calendarv2
events
=
Event
.
objects
.
all
()
return
render
(
request
,
'calendar.html'
,
{
'events'
:
events
})
output_view
=
""
for
event
in
events
:
date_and_time
=
"Date and Time: "
+
event
.
target_datetime
.
strftime
(
"
%
m/
%
d/
%
Y,
%
I:
%
M
%
p"
)
+
"<br>"
event_activity
=
"Activity: "
+
event
.
activity
+
"<br>"
estimated_duration
=
"Estimated Hours: "
+
str
(
event
.
estimated_hours
)
+
"<br>"
course_section
=
"Course/Section: "
+
event
.
course
.
code
+
" "
+
event
.
course
.
title
+
"-"
+
event
.
course
.
section
+
"<br>"
event_mode
=
"Mode: "
+
event
.
location
.
mode
+
"<br>"
event_venue
=
"Venue: "
+
event
.
location
.
venue
+
"<br><br>"
#calendar Detail View for CBV Implementation
class
EventDetailView
(
DetailView
):
model
=
Event
template_name
=
'event-details.html'
output_view
=
output_view
+
date_and_time
+
event_activity
+
estimated_duration
+
course_section
+
event_mode
+
event_venue
class
EventAddListView
(
CreateView
):
model
=
Event
template_name
=
"event-add.html"
fields
=
"__all__"
# calendar for editing CBV implementation.
class
EventEditView
(
UpdateView
):
model
=
Event
template_name
=
'event-edit.html'
fields
=
"__all__"
return
HttpResponse
(
title
+
output_view
)
\ No newline at end of file
widget_aguandhischipmunks/db.sqlite3
0 → 100644
View file @
6c40e867
File added
widget_aguandhischipmunks/templates/base.html
View file @
6c40e867
...
...
@@ -10,4 +10,4 @@
{% block content %}{% endblock %}
</div>
</body>
</html>
\ No newline at end of file
</html>
widget_aguandhischipmunks/widget_aguandhischipmunks/__pycache__/urls.cpython-310.pyc
0 → 100644
View file @
6c40e867
File added
widget_aguandhischipmunks/widget_aguandhischipmunks/settings.py
View file @
6c40e867
...
...
@@ -62,6 +62,7 @@ STATIC_URL = '/static/'
STATICFILES_DIRS
=
[
BASE_DIR
/
"static"
]
TEMPLATES
=
[
{
<<<<<<<
HEAD
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)],
'APP_DIRS'
:
True
,
...
...
@@ -71,6 +72,17 @@ TEMPLATES = [
'django.template.context_processors.request'
,
'django.contrib.auth.context_processors.auth'
,
'django.contrib.messages.context_processors.messages'
,
=======
"BACKEND"
:
"django.template.backends.django.DjangoTemplates"
,
'DIRS'
:
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)],
"APP_DIRS"
:
True
,
"OPTIONS"
:
{
"context_processors"
:
[
"django.template.context_processors.debug"
,
"django.template.context_processors.request"
,
"django.contrib.auth.context_processors.auth"
,
"django.contrib.messages.context_processors.messages"
,
>>>>>>>
origin
/
calendarv2
],
},
},
...
...
@@ -120,6 +132,9 @@ USE_I18N = True
USE_TZ
=
True
USE_L10N
=
False
DATE_FORMAT
=
"
%
m/
%
d/
%
Y"
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
...
...
widget_aguandhischipmunks/widget_aguandhischipmunks/urls.py
View file @
6c40e867
...
...
@@ -19,7 +19,10 @@ from django.urls import path, include
urlpatterns
=
[
path
(
"admin/"
,
admin
.
site
.
urls
),
path
(
"dashboard/"
,
include
(
"dashboard.urls"
,
namespace
=
"dashboard"
)),
<<<<<<<
HEAD
path
(
"widgetusers/"
,
include
(
"dashboard.urls"
,
namespace
=
"widgetusers"
)),
=======
>>>>>>>
origin
/
calendarv2
path
(
"assignments/"
,
include
(
"assignments.urls"
)),
path
(
"forum/"
,
include
(
"forum.urls"
)),
path
(
"calendar/"
,
include
(
"calendar_app.urls"
)),
...
...
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