Commit 8bebcf46 authored by Joan Denise Nocos's avatar Joan Denise Nocos

fix: moved images and style.css to new folder, updated corresponding dir in...

fix: moved images and style.css to new folder, updated corresponding dir in Assignment model and index and details templates
parent b814c062
# Generated by Django 3.2.12 on 2022-05-19 01:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0005_assignment_image'),
]
operations = [
migrations.AlterField(
model_name='assignment',
name='image',
field=models.FileField(null=True, upload_to='static/assignments/'),
),
]
...@@ -13,7 +13,7 @@ class Assignment(models.Model): ...@@ -13,7 +13,7 @@ class Assignment(models.Model):
description = models.CharField(max_length=500) description = models.CharField(max_length=500)
max_points = models.IntegerField(default=0) max_points = models.IntegerField(default=0)
passing_score = models.IntegerField(default=0) passing_score = models.IntegerField(default=0)
image = models.FileField(upload_to='static/', null=True) image = models.FileField(upload_to='static/assignments/', null=True)
def _str_(self): def _str_(self):
return self.name return self.name
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'style.css' %}"> href="{% static 'assignments/style.css' %}">
<title>{% block page-title %}Assignment {{ assignment_id }} Details{% endblock %}</title> <title>{% block page-title %}Assignment {{ assignment_id }} Details{% endblock %}</title>
</head> </head>
<body> <body>
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
<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/{{ assignment.file }}" width="250" height="250"> <img src="/static/assignments/{{ assignment.file }}" width="250" height="250">
</body> </body>
</html> </html>
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'style.css' %}"> href="{% static 'assignments/style.css' %}">
<title>{% block page-title %}Assignments Per Course{% endblock %}</title> <title>{% block page-title %}Assignments Per Course{% endblock %}</title>
</head> </head>
<body> <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 %}
<ul> <ul>
{% for course in course_list %} {% for course in course_list %}
......
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