Remove header title from main views, and set them active in the navbar
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
<message id="Lms.Explore.Artists.template">
|
||||
<div class="Lms-header">
|
||||
<h2>${tr:Lms.Explore.artists}</h2>
|
||||
${mode class="nav nav-pills Lms-explore-mode-container"}
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="Lms-header">
|
||||
<h2>${tr:Lms.PlayQueue.playqueue}</h2>
|
||||
${clear-btn}${shuffle-btn}${repeat-btn}${radio-btn}
|
||||
<h4><small>${nb-tracks}</small></h4>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
<message id="Lms.Explore.Releases.template">
|
||||
<div class="Lms-header">
|
||||
<h2>${tr:Lms.Explore.releases}</h2>
|
||||
${mode class="nav nav-pills Lms-explore-mode-container"}
|
||||
${play-btn}${more-btn}
|
||||
</div>
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
</div>
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>${artists class="Lms-btn"}</li>
|
||||
<li>${releases class="Lms-btn"}</li>
|
||||
<li>${tracks class="Lms-btn"}</li>
|
||||
<li>${playqueue class="Lms-btn"}</li>
|
||||
<li class="${artists-active}">${artists class="Lms-btn"}</li>
|
||||
<li class="${releases-active}">${releases class="Lms-btn"}</li>
|
||||
<li class="${tracks-active}">${tracks class="Lms-btn"}</li>
|
||||
<li class="${playqueue-active}">${playqueue class="Lms-btn"}</li>
|
||||
</ul>
|
||||
<div class="navbar-form navbar-left">
|
||||
${filters class="form-group Lms-clusters-control"}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="Lms-header">
|
||||
<h2>${tr:Lms.Explore.tracks}</h2>
|
||||
${mode class="nav nav-pills Lms-explore-mode-container"}
|
||||
${play-btn}${more-btn}
|
||||
</div>
|
||||
|
||||
@@ -347,8 +347,9 @@ enum IdxRoot
|
||||
IdxAdminUser,
|
||||
};
|
||||
|
||||
static void
|
||||
handlePathChange(Wt::WStackedWidget* stack, bool isAdmin)
|
||||
static
|
||||
void
|
||||
handlePathChange(Wt::WTemplate& main, Wt::WStackedWidget& stack, bool isAdmin)
|
||||
{
|
||||
static const struct
|
||||
{
|
||||
@@ -372,6 +373,11 @@ handlePathChange(Wt::WStackedWidget* stack, bool isAdmin)
|
||||
|
||||
LMS_LOG(UI, DEBUG) << "Internal path changed to '" << wApp->internalPath() << "'";
|
||||
|
||||
main.bindString("artists-active", wApp->internalPathMatches("/artists") ? "active" : "");
|
||||
main.bindString("releases-active", wApp->internalPathMatches("/releases") ? "active" : "");
|
||||
main.bindString("tracks-active", wApp->internalPathMatches("/tracks") ? "active" : "");
|
||||
main.bindString("playqueue-active", wApp->internalPathMatches("/playqueue") ? "active" : "");
|
||||
|
||||
for (const auto& view : views)
|
||||
{
|
||||
if (wApp->internalPathMatches(view.path))
|
||||
@@ -379,7 +385,7 @@ handlePathChange(Wt::WStackedWidget* stack, bool isAdmin)
|
||||
if (view.admin && !isAdmin)
|
||||
break;
|
||||
|
||||
stack->setCurrentIndex(view.index);
|
||||
stack.setCurrentIndex(view.index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -597,10 +603,10 @@ LmsApplication::createHome()
|
||||
|
||||
internalPathChanged().connect([=]
|
||||
{
|
||||
handlePathChange(mainStack, isUserAdmin());
|
||||
handlePathChange(*main, *mainStack, isUserAdmin());
|
||||
});
|
||||
|
||||
handlePathChange(mainStack, isUserAdmin());
|
||||
handlePathChange(*main, *mainStack, isUserAdmin());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user