Allow sorting and filtering of “known Sones.”
[Sone.git] / src / main / resources / templates / knownSones.html
1 <%include include/head.html>
2
3         <div class="page-id hidden">known-sones</div>
4         
5         <script language="javascript">
6
7                 $(document).ready(function() {
8                         $("select[name=sort]").change(function() {
9                                 value = $(this).val();
10                                 if (value == "activity") {
11                                         $("select[name=order]").val("desc");
12                                 } else if (value == "name") {
13                                         $("select[name=order]").val("asc");
14                                 } 
15                         });
16                 });
17         
18         </script>
19
20         <h1><%= Page.KnownSones.Page.Title|l10n|html></h1>
21         
22         <div id="sort-options">
23                 <form action="knownSones.html" method="get">
24                         <div>
25                                 Sort:
26                                 <select name="sort">
27                                         <option value="name"<%if sort|match value="name"> selected="selected"<%/if>>Name</option>
28                                         <option value="activity"<%if sort|match value="activity"> selected="selected"<%/if>>Last activity</option>
29                                 </select>
30                                 <select name="order">
31                                         <option value="asc"<%if order|match value="asc"> selected="selected"<%/if>>Ascending</option>
32                                         <option value="desc"<%if order|match value="desc"> selected="selected"<%/if>>Descending</option>
33                                 </select>
34                         </div>
35                         <%ifnull !currentSone>
36                                 <div>
37                                         Followed Sones:
38                                         <select name="followedSones">
39                                                 <option value="none"></option>
40                                                 <option value="show-only"<%if followedSones|match value="show-only"> selected="selected"<%/if>>Show only followed Sones</option>
41                                                 <option value="hide"<%if followedSones|match value="hide"> selected="selected"<%/if>>Hide followed Sones</option>
42                                         </select>
43                                 </div>
44                         <%/if>
45                         <div>
46                                 <button type="submit">Apply</button>
47                         </div>
48                 </form>
49         </div>
50
51         <div id="known-sones">
52                 <%= page|store key=pageParameter>
53                 <%include include/pagination.html>
54                 <%foreach pagination.items sone>
55                         <%include include/viewSone.html>
56                 <%foreachelse>
57                         <div><%= Page.KnownSones.Text.NoKnownSones|l10n|html></div>
58                 <%/foreach>
59                 <%include include/pagination.html>
60         </div>
61
62 <%include include/tail.html>