diff --git a/approot/artist.xml b/approot/artist.xml
index 5600591f..9fe64bf9 100644
--- a/approot/artist.xml
+++ b/approot/artist.xml
@@ -6,34 +6,40 @@
${name}
${clusters class="mb-2"}
- ${play-btn class="btn btn-outline-primary me-2"}${more-btn class="btn btn-outline-primary"}
+
+ ${play-btn class="btn btn-outline-primary me-2"}
+
+ ${more-btn class="btn btn-outline-primary" data-bs-toggle="dropdown" aria-expanded="false"}
+
+
+
${}
- ${releases class="row gy-4"}
+ ${releases class="row gy-4 mb-5"}
${}
${}
${tracks}
${}
+ ${}
- ${
}
${tr:Lms.Explore.Artist.similar-artists}
${similar-artists}
- ${}
- ${
}
-
-
-
${tr:Lms.Explore.links}
- ${mbid-link class="Lms-btn text-muted"}
-
-
- ${}
+ ${}
diff --git a/approot/release.xml b/approot/release.xml
index 11ee3a08..71b381b8 100644
--- a/approot/release.xml
+++ b/approot/release.xml
@@ -35,22 +35,15 @@
${container class="d-grid gap-3"}
+ ${}
+ ${copyright class="text-reset"}
+ ${}
-
- ${
}
-
-
${tr:Lms.Explore.Release.similar-releases}
- ${similar-releases class="row gy-4"}
-
- ${}
- ${
}
-
-
${tr:Lms.Explore.Release.copyright}
- ${copyright class="text-muted"}
-
- ${}
-
+ ${}
+ ${tr:Lms.Explore.Release.similar-releases}
+ ${similar-releases class="row gy-4"}
+ ${}
diff --git a/src/lms/ui/explore/ArtistView.cpp b/src/lms/ui/explore/ArtistView.cpp
index 3ea99fd4..0d817647 100644
--- a/src/lms/ui/explore/ArtistView.cpp
+++ b/src/lms/ui/explore/ArtistView.cpp
@@ -19,12 +19,7 @@
#include "ArtistView.hpp"
-#include
-#include
-#include
#include
-#include
-#include
#include "services/database/Artist.hpp"
#include "services/database/Cluster.hpp"
@@ -52,10 +47,11 @@ using namespace Database;
namespace UserInterface {
Artist::Artist(Filters* filters)
-: Wt::WTemplate {Wt::WString::tr("Lms.Explore.Artist.template")}
+: Template {Wt::WString::tr("Lms.Explore.Artist.template")}
, _filters {filters}
{
addFunction("tr", &Wt::WTemplate::Functions::tr);
+ addFunction("id", &Wt::WTemplate::Functions::id);
LmsApp->internalPathChanged().connect(this, [this]
{
@@ -140,44 +136,43 @@ Artist::refreshView()
}
bindString("name", Wt::WString::fromUTF8(artist->getName()), Wt::TextFormat::Plain);
- {
- Wt::WPushButton* playBtn {bindNew("play-btn", Wt::WString::tr("Lms.Explore.template.play-btn"), Wt::TextFormat::XHTML)};
- playBtn->clicked().connect([=]
+
+ bindNew("more-btn", Wt::WString::tr("Lms.Explore.template.more-btn"), Wt::TextFormat::XHTML);
+ bindNew("play-btn", Wt::WString::tr("Lms.Explore.template.play-btn"), Wt::TextFormat::XHTML)
+ ->clicked().connect([=]
{
artistsAction.emit(PlayQueueAction::Play, {_artistId});
});
- }
+
+ bindNew("play-shuffled", Wt::WString::tr("Lms.Explore.play-shuffled"), Wt::TextFormat::Plain)
+ ->clicked().connect([=]
+ {
+ artistsAction.emit(PlayQueueAction::PlayShuffled, {_artistId});
+ });
+ bindNew("play-last", Wt::WString::tr("Lms.Explore.play-last"), Wt::TextFormat::Plain)
+ ->clicked().connect([=]
+ {
+ artistsAction.emit(PlayQueueAction::PlayLast, {_artistId});
+ });
+ bindNew("download", Wt::WString::tr("Lms.Explore.download"))
+ ->setLink(Wt::WLink {std::make_unique(*artistId)});
{
- Wt::WPushButton* moreBtn {bindNew("more-btn", Wt::WString::tr("Lms.Explore.template.more-btn"), Wt::TextFormat::XHTML)};
- moreBtn->clicked().connect([=]
+ auto isStarred {[=] { return Service::get()->isStarred(LmsApp->getUserId(), *artistId); }};
+
+ Wt::WPushButton* starBtn {bindNew("star", Wt::WString::tr(isStarred() ? "Lms.Explore.unstar" : "Lms.Explore.star"))};
+ starBtn->clicked().connect([=]
{
- Wt::WPopupMenu* popup {LmsApp->createPopupMenu()};
-
- popup->addItem(Wt::WString::tr("Lms.Explore.play-shuffled"))
- ->triggered().connect(this, [=]
- {
- artistsAction.emit(PlayQueueAction::PlayShuffled, {_artistId});
- });
- popup->addItem(Wt::WString::tr("Lms.Explore.play-last"))
- ->triggered().connect(this, [=]
- {
- artistsAction.emit(PlayQueueAction::PlayLast, {_artistId});
- });
-
- const bool isStarred {Service::get()->isStarred(LmsApp->getUserId(), _artistId)};
- popup->addItem(Wt::WString::tr(isStarred ? "Lms.Explore.unstar" : "Lms.Explore.star"))
- ->triggered().connect(this, [=]
- {
- if (isStarred)
- Service::get()->unstar(LmsApp->getUserId(), _artistId);
- else
- Service::get()->star(LmsApp->getUserId(), _artistId);
- });
- popup->addItem(Wt::WString::tr("Lms.Explore.download"))
- ->setLink(Wt::WLink {std::make_unique(*artistId)});
-
- popup->exec(moreBtn);
+ if (isStarred())
+ {
+ Service::get()->unstar(LmsApp->getUserId(), *artistId);
+ starBtn->setText(Wt::WString::tr("Lms.Explore.star"));
+ }
+ else
+ {
+ Service::get()->star(LmsApp->getUserId(), *artistId);
+ starBtn->setText(Wt::WString::tr("Lms.Explore.unstar"));
+ }
});
}
}
@@ -240,11 +235,7 @@ Artist::refreshLinks(const Database::Artist::pointer& artist)
if (mbid)
{
setCondition("if-has-mbid", true);
-
- Wt::WLink link {"https://musicbrainz.org/artist/" + std::string {mbid->getAsString()}};
- link.setTarget(Wt::LinkTarget::NewWindow);
-
- bindNew("mbid-link", link, Wt::WString::tr("Lms.Explore.musicbrainz-artist"));
+ bindString("mbid-link", std::string {"https://musicbrainz.org/artist/"} + std::string {mbid->getAsString()});
}
}
diff --git a/src/lms/ui/explore/ArtistView.hpp b/src/lms/ui/explore/ArtistView.hpp
index 26255a6a..e6e2933e 100644
--- a/src/lms/ui/explore/ArtistView.hpp
+++ b/src/lms/ui/explore/ArtistView.hpp
@@ -19,13 +19,9 @@
#pragma once
-#include
-#include
-
-#include
-#include
-
#include "services/database/Object.hpp"
+#include "common/Template.hpp"
+
#include "PlayQueueAction.hpp"
namespace Database
@@ -40,7 +36,7 @@ namespace UserInterface
class Filters;
class InfiniteScrollingContainer;
- class Artist : public Wt::WTemplate
+ class Artist : public Template
{
public:
Artist(Filters* filters);
diff --git a/src/lms/ui/explore/ReleaseView.cpp b/src/lms/ui/explore/ReleaseView.cpp
index 16a19c48..778d9155 100644
--- a/src/lms/ui/explore/ReleaseView.cpp
+++ b/src/lms/ui/explore/ReleaseView.cpp
@@ -20,11 +20,8 @@
#include "ReleaseView.hpp"
#include
-#include
#include
#include
-#include
-#include
#include "services/database/Cluster.hpp"
#include "services/database/Release.hpp"
@@ -184,18 +181,18 @@ Release::refreshView()
{
auto isStarred {[=] { return Service::get()->isStarred(LmsApp->getUserId(), *releaseId); }};
- Wt::WPushButton* star {bindNew("star", Wt::WString::tr(isStarred() ? "Lms.Explore.unstar" : "Lms.Explore.star"))};
- star->clicked().connect([=]
+ Wt::WPushButton* starBtn {bindNew("star", Wt::WString::tr(isStarred() ? "Lms.Explore.unstar" : "Lms.Explore.star"))};
+ starBtn->clicked().connect([=]
{
if (isStarred())
{
Service::get()->unstar(LmsApp->getUserId(), *releaseId);
- star->setText(Wt::WString::tr("Lms.Explore.star"));
+ starBtn->setText(Wt::WString::tr("Lms.Explore.star"));
}
else
{
Service::get()->star(LmsApp->getUserId(), *releaseId);
- star->setText(Wt::WString::tr("Lms.Explore.unstar"));
+ starBtn->setText(Wt::WString::tr("Lms.Explore.unstar"));
}
});
}