Converted the news section into a nicer CSS based layout
authorJoey Schulze <joey@infodrom.org>
Sat, 9 Dec 2006 19:59:12 +0000 (19:59 +0000)
committerJoey Schulze <joey@infodrom.org>
Sat, 9 Dec 2006 19:59:12 +0000 (19:59 +0000)
src/index.wml

index 23c73db..1962651 100644 (file)
@@ -46,35 +46,42 @@ genauso interessant, wie f&uuml;r den gewerblichen Einsatz.  <p>
        push (@top, $fname) if ($1 gt $pivot);
     }
 
        push (@top, $fname) if ($1 gt $pivot);
     }
 
+    $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 ($#top > -1) {
     if ($#top > -1) {
-:>
-<center>
-<border width=90% color=0000ff>
-<:
+        print '<div style="padding-top: 10px"></div>'."\n";
         while (my $news = shift @top) {
         while (my $news = shift @top) {
+            $needp = 0;  # 0 = init, 1 = <p> need, 2 = no <p> needed
            $news =~ /news-(\d+)-(\d+)-(\d+).txt/;
            $news =~ /news-(\d+)-(\d+)-(\d+).txt/;
-           $date = "$3.$2.$1";
+           $date = sprintf ("%d. %s %04d", $3, $month[$2], $1);
            if (open (NEWS, "News/$news")) {
            if (open (NEWS, "News/$news")) {
-               printf "<b>%s</b><br>", $date;
+               printf $head."\n", $date;
                while (<NEWS>) {
                    if (/\\$/) {
                        s,\\$,,;
                        chomp;
                    }
                while (<NEWS>) {
                    if (/\\$/) {
                        s,\\$,,;
                        chomp;
                    }
+
+                   if ($needp == 0) {
+                     if (substr($_, 0, 3) eq "<p>") {
+                       $needp = 2;
+                     } else {
+                       $needp = 1;
+                       print "<p>";
+                     }
+                   }
+
                    print;
                }
                close (NEWS);
                    print;
                }
                close (NEWS);
-               print "<div align=\"center\"><hr width=\"95%\"></center>" if ($#top > -1);
+               print "</p>" if ($needp == 1);
+               print $foot;
            }
        }
            }
        }
-:>
-</border>
-</center>
-<:
     }
 
 :>
     }
 
 :>
-<p>
 
 </page>
 
 
 </page>