From ba44660a1a87d1c385b3a9e101ce946672fed755 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 19 May 2010 11:58:42 +0200 Subject: [PATCH] Shelf sharing (#301) --- wolnelektury/static/css/master.css | 30 +++++++++++++++++++ wolnelektury/static/js/catalogue.js | 16 +++++++++- .../catalogue/tagged_object_list.html | 6 ++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/wolnelektury/static/css/master.css b/wolnelektury/static/css/master.css index ba6e0aaaf..a0e5e3c22 100644 --- a/wolnelektury/static/css/master.css +++ b/wolnelektury/static/css/master.css @@ -459,6 +459,36 @@ div.shown-tags p, div.all-tags p { color: #900; } +#toggle-share-shelf { + display: block; + width: 100%; + height: 1.5em; + background-color: #EEE; + margin-top: 0.5em; + padding: 0.5em 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + text-align: center; + outline: none; +} +#toggle-share-shelf p { + margin:0; +} + +#share-shelf { + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + border: 3px solid #EEE; + padding: 5px; + margin-top: -5px; +} +#share-shelf input { + width: 100%; +} + + /* ============================ */ /* = Books and fragments list = */ /* ============================ */ diff --git a/wolnelektury/static/js/catalogue.js b/wolnelektury/static/js/catalogue.js index d57f74339..b37c57734 100644 --- a/wolnelektury/static/js/catalogue.js +++ b/wolnelektury/static/js/catalogue.js @@ -286,7 +286,18 @@ function serverTime() { $('p', this).html(LOCALE_TEXTS[LANGUAGE_CODE]['HIDE_DESCRIPTION'] + ' ▼'); } }); - + + $('#toggle-share-shelf').hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#EEE'}); } + ).click(function() { + if ($('#share-shelf').hasClass('hidden')) { + $('#share-shelf').slideDown('fast').removeClass('hidden'); + } else { + $('#share-shelf').slideUp('fast').addClass('hidden'); + } + }); + var target = $('#set-window div.target'); $('#set-window').jqm({ @@ -318,6 +329,9 @@ function serverTime() { $('#description').hide().addClass('hidden'); $('#toggle-description p').html(LOCALE_TEXTS[LANGUAGE_CODE]['EXPAND_SHELF']+' ▼'); } + + $('#share-shelf').hide().addClass('hidden'); + $('#share-shelf input').focus(function(){this.select();}); $('#user-info').show(); changeBannerText(); diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html index 3f9c5ba67..b105c70bd 100644 --- a/wolnelektury/templates/catalogue/tagged_object_list.html +++ b/wolnelektury/templates/catalogue/tagged_object_list.html @@ -42,6 +42,12 @@
+

{% trans "Share this shelf" %}

+
+

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

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

-- 2.20.1