From 157e562bf370883abebbd31bc603d9421e439d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ku=C5=BE=C3=ADlek?= Date: Thu, 27 Feb 2020 10:42:27 +0100 Subject: [PATCH] =?UTF-8?q?=C3=9AKLID=20TIME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yadc/templates/_formhelpers.html | 5 ++ yadc/templates/layout/base_sidebar.html | 10 +++ yadc/templates/layout/base_sidebar_tags.html | 7 ++ yadc/templates/layout/settings.html | 13 +--- yadc/templates/manage/posts.html | 31 +++----- yadc/templates/manage/profile.html | 2 +- yadc/templates/manage/users.html | 33 ++++---- yadc/templates/post/index.html | 59 +++++++------- yadc/templates/post/post.html | 82 +++++++++++--------- 9 files changed, 123 insertions(+), 119 deletions(-) create mode 100644 yadc/templates/layout/base_sidebar.html create mode 100644 yadc/templates/layout/base_sidebar_tags.html diff --git a/yadc/templates/_formhelpers.html b/yadc/templates/_formhelpers.html index 35ae620..ae118e2 100644 --- a/yadc/templates/_formhelpers.html +++ b/yadc/templates/_formhelpers.html @@ -6,4 +6,9 @@ {% endfor %} {% endif %} +{% endmacro %} + +{% macro management_gen_line(field, formfield) %} +{{ field }} +{{ formfield() }}{{ errors(formfield) }} {% endmacro %} \ No newline at end of file diff --git a/yadc/templates/layout/base_sidebar.html b/yadc/templates/layout/base_sidebar.html new file mode 100644 index 0000000..838b4b0 --- /dev/null +++ b/yadc/templates/layout/base_sidebar.html @@ -0,0 +1,10 @@ +{% extends 'layout/base.html' %} + +{% block content %} +
+
+ {% block sidebar %}{% endblock %} +
+ {% block main_content %}{% endblock %} +
+{% endblock content %} \ No newline at end of file diff --git a/yadc/templates/layout/base_sidebar_tags.html b/yadc/templates/layout/base_sidebar_tags.html new file mode 100644 index 0000000..673fb11 --- /dev/null +++ b/yadc/templates/layout/base_sidebar_tags.html @@ -0,0 +1,7 @@ +{% extends 'layout/base_sidebar.html' %} +{% from '_includes.html' import render_tags with context %} + +{% block sidebar %} + {{ render_tags() }} +{% endblock %} + diff --git a/yadc/templates/layout/settings.html b/yadc/templates/layout/settings.html index a0bb66b..e173252 100644 --- a/yadc/templates/layout/settings.html +++ b/yadc/templates/layout/settings.html @@ -1,11 +1,6 @@ -{% extends 'layout/base.html' %} +{% extends 'layout/base_sidebar.html' %} {% from '_includes.html' import render_sidenav with context %} -{% block content %} -
-
- {{ render_sidenav({"speedtest": ("Speedtest", "http://speedtest.cesnet.cz")}) }} -
- {% block setting_content %}{% endblock %} -
-{% endblock content %} \ No newline at end of file +{% block sidebar %} + {{ render_sidenav({"speedtest": ("Speedtest", "http://speedtest.cesnet.cz")}) }} +{% endblock %} diff --git a/yadc/templates/manage/posts.html b/yadc/templates/manage/posts.html index c2451ab..ac8d9d1 100644 --- a/yadc/templates/manage/posts.html +++ b/yadc/templates/manage/posts.html @@ -1,8 +1,8 @@ {% extends 'layout/settings.html' %} {% from '_includes.html' import render_pagination with context %} -{% from "_formhelpers.html" import errors %} +{% from "_formhelpers.html" import management_gen_line, errors %} -{% block setting_content %} +{% block main_content %}
@@ -18,24 +18,15 @@ {% for post in posts %} - - - {{ post.editform.csrf_token }} - {{ post.editform.post_id() }} + + {{ post.editform.csrf_token }} + {{ post.editform.post_id() }} + - - - + + + - - + + {% endfor %}
{{ post.id }}
{{ post.md5[:7] }}
- {{ post.rating.name.capitalize() }} - {{ post.editform.rating() }}{{ errors(post.editform.rating) }} - - {{ post.status.name.capitalize() }} - {{ post.editform.status() }}{{ errors(post.editform.status) }} - - {{ post.source }} - {{ post.editform.source() }}{{ errors(post.editform.source) }} - {{ management_gen_line(post.rating.name.capitalize(), post.editform.rating) }}{{ management_gen_line(post.status.name.capitalize(), post.editform.status) }}{{ management_gen_line(post.source, post.editform.source) }} {{ post.origin_filename }} @@ -43,8 +34,8 @@
diff --git a/yadc/templates/manage/profile.html b/yadc/templates/manage/profile.html index 61610a7..ffd834a 100644 --- a/yadc/templates/manage/profile.html +++ b/yadc/templates/manage/profile.html @@ -1,7 +1,7 @@ {% extends 'layout/settings.html' %} {% from "_formhelpers.html" import errors %} -{% block setting_content %} +{% block main_content %}

