Appmanager: implement functional search bar
reworked handlers for different app types
Change-Id: I82d3c856aa5c583dcdcf83ed6fbaf440bc4c8f87
diff --git a/core/installer/welcome/appmanager-tmpl/base.html b/core/installer/welcome/appmanager-tmpl/base.html
index fa77d97..dd0549a 100644
--- a/core/installer/welcome/appmanager-tmpl/base.html
+++ b/core/installer/welcome/appmanager-tmpl/base.html
@@ -14,9 +14,9 @@
<aside id="menu-nav">
<nav id="menu" class="is-sticky-above-lg">
<ul>
- <li><a href="/" class="{{ if (eq .CurrentPage "ALL") }}primary{{ end }}">All</a></li>
- <li><a href="/installed" class="{{ if (eq .CurrentPage "INSTALLED") }}primary{{ end }}">Installed</a></li>
- <li><a href="/not-installed" class="{{ if (eq .CurrentPage "NOT_INSTALLED") }}primary{{ end }}">Not Installed</a></li>
+ <li><a href="/" class="{{ if (eq .CurrentPage "all") }}primary{{ end }}">All</a></li>
+ <li><a href="/installed" class="{{ if (eq .CurrentPage "installed") }}primary{{ end }}">Installed</a></li>
+ <li><a href="/not-installed" class="{{ if (eq .CurrentPage "not-installed") }}primary{{ end }}">Not Installed</a></li>
<hr>
{{ block "extra_menu" . }}{{ end }}
</ul>
@@ -26,6 +26,6 @@
{{ block "content" . }}{{ end }}
</div>
</main>
- <script src="/static/app-manager.js?v=0.0.2"></script>
+ <script src="/static/app-manager.js?v=0.0.10"></script>
</body>
</html>
diff --git a/core/installer/welcome/appmanager-tmpl/index.html b/core/installer/welcome/appmanager-tmpl/index.html
index 6ba92c3..fcb613f 100644
--- a/core/installer/welcome/appmanager-tmpl/index.html
+++ b/core/installer/welcome/appmanager-tmpl/index.html
@@ -1,13 +1,14 @@
{{ define "header" }}
- <form class="search-bar">
- <input name="search" type="search" placeholder="Search" />
+ <form id="search-form" class="search-bar" method="GET" action="/{{ .SearchTarget }}">
+ <input id="search-input" name="query" type="search" placeholder="Search" value="{{ .SearchValue }}"/>
</form>
+ <input type="hidden" id="page-type" value="{{ .SearchTarget }}" />
{{ end }}
{{ define "content" }}
<aside>
<nav>
- <ul>
+ <ul id="app-list">
{{ range .Apps }}
<li class="app-card">
<a href="/app/{{ .Slug }}" class="app-link">