diff data/plugin/parser/text_x_arnica.py @ 334:ff4d2f96a36b

text_x_arnica: applied patch for new parameter album_link_page link to page instead of slideshow by Johannes Berg
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 20 Jan 2009 19:28:59 +0100
parents a82e059e4477
children a6d96bdc0598
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Tue Jan 20 19:27:21 2009 +0100
+++ b/data/plugin/parser/text_x_arnica.py	Tue Jan 20 19:28:59 2009 +0100
@@ -30,7 +30,7 @@
                     sort_by=("name", "date", "alias"),
                     reverse_sort=False,
                     only_items=False, template_itemlist=False,
-                    album=False, album_title=unicode, album_image=u'',
+                    album=False, album_title=unicode, album_image=u'', album_link_page=False,
                     renew=False,
                     thumbnail_width=128,
                     webnail_width=640):
@@ -52,6 +52,7 @@
     @param album: if set, selects album mode, only thumbnail from first image is shown, related is album title and album_image
     @param album_title: default is pagename of the images for the album.
     @param album_image: image to show on album default is the first image
+    @param album_link_page: link to page instead of slideshow
     @param renew: if set then all selected thumbnails_* and webnails_* are removed and will be recreated
     @param thumbnail_width: default width of thumbnail is 128px
     @param webnail_width: default width of webnail is 640px
@@ -101,7 +102,7 @@
         """ shows restricted tools
             @param this_target: image
         """
-        if not self.request.user.may.delete(self.pagename):
+        if self.album or not self.request.user.may.delete(self.pagename):
             return ''
         return """
 <li class="tool">
@@ -229,7 +230,7 @@
     <form action="%(url)s" method="POST" enctype="multipart/form-data">
       <div class="imagecont" style="height:%(width)spx;">
         <div class="image" style="width:%(width)spx;">
-             <input type="hidden" name="action" value="arnica_slides">
+             <input type="hidden" name="action" value="%(action)s">
              <input type="hidden" name="do" value="slide_show">
              <input type="hidden" name="alias" value="%(description)s">
              <input type="hidden" name="target" value="%(target)s">
@@ -237,7 +238,7 @@
              <input type="hidden" name="images" value="%(images)s">
              <input type="hidden" name="original_images" value="%(original_images)s">
              <input type="hidden" name="exif_date" value="%(exif_date)s">
-             <input type="image" value="submit" title="slide show" src="%(thumbnail)s">
+             <input type="image" value="submit" title="%(submit_title)s" src="%(thumbnail)s">
         </div>
       </div>
     </form>
@@ -261,6 +262,8 @@
         "html_tools": self.html_show_tools(image),
         "date_html": self.html_show_date(image),
         "alias_html": self.html_show_alias(image),
+        "submit_title": { True: "images", False: "slide show" }[self.album_link_page],
+        "action": { True: "show", False: "arnica_slides" }[self.album_link_page],
         }
         return html