Reload page on changes in sort options.
[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                         $("#sort-options select").change(function() {
17                                 this.form.submit();
18                         });
19                 });
20         
21         </script>
22
23         <h1><%= Page.KnownSones.Page.Title|l10n|html></h1>
24         
25         <div id="sort-options">
26                 <form action="knownSones.html" method="get">
27                         <div>
28                                 Sort:
29                                 <select name="sort">
30                                         <option value="name"<%if sort|match value="name"> selected="selected"<%/if>>Name</option>
31                                         <option value="activity"<%if sort|match value="activity"> selected="selected"<%/if>>Last activity</option>
32                                 </select>
33                                 <select name="order">
34                                         <option value="asc"<%if order|match value="asc"> selected="selected"<%/if>>Ascending</option>
35                                         <option value="desc"<%if order|match value="desc"> selected="selected"<%/if>>Descending</option>
36                                 </select>
37                         </div>
38                         <%ifnull !currentSone>
39                                 <div>
40                                         Followed Sones:
41                                         <select name="followedSones">
42                                                 <option value="none"></option>
43                                                 <option value="show-only"<%if followedSones|match value="show-only"> selected="selected"<%/if>>Show only followed Sones</option>
44                                                 <option value="hide"<%if followedSones|match value="hide"> selected="selected"<%/if>>Hide followed Sones</option>
45                                         </select>
46                                 </div>
47                         <%/if>
48                         <div>
49                                 <button type="submit">Apply</button>
50                         </div>
51                 </form>
52         </div>
53
54         <div id="known-sones">
55                 <%= page|store key=pageParameter>
56                 <%include include/pagination.html>
57                 <%foreach pagination.items sone>
58                         <%include include/viewSone.html>
59                 <%foreachelse>
60                         <div><%= Page.KnownSones.Text.NoKnownSones|l10n|html></div>
61                 <%/foreach>
62                 <%include include/pagination.html>
63         </div>
64
65 <%include include/tail.html>