Author: keschte
Date: 2006-08-12 16:14:11 +0000 (Sat, 12 Aug 2006)
New Revision: 8395
Modified:
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/album
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/albumcollapsed
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_begin
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_end
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_summary
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_track
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/track_relationships
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/show/release/index.html
Log:
added "show relationships" toggle link to the release page. the "show artists"
and "show relationships" links will now be carried in the session, and be used
on the pages which do not override this value. another click on the show/hide
xxx link will toggle this behaviour.
Modified: mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/album
===================================================================
--- mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/album
2006-08-12 14:43:09 UTC (rev 8394)
+++ mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/album
2006-08-12 16:14:11 UTC (rev 8395)
@@ -38,21 +38,41 @@
$showlinks => 1 # TODO: link|showlinks make consistent.
$showmodlinks => 1
$showcollapsed => 0
- $showrelationships => 1
+ $ex => ""
- $ex => ""
- $mbtagger => $session{'mbt'}
$showids => 0
$showtag => 0
$showreleases => 0
$tagchecked => 0
$tracks => undef
- $showtrackartists => 0
$releaseevents => undef
+ $mbt => $session{"mbt"}
+
+ # show track artists toggle is stored in the session, but
+ # allows to override setting with passed in values.
+ # (ie pages which do not want the track artists to be shown)
+ $showtrackartists => $session{"showtrackartists"}
+
+ # show track relationships toggle is stored in the session, but
+ # allows to override setting with passed in values.
+ # (ie pages which do not want the track artists to be shown)
+ $showrelationships => $session{"showrelationships"}
+
+ # the toggle function is only available on the "show release"
+ # page, because the parameters need to be handled and written
+ # to the session. any other page which wants to handle the
+ # arguments will need to provide the same funcationlity than
+ # the "show release" page.
+ $showrelationshipstoggle => 0
+ $showtrackartiststoggle => 0
+
</%args>
<%perl>
+ $showtrackartists = 0 if (not defined $showtrackartists);
+ $showrelationships = 1 if (not defined $showrelationships);
+
$mb = $m->comp("/comp/dblogin") if (not defined $mb);
# always load multiple artist tracks
@@ -77,7 +97,8 @@
linktype => "collapse",
link => $url,
showtag => $showtag,
- tagchecked => $tagchecked);
+ tagchecked => $tagchecked
+ );
}
else
{
@@ -88,7 +109,11 @@
showmodlinks => $showmodlinks,
showtag => $showtag,
tagchecked => $tagchecked,
- showtrackartists => $showtrackartists);
+ showtrackartists => $showtrackartists,
+ showrelationships => $showrelationships,
+ showtrackartiststoggle =>
$showtrackartiststoggle,
+ showrelationshipstoggle =>
$showrelationshipstoggle
+ );
}
my $trmcounts = $album->LoadTRMCount();
@@ -114,25 +139,33 @@
track => $track,
tindex => $i,
highlight => $highlighttracks->{$track->GetId},
- showmodlinks => $showmodlinks,
+ showeditlinks => $showmodlinks,
trmcount => $tcount,
puidcount => $pcount,
- mbtagger => $mbtagger,
+ mbt => $mbt,
showtrackartists => $showtrackartists,
showrelationships => $showrelationships,
- highlightonly => $highlightonly);
+ highlightonly => $highlightonly
+ );
}
}
$m->comp("/comp/release/release_summary",
- artist => $artist, album => $album,
- showmodlinks => $showmodlinks,
- showtrackartists => $showtrackartists);
+ artist => $artist,
+ album => $album,
+ showeditlinks => $showmodlinks,
+ showtrackartists => $showtrackartists
+ );
$m->comp("/comp/release/release_end",
- artist => $artist, album => $album, showmodlinks =>
$showmodlinks,
- showids => $showids, showreleases => $showreleases,
- showtrackartists => $showtrackartists, link => $link,
releaseevents => $releaseevents);
+ artist => $artist,
+ album => $album,
+ showeditlinks => $showmodlinks,
+ showdiscids => $showids,
+ showreleaseevents => $showreleases,
+ releaseevents => $releaseevents,
+ showtrackartists => $showtrackartists
+ );
</%perl>
Modified: mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/albumcollapsed
===================================================================
--- mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/albumcollapsed
2006-08-12 14:43:09 UTC (rev 8394)
+++ mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/albumcollapsed
2006-08-12 16:14:11 UTC (rev 8395)
@@ -46,20 +46,28 @@
$link .= $ex . "&short=$short&compact=0#al" . $album->GetId();
$m->comp("/comp/release/release_begin",
- album => $album, artist => $artist,
+ album => $album,
+ artist => $artist,
linktype => "expand",
- showlinks => 0, showmodlinks => 0, link => $link,
+ showlinks => 0,
+ showmodlinks => 0,
+ link => $link,
showtag => $showtag
);
$m->comp("/comp/release/release_summary",
- artist => $artist, album => $album,
+ artist => $artist,
+ album => $album,
showmodlinks => 0
);
$m->comp("/comp/release/release_end",
- artist => $artist, album => $album,
- showids => 0, showlinks => 0, showmodlinks => 0, link => 0,
+ artist => $artist,
+ album => $album,
+ showids => 0,
+ showlinks => 0,
+ showmodlinks => 0,
+ link => 0,
showreleases => $showreleases);
</%perl>
Modified:
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_begin
===================================================================
---
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_begin
2006-08-12 14:43:09 UTC (rev 8394)
+++
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_begin
2006-08-12 16:14:11 UTC (rev 8395)
@@ -35,8 +35,13 @@
$showlinks => 1
$showmodlinks => 1
- $showtrackartists => 0
+ $showtrackartists => $session{"showtrackartists"}
+ $showtrackartiststoggle => 0
+
+ $showrelationships => $session{"showrelationships"}
+ $showrelationshipstoggle => 0
+
$link => ""
$linktype => ""
@@ -87,7 +92,7 @@
alt="Open in tagger" /></a></td>
% }
-% if ($session{uid} && !$nonalbum && $showtag)
+% if ($session{"uid"} && !$nonalbum && $showtag)
% {
<td class="batchop" id="batchop::<% $releaseid %>">
@@ -121,7 +126,8 @@
$m->out(qq! | <a
href="/show/release/details.html?releaseid=$releaseid">Details</a>!);
$m->out(qq! | !);
$m->comp("/comp/googlelink", search => [
$artist->GetName, $name ], text => "Search google");
- if ($session{uid} and !$nonalbum)
+
+ if ($session{"uid"} and !$nonalbum)
{
$m->out(qq! | <a
href="/mod/search/pre/album.html?releaseid=$releaseid">View edits</a>!);
}
@@ -156,11 +162,27 @@
$m->out(qq! | <a
href="/edit/track/add.html?releaseid=$releaseid">Add track</a>!);
}
$m->out(qq! | <a
href="/edit/album/move.html?releaseid=$releaseid">Move</a>!);
- if ($artistid != &ModDefs::VARTIST_ID
&& !$showtrackartists and !$nonalbum)
+
+ # only show the track artists toggle
function if the page using the /comp/album
+ # parameter handles the arguments
+ if ($showtrackartiststoggle &&
$artistid != &ModDefs::VARTIST_ID && !$nonalbum)
{
- $m->out(qq! | <a
href="/show/release/?releaseid=$releaseid&showtrackartists=1">Show artists</a>!);
+ my $newtext =
($showtrackartists ? "Hide" : "Show")." artists";
+ my $newvalue =
($showtrackartists ? 0 : 1);
+
+ $m->out(qq! | <a
href="/show/release/?releaseid=$releaseid&showtrackartists=$newvalue">$newtext</a>!);
}
+ # only show the track relationships
toggle function if the page using the /comp/album
+ # parameter handles the arguments
+ if ($showrelationshipstoggle)
+ {
+ my $newtext =
($showrelationships ? "Hide" : "Show")." relationships";
+ my $newvalue =
($showrelationships ? 0 : 1);
+
+ $m->out(qq! | <a
href="/show/release/?releaseid=$releaseid&showrelationships=$newvalue">$newtext</a>!);
+ }
+
if (!$release->HasMultipleTrackArtists)
{
$m->out(qq! | <a
href="/edit/album/mac.html?releaseid=$releaseid">Convert to multiple artists</a>!);
Modified:
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_end
===================================================================
--- mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_end
2006-08-12 14:43:09 UTC (rev 8394)
+++ mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_end
2006-08-12 16:14:11 UTC (rev 8395)
@@ -31,12 +31,14 @@
$artist
$album
- $showids => 1
- $showreleases => 0
- $showmodlinks => 1
- $showtrackartists => 0
+ $showdiscids
+ $showreleaseevents
+
+ $showeditlinks
$releaseevents => undef
+ $showtrackartists
+
</%args>
<%perl>
@@ -45,7 +47,7 @@
my $releaseid = $release->GetId;
my $isva = $release->HasMultipleTrackArtists || $showtrackartists;
- if ($showids)
+ if ($showdiscids)
{
my @ids = @{ $release->GetDiscIDs };
@@ -85,7 +87,7 @@
<td class="length"><% $duration %></td>
% # 3. Edit Links
-% if ($session{"uid"} and $showmodlinks)
+% if ($session{"uid"} and $showeditlinks)
% {
% my $tocid = $cdtoc->GetId();
@@ -104,7 +106,7 @@
</table>
-% if ($showreleases and not $release->IsNonAlbumTracks)
+% if ($showreleaseevents and not $release->IsNonAlbumTracks)
% {
<table id="releaseevents::<% $releaseid %>" class="releaseevents">
@@ -150,7 +152,7 @@
</td>
-% if ($session{"uid"} and $showmodlinks)
+% if ($session{"uid"} and $showeditlinks)
% {
<td class="links">
Modified:
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_summary
===================================================================
---
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_summary
2006-08-12 14:43:09 UTC (rev 8394)
+++
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_summary
2006-08-12 16:14:11 UTC (rev 8395)
@@ -31,9 +31,10 @@
$album
$artist
- $showmodlinks => 1
- $showtrackartists => 0
+ $showeditlinks
+ $showtrackartists
+
</%args>
<%perl>
@@ -44,7 +45,7 @@
my $isva = $release->HasMultipleTrackArtists || $showtrackartists;
my $colspan = 3;
- $colspan++ if ($showmodlinks);
+ $colspan++ if ($showeditlinks);
$colspan++ if ($isva);
my $trackcount = $release->GetTrackCount();
@@ -109,7 +110,7 @@
$editwhat = "";
$m->out("</a> ]");
- if ($session{"uid"} and $showmodlinks)
+ if ($session{"uid"} and $showeditlinks)
{
$m->out(sprintf qq! <a
href="/edit/albumlanguage/edit.html?id=%s" title="%s">Edit%s</a>!,
$release->GetId(),
@@ -150,7 +151,7 @@
$m->out("</a> ]");
}
- if ($session{"uid"} and $showmodlinks)
+ if ($session{"uid"} and $showeditlinks)
{
$m->out(sprintf qq! <a
href="/edit/album/editattributes.html?id=%s" title="%s">Edit</a>!,
$release->GetId(),
Modified:
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_track
===================================================================
---
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_track
2006-08-12 14:43:09 UTC (rev 8394)
+++
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/release_track
2006-08-12 16:14:11 UTC (rev 8395)
@@ -37,14 +37,14 @@
$highlight
$highlightonly => 0
- $showmodlinks
- $showtrackartists => 0
- $showrelationships => 1
-
$trmcount => 0
$puidcount => 0
- $mbtagger => $session{'mbt'}
+ $showeditlinks
+ $mbt
+ $showtrackartists
+ $showrelationships
+
</%args>
<%perl>
@@ -84,7 +84,7 @@
# the windows-tagger works track based, show the tagger icon.
- if ($mbtagger && $showmodlinks and $track->GetId)
+ if ($mbt && $showeditlinks and $track->GetId)
{
$m->out(qq!<a href="tag:! . $track->GetMBId() . ':' .
$album->GetMBId() . qq!">!);
$m->out(qq!<img src="/images/mblookup-tag.gif" alt="Tag"
title="Tag the current track" !);
@@ -116,7 +116,7 @@
if ($track->GetId && $showrelationships)
{
- $m->comp("/comp/release/track_relationships", mb => $mb, track
=> $track, showmodlinks => $showmodlinks);
+ $m->comp("/comp/release/track_relationships", mb => $mb, track
=> $track, showeditlinks => $showeditlinks);
}
$m->out("</td>\n");
@@ -132,7 +132,7 @@
my $artist = $m->comp("/comp/loadartist", $mb,
$track->GetArtist);
$m->comp("/comp/linkartist", artist => $artist, strong => 0,
icon => 0);
- if (exists $session{user} and $showmodlinks)
+ if (exists $session{user} and $showeditlinks)
{
$m->out(sprintf qq! (<a
href="/edit/track/change.html?releaseid=%s&tindex=%s&solo=1">Change</a>)!,
$album->GetId(),
@@ -155,7 +155,7 @@
$m->out("</td>\n");
# 5. links
- if ($session{uid} and $showmodlinks)
+ if ($session{uid} and $showeditlinks)
{
$m->out(qq!<td class="links">!);
$m->out(sprintf qq!<a
href="/edit/track/edit.html?releaseid=%s&trackid=%s" title="%s">Edit</a>!,
Modified:
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/track_relationships
===================================================================
---
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/track_relationships
2006-08-12 14:43:09 UTC (rev 8394)
+++
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/comp/release/track_relationships
2006-08-12 16:14:11 UTC (rev 8395)
@@ -30,7 +30,7 @@
$mb
$track
- $showmodlinks
+ $showeditlinks
</%args>
<%perl>
@@ -129,7 +129,7 @@
$m->out('</span>')
if ($max == 1 && $item->{modpending});
- if ($session{uid} && $showmodlinks && $expanded)
+ if ($session{"uid"} && $showeditlinks && $expanded)
{
$m->out('</td><td align="right" valign="top">');
$m->out('<nobr> [ <a
href="/edit/relationship/remove.html?type=' . $item->{link0_type} . '-' .
Modified:
mb_server/branches/RELEASE_20060712-BRANCH/htdocs/show/release/index.html
===================================================================
--- mb_server/branches/RELEASE_20060712-BRANCH/htdocs/show/release/index.html
2006-08-12 14:43:09 UTC (rev 8394)
+++ mb_server/branches/RELEASE_20060712-BRANCH/htdocs/show/release/index.html
2006-08-12 16:14:11 UTC (rev 8395)
@@ -33,16 +33,17 @@
$discid => undef
- $mbt => $session{"mbt"}
- $tport => $session{"tport"}
-
$addrel => 0
$remrel => -1
$remtype => ""
$arcancel => 0
- $showtrackartists => 0
+ $mbt => $session{"mbt"}
+ $tport => $session{"tport"}
+ $showtrackartists => $session{"showtrackartists"}
+ $showrelationships => $session{"showrelationships"}
+
</%args>
<%perl>
@@ -63,10 +64,18 @@
text => "You need to specify either a valid
mbid or a releaseid argument");
}
- # check tagger session stuff
- UserStuff::EnsureSessionOpen(), $session{mbt} = 1 if $mbt;
- UserStuff::EnsureSessionOpen(), $session{tport} = $tport if $tport;
+ # get passed in tagger settings, and write to session
+ UserStuff::EnsureSessionOpen(), $session{"mbt"} = 1 if $mbt;
+ UserStuff::EnsureSessionOpen(), $session{"tport"} = $tport if $tport;
+ # get passed in or default "show track artist" setting , and write to
session
+ $showtrackartists = 0 if (not defined $showtrackartists);
+ UserStuff::EnsureSessionOpen(), $session{"showtrackartists"} =
$showtrackartists;
+
+ # get passed in or default "show track relationships" setting , and
write to session
+ $showrelationships = 1 if (not defined $showrelationships);
+ UserStuff::EnsureSessionOpen(), $session{"showrelationships"} =
$showrelationships;
+
# Instantiate MusicBrainz object, and load release entities
my $mb = $m->comp("/comp/dblogin");
my $release = $m->comp("/comp/loadrelease", $mb, $mbid || $releaseid);
@@ -132,9 +141,14 @@
<& /edit/annotation/latest, album => $release, explain => 1 &>
<br />
- <& /comp/album, album => $release, artist => $artist,
- mbtagger => $mbt, showids => 1, showtag => 1, showreleases => 1,
- showtrackartists => $showtrackartists,
+ <& /comp/album,
+ album => $release,
+ artist => $artist,
+ showids => 1,
+ showtag => 1,
+ showreleases => 1,
+ showtrackartiststoggle => 1,
+ showrelationshipstoggle => 1
&>
<& /comp/js/diffcollapse, JSCollapse => 0 &>
|