[mb-commits] r9892 - in mb_server/branches/TemplateToolkit: lib/MusicBrainz/Server/Controller root/artist root/components root/layout/sidebar root/user
root at musicbrainz.org
root at musicbrainz.org
Sat Jun 28 09:19:52 UTC 2008
Author: acid2
Date: 2008-06-28 09:19:52 +0000 (Sat, 28 Jun 2008)
New Revision: 9892
Modified:
mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm
mb_server/branches/TemplateToolkit/root/artist/show.tt
mb_server/branches/TemplateToolkit/root/components/piped-list.tt
mb_server/branches/TemplateToolkit/root/layout/sidebar/user.tt
mb_server/branches/TemplateToolkit/root/user/profile.tt
Log:
Small bit more on artist pages, furthor progressing on the profile page (think this is done now, accept for what it links to)
Modified: mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm
===================================================================
--- mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm 2008-06-27 21:20:49 UTC (rev 9891)
+++ mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Artist.pm 2008-06-28 09:19:52 UTC (rev 9892)
@@ -27,6 +27,7 @@
require MusicBrainz;
require MusicBrainz::Server::Validation;
require MusicBrainz::Server::Artist;
+ require ModDefs;
if($mbid ne "")
{
@@ -47,7 +48,8 @@
start => $artist->GetBeginDate,
end => $artist->GetEndDate
},
- quality => '',
+ quality => ModDefs::GetQualityText($artist->GetQuality),
+ resolution => $artist->GetResolution,
};
$c->stash->{template} = 'artist/show.tt';
Modified: mb_server/branches/TemplateToolkit/root/artist/show.tt
===================================================================
--- mb_server/branches/TemplateToolkit/root/artist/show.tt 2008-06-27 21:20:49 UTC (rev 9891)
+++ mb_server/branches/TemplateToolkit/root/artist/show.tt 2008-06-28 09:19:52 UTC (rev 9892)
@@ -1,8 +1,45 @@
[% WRAPPER 'layout.tt' %]
+[% info_links = [
+ { link => "permalink", text => "Permenant Link" },
+ { link => "details", text => "Details" },
+ { link => "aliases", text => "Aliases" },
+ { link => "tags", text => "Tags" },
+ { link => "", text => "Releases" },
+ { link => "", text => "Appears On" },
+ { link => "", text => "Similar Artists" },
+ { link => "", text => "Search Google" }
+ ]
+%]
+
<div id="artistHeader">
<h1>[% artist.name %]</h1>
- <h2>[% artist.type %], [% artist.quality %]</h2>
+ [% IF artist.resolution %]
+ <h2>[% artist.resolution %]</h2>
+ [% END %]
+ <h2>Type: [% artist.type %],
+ [% artist.quality %] data quality</h2>
+
+ Info: [% INCLUDE "components/piped-list.tt" list=info_links %]
+
+ <div id="editLinks">
+ Edit:
+ [% IF logged_in %]
+ [% edit_links = [
+ { link => "", text => "Edit Artist" },
+ { link => "", text => "Merge Into" },
+ { link => "", text => "Subscribe" },
+ { link => "", text => "Add Release" },
+ { link => "", text => "Import Release" },
+ { link => "", text => "Add Non-Album Tracks" },
+ { link => "", text => "Change Data Quality" },
+ ]
+ %]
+ [% INCLUDE "components/piped-list.tt" list=edit_links %]
+ [% ELSE %]
+ <a href="[% c.uri_for('/user/login') %]">Log in</a> to edit this data
+ [% END %]
+ </div>
</div>
[% END %]
Modified: mb_server/branches/TemplateToolkit/root/components/piped-list.tt
===================================================================
--- mb_server/branches/TemplateToolkit/root/components/piped-list.tt 2008-06-27 21:20:49 UTC (rev 9891)
+++ mb_server/branches/TemplateToolkit/root/components/piped-list.tt 2008-06-28 09:19:52 UTC (rev 9892)
@@ -1,4 +1,6 @@
[% FOREACH list %]
+ [% UNLESS hide %]
<a href="[% link %]">[% text %]</a>
- [% UNLESS loop.last %] | [% END %]
+ [% "|" UNLESS loop.last %]
+ [% END %]
[% END %]
\ No newline at end of file
Modified: mb_server/branches/TemplateToolkit/root/layout/sidebar/user.tt
===================================================================
--- mb_server/branches/TemplateToolkit/root/layout/sidebar/user.tt 2008-06-27 21:20:49 UTC (rev 9891)
+++ mb_server/branches/TemplateToolkit/root/layout/sidebar/user.tt 2008-06-28 09:19:52 UTC (rev 9892)
@@ -1,12 +1,12 @@
<ul>
- <li><a href="/user/profile">My Profile</a></li>
- <li><a href="/user/logout">Logout</a></li>
- <li><a href="/user/preferences">Preferences</a></li>
+ <li><a href="[% c.uri_for('/user/profile') %]">My Profile</a></li>
+ <li><a href="[% c.uri_for('/user/logout') %]">Logout</a></li>
+ <li><a href="[% c.uri_for('/user/preferences') %]">Preferences</a></li>
<li>
<a href="/bad_link">Votes on Edits</a>
<ul>
<li><a href="/bad_link">Subscribed</a></li>
</ul>
</li>
- <li><a href="/bad_link">Donate!</a></li>
+ <li><a href="http://metabrainz.org/donate">Donate!</a></li>
</ul>
Modified: mb_server/branches/TemplateToolkit/root/user/profile.tt
===================================================================
--- mb_server/branches/TemplateToolkit/root/user/profile.tt 2008-06-27 21:20:49 UTC (rev 9891)
+++ mb_server/branches/TemplateToolkit/root/user/profile.tt 2008-06-28 09:19:52 UTC (rev 9892)
@@ -15,7 +15,7 @@
{ link => "", text => "Open Edits" },
{ link => "", text => "Failed Edits" },
{ link => "", text => "Cancelled Edits" },
- { link => "", text => "Subscriptions" },
+ { link => "", text => "Subscriptions", hide => not (viewing_own_profile or profile.public_subscriptions) },
]
%]
@@ -36,26 +36,38 @@
[% INCLUDE "components/piped-list.tt" list=edit_account_options
WRAPPER property name="Edit My Account" IF viewing_own_profile%]
- [% profile.name WRAPPER property name="Name" %]
+ [% profile.name | html_entity WRAPPER property name="Name" %]
- [% profile.type or "Unknown" WRAPPER property name="User Type" %]
+ [% IF (not viewing_own_profile) %]
+ [% WRAPPER property name="Contact"%]
+ <a href="[% c.uri_for('/user/contact', profile.name) %]">Send E-Mail</a>
+ [% END %]
+ [% END %]
+ [% (profile.type or "Unknown") | html_entity WRAPPER property name="User Type" %]
+
[% WRAPPER property name="E-Mail" %]
- [% viewing_own_profile ? profile.email.address or "[None]" : "[Hidden]" %]
+ [% IF viewing_own_profile %]
+ [% (profile.email.address or "[None]") | html_entity %]
+ [% ELSE %][Hidden][% END %]
[% IF profile.email.verified_at %]
- (verified [% profile.email.verified_at %])
+ (verified [% profile.email.verified_at |mb_date %])
[% ELSE %]
[% IF viewing_own_profile %](<em>unverified!</em>)[% END %]
[% END %]
[% END %]
- [% profile.homepage or "[None]" WRAPPER property name="Homepage" %]
+ [% WRAPPER property name="Homepage" %]
+ [% IF profile.hompage %]
+ <a href="[% profile.homepage | url %]">[% profile.homepage | html_entity %]</a>
+ [% ELSE %][None][% END %]
+ [% END %]
- [% profile.biography or "[None]" WRAPPER property name="Biography" %]
+ [% (profile.biography or "[None]") | html_entity WRAPPER property name="Biography" %]
[% WRAPPER property name="Subscriptions" %]
- [% viewing_own_profile ? "Your" : profile.name %] subscriptions are [% profile.public_subscriptions ? "public" : "private" %]
+ [% viewing_own_profile ? "Your" : profile.name | html_entity %] subscriptions are [% profile.public_subscriptions ? "public" : "private" %]
[% END %]
[% WRAPPER property name="Subscribers" %]
@@ -65,7 +77,13 @@
<h3>User Statistics</h3>
<dl>
- [% profile.member_since | mb_date WRAPPER property name="Member Since" %]
+ [% WRAPPER property name="Member Since" %]
+ [% IF profile.name == "Rob" %]the dawn of the project
+ [% ELSIF profile.is_special %]N/A
+ [% ELSIF profile.charter %]charter member
+ [% ELSE %][% profile.member_since | mb_date %]
+ [% END %]
+ [% END %]
[% profile.accepted_non_autoedits WRAPPER property name="Accepted Non-autoedits" %]
[% profile.accepted_autoedits WRAPPER property name="Autoedits" %]
[% profile.edits_voted_down WRAPPER property name="Edits Voted Down" %]
More information about the MusicBrainz-commits
mailing list