changeset 277:0430039fe8c5

text_x_arnica.: fixed clearing of floating style for one image independent of number of columns, moved br style to a class definition
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 16 Sep 2008 12:27:06 +0200
parents e3c509f99aad
children 03071c3569d8
files data/plugin/parser/text_x_arnica.py htdocs/arnica/css/text_x_arnica.css
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Tue Sep 16 11:55:05 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Tue Sep 16 12:27:06 2008 +0200
@@ -384,11 +384,13 @@
             self.request.write(self.formatter.div(0))
 
         col_count = 1
+        cols = min([self.columns, len(self.arnica_image)])
         result = []
         image_names = self.arnica_image.keys()
         index = [self.arnica_image[img][4] for img in image_names]
         selected_images = [image_names[int(idx)] for idx in index]
         if self.album:
+            cols = 1
             album_image = self.album_image or self.arnica_image.keys()[0] #self.high_resolution_image[0]
             if not album_image in self.arnica_image.keys():
                 html = self.formatter.text(_("""You can't use as album image:
@@ -396,15 +398,14 @@
 in your item list!""") % {"album_image": album_image, })
             else:
                 html = self.html_arrange_thumbnails(album_image, selected_images)
-
             result.append(''.join(html))
         else:
             for image in selected_images:
                 html = self.html_arrange_thumbnails(image, selected_images)
                 result.append(''.join(html))
-                if col_count == self.columns and self.columns != 0:
+                if col_count == cols and self.columns != 0:
                     col_count = 0
-                    result.append('<br style=clear:both>')
+                    result.append('<br class="clearboth">')
                 col_count += 1
 
         return ''.join(result)
--- a/htdocs/arnica/css/text_x_arnica.css	Tue Sep 16 11:55:05 2008 +0200
+++ b/htdocs/arnica/css/text_x_arnica.css	Tue Sep 16 12:27:06 2008 +0200
@@ -9,6 +9,8 @@
 
 body { min-height: 100%; position: relative; }
 
+.clearboth { clear: both; }
+
 div.arnica {
     position: relative;
     display: block;