Add optional parameter to hide moving buttons
[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") || (value == "posts") || (value == "images")) {
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                                 <%= Page.KnownSones.Label.Sort|l10n|html>
29                                 <select name="sort">
30                                         <option value="name"<%if sort|match value=="name"> selected="selected"<%/if>><%= Page.KnownSones.Sort.Field.Name|l10n|html></option>
31                                         <option value="activity"<%if sort|match value=="activity"> selected="selected"<%/if>><%= Page.KnownSones.Sort.Field.LastActivity|l10n|html></option>
32                                         <option value="posts"<%if sort|match value=="posts"> selected="selected"<%/if>><%= Page.KnownSones.Sort.Field.Posts|l10n|html></option>
33                                         <option value="images"<%if sort|match value=="images"> selected="selected"<%/if>><%= Page.KnownSones.Sort.Field.Images|l10n|html></option>
34                                 </select>
35                                 <select name="order">
36                                         <option value="asc"<%if order|match value=="asc"> selected="selected"<%/if>><%= Page.KnownSones.Sort.Order.Ascending|l10n|html></option>
37                                         <option value="desc"<%if order|match value=="desc"> selected="selected"<%/if>><%= Page.KnownSones.Sort.Order.Descending|l10n|html></option>
38                                 </select>
39                         </div>
40                         <%ifnull !currentSone>
41                                 <div>
42                                         <%= Page.KnownSones.Label.FilterSones|l10n|html>
43                                         <select name="filter">
44                                                 <option value="none"></option>
45                                                 <%ifnull !currentSone>
46                                                         <option value="followed"<%if filter|match value=="followed"> selected="selected"<%/if>><%= Page.KnownSones.Filter.Followed|l10n|html></option>
47                                                         <option value="not-followed"<%if filter|match value=="not-followed"> selected="selected"<%/if>><%= Page.KnownSones.Filter.NotFollowed|l10n|html></option>
48                                                 <%/if>
49                                                 <option value="new"<%if filter|match value=="new"> selected="selected"<%/if>><%= Page.KnownSones.Filter.New|l10n|html></option>
50                                                 <option value="not-new"<%if filter|match value=="not-new"> selected="selected"<%/if>><%= Page.KnownSones.Filter.NotNew|l10n|html></option>
51                                                 <option value="own"<%if filter|match value=="own"> selected="selected"<%/if>><%= Page.KnownSones.Filter.Own|l10n|html></option>
52                                                 <option value="not-own"<%if filter|match value=="not-own"> selected="selected"<%/if>><%= Page.KnownSones.Filter.NotOwn|l10n|html></option>
53                                         </select>
54                                 </div>
55                         <%/if>
56                         <div>
57                                 <button type="submit"><%= Page.KnownSones.Button.Apply|l10n|html></button>
58                         </div>
59                 </form>
60         </div>
61
62         <%if !pagination.items.empty>
63                 <div>
64                         <form action="followSone.html" method="post">
65                                 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
66                                 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
67                                 <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if !sone.friend><%if !sone.current><%sone.id> <%/if><%/if><%/foreach>" />
68                                 <button type="submit"><%= Page.KnownSones.Button.FollowAllSones|l10n|html></button>
69                         </form>
70                 </div>
71
72                 <div>
73                         <form action="unfollowSone.html" method="post">
74                                 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
75                                 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
76                                 <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if sone.friend><%sone.id> <%/if><%/foreach>" />
77                                 <button type="submit"><%= Page.KnownSones.Button.UnfollowAllSones|l10n|html></button>
78                         </form>
79                 </div>
80         <%/if>
81
82         <div id="known-sones">
83                 <%include include/pagination.html pageParameter==page>
84                 <%foreach pagination.items sone>
85                         <%include include/viewSone.html>
86                 <%foreachelse>
87                         <div><%= Page.KnownSones.Text.NoKnownSones|l10n|html></div>
88                 <%/foreach>
89                 <%include include/pagination.html pageParameter==page>
90         </div>
91
92 <%include include/tail.html>