[UI/MOBILE] WIP on internal path support

This commit is contained in:
emeric
2016-03-06 12:26:32 +01:00
parent f8c808433f
commit 073a178aa2
2 changed files with 22 additions and 13 deletions
+6 -4
View File
@@ -195,7 +195,6 @@ LmsApplication::handleAuthEvent(void)
setConfirmCloseMessage("Closing LMS. Are you sure?"); setConfirmCloseMessage("Closing LMS. Are you sure?");
// Handle internal paths // Handle internal paths
// setInternalPath("audio");
// Create a Vertical layout: top is the nav bar, bottom is the contents // Create a Vertical layout: top is the nav bar, bottom is the contents
Wt::WVBoxLayout *layout = new Wt::WVBoxLayout(this->root()); Wt::WVBoxLayout *layout = new Wt::WVBoxLayout(this->root());
@@ -216,7 +215,7 @@ LmsApplication::handleAuthEvent(void)
LineEdit *searchEdit = new LineEdit(500); LineEdit *searchEdit = new LineEdit(500);
navigation->bindWidget("search", searchEdit); navigation->bindWidget("search", searchEdit);
searchEdit->setEmptyText("Search..."); searchEdit->setEmptyText("Search...");
AearchEdit->addStyleClass("navbar-form navbar-nav"); searchEdit->addStyleClass("navbar-form navbar-nav");
searchEdit->setWidth(150); searchEdit->setWidth(150);
// TODO add a span with a search icon // TODO add a span with a search icon
@@ -257,8 +256,11 @@ LmsApplication::handleAuthEvent(void)
layout->addWidget(contentsStack, 1); layout->addWidget(contentsStack, 1);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
// Set initial path if (agentIsMobile())
wApp->setInternalPath("/audio/search/preview", true); setInternalPath("/audio/search/preview", true);
else
setInternalPath("/audio");
} }
} // namespace UserInterface } // namespace UserInterface
+7
View File
@@ -179,7 +179,10 @@ ImageResource::handleRequest(const Wt::Http::Request& request, Wt::Http::Respons
} }
} }
if (!path.empty())
{
std::vector<Image::Image> covers; std::vector<Image::Image> covers;
switch (coverType) switch (coverType)
{ {
case Database::Track::CoverType::Embedded: case Database::Track::CoverType::Embedded:
@@ -194,6 +197,10 @@ ImageResource::handleRequest(const Wt::Http::Request& request, Wt::Http::Respons
putCover(response, covers, size); putCover(response, covers, size);
return; return;
} }
putImage(response, getDefaultCover(size));
return;
}
else if (releaseIdStr) else if (releaseIdStr)
{ {
Database::Release::id_type releaseId; Database::Release::id_type releaseId;