Add “follow all Sones” and “unfollow all Sones” 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")) {
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                                         <option value="posts"<%if sort|match value="posts"> selected="selected"<%/if>>Number of posts</option>
33                                 </select>
34                                 <select name="order">
35                                         <option value="asc"<%if order|match value="asc"> selected="selected"<%/if>>Ascending</option>
36                                         <option value="desc"<%if order|match value="desc"> selected="selected"<%/if>>Descending</option>
37                                 </select>
38                         </div>
39                         <%ifnull !currentSone>
40                                 <div>
41                                         Followed Sones:
42                                         <select name="followedSones">
43                                                 <option value="none"></option>
44                                                 <option value="show-only"<%if followedSones|match value="show-only"> selected="selected"<%/if>>Show only followed Sones</option>
45                                                 <option value="hide"<%if followedSones|match value="hide"> selected="selected"<%/if>>Hide followed Sones</option>
46                                         </select>
47                                 </div>
48                         <%/if>
49                         <div>
50                                 <button type="submit">Apply</button>
51                         </div>
52                 </form>
53         </div>
54
55         <div>
56                 <form action="followSone.html" method="post">
57                         <input type="hidden" name="formPassword" value="<%formPassword|html>" />
58                         <input type="hidden" name="returnPage" value="<%request.uri|html>" />
59                         <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if !sone.friend><%if !sone.current><%sone.id> <%/if><%/if><%/foreach>" />
60                         <button type="submit"><%= Page.KnownSones.Button.FollowAllSones|l10n|html></button>
61                 </form>
62         </div>
63
64         <div>
65                 <form action="unfollowSone.html" method="post">
66                         <input type="hidden" name="formPassword" value="<%formPassword|html>" />
67                         <input type="hidden" name="returnPage" value="<%request.uri|html>" />
68                         <input type="hidden" name="sone" value="<%foreach pagination.items sone><%if sone.friend><%sone.id> <%/if><%/foreach>" />
69                         <button type="submit"><%= Page.KnownSones.Button.UnfollowAllSones|l10n|html></button>
70                 </form>
71         </div>
72
73         <div id="known-sones">
74                 <%= page|store key=pageParameter>
75                 <%include include/pagination.html>
76                 <%foreach pagination.items sone>
77                         <%include include/viewSone.html>
78                 <%foreachelse>
79                         <div><%= Page.KnownSones.Text.NoKnownSones|l10n|html></div>
80                 <%/foreach>
81                 <%include include/pagination.html>
82         </div>
83
84 <%include include/tail.html>