From: Radek Czajka Date: Wed, 19 May 2010 10:48:49 +0000 (+0200) Subject: Display shelf sharing only for own shelves. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/bc880d2824c5400c2096e642ba76fdd8bbf95b34?ds=sidebyside;hp=ba44660a1a87d1c385b3a9e101ce946672fed755 Display shelf sharing only for own shelves. --- diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index cf1461feb..7cef7268b 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -86,6 +86,7 @@ def tagged_object_list(request, tags=''): model = models.Book shelf = [tag for tag in tags if tag.category == 'set'] shelf_is_set = (len(tags) == 1 and tags[0].category == 'set') + my_shelf_is_set = shelf_is_set and tags[0].user == request.user theme_is_set = len([tag for tag in tags if tag.category == 'theme']) > 0 if theme_is_set: model = models.Fragment @@ -110,6 +111,7 @@ def tagged_object_list(request, tags=''): extra_context = { 'categories': categories, 'shelf_is_set': shelf_is_set, + 'my_shelf_is_set': my_shelf_is_set, 'only_author': only_author, 'pd_counter': pd_counter, 'user_is_owner': user_is_owner, diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html index b105c70bd..f5b896c8f 100644 --- a/wolnelektury/templates/catalogue/tagged_object_list.html +++ b/wolnelektury/templates/catalogue/tagged_object_list.html @@ -42,12 +42,14 @@
+ {% if my_shelf_is_set %}

{% trans "Share this shelf" %}

{% trans "Copy this link and share it with other people to let them see your shelf." %}

+ {% endif %} {% endif %} {% if last_tag.gazeta_link %}