r10153 - in mb_server/branches/TemplateToolkit: lib/MusicBrainz/Server lib/MusicBrainz/Server/Adapter lib/MusicBrainz/Server/Controller root/css root/releases

by root-97 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View in Thread

Author: acid2
Date: 2008-07-23 14:21:18 +0000 (Wed, 23 Jul 2008)
New Revision: 10153

Modified:
   mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Adapter/Relations.pm
   mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Release.pm
   mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Release.pm
   mb_server/branches/TemplateToolkit/root/css/release.css
   mb_server/branches/TemplateToolkit/root/releases/full.tt
Log:
Fixes #3861 (mostly)

Modified: mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Adapter/Relations.pm
===================================================================
--- mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Adapter/Relations.pm 2008-07-23 14:06:06 UTC (rev 10152)
+++ mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Adapter/Relations.pm 2008-07-23 14:21:18 UTC (rev 10153)
@@ -136,7 +136,7 @@
 
 sub ExportLink
 {
-    my ($link, $linkType) = @_;
+    my ($link, $linkType, $entity) = @_;
 
     croak ("No link passed")
         unless defined $link and ref $link eq 'HASH';
@@ -157,7 +157,7 @@
         {
             case("amazon asin")
             {
-                my ($asin) = MusicBrainz::Server::CoverArt->ParseAmazonURL($link->{link1_name});
+                my ($asin) = MusicBrainz::Server::CoverArt->ParseAmazonURL($link->{link1_name}, $entity);
                 $name = $asin;
             }
 
@@ -168,8 +168,8 @@
 
             case("cover art link")
             {
-                my ($new_name, $coverurl, $new_url) = MusicBrainz::Server::CoverArt->ParseCoverArtURL($link->{link1_name});
-
+                my ($new_name, $coverurl, $new_url) = MusicBrainz::Server::CoverArt->ParseCoverArtURL($link->{link1_name}, $entity);
+                
                 $name = $new_name
                     if $new_name;
 

Modified: mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Release.pm
===================================================================
--- mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Release.pm 2008-07-23 14:06:06 UTC (rev 10152)
+++ mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Controller/Release.pm 2008-07-23 14:21:18 UTC (rev 10153)
@@ -143,17 +143,17 @@
     $c->stash->{show_artists}       = $c->req->query_params->{artist};
     $c->stash->{show_relationships} = defined $show_rels ? $show_rels : 1;
 
+    # Load Release Relationships
+    #
+    $c->stash->{relations} = LoadRelations($release, 'album');
+
     # Load Release
     #
     $c->stash->{release} = $release->ExportStash qw( puids   track_count
                                                      quality language
-                                                     type                );
+                                                     type    cover_art   );
 
 
-    # Load Release Relationships
-    #
-    $c->stash->{relations} = LoadRelations($release, 'album');
-
     # Load Artist
     #
     my $artist = MusicBrainz::Server::Artist->new($c->mb->{DBH});

Modified: mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Release.pm
===================================================================
--- mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Release.pm 2008-07-23 14:06:06 UTC (rev 10152)
+++ mb_server/branches/TemplateToolkit/lib/MusicBrainz/Server/Release.pm 2008-07-23 14:21:18 UTC (rev 10153)
@@ -379,6 +379,11 @@
                 };
             }
 
+            case('cover_art') {
+                $stash{has_artwork} = $self->GetCoverartURL ? 1 : 0;
+                $stash{cover_url  } = $self->GetCoverartURL;
+            }
+
             case('attributes') {
                 $stash{attributes} = [];
                 for ($self->GetAttributes) {

Modified: mb_server/branches/TemplateToolkit/root/css/release.css
===================================================================
--- mb_server/branches/TemplateToolkit/root/css/release.css 2008-07-23 14:06:06 UTC (rev 10152)
+++ mb_server/branches/TemplateToolkit/root/css/release.css 2008-07-23 14:21:18 UTC (rev 10153)
@@ -22,6 +22,19 @@
     margin-bottom: 10px;
 }
 
+div.release .release_top {
+    overflow: auto;
+}
+
+div.release .artwork {
+    float: right;
+    padding: 10px;
+}
+
+div.release .artwork img {
+    border: 1px dotted black;
+}
+
 div.release table.release_tracks {
     border-bottom: 1px solid black;
     width: 100%;

Modified: mb_server/branches/TemplateToolkit/root/releases/full.tt
===================================================================
--- mb_server/branches/TemplateToolkit/root/releases/full.tt 2008-07-23 14:06:06 UTC (rev 10152)
+++ mb_server/branches/TemplateToolkit/root/releases/full.tt 2008-07-23 14:21:18 UTC (rev 10153)
@@ -33,26 +33,33 @@
 
 <div class="release">
   [% INCLUDE "releases/box-header.tt" %]
-  <div class="infoLinks">
-    Info: [% INCLUDE "components/piped-list.tt" list=info_links %]
-  </div>
-  <div class="editLinks">
-    Edit:
-    [%- IF c.user_exists -%]
-      [%- edit_links = [
-            { link => '', text => 'Add relationship' },
-            { link => '', text => 'Relate to URL' },
-            { link => '', text => 'Add CC license' },
-          ] -%]
+  <div class="release_top">
+    [%- IF release.has_artwork -%]
+      <div class="artwork">
+        <img src="[% release.cover_url %]">
+      </div>
+    [%- END -%]
+    <div class="infoLinks">
+      Info: [% INCLUDE "components/piped-list.tt" list=info_links %]
+    </div>
+    <div class="editLinks">
+      Edit:
+      [%- IF c.user_exists -%]
+        [%- edit_links = [
+              { link => '', text => 'Add relationship' },
+              { link => '', text => 'Relate to URL' },
+              { link => '', text => 'Add CC license' },
+            ] -%]
         [% INCLUDE "components/piped-list.tt" list=edit_links %]
-    [%- ELSE -%]
-      Please <a href="[% c.uri_for('/user/login') %]">log in</a> to edit this release
-    [%- END -%]
+      [%- ELSE -%]
+        Please <a href="[% c.uri_for('/user/login') %]">log in</a> to edit this release
+      [%- END -%]
+    </div>
+    <div class="releasetags">
+      [% INCLUDE "tag/summary.tt" tags=tags source=release %]
+    </div>
   </div>
-  <div class="releasetags">
-    [% INCLUDE "tag/summary.tt" tags=tags source=release %]
-  </div>
-  <table class="release_tracks">
+  <table class="release_tracks" [%- IF release.has_artwork; 'style="border-top: 1px solid black;"'; END -%]>
     <tbody>
       [%- FOREACH track=tracks -%]
         <tr>


_______________________________________________
MusicBrainz-commits mailing list
MusicBrainz-commits@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-commits
LightInTheBox - Buy quality products at wholesale price!
 
Creative Commons EFF GPL LGPL
Original Design|vacubomb.com Contact Details Server Version: RELEASE-20060712