[mb-commits] r9915 - in mb_server/branches/TemplateToolkit: lib/MusicBrainz/Server/Controller root/artist
root at musicbrainz.org
root at musicbrainz.org
Mon Jun 30 01:44:58 UTC 2008
Author: acid2
Date: 2008-06-30 01:44:58 +0000 (Mon, 30 Jun 2008)
New Revision: 9915
Added:
mb_server/branches/TemplateToolkit/root/artist/header.tt
mb_server/branches/TemplateToolkit/root/artist/landing.tt
mb_server/branches/TemplateToolkit/root/artist/tags.tt
Modified:
mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm
mb_server/branches/TemplateToolkit/root/artist/compact.tt
mb_server/branches/TemplateToolkit/root/artist/full.tt
Log:
Moved the compact/full views to use a main wrapper (landing) - also added simple support for tags
Modified: mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm
===================================================================
--- mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm 2008-06-30 00:32:57 UTC (rev 9914)
+++ mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm 2008-06-30 01:44:58 UTC (rev 9915)
@@ -28,6 +28,7 @@
use Encode qw( decode );
use MusicBrainz::Server::Artist;
use MusicBrainz::Server::Release;
+ use MusicBrainz::Server::Tag;
use MusicBrainz::Server::Validation;
use MusicBrainz;
use ModDefs;
@@ -45,6 +46,13 @@
$artist->SetMBId($mbid);
$artist->LoadFromId(1) or $c->error("Failed to load artist");
+ # Load tags
+ my $tagCount = 5;
+ my $t = MusicBrainz::Server::Tag->new($mb->{DBH});
+ my $tagHash = $t->GetTagHashForEntity('artist', $artist->GetId, $tagCount + 1);
+
+ my @tags = sort { $tagHash->{$b} <=> $tagHash->{$a}; } keys %{$tagHash};
+
# Load releases
my @releases = $artist->GetReleases(1, 1);
my $onlyHasVAReleases = (scalar @releases) == 0;
@@ -116,6 +124,7 @@
},
quality => ModDefs::GetQualityText($artist->GetQuality),
resolution => $artist->GetResolution,
+ tags => \@tags
};
# Releases, sorted into "release groups":
Modified: mb_server/branches/TemplateToolkit/root/artist/compact.tt
===================================================================
--- mb_server/branches/TemplateToolkit/root/artist/compact.tt 2008-06-30 00:32:57 UTC (rev 9914)
+++ mb_server/branches/TemplateToolkit/root/artist/compact.tt 2008-06-30 01:44:58 UTC (rev 9915)
@@ -1,7 +1,6 @@
[% WRAPPER "layout.tt" title=artist.name %]
+[% WRAPPER "artist/landing.tt" %]
-[% INCLUDE "artist/header.tt" %]
-
<h1>Releases</h1>
<table class="releasetypes">
[% FOREACH group IN groups %]
@@ -38,3 +37,4 @@
</table>
[% END %]
+[% END %]
Modified: mb_server/branches/TemplateToolkit/root/artist/full.tt
===================================================================
--- mb_server/branches/TemplateToolkit/root/artist/full.tt 2008-06-30 00:32:57 UTC (rev 9914)
+++ mb_server/branches/TemplateToolkit/root/artist/full.tt 2008-06-30 01:44:58 UTC (rev 9915)
@@ -1,7 +1,6 @@
[% WRAPPER "layout.tt" title=artist.name %]
+[% WRAPPER "artist/landing.tt" %]
-[% INCLUDE "artist/header.tt" %]
-
[% FOREACH group IN groups %]
<h2>[% group.name %]</h2>
[% FOREACH release IN group.releases %]
@@ -10,3 +9,4 @@
[% END %]
[% END %]
+[% END %]
Added: mb_server/branches/TemplateToolkit/root/artist/header.tt
Added: mb_server/branches/TemplateToolkit/root/artist/landing.tt
Added: mb_server/branches/TemplateToolkit/root/artist/tags.tt
More information about the MusicBrainz-commits
mailing list