Shelf sharing (#301)
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 19 May 2010 09:58:42 +0000 (11:58 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 19 May 2010 09:58:42 +0000 (11:58 +0200)
wolnelektury/static/css/master.css
wolnelektury/static/js/catalogue.js
wolnelektury/templates/catalogue/tagged_object_list.html

index ba6e0aa..a0e5e3c 100644 (file)
@@ -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 = */
 /* ============================ */
index d57f743..b37c577 100644 (file)
@@ -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();
index 3f9c5ba..b105c70 100644 (file)
                     <div class="clearboth"></div>
                 </form>
             </div>
+            <div id="toggle-share-shelf"><p>{% trans "Share this shelf" %}</p></div>
+            <div id="share-shelf">
+                <p>{% trans "Copy this link and share it with other people to let them see your shelf." %}
+                <input id="share-shelf-url" value='http://{{ request.META.HTTP_HOST }}{{ request.path }}' />
+                </p>
+            </div>
         {% endif %}
         {% if last_tag.gazeta_link %}
         <p><a href="{{ last_tag.gazeta_link }}">