Commit 9b64c645 authored by Joan Denise Nocos's avatar Joan Denise Nocos

chore: added base.html file to assignments app, modified index and details...

chore: added base.html file to assignments app, modified index and details templates to extend base.html file
parent 8bebcf46
...@@ -23,10 +23,6 @@ p{ ...@@ -23,10 +23,6 @@ p{
} }
body { body {
background-color: white; background-color: white;
background-size: cover;
background-position: center;
background-attachment: fixed;
font-family: Helvetica;
} }
a{ a{
color: blue; color: blue;
...@@ -34,12 +30,6 @@ a{ ...@@ -34,12 +30,6 @@ a{
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
} }
ol {
font-size:35px;
font-family: Helvetica;
color: black;
font-weight: bold;
}
a:link { a:link {
text-decoration: underline; text-decoration: underline;
} }
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css"
href="{% static 'assignments/style.css' %}">
<title>{% block page-title %}{% endblock %}</title>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
{% load static %} {% extends "assignments/base.html" %}
<!DOCTYPE html> {% block page-title %}Assignment {{ assignment_id }} Details{% endblock %}
<html lang="en">
<head> {% block content %}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css"
href="{% static 'assignments/style.css' %}">
<title>{% block page-title %}Assignment {{ assignment_id }} Details{% endblock %}</title>
</head>
<body>
<h1>{{ course.course_code }} {{ course.course_title }} {{ course.section }}</h1> <h1>{{ course.course_code }} {{ course.course_title }} {{ course.section }}</h1>
<h3>{{ assignment.name }}</h3> <h3>{{ assignment.name }}</h3>
<p>Description: {{ assignment.description }}</p> <p>Description: {{ assignment.description }}</p>
<p>Perfect Score: {{ assignment.max_points }}</p> <p>Perfect Score: {{ assignment.max_points }}</p>
<p>Passing Score: {{ assignment.passing_score }}</p> <p>Passing Score: {{ assignment.passing_score }}</p>
<img src="/static/assignments/{{ assignment.file }}" width="250" height="250"> <img src="/static/assignments/{{ assignment.file }}" width="250" height="250">
</body> {% endblock %}
</html> \ No newline at end of file
{% load static %} {% extends "assignments/base.html" %}
<!DOCTYPE html> {% block page-title %}Assignments Per Course{% endblock %}
<html lang="en">
<head> {% block content %}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css"
href="{% static 'assignments/style.css' %}">
<title>{% block page-title %}Assignments Per Course{% endblock %}</title>
</head>
<body>
<h1>Assignments Per Course</h1> <h1>Assignments Per Course</h1>
<h2>List of courses:</h2> <h2>List of courses:</h2>
{% if course_list %} {% if course_list %}
...@@ -29,9 +21,4 @@ ...@@ -29,9 +21,4 @@
{% else %} {% else %}
<p>No course available.</p> <p>No course available.</p>
{% endif %} {% endif %}
</body> {% endblock %}
</html> \ No newline at end of file
...@@ -16,7 +16,7 @@ def details(request, assignment_id): ...@@ -16,7 +16,7 @@ def details(request, assignment_id):
try: try:
assignment = Assignment.objects.get(pk=assignment_id) assignment = Assignment.objects.get(pk=assignment_id)
except Assignment.DoesNotExist: except Assignment.DoesNotExist:
raise Http404("Assignment does not exist!") raise Http404("Assignment does not exist.")
score = assignment.max_points score = assignment.max_points
assignment.passing_score = (score*60) // 100 assignment.passing_score = (score*60) // 100
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment