Improve the visible representation of news by using manually crafted CSS
authorJoey Schulze <joey@infodrom.org>
Thu, 9 Nov 2006 16:34:52 +0000 (16:34 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 9 Nov 2006 16:34:52 +0000 (16:34 +0000)
src/News/index.wml
src/News/olds.wml

index fc9a1b9..7a1e532 100644 (file)
@@ -4,8 +4,11 @@
 
 <h3>Nachrichten der LUGO und zu GNU/Linux</h3>
 
+<div style="padding-top: 10px"></div>
 <:
     $limit = 5;
+    $head = '<div class="news"><div class="newsbody"><h3 class="newstitle">%s</h3><div class="newscontent">';
+    $foot = '</div></div></div>';
     @month = ('dummy','Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember');
 
     if (opendir (NEWS, ".")) {
@@ -18,7 +21,7 @@
         $news[$i] =~ /news-(\d+)-(\d+)-(\d+).txt/;
        $date = sprintf ("%d. %s %04d", $3, $month[$2], $1);
        if (open (NEWS, $news[$i])) {
-           printf "<b>%s</b><br>", $date;
+           printf $head."\n", $date;
            while (<NEWS>) {
                if (/\\$/) {
                    s,\\$,,;
@@ -37,7 +40,8 @@
                print;
            }
            close (NEWS);
-           print "<hr>" if ($i+1 < $limit && $i+1 < $#news);
+           print "</p>" if ($needp == 1);
+           print $foot;
        }
     }
 
index 6b3daf9..8021a82 100644 (file)
@@ -4,9 +4,12 @@
 
 <h3>Ältere Nachrichten</h3>
 
+<div style="padding-top: 10px"></div>
 <:
     $limit = 5;
     @month = ('dummy','Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember');
+    $head = '<div class="news"><div class="newsbody"><h3 class="newstitle">%s</h3><div class="newscontent">';
+    $foot = '</div></div></div>';
 
     if (opendir (NEWS, ".")) {
        @news = reverse (sort (grep (/^news-.*\.txt$/,readdir (NEWS))));
@@ -18,7 +21,7 @@
         $news[$i] =~ /news-(\d+)-(\d+)-(\d+).txt/;
        $date = sprintf ("%d. %s %04d", $3, $month[$2], $1);
        if (open (NEWS, $news[$i])) {
-           printf "<b>%s</b><br>", $date;
+           printf $head."\n", $date;
            while (<NEWS>) {
                if (/\\$/) {
                    s,\\$,,;
@@ -37,7 +40,8 @@
                print;
            }
            close (NEWS);
-           print "<hr>" if ($i+1 < $#news);
+           print "</p>" if ($needp == 1);
+           print $foot;
        }
     }
 :>