Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coursework
Project
Project
Details
Activity
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
Борис Ким
coursework
Commits
c52482ce
Commit
c52482ce
authored
Nov 03, 2021
by
Борис Ким
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Применил немного верстки на страницах
parent
33ec296f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
40 deletions
+32
-40
settings.py
source/portal/settings.py
+2
-1
models.py
source/webapp/models.py
+0
-15
main.css
source/webapp/static/css/main.css
+4
-9
base.html
source/webapp/templates/base.html
+2
-1
courses_list.html
source/webapp/templates/courses/courses_list.html
+6
-6
delete.html
source/webapp/templates/courses/delete.html
+16
-6
detail.html
source/webapp/templates/courses/detail.html
+2
-2
No files found.
source/portal/settings.py
View file @
c52482ce
...
@@ -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
=
[
...
...
source/webapp/models.py
View file @
c52482ce
...
@@ -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'
)
...
...
source/webapp/static/css/main.css
View file @
c52482ce
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
source/webapp/templates/base.html
View file @
c52482ce
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<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"
>
...
...
source/webapp/templates/courses/courses_list.html
View file @
c52482ce
...
@@ -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>
...
...
source/webapp/templates/courses/delete.html
View file @
c52482ce
...
@@ -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"
>
<h4
style=
"color: red;"
>
Warning!
</h4>
</div>
<div
class=
"card-body"
>
<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"
>
<form
action=
''
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
<button
>
Yes
</button>
<button
class=
"btn btn-danger p-2"
style=
"width: 90px;"
>
Yes
</button>
</form>
</form>
</div>
</div>
</div>
{% endblock %}
{% endblock %}
source/webapp/templates/courses/detail.html
View file @
c52482ce
...
@@ -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: 1
00px; height: 5
0px;"
>
<div
style=
"width: 1
50px; height: 70px; margin: 2
0px;"
>
<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>
...
...
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