Now handling multi artists in tracks, playqueue and play history views

This commit is contained in:
emeric
2019-03-19 13:38:44 +01:00
parent 3150de4f0c
commit 37e87ccc1c
8 changed files with 94 additions and 45 deletions
+9 -7
View File
@@ -16,16 +16,18 @@
<message id="Lms.PlayHistory.template.entry"> <message id="Lms.PlayHistory.template.entry">
<div class="row Lms-playhistory-entry Lms-vertical-align"> <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> <h4>${name}</h4>
</div> ${<if-has-artists-or-release>}
<div class="col-sm-3 hidden-xs"> ${<if-has-release>}<small>${release class="Lms-explore-releasename"}</small>${</if-has-release>}
${<if-has-release>}<small>${release-name class="Lms-explore-releasename"}</small>${</if-has-release>} ${<if-has-artists>}<small>${artists}</small>${</if-has-artists>}
</div> ${</if-has-artists-or-release>}
<div class="col-sm-3 hidden-xs">
${<if-has-artist>}<small>${artist-name class="Lms-explore-artistname"}</small>${</if-has-artist>}
</div> </div>
</div> </div>
</message> </message>
<message id="Lms.PlayHistory.template.entry-artist">
${artist class="Lms-explore-artistname"}
</message>
</messages> </messages>
+9 -7
View File
@@ -42,14 +42,12 @@
<message id="Lms.PlayQueue.template.entry"> <message id="Lms.PlayQueue.template.entry">
<div class="row Lms-playqueue-entry Lms-vertical-align"> <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> <h4>${name}</h4>
</div> ${<if-has-artists-or-release>}
<div class="col-sm-3 hidden-xs"> ${<if-has-release>}<small>${release class="Lms-explore-releasename"}</small>${</if-has-release>}
${<if-has-release>}<small>${release-name class="Lms-explore-releasename"}</small>${</if-has-release>} ${<if-has-artists>}<small>${artists}</small>${</if-has-artists>}
</div> ${</if-has-artists-or-release>}
<div class="col-sm-3 hidden-xs">
${<if-has-artist>}<small>${artist-name class="Lms-explore-artistname"}</small>${</if-has-artist>}
</div> </div>
<div class="col-xs-3 Lms-playqueue-entry-controls"> <div class="col-xs-3 Lms-playqueue-entry-controls">
${play-btn}${del-btn} ${play-btn}${del-btn}
@@ -57,4 +55,8 @@
</div> </div>
</message> </message>
<message id="Lms.PlayQueue.template.entry-artist">
${artist class="Lms-explore-artistname"}
</message>
</messages> </messages>
+1 -4
View File
@@ -38,10 +38,7 @@
</message> </message>
<message id="Lms.Explore.Release.template.entry-artist"> <message id="Lms.Explore.Release.template.entry-artist">
${artist class="Lms-explore-artistname Lms-explore-release-entry-artist"} ${artist class="Lms-explore-artistname"}
</message> </message>
</messages> </messages>
+9 -7
View File
@@ -24,14 +24,12 @@
<message id="Lms.Explore.Tracks.template.entry"> <message id="Lms.Explore.Tracks.template.entry">
<div class="row Lms-explore-tracks-entry Lms-vertical-align"> <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> <h4>${name}</h4>
</div> ${<if-has-artists-or-release>}
<div class="col-sm-3 hidden-xs"> ${<if-has-release>}<small>${release class="Lms-explore-releasename"}</small>${</if-has-release>}
${<if-has-release>}<small>${release-name class="Lms-explore-releasename"}</small>${</if-has-release>} ${<if-has-artists>}<small>${artists}</small>${</if-has-artists>}
</div> ${</if-has-artists-or-release>}
<div class="col-sm-3 hidden-xs">
${<if-has-artist>}<small>${artist-name class="Lms-explore-artistname"}</small>${</if-has-artist>}
</div> </div>
<div class="col-xs-3 Lms-explore-tracks-entry-controls"> <div class="col-xs-3 Lms-explore-tracks-entry-controls">
${play-btn}${add-btn} ${play-btn}${add-btn}
@@ -39,4 +37,8 @@
</div> </div>
</message> </message>
<message id="Lms.Explore.Tracks.template.entry-artist">
${artist class="Lms-explore-artistname"}
</message>
</messages> </messages>
+24 -9
View File
@@ -185,10 +185,6 @@ a:hover {
font-weight: bold; font-weight: bold;
} }
.Lms-explore-release-entry-artist {
display: inline-block;
}
.Lms-explore-releaselink { .Lms-explore-releaselink {
margin: 0px; margin: 0px;
padding-top: 4px; padding-top: 4px;
@@ -241,8 +237,14 @@ a:hover {
.Lms-explore-tracks-entry { .Lms-explore-tracks-entry {
min-height: 32px; min-height: 32px;
padding-top: 2px; border-bottom-style: solid;
padding-bottom: 2px; border-bottom-color: lightgrey;
border-bottom-width: thin;
}
.Lms-explore-tracks-entry-name {
margin-top: 4px;
margin-bottom: 4px;
} }
.Lms-explore-tracks-entry:hover { .Lms-explore-tracks-entry:hover {
@@ -273,15 +275,21 @@ a:hover {
} }
.Lms-playqueue-entry { .Lms-playqueue-entry {
border-bottom-style: solid;
border-bottom-color: lightgrey;
border-bottom-width: thin;
min-height: 32px; min-height: 32px;
padding-top: 2px;
padding-bottom: 2px;
} }
.Lms-playqueue-entry:hover { .Lms-playqueue-entry:hover {
background-color: lightgrey; background-color: lightgrey;
} }
.Lms-playqueue-entry-name {
margin-top: 4px;
margin-bottom: 4px;
}
.Lms-playqueue-entry-controls { .Lms-playqueue-entry-controls {
text-align: right; text-align: right;
} }
@@ -309,14 +317,21 @@ a:hover {
} }
.Lms-playhistory-entry { .Lms-playhistory-entry {
border-bottom-style: solid;
border-bottom-color: lightgrey;
border-bottom-width: thin;
min-height: 32px; min-height: 32px;
margin-bottom: 2px;
} }
.Lms-playhistory-entry:hover { .Lms-playhistory-entry:hover {
background-color: lightgrey; background-color: lightgrey;
} }
.Lms-playhistory-entry-name {
margin-top: 4px;
margin-bottom: 4px;
}
.Lms-player { .Lms-player {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
+14 -4
View File
@@ -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); entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
auto artists {track->getArtists()}; auto artists {track->getArtists()};
auto release = track->getRelease();
if (!artists.empty() || release)
entry->setCondition("if-has-artists-or-release", true);
if (!artists.empty()) if (!artists.empty())
{ {
entry->setCondition("if-has-artist", true); entry->setCondition("if-has-artists", true);
entry->bindWidget("artist-name", LmsApplication::createArtistAnchor(artists.front()));
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) if (release)
{ {
entry->setCondition("if-has-release", true); entry->setCondition("if-has-release", true);
entry->bindWidget("release-name", LmsApplication::createReleaseAnchor(track->getRelease())); entry->bindWidget("release", LmsApplication::createReleaseAnchor(track->getRelease()));
} }
return entry; return entry;
+14 -4
View File
@@ -331,16 +331,26 @@ PlayQueue::addSome()
entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain); entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
auto artists {track->getArtists()}; auto artists {track->getArtists()};
auto release = track->getRelease();
if (!artists.empty() || release)
entry->setCondition("if-has-artists-or-release", true);
if (!artists.empty()) if (!artists.empty())
{ {
entry->setCondition("if-has-artist", true); entry->setCondition("if-has-artists", true);
entry->bindWidget("artist-name", LmsApplication::createArtistAnchor(artists.front()));
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) if (release)
{ {
entry->setCondition("if-has-release", true); 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); Wt::WText* playBtn = entry->bindNew<Wt::WText>("play-btn", Wt::WString::tr("Lms.PlayQueue.template.play-btn"), Wt::TextFormat::XHTML);
+14 -3
View File
@@ -117,16 +117,27 @@ Tracks::addSome()
entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain); entry->bindString("name", Wt::WString::fromUTF8(track->getName()), Wt::TextFormat::Plain);
auto artists {track->getArtists()}; auto artists {track->getArtists()};
auto release {track->getRelease()};
if (!artists.empty() || release)
entry->setCondition("if-has-artists-or-release", true);
if (!artists.empty()) if (!artists.empty())
{ {
entry->setCondition("if-has-artist", true); entry->setCondition("if-has-artists", true);
entry->bindWidget("artist-name", LmsApplication::createArtistAnchor(artists.front()));
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()) if (track->getRelease())
{ {
entry->setCondition("if-has-release", true); 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); Wt::WText* playBtn = entry->bindNew<Wt::WText>("play-btn", Wt::WString::tr("Lms.Explore.template.play-btn"), Wt::TextFormat::XHTML);