Now handling multi artists in tracks, playqueue and play history views
This commit is contained in:
@@ -16,16 +16,18 @@
|
||||
|
||||
<message id="Lms.PlayHistory.template.entry">
|
||||
<div class="row Lms-playhistory-entry Lms-vertical-align">
|
||||
<div class="col-xs-9">
|
||||
<div class="col-xs-12 Lms-playhistory-entry-name">
|
||||
<h4>${name}</h4>
|
||||
</div>
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
${<if-has-release>}<small>${release-name class="Lms-explore-releasename"}</small>${</if-has-release>}
|
||||
</div>
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
${<if-has-artist>}<small>${artist-name class="Lms-explore-artistname"}</small>${</if-has-artist>}
|
||||
${<if-has-artists-or-release>}
|
||||
${<if-has-release>}<small>${release class="Lms-explore-releasename"}</small>${</if-has-release>}
|
||||
${<if-has-artists>}<small>${artists}</small>${</if-has-artists>}
|
||||
${</if-has-artists-or-release>}
|
||||
</div>
|
||||
</div>
|
||||
</message>
|
||||
|
||||
<message id="Lms.PlayHistory.template.entry-artist">
|
||||
${artist class="Lms-explore-artistname"}
|
||||
</message>
|
||||
|
||||
</messages>
|
||||
|
||||
@@ -42,14 +42,12 @@
|
||||
|
||||
<message id="Lms.PlayQueue.template.entry">
|
||||
<div class="row Lms-playqueue-entry Lms-vertical-align">
|
||||
<div class="col-xs-9">
|
||||
<div class="col-xs-9 Lms-playqueue-entry-name">
|
||||
<h4>${name}</h4>
|
||||
</div>
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
${<if-has-release>}<small>${release-name class="Lms-explore-releasename"}</small>${</if-has-release>}
|
||||
</div>
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
${<if-has-artist>}<small>${artist-name class="Lms-explore-artistname"}</small>${</if-has-artist>}
|
||||
${<if-has-artists-or-release>}
|
||||
${<if-has-release>}<small>${release class="Lms-explore-releasename"}</small>${</if-has-release>}
|
||||
${<if-has-artists>}<small>${artists}</small>${</if-has-artists>}
|
||||
${</if-has-artists-or-release>}
|
||||
</div>
|
||||
<div class="col-xs-3 Lms-playqueue-entry-controls">
|
||||
${play-btn}${del-btn}
|
||||
@@ -57,4 +55,8 @@
|
||||
</div>
|
||||
</message>
|
||||
|
||||
<message id="Lms.PlayQueue.template.entry-artist">
|
||||
${artist class="Lms-explore-artistname"}
|
||||
</message>
|
||||
|
||||
</messages>
|
||||
|
||||
+1
-4
@@ -38,10 +38,7 @@
|
||||
</message>
|
||||
|
||||
<message id="Lms.Explore.Release.template.entry-artist">
|
||||
${artist class="Lms-explore-artistname Lms-explore-release-entry-artist"}
|
||||
${artist class="Lms-explore-artistname"}
|
||||
</message>
|
||||
|
||||
|
||||
|
||||
|
||||
</messages>
|
||||
|
||||
+9
-7
@@ -24,14 +24,12 @@
|
||||
|
||||
<message id="Lms.Explore.Tracks.template.entry">
|
||||
<div class="row Lms-explore-tracks-entry Lms-vertical-align">
|
||||
<div class="col-xs-9">
|
||||
<div class="col-xs-9 Lms-explore-tracks-entry-name">
|
||||
<h4>${name}</h4>
|
||||
</div>
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
${<if-has-release>}<small>${release-name class="Lms-explore-releasename"}</small>${</if-has-release>}
|
||||
</div>
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
${<if-has-artist>}<small>${artist-name class="Lms-explore-artistname"}</small>${</if-has-artist>}
|
||||
${<if-has-artists-or-release>}
|
||||
${<if-has-release>}<small>${release class="Lms-explore-releasename"}</small>${</if-has-release>}
|
||||
${<if-has-artists>}<small>${artists}</small>${</if-has-artists>}
|
||||
${</if-has-artists-or-release>}
|
||||
</div>
|
||||
<div class="col-xs-3 Lms-explore-tracks-entry-controls">
|
||||
${play-btn}${add-btn}
|
||||
@@ -39,4 +37,8 @@
|
||||
</div>
|
||||
</message>
|
||||
|
||||
<message id="Lms.Explore.Tracks.template.entry-artist">
|
||||
${artist class="Lms-explore-artistname"}
|
||||
</message>
|
||||
|
||||
</messages>
|
||||
|
||||
+24
-9
@@ -185,10 +185,6 @@ a:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.Lms-explore-release-entry-artist {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.Lms-explore-releaselink {
|
||||
margin: 0px;
|
||||
padding-top: 4px;
|
||||
@@ -241,8 +237,14 @@ a:hover {
|
||||
|
||||
.Lms-explore-tracks-entry {
|
||||
min-height: 32px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: lightgrey;
|
||||
border-bottom-width: thin;
|
||||
}
|
||||
|
||||
.Lms-explore-tracks-entry-name {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.Lms-explore-tracks-entry:hover {
|
||||
@@ -273,15 +275,21 @@ a:hover {
|
||||
}
|
||||
|
||||
.Lms-playqueue-entry {
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: lightgrey;
|
||||
border-bottom-width: thin;
|
||||
min-height: 32px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.Lms-playqueue-entry:hover {
|
||||
background-color: lightgrey;
|
||||
}
|
||||
|
||||
.Lms-playqueue-entry-name {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.Lms-playqueue-entry-controls {
|
||||
text-align: right;
|
||||
}
|
||||
@@ -309,14 +317,21 @@ a:hover {
|
||||
}
|
||||
|
||||
.Lms-playhistory-entry {
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: lightgrey;
|
||||
border-bottom-width: thin;
|
||||
min-height: 32px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.Lms-playhistory-entry:hover {
|
||||
background-color: lightgrey;
|
||||
}
|
||||
|
||||
.Lms-playhistory-entry-name {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.Lms-player {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
||||
@@ -40,16 +40,26 @@ std::unique_ptr<Wt::WTemplate> createEntry(Database::Track::pointer track)
|
||||
entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
|
||||
|
||||
auto artists {track->getArtists()};
|
||||
auto release = track->getRelease();
|
||||
|
||||
if (!artists.empty() || release)
|
||||
entry->setCondition("if-has-artists-or-release", true);
|
||||
|
||||
if (!artists.empty())
|
||||
{
|
||||
entry->setCondition("if-has-artist", true);
|
||||
entry->bindWidget("artist-name", LmsApplication::createArtistAnchor(artists.front()));
|
||||
entry->setCondition("if-has-artists", true);
|
||||
|
||||
Wt::WContainerWidget* artistContainer {entry->bindNew<Wt::WContainerWidget>("artists")};
|
||||
for (const auto& artist : artists)
|
||||
{
|
||||
Wt::WTemplate* a {artistContainer->addNew<Wt::WTemplate>(Wt::WString::tr("Lms.PlayHistory.template.entry-artist"))};
|
||||
a->bindWidget("artist", LmsApplication::createArtistAnchor(artist));
|
||||
}
|
||||
}
|
||||
auto release = track->getRelease();
|
||||
if (release)
|
||||
{
|
||||
entry->setCondition("if-has-release", true);
|
||||
entry->bindWidget("release-name", LmsApplication::createReleaseAnchor(track->getRelease()));
|
||||
entry->bindWidget("release", LmsApplication::createReleaseAnchor(track->getRelease()));
|
||||
}
|
||||
|
||||
return entry;
|
||||
|
||||
@@ -331,16 +331,26 @@ PlayQueue::addSome()
|
||||
entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
|
||||
|
||||
auto artists {track->getArtists()};
|
||||
auto release = track->getRelease();
|
||||
|
||||
if (!artists.empty() || release)
|
||||
entry->setCondition("if-has-artists-or-release", true);
|
||||
|
||||
if (!artists.empty())
|
||||
{
|
||||
entry->setCondition("if-has-artist", true);
|
||||
entry->bindWidget("artist-name", LmsApplication::createArtistAnchor(artists.front()));
|
||||
entry->setCondition("if-has-artists", true);
|
||||
|
||||
Wt::WContainerWidget* artistContainer {entry->bindNew<Wt::WContainerWidget>("artists")};
|
||||
for (const auto& artist : artists)
|
||||
{
|
||||
Wt::WTemplate* a {artistContainer->addNew<Wt::WTemplate>(Wt::WString::tr("Lms.PlayQueue.template.entry-artist"))};
|
||||
a->bindWidget("artist", LmsApplication::createArtistAnchor(artist));
|
||||
}
|
||||
}
|
||||
auto release = track->getRelease();
|
||||
if (release)
|
||||
{
|
||||
entry->setCondition("if-has-release", true);
|
||||
entry->bindWidget("release-name", LmsApplication::createReleaseAnchor(track->getRelease()));
|
||||
entry->bindWidget("release", LmsApplication::createReleaseAnchor(track->getRelease()));
|
||||
}
|
||||
|
||||
Wt::WText* playBtn = entry->bindNew<Wt::WText>("play-btn", Wt::WString::tr("Lms.PlayQueue.template.play-btn"), Wt::TextFormat::XHTML);
|
||||
|
||||
@@ -117,16 +117,27 @@ Tracks::addSome()
|
||||
entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
|
||||
|
||||
auto artists {track->getArtists()};
|
||||
auto release {track->getRelease()};
|
||||
|
||||
if (!artists.empty() || release)
|
||||
entry->setCondition("if-has-artists-or-release", true);
|
||||
|
||||
if (!artists.empty())
|
||||
{
|
||||
entry->setCondition("if-has-artist", true);
|
||||
entry->bindWidget("artist-name", LmsApplication::createArtistAnchor(artists.front()));
|
||||
entry->setCondition("if-has-artists", true);
|
||||
|
||||
Wt::WContainerWidget* artistContainer {entry->bindNew<Wt::WContainerWidget>("artists")};
|
||||
for (const auto& artist : artists)
|
||||
{
|
||||
Wt::WTemplate* a {artistContainer->addNew<Wt::WTemplate>(Wt::WString::tr("Lms.Explore.Tracks.template.entry-artist"))};
|
||||
a->bindWidget("artist", LmsApplication::createArtistAnchor(artist));
|
||||
}
|
||||
}
|
||||
|
||||
if (track->getRelease())
|
||||
{
|
||||
entry->setCondition("if-has-release", true);
|
||||
entry->bindWidget("release-name", LmsApplication::createReleaseAnchor(track->getRelease()));
|
||||
entry->bindWidget("release", LmsApplication::createReleaseAnchor(track->getRelease()));
|
||||
}
|
||||
|
||||
Wt::WText* playBtn = entry->bindNew<Wt::WText>("play-btn", Wt::WString::tr("Lms.Explore.template.play-btn"), Wt::TextFormat::XHTML);
|
||||
|
||||
Reference in New Issue
Block a user