From 983e786900da2ee30ad888f16943d091b7a48788 Mon Sep 17 00:00:00 2001 From: SvyatoslavArtymovych Date: Tue, 20 Jun 2023 14:21:25 +0300 Subject: [PATCH] interpretations component styling (for all pages containing this component) #176 --- .../components/interpretation_list_item.html | 117 ++++++++++++++++++ app/templates/book/interpretation_view.html | 104 +--------------- .../book/local_breadcrumbs_navigation.html | 62 +++++----- app/templates/book/my_contributions.html | 73 +---------- app/templates/home/index.html | 72 ++--------- .../search_results_interpretations.html | 77 ++---------- .../tag_search_results_interpretations.html | 73 +---------- app/templates/user/profile.html | 67 +--------- 8 files changed, 176 insertions(+), 469 deletions(-) create mode 100644 app/templates/book/components/interpretation_list_item.html diff --git a/app/templates/book/components/interpretation_list_item.html b/app/templates/book/components/interpretation_list_item.html new file mode 100644 index 0000000..187076a --- /dev/null +++ b/app/templates/book/components/interpretation_list_item.html @@ -0,0 +1,117 @@ +
+
+
+ + {% if not hide_vote_btns %} +
+ +
+ {% endif %} + + + {{ interpretation.vote_count }} + + + {% if not hide_vote_btns %} +
+ +
+ {% endif %} + + {% if show_control_btns %} + {% if interpretation.book.owner == current_user or access_to_approve_interpretation %} +
+ + + + + +
+ {% endif %} + + {% if interpretation.user_id == current_user.id %} + +
+ + +
+ {% endif %} + + {% if interpretation.book.owner == current_user or interpretation.user_id == current_user.id or access_to_delete_interpretation %} +
+ + +
+ {% endif %} + {% endif %} +
+ + +
+
+ {% if show_breadcrumbs %} + {% set local_breadcrumbs = interpretation.section.breadcrumbs_path %} + {% include 'book/local_breadcrumbs_navigation.html'%} + +

{{ interpretation.section.label }}

+
+ {% endif %} + +
+

{{ display_inline_elements(interpretation.text)|safe }}

+
+
+ +
+
+ + {{interpretation.user.username}} on {{interpretation.created_at.strftime('%B %d, %Y')}} +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/app/templates/book/interpretation_view.html b/app/templates/book/interpretation_view.html index 3f884a0..03b84e7 100644 --- a/app/templates/book/interpretation_view.html +++ b/app/templates/book/interpretation_view.html @@ -82,109 +82,7 @@ {% for interpretation in section.active_interpretations %} -
-
-
- -
- -
- - {{ interpretation.vote_count }} - -
- -
- - - {% if interpretation.book.owner == current_user or access_to_approve_interpretation %} -
- - - - - -
- {% endif %} - - {% if interpretation.user_id == current_user.id %} - -
- - -
- {% endif %} - - {% if interpretation.book.owner == current_user or interpretation.user_id == current_user.id or access_to_delete_interpretation %} -
- - -
- {% endif %} -
- - - -
-
-
-

{{ display_inline_elements(interpretation.text)|safe }}

-
-
- -
-
- - {{interpretation.user.username}} on {{interpretation.created_at.strftime('%B %d, %Y')}} -
-
- - - -
-
-
-
-
+ {% include 'book/components/interpretation_list_item.html' %} {% endfor %}