From 27efa3dcf3535abae998c196e39e23fe6c2a4d74 Mon Sep 17 00:00:00 2001 From: RemiZOffAlex Date: Mon, 17 Feb 2020 01:06:16 +0300 Subject: [PATCH] Update profile --- myapp/ns_profile/templates/profile.html | 2 + myapp/ns_profile/templates/profile_menu.html | 17 +++ myapp/ns_profile/templates/profile_pages.html | 111 ++++++++++++++++++ myapp/ns_profile/views.py | 19 +++ 4 files changed, 149 insertions(+) create mode 100644 myapp/ns_profile/templates/profile_menu.html create mode 100644 myapp/ns_profile/templates/profile_pages.html diff --git a/myapp/ns_profile/templates/profile.html b/myapp/ns_profile/templates/profile.html index bb2c89f..30e7a15 100644 --- a/myapp/ns_profile/templates/profile.html +++ b/myapp/ns_profile/templates/profile.html @@ -4,6 +4,8 @@

Профиль


+{% include 'profile_menu.html' %} +

Зарегистрирован: {{ user.created }}

{% endblock content %} diff --git a/myapp/ns_profile/templates/profile_menu.html b/myapp/ns_profile/templates/profile_menu.html new file mode 100644 index 0000000..e088ca4 --- /dev/null +++ b/myapp/ns_profile/templates/profile_menu.html @@ -0,0 +1,17 @@ +
+ +
+
diff --git a/myapp/ns_profile/templates/profile_pages.html b/myapp/ns_profile/templates/profile_pages.html new file mode 100644 index 0000000..ccb6f8c --- /dev/null +++ b/myapp/ns_profile/templates/profile_pages.html @@ -0,0 +1,111 @@ +{% extends "skeleton.html" %} +{% block content %} + +

Профиль

+
+ +{% include 'profile_menu.html' %} + + + +{% include 'inc/pages.html' %} + + + + + +{% endblock content %} + +{% block script %} + + + + + +{% endblock script %} diff --git a/myapp/ns_profile/views.py b/myapp/ns_profile/views.py index f67e321..45b8e78 100644 --- a/myapp/ns_profile/views.py +++ b/myapp/ns_profile/views.py @@ -20,3 +20,22 @@ def profile(): pagedata['title'] = 'Мой профиль - {}'.format(app.config['TITLE']) body = render_template('profile.html', pagedata=pagedata) return body + + +@app.route('/profile/pages') +@login_required +def profile_pages(): + """ + Личный профиль пользователя + """ + pagedata = {} + pagedata['title'] = 'Мой профиль - {}'.format(app.config['TITLE']) + + pagedata['pagination'] = { + "page": 1, + "per_page": app.config['ITEMS_ON_PAGE'], + "size": 0 + } + + body = render_template('profile_pages.html', pagedata=pagedata) + return body