changeset 253:902a0b543b9b

text_x_arnica: fixed wrong order for webnails
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 10 Sep 2008 10:20:36 +0200
parents cf5f8b929da9
children a422d7d58d56
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Wed Sep 10 10:09:35 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Wed Sep 10 10:20:36 2008 +0200
@@ -197,6 +197,9 @@
         """ html code of thumbnails view with contol
         @param idx: index position of corresponding data
         """
+        image_names = self.arnica_image.keys()
+        index = [self.arnica_image[img][5] for img in image_names]
+        selected_images = [image_names[int(idx)] for idx in index]
 
         html = """
 <form action="%(url)s" method="POST" enctype="multipart/form-data">
@@ -228,12 +231,12 @@
             "tablestyle": self.inner_table_style,
             "style": self.td_style,
             "thumbnail_width": self.thumbnail_width,
-            "description": packLine([self.arnica_image[image][4]] + [self.arnica_image[img][3] for img in self.arnica_image.keys()]),
-            "exif_date": packLine([self.arnica_image[image][3]] + [self.arnica_image[img][3] for img in self.arnica_image.keys()]),
+            "description": packLine([self.arnica_image[image][4]] + [self.arnica_image[img][3] for img in selected_images]),
+            "exif_date": packLine([self.arnica_image[image][3]] + [self.arnica_image[img][3] for img in selected_images]),
             "target": self.arnica_image[image][0],
-            "original_images": packLine([image] + self.arnica_image.keys()),
-            "images": packLine([self.arnica_image[image][0]] + [self.arnica_image[img][0] for img in self.arnica_image.keys()]),
-            "original_images": packLine([image] + self.arnica_image.keys()),
+            "original_images": packLine([image] + selected_images),
+            "images": packLine([self.arnica_image[image][0]] + [self.arnica_image[img][0] for img in selected_images]),
+            "original_images": packLine([image] + selected_images),
             "this_target": image,
             "html_tools_restricted": self.html_tools_restricted(image),
         }
@@ -278,6 +281,10 @@
         @param idx: index positionn of corresponding data
         """
 
+        image_names = self.arnica_image.keys()
+        index = [self.arnica_image[img][5] for img in image_names]
+        selected_images = [image_names[int(idx)] for idx in index]
+
         title = ""
         if self.album:
             title = '<div class="title">%(n)d images (%(album_title)s)</div>' % {"n": len(self.arnica_image),
@@ -307,11 +314,11 @@
             "style": self.inner_table_style,
             "url": Page(self.request, self.pagename).url(self.request),
             "pagename": self.pagename,
-            "description": packLine([self.arnica_image[image][4]] + [self.arnica_image[img][4] for img in self.arnica_image.keys()]),
-            "exif_date": packLine([self.arnica_image[image][3]] + [self.arnica_image[img][3] for img in self.arnica_image.keys()]),
+            "description": packLine([self.arnica_image[image][4]] + [self.arnica_image[img][4] for img in selected_images]),
+            "exif_date": packLine([self.arnica_image[image][3]] + [self.arnica_image[img][3] for img in selected_images]),
             "target": self.arnica_image[image][0],
-            "original_images": packLine([image] + self.arnica_image.keys()),
-            "images": packLine([self.arnica_image[image][0]] + [self.arnica_image[img][0] for img in self.arnica_image.keys()]),
+            "original_images": packLine([image] + selected_images),
+            "images": packLine([self.arnica_image[image][0]] + [self.arnica_image[img][0] for img in selected_images]),
             "thumbnail": cache.url(self.request, self.arnica_image[image][1]),
             "thumbnail_width": self.thumbnail_width,
             "html_tools": self.html_show_tools(image),