Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widgets_FEKK
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
Kyla Martin
widgets_FEKK
Commits
4c06e39c
Commit
4c06e39c
authored
May 16, 2022
by
Katrina Bernice Tan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created templates for the Assignments app
parent
9d067069
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
169 additions
and
10 deletions
+169
-10
.DS_Store
WidgetFEKK/.DS_Store
+0
-0
.DS_Store
WidgetFEKK/Assignments/.DS_Store
+0
-0
index.css
WidgetFEKK/Assignments/static/css/index.css
+79
-0
jokebear.png
WidgetFEKK/Assignments/static/images/jokebear.png
+0
-0
index.css
WidgetFEKK/Assignments/static/js/index.css
+0
-0
assignment_detail.html
.../Assignments/templates/Assignments/assignment_detail.html
+20
-0
assignment_list.html
...KK/Assignments/templates/Assignments/assignment_list.html
+29
-0
index.html
WidgetFEKK/Assignments/templates/index.html
+21
-0
urls.py
WidgetFEKK/Assignments/urls.py
+4
-1
views.py
WidgetFEKK/Assignments/views.py
+15
-8
settings.py
WidgetFEKK/WidgetFEKK/settings.py
+1
-1
db.sqlite3
WidgetFEKK/db.sqlite3
+0
-0
No files found.
WidgetFEKK/.DS_Store
View file @
4c06e39c
No preview for this file type
WidgetFEKK/Assignments/.DS_Store
View file @
4c06e39c
No preview for this file type
WidgetFEKK/Assignments/static/css/index.css
0 → 100644
View file @
4c06e39c
*
{
border
:
0
;
margin
:
0
;
color
:
#624741
;
}
body
{
font-family
:
'Inter'
,
sans-serif
;
background-color
:
#F9F5F0
;
}
#header
h1
{
color
:
#F9F5F0
;
padding
:
1em
;
text-align
:
right
;
font-size
:
15px
;
font-weight
:
300
;
background-color
:
#624741
}
#courses
h1
{
padding
:
1.2em
1em
;
color
:
#624741
;
font-size
:
70px
;
font-family
:
'Inter'
,
sans-serif
;
}
ul
{
padding
:
0
;
}
li
{
list-style-position
:
inside
;
padding-top
:
14px
;
}
.block
{
padding
:
1em
;
border
:
0.5px
;
border-style
:
solid
;
}
.block
h2
{
padding
:
0.2em
;
border-bottom
:
1px
#624741
;
border-style
:
solid
;
font-size
:
24px
;
}
.wrapper
{
display
:
grid
;
grid-template-columns
:
repeat
(
3
,
1
fr
);
grid-auto-rows
:
minimax
(
100px
,
auto
);
}
a
:hover
{
color
:
#e89a64
;
}
#details
{
padding
:
5em
;
}
#details
h5
{
font-size
:
20px
;
font-weight
:
500
;
}
#details
h3
{
font-size
:
80px
;
padding-bottom
:
2em
;
}
#details
h4
{
font-size
:
20px
;
font-weight
:
500
;
}
\ No newline at end of file
WidgetFEKK/Assignments/static/images/jokebear.png
0 → 100644
View file @
4c06e39c
3.34 KB
WidgetFEKK/Assignments/static/js/index.css
0 → 100644
View file @
4c06e39c
WidgetFEKK/Assignments/templates/Assignments/assignment_detail.html
0 → 100644
View file @
4c06e39c
{% extends 'base.html' %}
{% load static %}
{% block styles %}
<link
rel =
"stylesheet"
href=
"{% static 'css/index.css' %}"
>
{% endblock %}
{% block title %} {{object.course}} {% endblock title%}
{% block content %}
<div
id =
"header"
>
<h1>
Course: {{object.course}}
</h1>
</div>
<div
id =
"details"
>
<img
src=
"{%static 'images/jokebear.png'%}"
>
<h5>
Assignment Name:
</h5>
<h3>
{{object.name}}
</h3>
<h4>
<b>
Assignment Description:
</b>
{{object.description}}
</h4>
<h4>
<b>
Perfect Score:
</b>
{{object.max_points}}
</h4>
<h4>
<b>
Passing Score:
</b>
{{object.passing_score}}
</h4>
{%endblock content%}
\ No newline at end of file
WidgetFEKK/Assignments/templates/Assignments/assignment_list.html
0 → 100644
View file @
4c06e39c
{% extends 'base.html' %}
{% load static %}
{ % block styles %}
{ % endblock styles %}
{% block title %} Assignments {% endblock title%}
{% block content %}
<div
id =
"header"
>
</div>
<div
id =
"courses"
>
<ul>
<div
class =
"wrapper"
>
{% for a in assignments %}
<div
class =
"block"
>
<h2>
{{a.course}}
</h2>
<li>
<a
href=
"{% url 'Assignments:assignment-detail' a.pk%}"
>
{{a.name}}
</a>
</li>
</div>
{%endfor%}
</div>
</ul>
</div>
{%endblock content%}
\ No newline at end of file
WidgetFEKK/Assignments/templates/index.html
0 → 100644
View file @
4c06e39c
{% extends 'base.html' %}
{% load static %}
{% block styles %}
<link
rel =
"stylesheet"
href=
"{% static 'css/index.css' %}"
>
<link
rel=
"preconnect"
href=
"https://fonts.googleapis.com"
>
<link
rel=
"preconnect"
href=
"https://fonts.gstatic.com"
crossorigin
>
<link
href=
"https://fonts.googleapis.com/css2?family=Inter:wght@200;500;900&display=swap"
rel=
"stylesheet"
>
{% endblock %}
{% block title %} Assignments {% endblock title%}
{% block content %}
<div
id =
"header"
>
<h1>
Assignments per course
</h1>
</div>
<div
id =
"courses"
>
<h1>
List of courses:
</h1>
</div>
{% include "Assignments/assignment_list.html" with assignments=assignment %}
{%endblock content%}
\ No newline at end of file
WidgetFEKK/Assignments/urls.py
View file @
4c06e39c
from
django.urls
import
path
from
.
import
views
from
.views
import
MainView
,
AssignmentListView
,
AssignmentDetailView
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
'index'
)
path
(
''
,
MainView
.
as_view
(),
name
=
'index'
),
path
(
'assignment'
,
AssignmentListView
.
as_view
(),
name
=
'assignment-list'
),
path
(
'assignment/<int:pk>/details'
,
AssignmentDetailView
.
as_view
(),
name
=
'assignment-detail'
),
]
app_name
=
'Assignments'
\ No newline at end of file
WidgetFEKK/Assignments/views.py
View file @
4c06e39c
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views
import
View
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
.models
import
Assignment
,
Course
def
index
(
request
):
class
MainView
(
View
):
def
get
(
self
,
request
):
course
=
Course
.
objects
.
all
()
.
order_by
(
'course_code'
)
assignment
=
Assignment
.
objects
.
all
()
.
order_by
(
'course'
)
return
render
(
request
,
'index.html'
,{
'course'
:
course
,
'assignment'
:
assignment
,
})
print
=
"ASSIGNMENTS: "
assignments
=
Assignment
.
objects
.
all
()
for
i
in
assignments
:
print
+=
f
"<br /> Assignment name: {i.name} <br /> Description: {i.description} <br /> Perfect score: {i.max_points} <br /> Passing score: {i.passing_score} <br /> Course/Section: {i.course} <br />"
return
HttpResponse
(
print
)
class
AssignmentListView
(
ListView
):
model
=
Assignment
class
AssignmentDetailView
(
DetailView
):
model
=
Assignment
WidgetFEKK/WidgetFEKK/settings.py
View file @
4c06e39c
...
...
@@ -125,7 +125,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0/howto/static-files/
STATIC_URL
=
'static/'
STATIC_URL
=
'
/
static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
...
...
WidgetFEKK/db.sqlite3
View file @
4c06e39c
No preview for this file type
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