Commit c52482ce authored by Борис Ким's avatar Борис Ким

Применил немного верстки на страницах

parent 33ec296f
...@@ -28,7 +28,8 @@ INSTALLED_APPS = [ ...@@ -28,7 +28,8 @@ INSTALLED_APPS = [
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'webapp', 'webapp',
'crispy_forms' 'crispy_forms',
'fontawesomefree',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
......
...@@ -4,21 +4,6 @@ from django.contrib.auth.models import User ...@@ -4,21 +4,6 @@ from django.contrib.auth.models import User
from django.urls import reverse from django.urls import reverse
# class Student(User):
# name = models.CharField(max_length=50, verbose_name='name')
# surname = models.CharField(max_length=50, verbose_name='name')
# group = models.ForeignKey('webapp.Group', on_delete=models.CASCADE, verbose_name='group')
# course = models.ManyToManyField('webapp.Course', verbose_name='course', related_name='courses')
# adviser = models.ForeignKey('webapp.Teacher', on_delete=models.CASCADE, verbose_name='adviser')
# admission_date = models.DateField(('Admission date'), auto_now=False, auto_now_add=False)
# end_date = models.DateField(('End date'), auto_now=False, auto_now_add=False)
# class Teacher(models.Model):
# name = models.CharField(max_length=50, verbose_name='name')
# surname = models.CharField(max_length=50, verbose_name='name')
class Course(models.Model): class Course(models.Model):
title = models.CharField(max_length=50, verbose_name='title') title = models.CharField(max_length=50, verbose_name='title')
description = models.TextField(max_length=2000, verbose_name='description') description = models.TextField(max_length=2000, verbose_name='description')
......
body { body {
background-color: #81CAEA !important; background-color: #7BC89F !important;
} }
*{ *{
...@@ -9,8 +9,7 @@ body { ...@@ -9,8 +9,7 @@ body {
} }
.sidebar { .sidebar {
position: fixed; height: 140vh;
height: 110vh;
width: 220px; width: 220px;
z-index: 1; z-index: 1;
top: 0; top: 0;
...@@ -48,13 +47,9 @@ body { ...@@ -48,13 +47,9 @@ body {
padding: 20px; padding: 20px;
} }
.course-container {
margin-top: 50px;
margin-left: 50px;
}
.block-course { .block-course {
background-color: white; background-color: white;
width: 310px; width: 310px;
height: 300px; height: 300px;
} box-shadow: 0 0 10px rgba(0,0,0,0.5)
}
\ No newline at end of file
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="{% static 'css/main.css' %}" type="text/css"> <link rel="stylesheet" href="{% static 'css/main.css' %}" type="text/css">
<link href="{% static 'fontawesomefree/css/all.min.css' %}" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
......
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
<div class='course-container row d-flex flex-wrap justify-content-start'> <div class='course-container row d-flex flex-wrap justify-content-start'>
{% for course in courses %} {% for course in courses %}
<div class="content-course col-4" style="width: 300px;"> <div class="content-course col-4" style="width: 300px;">
<div class="block-course"> <div class="block-course shadow p-3 mb-5 bg-white rounded">
<div class="card-header"> <div class="card-header d-flex">
Course <h5 class="mr-auto p-2"> Course </h5>
<a class="p-2" href="{% url 'webapp:course_edit' course.id %}"> <i class="fas fa-edit"></i> </a>
<a class="p-2" href="{% url 'webapp:course_delete' course.id %}"> <i class="fas fa-trash-alt"></i> </a>
</div> </div>
<div class="card-body" style="height: 150px;"> <div class="card-body" style="height: 150px;">
<h5 class="card-title"> {{course.title}} </h5> <h5 class="card-title"> {{course.title}} </h5>
<p class="card-text"> {{course.description}} </p> <p class="card-text"> {{course.description}} </p>
</div> </div>
<div class="card-buttons" style="text-align: center;"> <div class="card-buttons" style="text-align: center;">
<a class="btn btn-primary" href="{% url 'webapp:course_detail' course.id %}"> See more </a> <a class="btn btn-primary p-2" href="{% url 'webapp:course_detail' course.id %}"> See more <i class="fas fa-eye"></i> </a>
<a class="btn btn-info" href="{% url 'webapp:course_edit' course.id %}"> Edit </a>
<a class="btn btn-danger" href="{% url 'webapp:course_delete' course.id %}"> Delete </a>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -3,10 +3,20 @@ ...@@ -3,10 +3,20 @@
{% block title %}Delete {{ course.title }}{% endblock %} {% block title %}Delete {{ course.title }}{% endblock %}
{% block content %} {% block content %}
<h2>Are you sure you want to delete course - {{ course.title}} ?</h2> <div class="card text-center" style="height: 250px;">
<a href="{% url "webapp:courses_list" %}">Cancel</a> <div class="card-header">
<form action='' method="post"> <h4 style="color: red;"> Warning! </h4>
{% csrf_token %} </div>
<button>Yes</button> <div class="card-body">
</form> <h5 class="card-title"> Are you sure you want to delete course - "{{ course.title}}"? </h5>
<p class="card-text">You can no longer restore anything</p>
<div class='d-flex justify-content-center'>
<a class='btn btn-primary p-2' href="{% url "webapp:courses_list" %}" style="width: 90px;">Cancel</a>
<form action='' method="post">
{% csrf_token %}
<button class="btn btn-danger p-2" style="width: 90px;">Yes</button>
</form>
</div>
</div>
</div>
{% endblock %} {% endblock %}
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<footer class="blockquote-footer"> Pr. {{course.teacher}} </footer> <footer class="blockquote-footer"> Pr. {{course.teacher}} </footer>
</blockquote> </blockquote>
</div> </div>
<div style="width: 100px; height: 50px;"> <div style="width: 150px; height: 70px; margin: 20px;">
<a href="{% url "webapp:class_create" %}"> Create new week </a> <a class='btn btn-primary' href="{% url "webapp:class_create" %}"> Create new week </a>
</div> </div>
</div> </div>
</div> </div>
......
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