From 6a3e0a8673f36a73781db047a3c79f00f19c83b5 Mon Sep 17 00:00:00 2001 From: SvyatoslavArtymovych Date: Fri, 28 Apr 2023 12:22:13 +0300 Subject: [PATCH] hide right side bar buttons if current users is not owner of book --- app/templates/book/collection_view.html | 3 +++ app/templates/book/right_sidebar.html | 2 ++ app/templates/book/section_view.html | 2 ++ app/templates/book/sub_collection_view.html | 2 ++ 4 files changed, 9 insertions(+) diff --git a/app/templates/book/collection_view.html b/app/templates/book/collection_view.html index 9994cb4..1032a89 100644 --- a/app/templates/book/collection_view.html +++ b/app/templates/book/collection_view.html @@ -1,11 +1,14 @@ {% extends 'base.html' %} +{% if book.owner.id == current_user.id %} + {% set show_create_collection = True %} {% include 'book/add_collection_modal.html' %} +{% endif %} {% block right_sidebar %} diff --git a/app/templates/book/right_sidebar.html b/app/templates/book/right_sidebar.html index 0ef8761..0bbfdf3 100644 --- a/app/templates/book/right_sidebar.html +++ b/app/templates/book/right_sidebar.html @@ -2,6 +2,7 @@