Permalink
Browse files

add code to supply a table format of the events to be used in the TPF…

… wiki
  • Loading branch information...
1 parent f9589b4 commit 1c32daf3531025cddd28030fb1dbd3279cf4cf4b @szabgab committed Mar 21, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/PEG.pm
View
@@ -88,6 +88,24 @@ get '/events' => sub {
template 'events' => {events => \@events};
};
+get '/events/table' => sub {
+ my $html = "<h2>Events</h2>\n";
+ $html .= qq(<table border="1" style="border-collapse:collapse" options="" class="formatter_table">\n);
+ foreach my $e (@{ _content()->{events}{events} }) {
+ my $wiki = '&nbsp;';
+ if ($e->{wiki}) {
+ $e->{wiki} =~ s/ /_/g;
+ #$wiki = "http://perlfoundation.org/perl5/$e->{wiki}";
+ $wiki = qq(<a target="_top" href="https://www.socialtext.net/perl5/$e->{wiki}">$e->{wiki}</a>);
+ }
+ $html .= qq(<tr><td>$e->{date}</td><td><a href="$e-{>url}">$e->{title}</a></td><td>$e->{address}</td><td>$wiki</td></tr>\n);
+ }
+ $html .= "</table>\n";
+
+ return $html;
+};
+
+
get '/calendar' => sub {
my $calendar = Data::ICal->new();

0 comments on commit 1c32daf

Please sign in to comment.