From: Marcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Date: Thu, 19 Apr 2012 12:24:30 +0000 (+0200)
Subject: add a revert button to return scan gallery to first page for this book
X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/2e9863762f318d332d2af5ed90e91a4a8e40fb0c?ds=inline

add a revert button to return scan gallery to first page for this book
---

diff --git a/apps/wiki/templates/wiki/tabs/gallery_view.html b/apps/wiki/templates/wiki/tabs/gallery_view.html
index 11767978..22f98c92 100644
--- a/apps/wiki/templates/wiki/tabs/gallery_view.html
+++ b/apps/wiki/templates/wiki/tabs/gallery_view.html
@@ -2,6 +2,10 @@
 <div id="side-gallery">
     <!-- gallery toolbar -->
     <div class="toolbar">
+        <button class="start-page">
+            <img src="{{STATIC_URL}}icons/revert.png"
+            	alt="{% trans "Start page" %}" title="{% trans "Start page" %}"/>
+        </button>
         <button class="previous-page">
             <img src="{{STATIC_URL}}icons/go-previous.png"
             	alt="{% trans "Previous" %}" title="{% trans "Previous" %}"/>
diff --git a/redakcja/static/icons/revert.png b/redakcja/static/icons/revert.png
new file mode 100644
index 00000000..de96265c
Binary files /dev/null and b/redakcja/static/icons/revert.png differ
diff --git a/redakcja/static/js/wiki/view_gallery.js b/redakcja/static/js/wiki/view_gallery.js
index 315a421b..65a716af 100644
--- a/redakcja/static/js/wiki/view_gallery.js
+++ b/redakcja/static/js/wiki/view_gallery.js
@@ -72,6 +72,10 @@
                 self.setPage($(this).val());
             });
                     
+	    $('.start-page', this.$element).click(function(){
+		self.setPage(CurrentDocument.galleryStart);
+	    });
+
             $('.previous-page', this.$element).click(function(){
                 self.setPage(parseInt(self.$numberInput.val(),10) - 1);
             });