Various fixe
This commit is contained in:
@@ -142,6 +142,10 @@ a.Lms-artistname:hover, a.Lms-artistname:focus {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.Lms-explore-entry-grid-text-container {
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.Lms-explore-entry-grid-text-container h5, h6 {
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
|
||||
@@ -395,7 +395,7 @@ Artist::getTracks(std::optional<TrackArtistLink::Type> linkType) const
|
||||
|
||||
auto query {session()->query<Wt::Dbo::ptr<Track>>("SELECT DISTINCT t FROM track t INNER JOIN artist a ON a.id = t_a_l.artist_id INNER JOIN track_artist_link t_a_l ON t_a_l.track_id = t.id")
|
||||
.where("a.id = ?").bind(self()->id())
|
||||
.orderBy("t.year,t.release_id,t.disc_number,t.track_number")};
|
||||
.orderBy("t.year DESC,t.release_id,t.disc_number,t.track_number")};
|
||||
|
||||
if (linkType)
|
||||
query.where("t_a_l.type = ?").bind(*linkType);
|
||||
|
||||
@@ -427,6 +427,7 @@ LmsApplication::createHome()
|
||||
_audioFileResource = std::make_shared<AudioFileResource>();
|
||||
|
||||
declareJavaScriptFunction("onLoadCover", "function(id) { id.className += \" Lms-cover-loaded\"}");
|
||||
doJavaScript("$('body').tooltip({ selector: '[data-toggle=\"tooltip\"]'})");
|
||||
|
||||
Wt::WTemplate* main {root()->addWidget(std::make_unique<Wt::WTemplate>(Wt::WString::tr("Lms.template")))};
|
||||
|
||||
|
||||
@@ -50,8 +50,15 @@ PlayQueue::PlayQueue()
|
||||
_radioMode = LmsApp->getUser()->isRadioSet();
|
||||
}
|
||||
|
||||
auto setToolTip = [](Wt::WWidget& widget, Wt::WString title)
|
||||
{
|
||||
widget.setAttributeValue("data-toggle", "tooltip");
|
||||
widget.setAttributeValue("data-placement", "bottom");
|
||||
widget.setAttributeValue("title", std::move(title));
|
||||
};
|
||||
|
||||
Wt::WText* clearBtn = bindNew<Wt::WText>("clear-btn", Wt::WString::tr("Lms.PlayQueue.template.clear-btn"), Wt::TextFormat::XHTML);
|
||||
clearBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.clear"));
|
||||
setToolTip(*clearBtn, Wt::WString::tr("Lms.PlayQueue.clear"));
|
||||
clearBtn->clicked().connect([=]
|
||||
{
|
||||
clearTracks();
|
||||
@@ -68,7 +75,7 @@ PlayQueue::PlayQueue()
|
||||
});
|
||||
|
||||
Wt::WText* shuffleBtn = bindNew<Wt::WText>("shuffle-btn", Wt::WString::tr("Lms.PlayQueue.template.shuffle-btn"), Wt::TextFormat::XHTML);
|
||||
shuffleBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.shuffle"));
|
||||
setToolTip(*shuffleBtn, Wt::WString::tr("Lms.PlayQueue.shuffle"));
|
||||
shuffleBtn->clicked().connect([=]
|
||||
{
|
||||
{
|
||||
@@ -87,7 +94,7 @@ PlayQueue::PlayQueue()
|
||||
});
|
||||
|
||||
_repeatBtn = bindNew<Wt::WText>("repeat-btn", Wt::WString::tr("Lms.PlayQueue.template.repeat-btn"), Wt::TextFormat::XHTML);
|
||||
_repeatBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.repeat"));
|
||||
setToolTip(*_repeatBtn, Wt::WString::tr("Lms.PlayQueue.repeat"));
|
||||
_repeatBtn->clicked().connect([=]
|
||||
{
|
||||
_repeatAll = !_repeatAll;
|
||||
@@ -101,7 +108,7 @@ PlayQueue::PlayQueue()
|
||||
updateRepeatBtn();
|
||||
|
||||
_radioBtn = bindNew<Wt::WText>("radio-btn", Wt::WString::tr("Lms.PlayQueue.template.radio-btn"));
|
||||
_radioBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.radio-mode"));
|
||||
setToolTip(*_radioBtn, Wt::WString::tr("Lms.PlayQueue.radio-mode"));
|
||||
_radioBtn->clicked().connect([=]
|
||||
{
|
||||
_radioMode = !_radioMode;
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace UserInterface::TrackListHelpers
|
||||
auto cover = entry->bindNew<Wt::WImage>("cover");
|
||||
cover->setImageLink(LmsApp->getImageResource()->getTrackUrl(trackId, ImageResource::Size::Large));
|
||||
cover->setStyleClass("Lms-cover");
|
||||
cover->setAttributeValue("onload", LmsApp->javaScriptClass() + ".onLoadCover(this)");
|
||||
}
|
||||
|
||||
entry->bindString("duration", trackDurationToString(track->getDuration()), Wt::TextFormat::Plain);
|
||||
@@ -106,8 +107,7 @@ namespace UserInterface::TrackListHelpers
|
||||
|
||||
if (auto trackIdLoaded {LmsApp->getMediaPlayer().getTrackLoaded()})
|
||||
{
|
||||
if (*trackIdLoaded == trackId)
|
||||
entry->bindString("is-playing", "Lms-entry-playing");
|
||||
entry->bindString("is-playing", *trackIdLoaded == trackId ? "Lms-entry-playing" : "");
|
||||
}
|
||||
else
|
||||
entry->bindString("is-playing", "");
|
||||
|
||||
Reference in New Issue
Block a user