diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-06-19 14:13:29 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-06-19 14:13:29 +0200 |
| commit | fa9fdb70b3c7b32f457a71859ad2647860166d24 (patch) | |
| tree | 0591008637bcd3198783f88db608c1cbfcdada09 /templates | |
| parent | 60e3ab8f5edd4513581d674e2b18acdf2d32af10 (diff) | |
| download | jokevote-fa9fdb70b3c7b32f457a71859ad2647860166d24.tar.gz jokevote-fa9fdb70b3c7b32f457a71859ad2647860166d24.zip | |
expose sort options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/index.html | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/templates/index.html b/templates/index.html index 861f259..b08f68b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -34,17 +34,34 @@ </div> </form> {% endif %} - <form> - <div class="col s9 input-field"> - <label for="search">Stichworte</label> - <input type="text" name="filter"> + <div class="col s12"> + <form> + <div class="col s9 input-field"> + <label for="search">Stichworte</label> + <input type="text" name="filter"> + </div> + <div class="col s3"> + <button class="btn" type="submit">Suchen</button> + </div> + </form> + </div> + <div class="right"> + <div class="col offset-s5 s5"> + <form> + <div class="input-field"> + <select name="sort" onchange="this.form.submit();"> + {% for meth in [["rank", "Angesagt"], ["score", "Punkte"], ["age", "Alter"], ["unread", "Ungelesen"]] %} + <option value="{{ meth[0] }}"{% if selected_sort == meth[0] %} selected{% endif %}>{{ meth[1] }}</option> + {% endfor %} + </select> + <label>Sortierung</label> + </div> + <noscript><input type="submit" value="Anzeigen"></noscript> + </form> </div> - <div class="col s3"> - <button class="btn" type="submit">Suchen</button> + <div class="col s2"> + <a id="export" target="_blank" class="btn-floating btn-large right" href="/export{% if query %}?{{ query }}{% endif %}"><i class="material-icons">file_download</i></a> </div> - </form> - <div class="col s2 m12 l2 right"> - <a id="export" target="_blank" class="btn-floating btn-large right" href="/export{% if query %}?{{ query }}{% endif %}"><i class="material-icons">file_download</i></a> </div> </div> </header> @@ -148,11 +165,17 @@ </main> </div> <script type="text/javascript"> + function materialjs() { + $('select').material_select(); + } + $(document).ready(function() { + materialjs(); $('#main').smoothState({ prefetch: true, locationHeader: 'X-SmoothState-Location', - blacklist: '#export' + blacklist: '#export', + onAfter: materialjs }); }); function openEditor(me) { |
