} else {
Collections.sort(knownSones, Sone.LAST_ACTIVITY_COMPARATOR);
}
+ } else if ("posts".equals(sortField)) {
+ if ("asc".equals(sortOrder)) {
+ Collections.sort(knownSones, new ReverseComparator<Sone>(Sone.POST_COUNT_COMPARATOR));
+ } else {
+ Collections.sort(knownSones, Sone.POST_COUNT_COMPARATOR);
+ }
} else {
if ("desc".equals(sortOrder)) {
Collections.sort(knownSones, new ReverseComparator<Sone>(Sone.NICE_NAME_COMPARATOR));
$(document).ready(function() {
$("select[name=sort]").change(function() {
value = $(this).val();
- if (value == "activity") {
+ if ((value == "activity") || (value == "posts")) {
$("select[name=order]").val("desc");
} else if (value == "name") {
$("select[name=order]").val("asc");
<select name="sort">
<option value="name"<%if sort|match value="name"> selected="selected"<%/if>>Name</option>
<option value="activity"<%if sort|match value="activity"> selected="selected"<%/if>>Last activity</option>
+ <option value="posts"<%if sort|match value="posts"> selected="selected"<%/if>>Number of posts</option>
</select>
<select name="order">
<option value="asc"<%if order|match value="asc"> selected="selected"<%/if>>Ascending</option>