diff options
| -rw-r--r-- | dev.buetow.org/content/home.xml | 46 | ||||
| -rw-r--r-- | dev.buetow.org/content/projectlist.inc.pl | 42 |
2 files changed, 43 insertions, 45 deletions
diff --git a/dev.buetow.org/content/home.xml b/dev.buetow.org/content/home.xml index 8d967d0..dbc3ba8 100644 --- a/dev.buetow.org/content/home.xml +++ b/dev.buetow.org/content/home.xml @@ -35,50 +35,6 @@ </text> </information> <text> - <perl> - # Ugly but works for now - my $hostroot = $config->get_hostroot(); - - sub getf ($) { - open my $f, $_[0] or die "$!: $_[0]\n"; - my @slurp = !!LT!!$f!!GT!!; - close $f; - @slurp; - } - - sub nl () { "!!LT!!br /!!GT!!\n" } - - sub list (*) { - my $tag = shift; - my @found = sort `find $hostroot -name $tag`; - my $ret = ''; - - - for my $found (@found) { - $found =~ /.*hosts.(.*?).$tag/; - my $host = $1; - - my @content = getf $found; - - $ret .= "!!LT!!b!!GT!!!!LT!!a href=http://$host!!GT!!$host!!LT!!/a!!GT!!!!LT!!/b!!GT!!" . nl;; - if (@content) { - $ret .= join " ", @content; - $ret .= nl; - } - $ret .= nl; - } - - $ret; - } - - my $ret = list PROJECT; - - $ret .= "!!LT!!b!!GT!!!!LT!!i!!GT!!Older projects (not active at the moment):!!LT!!/i!!GT!!!!LT!!/b!!GT!!" . nl x 2; - $ret .= list OLDPROJECT; - $ret .= "!!LT!!b!!GT!!!!LT!!i!!GT!!Obsolete projects (no work will be done anymore and the software may be broken):!!LT!!/i!!GT!!!!LT!!/b!!GT!!" . nl x 2; - $ret .= list OBSOLETEPROJECT; - - $ret; - </perl> + <includerun>projectlist.inc.pl</includerun> </text> </content> diff --git a/dev.buetow.org/content/projectlist.inc.pl b/dev.buetow.org/content/projectlist.inc.pl new file mode 100644 index 0000000..4d1d4f2 --- /dev/null +++ b/dev.buetow.org/content/projectlist.inc.pl @@ -0,0 +1,42 @@ +my $hostroot = $config->get_hostroot(); + +sub getf ($) { + open my $f, $_[0] or die "$!: $_[0]\n"; + my @slurp = <$f>; + close $f; + @slurp; +} + +sub nl () { "<br />\n" } + +sub list (*) { + my $tag = shift; + my @found = sort `find $hostroot -name $tag`; + my $ret = ''; + + + for my $found (@found) { + $found =~ /.*hosts.(.*?).$tag/; + my $host = $1; + + my @content = getf $found; + + $ret .= "<b><a href=http://$host>$host</a></b>" . nl; + if (@content) { + $ret .= join " ", @content; + $ret .= nl; + } + $ret .= nl; + } + + $ret; +} + +my $ret = list PROJECT; + +$ret .= "<b><i>Older projects (not active at the moment):</i></b>" . nl x 2; +$ret .= list OLDPROJECT; +$ret .= "<b><i>Obsolete projects (no work will be done anymore and the software may be broken):</i></b>" . nl x 2; +$ret .= list OBSOLETEPROJECT; + +return $ret; |
