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
8b8afca7
Commit
8b8afca7
authored
Nov 02, 2021
by
Борис Ким
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил вью для детального просмотра курса
parent
69d44efd
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
3 deletions
+30
-3
urls.py
source/portal/urls.py
+2
-1
base.html
source/webapp/templates/base.html
+1
-1
courses_list.html
source/webapp/templates/courses/courses_list.html
+1
-0
detail.html
source/webapp/templates/courses/detail.html
+19
-0
courses_views.py
source/webapp/views/courses_views.py
+7
-1
No files found.
source/portal/urls.py
View file @
8b8afca7
...
@@ -19,5 +19,6 @@ from webapp.views import courses_views as webapp_views
...
@@ -19,5 +19,6 @@ from webapp.views import courses_views as webapp_views
urlpatterns
=
[
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
''
,
webapp_views
.
CoursesListView
.
as_view
(),
name
=
'courses_list'
)
path
(
''
,
webapp_views
.
CoursesListView
.
as_view
(),
name
=
'courses_list'
),
path
(
'course/<int:course_pk>/'
,
webapp_views
.
CourseDetailView
.
as_view
(),
name
=
'course_detail'
)
]
]
source/webapp/templates/base.html
View file @
8b8afca7
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<title>
{% block title %}{% endblock %}
</title>
<title>
{% block title %}{% endblock %}
</title>
</head>
</head>
<body>
<body>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark
fixed-top
"
>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark"
>
<a
class=
"navbar-brand"
href=
"#"
>
Navbar
</a>
<a
class=
"navbar-brand"
href=
"#"
>
Navbar
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarNav"
aria-controls=
"navbarNav"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarNav"
aria-controls=
"navbarNav"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
<span
class=
"navbar-toggler-icon"
></span>
...
...
source/webapp/templates/courses/courses_list.html
View file @
8b8afca7
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<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>
<a
class=
"btn btn-primary"
href=
"{% url 'course_detail' course.id %}"
>
See more
</a>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
source/webapp/templates/courses/detail.html
0 → 100644
View file @
8b8afca7
{% extends 'base.html' %}
{% block title %} {{course.title}} {% endblock %}
{% block content %}
<div
class=
'course-block-detail'
>
<div
class=
"card"
>
<div
class=
"card-header"
>
{{course.title}}
</div>
<div
class=
"card-body"
>
<blockquote
class=
"blockquote mb-0"
>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
</p>
<footer
class=
"blockquote-footer"
>
Someone famous in
<cite
title=
"Source Title"
>
Source Title
</cite></footer>
</blockquote>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
source/webapp/views/courses_views.py
View file @
8b8afca7
...
@@ -10,3 +10,9 @@ class CoursesListView(ListView):
...
@@ -10,3 +10,9 @@ class CoursesListView(ListView):
context_object_name
=
'courses'
context_object_name
=
'courses'
template_name
=
'courses/courses_list.html'
template_name
=
'courses/courses_list.html'
paginate_by
=
9
paginate_by
=
9
class
CourseDetailView
(
DetailView
):
model
=
Course
template_name
=
'courses/detail.html'
pk_url_kwarg
=
'course_pk'
\ No newline at end of file
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