Still converting to bootstrap 5. Converted copyright + some artist stuff
This commit is contained in:
+18
-12
@@ -6,34 +6,40 @@
|
|||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<h3>${name}</h3>
|
<h3>${name}</h3>
|
||||||
${clusters class="mb-2"}
|
${clusters class="mb-2"}
|
||||||
${play-btn class="btn btn-outline-primary me-2"}${more-btn class="btn btn-outline-primary"}
|
<div class="d-flex">
|
||||||
|
${play-btn class="btn btn-outline-primary me-2"}
|
||||||
|
<div class="dropdown d-inline-block">
|
||||||
|
${more-btn class="btn btn-outline-primary" data-bs-toggle="dropdown" aria-expanded="false"}
|
||||||
|
<ul class="dropdown-menu" aria-labelledby="${id:more-btn}">
|
||||||
|
<li>${play-shuffled class="btn dropdown-item"}</li>
|
||||||
|
<li>${play-last class="btn dropdown-item"}</li>
|
||||||
|
<li>${star class="btn dropdown-item"}</li>
|
||||||
|
${<if-has-mbid>}
|
||||||
|
<li><a href="${mbid-link}" target="_blank" class="dropdown-item">${tr:Lms.Explore.musicbrainz-artist}</a></li>
|
||||||
|
${</if-has-mbid>}
|
||||||
|
<li>${download class="btn dropdown-item"}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${<if-has-release>}
|
${<if-has-release>}
|
||||||
${releases class="row gy-4"}
|
${releases class="row gy-4 mb-5"}
|
||||||
${</if-has-release>}
|
${</if-has-release>}
|
||||||
${<if-has-non-release-track>}
|
${<if-has-non-release-track>}
|
||||||
<div class="Lms-explore-artist-tracks-container">
|
<div class="Lms-explore-artist-tracks-container">
|
||||||
${tracks}
|
${tracks}
|
||||||
</div>
|
</div>
|
||||||
${</if-has-non-release-track>}
|
${</if-has-non-release-track>}
|
||||||
|
${<if-has-similar-artists>}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
${<if-has-similar-artists>}
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="well well-sm">
|
<div class="well well-sm">
|
||||||
<h3>${tr:Lms.Explore.Artist.similar-artists}</h3>
|
<h3>${tr:Lms.Explore.Artist.similar-artists}</h3>
|
||||||
${similar-artists}
|
${similar-artists}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${</if-has-similar-artists>}
|
|
||||||
${<if-has-mbid>}
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="well well-sm">
|
|
||||||
<h3>${tr:Lms.Explore.links}</h3>
|
|
||||||
${mbid-link class="Lms-btn text-muted"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
${</if-has-mbid>}
|
|
||||||
</div>
|
</div>
|
||||||
|
${</if-has-similar-artists>}
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
</messages>
|
</messages>
|
||||||
|
|||||||
+7
-14
@@ -35,22 +35,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${container class="d-grid gap-3"}
|
${container class="d-grid gap-3"}
|
||||||
|
${<if-has-copyright>}
|
||||||
|
<div class="pt-1 mt-1 border-top border-dark small text-muted fw-lighter fst-italic">${copyright class="text-reset"}</div>
|
||||||
|
${</if-has-copyright>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
${<if-has-similar-releases>}
|
||||||
${<if-has-similar-releases>}
|
<h3>${tr:Lms.Explore.Release.similar-releases}</h3>
|
||||||
<div class="col-12">
|
${similar-releases class="row gy-4"}
|
||||||
<h3>${tr:Lms.Explore.Release.similar-releases}</h3>
|
${</if-has-similar-releases>}
|
||||||
${similar-releases class="row gy-4"}
|
|
||||||
</div>
|
|
||||||
${</if-has-similar-releases>}
|
|
||||||
${<if-has-copyright>}
|
|
||||||
<div class="col-12 col-md-4">
|
|
||||||
<h3>${tr:Lms.Explore.Release.copyright}</h3>
|
|
||||||
${copyright class="text-muted"}
|
|
||||||
</div>
|
|
||||||
${</if-has-copyright>}
|
|
||||||
</div>
|
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message id="Lms.Explore.Release.template.entry-release-artist">
|
<message id="Lms.Explore.Release.template.entry-release-artist">
|
||||||
|
|||||||
@@ -19,12 +19,7 @@
|
|||||||
|
|
||||||
#include "ArtistView.hpp"
|
#include "ArtistView.hpp"
|
||||||
|
|
||||||
#include <Wt/WAnchor.h>
|
|
||||||
#include <Wt/WImage.h>
|
|
||||||
#include <Wt/WPopupMenu.h>
|
|
||||||
#include <Wt/WPushButton.h>
|
#include <Wt/WPushButton.h>
|
||||||
#include <Wt/WTemplate.h>
|
|
||||||
#include <Wt/WText.h>
|
|
||||||
|
|
||||||
#include "services/database/Artist.hpp"
|
#include "services/database/Artist.hpp"
|
||||||
#include "services/database/Cluster.hpp"
|
#include "services/database/Cluster.hpp"
|
||||||
@@ -52,10 +47,11 @@ using namespace Database;
|
|||||||
namespace UserInterface {
|
namespace UserInterface {
|
||||||
|
|
||||||
Artist::Artist(Filters* filters)
|
Artist::Artist(Filters* filters)
|
||||||
: Wt::WTemplate {Wt::WString::tr("Lms.Explore.Artist.template")}
|
: Template {Wt::WString::tr("Lms.Explore.Artist.template")}
|
||||||
, _filters {filters}
|
, _filters {filters}
|
||||||
{
|
{
|
||||||
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
||||||
|
addFunction("id", &Wt::WTemplate::Functions::id);
|
||||||
|
|
||||||
LmsApp->internalPathChanged().connect(this, [this]
|
LmsApp->internalPathChanged().connect(this, [this]
|
||||||
{
|
{
|
||||||
@@ -140,44 +136,43 @@ Artist::refreshView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bindString("name", Wt::WString::fromUTF8(artist->getName()), Wt::TextFormat::Plain);
|
bindString("name", Wt::WString::fromUTF8(artist->getName()), Wt::TextFormat::Plain);
|
||||||
{
|
|
||||||
Wt::WPushButton* playBtn {bindNew<Wt::WPushButton>("play-btn", Wt::WString::tr("Lms.Explore.template.play-btn"), Wt::TextFormat::XHTML)};
|
bindNew<Wt::WPushButton>("more-btn", Wt::WString::tr("Lms.Explore.template.more-btn"), Wt::TextFormat::XHTML);
|
||||||
playBtn->clicked().connect([=]
|
bindNew<Wt::WPushButton>("play-btn", Wt::WString::tr("Lms.Explore.template.play-btn"), Wt::TextFormat::XHTML)
|
||||||
|
->clicked().connect([=]
|
||||||
{
|
{
|
||||||
artistsAction.emit(PlayQueueAction::Play, {_artistId});
|
artistsAction.emit(PlayQueueAction::Play, {_artistId});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
bindNew<Wt::WPushButton>("play-shuffled", Wt::WString::tr("Lms.Explore.play-shuffled"), Wt::TextFormat::Plain)
|
||||||
|
->clicked().connect([=]
|
||||||
|
{
|
||||||
|
artistsAction.emit(PlayQueueAction::PlayShuffled, {_artistId});
|
||||||
|
});
|
||||||
|
bindNew<Wt::WPushButton>("play-last", Wt::WString::tr("Lms.Explore.play-last"), Wt::TextFormat::Plain)
|
||||||
|
->clicked().connect([=]
|
||||||
|
{
|
||||||
|
artistsAction.emit(PlayQueueAction::PlayLast, {_artistId});
|
||||||
|
});
|
||||||
|
bindNew<Wt::WPushButton>("download", Wt::WString::tr("Lms.Explore.download"))
|
||||||
|
->setLink(Wt::WLink {std::make_unique<DownloadArtistResource>(*artistId)});
|
||||||
|
|
||||||
{
|
{
|
||||||
Wt::WPushButton* moreBtn {bindNew<Wt::WPushButton>("more-btn", Wt::WString::tr("Lms.Explore.template.more-btn"), Wt::TextFormat::XHTML)};
|
auto isStarred {[=] { return Service<Scrobbling::IScrobblingService>::get()->isStarred(LmsApp->getUserId(), *artistId); }};
|
||||||
moreBtn->clicked().connect([=]
|
|
||||||
|
Wt::WPushButton* starBtn {bindNew<Wt::WPushButton>("star", Wt::WString::tr(isStarred() ? "Lms.Explore.unstar" : "Lms.Explore.star"))};
|
||||||
|
starBtn->clicked().connect([=]
|
||||||
{
|
{
|
||||||
Wt::WPopupMenu* popup {LmsApp->createPopupMenu()};
|
if (isStarred())
|
||||||
|
{
|
||||||
popup->addItem(Wt::WString::tr("Lms.Explore.play-shuffled"))
|
Service<Scrobbling::IScrobblingService>::get()->unstar(LmsApp->getUserId(), *artistId);
|
||||||
->triggered().connect(this, [=]
|
starBtn->setText(Wt::WString::tr("Lms.Explore.star"));
|
||||||
{
|
}
|
||||||
artistsAction.emit(PlayQueueAction::PlayShuffled, {_artistId});
|
else
|
||||||
});
|
{
|
||||||
popup->addItem(Wt::WString::tr("Lms.Explore.play-last"))
|
Service<Scrobbling::IScrobblingService>::get()->star(LmsApp->getUserId(), *artistId);
|
||||||
->triggered().connect(this, [=]
|
starBtn->setText(Wt::WString::tr("Lms.Explore.unstar"));
|
||||||
{
|
}
|
||||||
artistsAction.emit(PlayQueueAction::PlayLast, {_artistId});
|
|
||||||
});
|
|
||||||
|
|
||||||
const bool isStarred {Service<Scrobbling::IScrobblingService>::get()->isStarred(LmsApp->getUserId(), _artistId)};
|
|
||||||
popup->addItem(Wt::WString::tr(isStarred ? "Lms.Explore.unstar" : "Lms.Explore.star"))
|
|
||||||
->triggered().connect(this, [=]
|
|
||||||
{
|
|
||||||
if (isStarred)
|
|
||||||
Service<Scrobbling::IScrobblingService>::get()->unstar(LmsApp->getUserId(), _artistId);
|
|
||||||
else
|
|
||||||
Service<Scrobbling::IScrobblingService>::get()->star(LmsApp->getUserId(), _artistId);
|
|
||||||
});
|
|
||||||
popup->addItem(Wt::WString::tr("Lms.Explore.download"))
|
|
||||||
->setLink(Wt::WLink {std::make_unique<DownloadArtistResource>(*artistId)});
|
|
||||||
|
|
||||||
popup->exec(moreBtn);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -240,11 +235,7 @@ Artist::refreshLinks(const Database::Artist::pointer& artist)
|
|||||||
if (mbid)
|
if (mbid)
|
||||||
{
|
{
|
||||||
setCondition("if-has-mbid", true);
|
setCondition("if-has-mbid", true);
|
||||||
|
bindString("mbid-link", std::string {"https://musicbrainz.org/artist/"} + std::string {mbid->getAsString()});
|
||||||
Wt::WLink link {"https://musicbrainz.org/artist/" + std::string {mbid->getAsString()}};
|
|
||||||
link.setTarget(Wt::LinkTarget::NewWindow);
|
|
||||||
|
|
||||||
bindNew<Wt::WAnchor>("mbid-link", link, Wt::WString::tr("Lms.Explore.musicbrainz-artist"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,13 +19,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <unordered_set>
|
|
||||||
|
|
||||||
#include <Wt/WSignal.h>
|
|
||||||
#include <Wt/WTemplate.h>
|
|
||||||
|
|
||||||
#include "services/database/Object.hpp"
|
#include "services/database/Object.hpp"
|
||||||
|
#include "common/Template.hpp"
|
||||||
|
|
||||||
#include "PlayQueueAction.hpp"
|
#include "PlayQueueAction.hpp"
|
||||||
|
|
||||||
namespace Database
|
namespace Database
|
||||||
@@ -40,7 +36,7 @@ namespace UserInterface
|
|||||||
class Filters;
|
class Filters;
|
||||||
class InfiniteScrollingContainer;
|
class InfiniteScrollingContainer;
|
||||||
|
|
||||||
class Artist : public Wt::WTemplate
|
class Artist : public Template
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Artist(Filters* filters);
|
Artist(Filters* filters);
|
||||||
|
|||||||
@@ -20,11 +20,8 @@
|
|||||||
#include "ReleaseView.hpp"
|
#include "ReleaseView.hpp"
|
||||||
|
|
||||||
#include <Wt/WAnchor.h>
|
#include <Wt/WAnchor.h>
|
||||||
#include <Wt/WApplication.h>
|
|
||||||
#include <Wt/WImage.h>
|
#include <Wt/WImage.h>
|
||||||
#include <Wt/WPushButton.h>
|
#include <Wt/WPushButton.h>
|
||||||
#include <Wt/WTemplate.h>
|
|
||||||
#include <Wt/WText.h>
|
|
||||||
|
|
||||||
#include "services/database/Cluster.hpp"
|
#include "services/database/Cluster.hpp"
|
||||||
#include "services/database/Release.hpp"
|
#include "services/database/Release.hpp"
|
||||||
@@ -184,18 +181,18 @@ Release::refreshView()
|
|||||||
{
|
{
|
||||||
auto isStarred {[=] { return Service<Scrobbling::IScrobblingService>::get()->isStarred(LmsApp->getUserId(), *releaseId); }};
|
auto isStarred {[=] { return Service<Scrobbling::IScrobblingService>::get()->isStarred(LmsApp->getUserId(), *releaseId); }};
|
||||||
|
|
||||||
Wt::WPushButton* star {bindNew<Wt::WPushButton>("star", Wt::WString::tr(isStarred() ? "Lms.Explore.unstar" : "Lms.Explore.star"))};
|
Wt::WPushButton* starBtn {bindNew<Wt::WPushButton>("star", Wt::WString::tr(isStarred() ? "Lms.Explore.unstar" : "Lms.Explore.star"))};
|
||||||
star->clicked().connect([=]
|
starBtn->clicked().connect([=]
|
||||||
{
|
{
|
||||||
if (isStarred())
|
if (isStarred())
|
||||||
{
|
{
|
||||||
Service<Scrobbling::IScrobblingService>::get()->unstar(LmsApp->getUserId(), *releaseId);
|
Service<Scrobbling::IScrobblingService>::get()->unstar(LmsApp->getUserId(), *releaseId);
|
||||||
star->setText(Wt::WString::tr("Lms.Explore.star"));
|
starBtn->setText(Wt::WString::tr("Lms.Explore.star"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Service<Scrobbling::IScrobblingService>::get()->star(LmsApp->getUserId(), *releaseId);
|
Service<Scrobbling::IScrobblingService>::get()->star(LmsApp->getUserId(), *releaseId);
|
||||||
star->setText(Wt::WString::tr("Lms.Explore.unstar"));
|
starBtn->setText(Wt::WString::tr("Lms.Explore.unstar"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user