changeset 165:7332323c8a6f

arnica_slides: use prefix Webnail in options list
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 14 Jul 2008 16:21:48 +0200
parents db98e843b83c
children 9817520ac155
files data/plugin/action/arnica_slides.py
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/arnica_slides.py	Mon Jul 14 16:12:05 2008 +0200
+++ b/data/plugin/action/arnica_slides.py	Mon Jul 14 16:21:48 2008 +0200
@@ -182,7 +182,7 @@
         url = AttachFile.getAttachUrl(pagename, "", request)
 
     image_url = "%s%s" % (url, images[idx])
-    option_webnail = option_list(image_url, pagename, images, request, image_for_webnail)
+    option_webnail = option_list(image_url, pagename, images, alias, request, image_for_webnail)
     inner_table_style = ' style="border-style:none; margin:10px;"'
     this_webnail_list = "".join(["%s%s|" % (url, name) for name in images])
 
@@ -234,7 +234,7 @@
 }
     return html
 
-def option_list(this_image, pagename, text, request, image_for_webnail):
+def option_list(this_image, pagename, text, alias, request, image_for_webnail):
     """ generates the pulldown option list
     @param this_image: selected image  on top
     @param pagename: pagename of attachments
@@ -242,21 +242,26 @@
     @param request: request object
     """
     txt = ''
-
+    i = 0
     for filename in text:
         if not image_for_webnail:
             url = sendcached.get_url(request, filename)
+            prefix = 'Webnail'
         else:
             url = AttachFile.getAttachUrl(pagename, filename, request)
+            prefix = ''
 
         if url == this_image:
-            txt += '<option selected value="%(name)s">%(alias)s' % {
+            txt += '<option selected value="%(name)s">%(prefix)s: %(alias)s' % {
+                    "prefix": prefix,
                     "name": this_image,
-                    "alias": filename[4:]}
+                    "alias": alias[i]}
         else:
-            txt += '<option value="%(name)s">%(alias)s' % {
+            txt += '<option value="%(name)s">%(prefix)s: %(alias)s' % {
+                    "prefix": prefix,
                     "name": this_image,
-                    "alias": filename[4:]}
+                    "alias": alias[i]}
+        i += 1
 
     return txt