Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ApacheGallery] Various improvements to Apache::Gallery



Hi,

I've made what I believe is a few minor improvements to the look
of the pages rendered by Apache::Gallery

- Less space wasted at the top of the page, above the picture,
  reducing the risk of having to scroll down, to see the bottom
  bit if the picture.
- Put the comment for the picture in a box seperate from the info
  to make it more visible.
- Render the directory comments in the same way we render picture
  info/comments, that is in a box with a dark background with the
  default style sheet.

Attached my changes, please consider them for inclusion in the next
release.

/Jesper

-- 
Jesper Skriver, jesper(at)skriver(dot)dk  -  CCIE #5456

One Unix to rule them all, One Resolver to find them,
One IP to bring them all and in the zone to bind them.
--- /usr/local/lib/perl5/site_perl/5.8.5/Apache/Gallery.pm.bak	Sun Nov 21 16:33:15 2004
+++ //usr/local/lib/perl5/site_perl/5.8.5/Apache/Gallery.pm	Sun Nov 21 16:52:17 2004
@@ -515,6 +515,8 @@
 				slideshowoff   => "$tpl_dir/slideshowoff.tpl",
 				pictureinfo    => "$tpl_dir/pictureinfo.tpl",
 				nopictureinfo  => "$tpl_dir/nopictureinfo.tpl",
+				picturecomment    => "$tpl_dir/picturecomment.tpl",
+				nopicturecomment  => "$tpl_dir/nopicturecomment.tpl",
 			       );
 
 		my $resolution = (($image_width > $orig_width) && ($height > $orig_height)) ? 
@@ -662,8 +664,7 @@
 			$tpl_vars{INFO} = "";
 		}
 
-		if ($exif_mode eq 'namevalue' && $foundinfo or $foundcomment) {
-
+		if ($exif_mode eq 'namevalue' && $foundinfo) {
 			$tpl_vars{PICTUREINFO} = fill_in_file($tpl_vars{pictureinfo},
 				HASH => \%tpl_vars
 			);
@@ -671,10 +672,22 @@
 			unless (defined($exifvalues)) {
 				$tpl_vars{EXIFVALUES} = "";
 			}
-
 		}
 		else {
 			$tpl_vars{PICTUREINFO} = fill_in_file($tpl_vars{nopictureinfo},
+					HASH => \%tpl_vars,
+			);
+		}
+
+		if ($foundcomment) {
+			$tpl_vars{PICTURECOMMENT} =
+				fill_in_file($tpl_vars{picturecomment},
+				HASH => \%tpl_vars
+			);
+		}
+		else {
+			$tpl_vars{PICTURECOMMENT} =
+					fill_in_file($tpl_vars{nopicturecomment},
 					HASH => \%tpl_vars,
 			);
 		}
<td width="60%">
          <center>
            <table align="center">
              <tr>
                <td>
									&nbsp;
                </td>
              </tr>
            </table>
          </center>
</td>
              <tr>
                 <td colspan="3">
                   <div id="comment">
                      { $COMMENT }
                   </div>
                 </td>
              </tr>
Only in .: #showpicture.tpl#
Only in .: a
diff -u /usr/local/apache/gallery/templates/dircomment.tpl ./dircomment.tpl
--- /usr/local/apache/gallery/templates/dircomment.tpl	Fri Nov 19 17:24:28 2004
+++ ./dircomment.tpl	Sun Nov 21 16:53:43 2004
@@ -2,7 +2,7 @@
   <td>
 <table class="info">
   <tr>
-    <td>
+    <td id="comment">
     { $COMMENT }
     </td>
   </tr>
Only in .: nopicturecomment.tpl
Only in .: picturecomment.tpl
diff -u /usr/local/apache/gallery/templates/pictureinfo.tpl ./pictureinfo.tpl
--- /usr/local/apache/gallery/templates/pictureinfo.tpl	Fri Nov 19 17:24:28 2004
+++ ./pictureinfo.tpl	Sun Nov 21 16:49:00 2004
@@ -2,7 +2,6 @@
                  <td colspan="3">
                    <div id="comment">
                       { $INFO }
-                      { $COMMENT }
                    </div>
                  </td>
               </tr>
diff -u /usr/local/apache/gallery/templates/showpicture.tpl ./showpicture.tpl
--- /usr/local/apache/gallery/templates/showpicture.tpl	Fri Nov 19 17:24:28 2004
+++ ./showpicture.tpl	Sun Nov 21 17:01:30 2004
@@ -1,30 +1,37 @@
 <div id="page">
-  <div id="title">
-    { $MENU }
-  </div>
-
-  <div id="menu">
-{ $BACK } - <a href="./">up</a> - { $NEXT }</div>
+  <table width=100% border=0 cellspacing=0 cellpadding=0>
+    <tr>
+      <td align="LEFT" id="title">
+        { $MENU }
+      </td>
+      <td align="RIGHT" id="menu">
+        { $BACK } - <a href="./">up</a> - { $NEXT }
+      </td>
+    </tr>
+    <tr>
+      <td align="CENTER" id="picture" colspan=2>
+        IMG { $NUMBER } of { $TOTAL }
+      </td>
+    </tr>
+  </table>
   <div>
-    <table>
+    <table border=0 cellspacing=0 cellpadding=0>
       <tr>
-
-        <td colspan="3" id="picture">
-          IMG { $NUMBER } of { $TOTAL } { $EXIFVALUES } <br><br>
-          <img src="{ $SRC }" alt="* Image { $NUMBER }"><br><br>
-[ Size: { $SIZES } | Slideshow: { $SLIDESHOW } ]</td>
-
-              </tr>
-              { $PICTUREINFO }
+       <td colspan="3" id="picture">
+          { $EXIFVALUES }
+          <img src="{ $SRC }" alt="* Image { $NUMBER }"><br>
+          [ Size: { $SIZES } | Slideshow: { $SLIDESHOW } ]
+       </td>
+      </tr>
+      { $PICTUREINFO }
+      { $PICTURECOMMENT }
+      <tr>
+	<td colspan="3">
+	  <div id="gallery">
+	  <a href="http://apachegallery.dk/";>Apache::Gallery</a> &copy; 2001-2004 Michael Legart, <a href="http://www.hestdesign.com/";>Hest Design</a>
+	  </div>
+	</td>
       </tr>
-	  <tr>
-	  	<td colspan="3">
-		  <div id="gallery">
-		  <a href="http://apachegallery.dk/";>Apache::Gallery</a> &copy; 2001-2004 Michael Legart, <a href="http://www.hestdesign.com/";>Hest Design</a>
-
-		  </div>
-		</td>
-	  </tr>
     </table>
   </div>
 </div>