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
f217ed60
Commit
f217ed60
authored
Nov 03, 2021
by
Борис Ким
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Сделал ссылку на логин и отображение пользователя в главном меню
parent
8241ef34
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
urls.py
source/accounts/urls.py
+2
-1
settings.py
source/portal/settings.py
+2
-0
base.html
source/webapp/templates/base.html
+25
-3
courses_list.html
source/webapp/templates/courses/courses_list.html
+1
-1
No files found.
source/accounts/urls.py
View file @
f217ed60
...
...
@@ -6,5 +6,6 @@ app_name = "accounts"
urlpatterns
=
[
path
(
'login/'
,
accounts_views
.
LoginView
.
as_view
(),
name
=
"login"
)
path
(
'login/'
,
accounts_views
.
LoginView
.
as_view
(),
name
=
"login"
),
path
(
'logout/'
,
accounts_views
.
LogoutView
.
as_view
(),
name
=
"logout"
),
]
source/portal/settings.py
View file @
f217ed60
...
...
@@ -129,5 +129,7 @@ MEDIA_URL = '/media/'
CRISPY_TEMPLATE_PACK
=
'bootstrap4'
LOGIN_URL
=
'/accounts/login/'
LOGIN_REDIRECT_URL
=
'/'
LOGOUT_REDIRECT_URL
=
'/'
\ No newline at end of file
source/webapp/templates/base.html
View file @
f217ed60
...
...
@@ -7,10 +7,12 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<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://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"
>
<title>
{% block title %}{% endblock %}
</title>
<link
rel=
"stylesheet"
href=
"https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"
>
<script
src=
"https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity=
"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity=
"sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin=
"anonymous"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity=
"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin=
"anonymous"
></script>
<title>
{% block title %} University {% endblock %}
</title>
</head>
<body>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark"
>
...
...
@@ -34,6 +36,26 @@
</li>
</ul>
</div>
{% if user.is_authenticated %}
<div
class=
"dropdown"
>
<a
class=
"dropdown-toggle"
style=
"color: white;"
type=
"button"
id=
"dropdownMenu2"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
{{ user.username }}
<i
class=
"fas fa-user"
></i>
</a>
<div
class=
"dropdown-menu dropdown-menu-right"
aria-labelledby=
"dropdownMenu2"
>
<button
class=
"dropdown-item"
type=
"button"
>
Profile
</button>
<button
class=
"dropdown-item"
type=
"button"
>
Students
</button>
<div
class=
"dropdown-divider"
></div>
<form
action=
"{% url 'accounts:logout' %}"
method=
"POST"
>
{% csrf_token %}
<button
class=
"dropdown-item"
>
Logout
</button>
</form>
</div>
</div>
{% else %}
<div>
<a
href=
"{% url 'accounts:login' %}"
>
Sign in
</a>
</div>
{% endif %}
</nav>
<div
class=
"row d-flex"
>
<div
class=
"sidebar col-2"
>
...
...
source/webapp/templates/courses/courses_list.html
View file @
f217ed60
{% extends 'base.html' %}
{% block title %}
List
{% endblock %}
{% block title %}
University
{% endblock %}
{% block content %}
<div
class=
'course-container row d-flex flex-wrap justify-content-start'
>
...
...
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