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
2dbf564e
Commit
2dbf564e
authored
Nov 04, 2021
by
Борис Ким
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправил ошибку с ссылкой на создание нового урока
parent
635a5cd4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
+9
-7
models.py
source/webapp/models.py
+1
-2
create.html
source/webapp/templates/classes/create.html
+3
-3
courses_list.html
source/webapp/templates/courses/courses_list.html
+3
-0
classes_views.py
source/webapp/views/classes_views.py
+2
-2
No files found.
source/webapp/models.py
View file @
2dbf564e
...
@@ -15,8 +15,7 @@ class Course(models.Model):
...
@@ -15,8 +15,7 @@ class Course(models.Model):
return
self
.
title
return
self
.
title
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
reverse
(
"course_detail"
,
args
=
[
str
(
self
.
id
)])
return
reverse
(
"webapp:course_detail"
,
args
=
[
str
(
self
.
id
)])
class
Group
(
models
.
Model
):
class
Group
(
models
.
Model
):
...
...
source/webapp/templates/classes/create.html
View file @
2dbf564e
...
@@ -3,14 +3,14 @@
...
@@ -3,14 +3,14 @@
{% block title %} Create new Class {% endblock %}
{% block title %} Create new Class {% endblock %}
{% block content %}
{% block content %}
<a
href=
"{% url "
courses_list
"
%}"
>
Return to the main page..
</a>
<a
href=
"{% url "
webapp:
courses_list
"
%}"
>
Return to the main page..
</a>
<hr>
<hr>
<h1>
Create new Class
</h1>
<h1>
Create new Class
</h1>
<div
class=
'column-center'
>
<div
class=
'column-center'
>
<form
action=
"{% url "
class_create
"
%}"
method=
"POST"
>
<form
action=
"{% url "
webapp:
class_create
"
%}"
method=
"POST"
>
{% include "partial/create_form.html" with button_text="Create new class" %}
{% include "partial/create_form.html" with button_text="Create new class" %}
</form>
</form>
</div>
</div>
<hr>
<hr>
<a
href=
"{% url "
courses_list
"
%}"
>
Return to the main page..
</a>
<a
href=
"{% url "
webapp:
courses_list
"
%}"
>
Return to the main page..
</a>
{% endblock %}
{% endblock %}
\ No newline at end of file
source/webapp/templates/courses/courses_list.html
View file @
2dbf564e
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
<a
class=
"card-title"
href=
"{% url 'webapp:course_detail' course.id %}"
>
<h5>
{{course.title}}
</h5>
</a>
<a
class=
"card-title"
href=
"{% url 'webapp:course_detail' course.id %}"
>
<h5>
{{course.title}}
</h5>
</a>
<p
class=
"card-text"
>
{{ course.description|truncatewords:30 }}
</p>
<p
class=
"card-text"
>
{{ course.description|truncatewords:30 }}
</p>
<p
class=
"card-text"
>
<b>
Teacher:
</b>
{{course.teacher}}
</p>
<p
class=
"card-text"
>
<b>
Teacher:
</b>
{{course.teacher}}
</p>
<p
class=
"card-text"
>
<b>
Groups(s):
</b>
{% for group in course.group.all %} {{group}} {% endfor %}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
source/webapp/views/classes_views.py
View file @
2dbf564e
...
@@ -10,7 +10,7 @@ from webapp.forms import ClassForm
...
@@ -10,7 +10,7 @@ from webapp.forms import ClassForm
class
CreateClassView
(
LoginRequiredMixin
,
PermissionRequiredMixin
,
CreateView
):
class
CreateClassView
(
LoginRequiredMixin
,
PermissionRequiredMixin
,
CreateView
):
model
=
Class
model
=
Class
fields
=
[
'title'
,
'description'
,
'file'
]
fields
=
[
'title'
,
'description'
,
'file'
]
template_name
=
'c
our
ses/create.html'
template_name
=
'c
las
ses/create.html'
permission_required
=
'webapp.add_class'
permission_required
=
'webapp.add_class'
def
form_valid
(
self
,
form
):
def
form_valid
(
self
,
form
):
...
@@ -22,7 +22,7 @@ class CreateClassView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
...
@@ -22,7 +22,7 @@ class CreateClassView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
return
redirect
(
"webapp:course_detail"
,
course_pk
=
course
.
pk
)
return
redirect
(
"webapp:course_detail"
,
course_pk
=
course
.
pk
)
def
get_success_url
(
self
):
def
get_success_url
(
self
):
return
reverse
(
"webapp:
project
_detail"
,
kwargs
=
{
'project_pk'
:
self
.
object
.
course
.
pk
})
return
reverse
(
"webapp:
course
_detail"
,
kwargs
=
{
'project_pk'
:
self
.
object
.
course
.
pk
})
class
EditClassView
(
UpdateView
):
class
EditClassView
(
UpdateView
):
...
...
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