Created
August 29, 2009 00:47
-
-
Save rassie/177346 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private template 'header' => sub { | |
my ($artist) = @_; | |
# Given over on $stash, here as an example | |
my $link_hash = { | |
overview => 'http://test.musicbrainz.org/artist/06fb1c8b-566e-4cb2-985b-b467c90781d4', | |
releases => 'http://test.musicbrainz.org/artist/06fb1c8b-566e-4cb2-985b-b467c90781d4/releases', | |
}; | |
my $titles = { | |
overview => __('Overview'), | |
releases => __('Releases'), | |
} | |
my @link_bar = qw/overview releases/ | |
div { | |
class is 'artistheader'; | |
h1 { show('artist_link', $artist) }; | |
p { | |
class is 'subheader'; | |
span { '~' }; outs $artist->type_name; | |
} | |
} | |
div { | |
class is 'tabs'; | |
ul { | |
class is 'tabs'; | |
map { | |
# TODO: some logic for class="sel" | |
if ($link_hash->{$_} && $titles->{$_}) { | |
li { | |
a { | |
href is $link_hash->{$_}; | |
outs $title->{$_}; | |
} | |
} | |
} | |
} @link_bar; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment