'Put on the shelf' usability improvement.
authorLukasz <lukasz@anwajler.com>
Wed, 2 Jun 2010 03:29:09 +0000 (05:29 +0200)
committerLukasz <lukasz@anwajler.com>
Wed, 2 Jun 2010 03:29:09 +0000 (05:29 +0200)
wolnelektury/static/css/master.css
wolnelektury/static/js/catalogue.js
wolnelektury/templates/catalogue/book_sets.html

index 0c9128d..98a96c0 100644 (file)
@@ -875,3 +875,6 @@ div.shown-tags p, div.all-tags p {
     color: #FFF;
     text-decoration: none;
 }
+#createNewShelf {
+display: none;
+}
index a76215a..3aad7b4 100644 (file)
@@ -107,6 +107,7 @@ function serverTime() {
 
 (function($) {
     $(function() {
+       
         $('form input').labelify({labelledClass: 'blur'});
         
         target = $('#login-register-window div.target');
@@ -347,9 +348,18 @@ function serverTime() {
                 target.html('<p><img src="/static/img/indicator.gif" />'+LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']+'</p>');
                 hash.w.css({position: 'absolute', left: offset.left, top: offset.top}).show() },
             onLoad: function(hash) { 
+               try {
+                       $('#createShelfTrigger').click(function(){
+                               $('#createNewShelf').show();
+                       });
+               } catch (e){}
+
                 $('form', hash.w).ajaxForm({
                     target: target,
-                    success: function() { setTimeout(function() { $('#set-window').jqmHide() }, 1000) }
+                    success: function() { 
+                       setTimeout(function() { 
+                                       $('#set-window').jqmHide();
+                                  }, 1000)}
                 });
             }
         });
index e17c513..2b713b4 100644 (file)
@@ -1,5 +1,11 @@
 {% load i18n %}
 <h2>{% trans "Put a book on the shelf!" %}</h2>
+<a href="#" id="createShelfTrigger">{% trans "Create new shelf" %}</a>
+<form id="createNewShelf" action="{% url catalogue.views.new_set %}" method="POST" accept-charset="utf-8" class="cuteform">
+<ol>
+    <li>{{ new_set_form.name }} <input type="submit" value="{% trans "Create new shelf" %}"/></li>
+</ol>
+</form>
 {% if not user.tag_set.count %}
     <p>{% trans "You do not have any shelves. You can create one below, if you want to."%}</p>
 {% else %}
@@ -10,9 +16,3 @@
     </ol>
     </form>
 {% endif %}
-<hr />
-<form action="{% url catalogue.views.new_set %}" method="POST" accept-charset="utf-8" class="cuteform">
-<ol>
-    <li>{{ new_set_form.name }} <input type="submit" value="{% trans "Create new shelf" %}"/></li>
-</ol>
-</form>
\ No newline at end of file