Permalink
Browse files

ironman widget

  • Loading branch information...
1 parent ab7d7b6 commit e4fc11373283384eb68fca66803664840d785f5b @yanick committed Aug 27, 2010
Showing with 57 additions and 0 deletions.
  1. +3 −0 galuga.conf
  2. +7 −0 lib/Galuga/Widget.pm
  3. +37 −0 lib/Galuga/Widget/Ironman.pm
  4. +2 −0 root/right_column.mason
  5. +8 −0 root/widgets/ironman.mason
View
@@ -27,6 +27,9 @@ template_extension .mason
</Model::DB>
<widgets>
+<ironman>
+ id yanick
+</ironman>
<cpan_author>
dist XML::XSS
dist XML::XPathScript
View
@@ -0,0 +1,7 @@
+package Galuga::Widget;
+
+use strict;
+use warnings;
+
+
+
@@ -0,0 +1,37 @@
+package Galuga::Widget::Ironman;
+
+use strict;
+use warnings;
+
+use Template::Declare::Tags;
+use base 'Template::Declare';
+
+template widget => sub {
+ my $self = shift;
+ my $c = shift;
+ my $id = $c->config->{widget}{ironman}{id};
+ my $gender = $c->config->{widget}{ironman}{gender} || 'male';
+
+ div {
+ attr { class => 'widget ironman' };
+ h3 {
+ a {
+ href is 'http://ironman.enlightenedperl.org/';
+ 'Perl Iron Man Challenge';
+ }
+ };
+
+ div {
+ align is 'center';
+ img {
+ src is
+ "http://ironman.enlightenedperl.org/munger/mybadge/$gender/${id}.png";
+ };
+ }
+
+ }
+
+};
+
+1;
+
View
@@ -2,6 +2,8 @@
<& /widgets/cpan_author.mason &>
+<& /widgets/ironman.mason &>
+
<& /widgets/twitter.mason &>
</div>
@@ -0,0 +1,8 @@
+<%once>
+use Template::Declare;
+use Galuga::Widget::Ironman;
+</%once>
+
+% Template::Declare->init( dispatch_to => [ 'Galuga::Widget::Ironman' ] );
+<% Template::Declare->show( 'widget', $c ) %>
+

0 comments on commit e4fc113

Please sign in to comment.