Change password

diff --git a/yadc/templates/manage/users.html b/yadc/templates/manage/users.html index f053e6f..1a0cd25 100644 --- a/yadc/templates/manage/users.html +++ b/yadc/templates/manage/users.html @@ -1,12 +1,13 @@ {% extends 'layout/settings.html' %} {% from '_includes.html' import render_pagination with context %} -{% from "_formhelpers.html" import errors %} +{% from "_formhelpers.html" import management_gen_line, errors %} -{% block setting_content %} +{% block main_content %}
+ @@ -16,22 +17,14 @@ {% for user in users %} - - - {{ user.editform.csrf_token }} - {{ user.editform.user_id() }} - - - + + {{ user.editform.csrf_token }} + {{ user.editform.user_id() }} + + + + + - - + + {% endfor %}
ID Username User status Perm level
- {{ user.username }} - {{ user.editform.username() }}{{ errors(user.editform.username) }} - - {{ user.user_status.name.capitalize() }} - {{ user.editform.user_status() }}{{ errors(user.editform.user_status) }} - - {{ user.op_level.name.capitalize() }} - {{ user.editform.op_level() }}{{ errors(user.editform.user_status) }} -
{{ user.id }}{{ management_gen_line(user.username, user.editform.username) }}{{ management_gen_line(user.user_status.name.capitalize(), user.editform.user_status) }}{{ management_gen_line(user.op_level.name.capitalize(), user.editform.op_level) }} {{ user.last_login.strftime('%I:%M %p %d %b, %Y') }} @@ -39,8 +32,8 @@
diff --git a/yadc/templates/post/index.html b/yadc/templates/post/index.html index 532c03f..b1489d2 100644 --- a/yadc/templates/post/index.html +++ b/yadc/templates/post/index.html @@ -1,33 +1,28 @@ -{% extends 'layout/base.html' %} -{% from '_includes.html' import render_tags, render_pagination with context %} +{% extends 'layout/base_sidebar_tags.html' %} +{% from '_includes.html' import render_pagination with context %} -{% block content %} -
-
- {{ render_tags() }} -
-
-
- {% for post in posts %} -
- - - -
- {% endfor %} - - -
- {{ render_pagination('post.posts') }} -
-
-{% endblock content %} \ No newline at end of file +{% block main_content %} +
+
+ {% for post in posts %} +
+ + + +
+ {% endfor %} + + +
+ {{ render_pagination('post.posts') }} +
+{% endblock %} \ No newline at end of file diff --git a/yadc/templates/post/post.html b/yadc/templates/post/post.html index 6756fe2..8b55874 100644 --- a/yadc/templates/post/post.html +++ b/yadc/templates/post/post.html @@ -1,42 +1,50 @@ -{% extends 'layout/base.html' %} -{% from '_includes.html' import render_tags, render_comments, render_post_edit with context %} +{% extends 'layout/base_sidebar_tags.html' %} +{% from '_includes.html' import render_comments, render_post_edit with context %} {% from "_formhelpers.html" import errors %} -{% block content %} -
-
-
- - -
Id: {{ post.id }}
-
Author: {{ post.author.username or "Deleted Account" }}
- {% if post.is_approved %} -
Approved by: {{ post.approver.username }}
- {% endif %} - {% if not post.is_approved %} -
Status: {{ post.status.name.capitalize() }}
- {% endif %} -
Posted: {{ post.natural_created() }}
- -
File size: {{ post.filesize_human }}
-
Image res: {{ post.image_resolution }}
- - {% if post.filetype.name == 'png' %} - - {% endif %} - -
- {{ render_tags() }} - {% if post.can_edit %} - {{ render_post_edit() }} +{% block sidebar %} +
+ + +
Id: {{ post.id }}
+
Author: {{ post.author.username or "Deleted Account" }}
+ + {% if post.is_approved %} +
Approved by: {{ post.approver.username }}
+ {% endif %} + + {% if not post.is_approved %} +
Status: {{ post.status.name.capitalize() }}
{% endif %} -
-
-
- -
-
-
+ +
Posted: {{ post.natural_created() }}
+ +
File size: {{ post.filesize_human }}
+
Image res: {{ post.image_resolution }}
+ + + {% if post.filetype.name == 'png' %} + + {% endif %} + + + {{ super() }} + + {% if post.can_edit %} + {{ render_post_edit() }} + {% endif %} +{% endblock %} + +{% block main_content %} +
+
+ +
+
+{% endblock %} + +{% block content %} +{{ super() }}

Comments

{{ render_comments() }} @@ -58,4 +66,4 @@

To comment, please log in.

{% endif %}
-{% endblock content %} \ No newline at end of file +{% endblock %} \ No newline at end of file