afd40dffd6d23c4d4f5c0adf41cf82b1f97dc995
[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                                         </select>
52                                 </div>
53                         <%/if>
54                         <div>
55                                 <button type="submit"><%= Page.KnownSones.Button.Apply|l10n|html></button>
56                         </div>
57                 </form>
58         </div>
59
60         <%if !pagination.items.empty>
61                 <div>
62                         <form action="followSone.html" method="post">
63                                 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
64                                 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
65                                 <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if !sone.friend><%if !sone.current><%sone.id> <%/if><%/if><%/foreach>" />
66                                 <button type="submit"><%= Page.KnownSones.Button.FollowAllSones|l10n|html></button>
67                         </form>
68                 </div>
69
70                 <div>
71                         <form action="unfollowSone.html" method="post">
72                                 <input type="hidden" name="formPassword" value="<%formPassword|html>" />
73                                 <input type="hidden" name="returnPage" value="<%request.uri|html>" />
74                                 <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if sone.friend><%sone.id> <%/if><%/foreach>" />
75                                 <button type="submit"><%= Page.KnownSones.Button.UnfollowAllSones|l10n|html></button>
76                         </form>
77                 </div>
78         <%/if>
79
80         <div id="known-sones">
81                 <%= page|store key=pageParameter>
82                 <%include include/pagination.html>
83                 <%foreach pagination.items sone>
84                         <%include include/viewSone.html>
85                 <%foreachelse>
86                         <div><%= Page.KnownSones.Text.NoKnownSones|l10n|html></div>
87                 <%/foreach>
88                 <%include include/pagination.html>
89         </div>
90
91 <%include include/tail.html>