Images count in gallery.
authorLukasz Anwajler <lukasz@anwajler.com>
Tue, 13 Jul 2010 14:34:00 +0000 (09:34 -0500)
committerLukasz Anwajler <lukasz@anwajler.com>
Tue, 13 Jul 2010 14:34:00 +0000 (09:34 -0500)
Gallery path fix.

apps/wiki/templates/wiki/tabs/gallery_view.html
redakcja/static/js/wiki/view_gallery.js
redakcja/static/js/wiki/wikiapi.js

index 2daff10..47f6af2 100644 (file)
@@ -7,7 +7,9 @@
         <button class="previous-page">
             <img src="{{STATIC_URL}}icons/go-previous.png"
                alt="{% trans "Previous" %}" title="{% trans "Previous" %}"/>
-        </button><input type="text" size="3" maxlength="3" value="1" class="page-number" />
+        </button>
+        <input type="text" size="3" maxlength="3" value="0" class="page-number" />
+        <input type="text" id="imagesCount" disabled="disabled" value="0" maxlength="3" size="3">
         <button class="next-page">
             <img src="{{STATIC_URL}}icons/go-next.png"
                alt="{% trans "Next" %}" title="{% trans "Next" %}"/>
@@ -22,4 +24,4 @@
     <div class="gallery-image">
         <img src="{{MEDIA_URL}}images/empty.png" />
     </div>
-</div>
\ No newline at end of file
+</div>
index aa39e15..c487d46 100644 (file)
@@ -65,7 +65,7 @@
                 event.preventDefault();
                 self.setPage($(this).val());
             });
-
+                    
             $('.previous-page', this.$element).click(function(){
                 self.setPage(parseInt(self.$numberInput.val(),10) - 1);
             });
 
     ScanGalleryPerspective.prototype.setPage = function(newPage){
         newPage = normalizeNumber(newPage, this.doc.galleryImages.length);
+        $('#imagesCount').val(this.doc.galleryImages.length);
         this.$numberInput.val(newPage);
                this.config().page = newPage;
         $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1]);
 
     $.wiki.ScanGalleryPerspective = ScanGalleryPerspective;
 
-})(jQuery);
\ No newline at end of file
+})(jQuery);
index 3ec2fdc..ad31af3 100644 (file)
@@ -33,7 +33,7 @@
 
                if (vname == "ajax_document_gallery") {
 
-                       return base_path + "/gallery/" + arguments[1];
+                       return base_path + "/" + arguments[1] + "/gallery";
                }
 
                if (vname == "ajax_document_diff")