Commit 3c32aff1 by Rocky Duan

disable asc sorting for now

parent 0992be37
...@@ -126,6 +126,7 @@ initializeFollowDiscussion = (discussion) -> ...@@ -126,6 +126,7 @@ initializeFollowDiscussion = (discussion) ->
$local(".new-post-form").show() $local(".new-post-form").show()
handleAjaxReloadDiscussion = (elem, url) -> handleAjaxReloadDiscussion = (elem, url) ->
if not url then return
$elem = $(elem) $elem = $(elem)
$discussion = $elem.parents("section.discussion") $discussion = $elem.parents("section.discussion")
Discussion.safeAjax Discussion.safeAjax
......
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
<%def name="link_to_sort(key, title)"> <%def name="link_to_sort(key, title)">
% if key == sort_key: % if key == sort_key:
${_link_to_sort(key, None, title + '', 'sorted')}
<!---
% if sort_order.lower() == 'desc': % if sort_order.lower() == 'desc':
${_link_to_sort(key, 'asc', title + '', 'sorted')} ${_link_to_sort(key, 'asc', title + '', 'sorted')}
% else: % else:
${_link_to_sort(key, 'desc', title + '', 'sorted')} ${_link_to_sort(key, 'desc', title + '', 'sorted')}
% endif % endif
-->
% else: % else:
${_link_to_sort(key, 'desc', title)} ${_link_to_sort(key, 'desc', title)}
% endif % endif
...@@ -18,7 +21,10 @@ ...@@ -18,7 +21,10 @@
return dict(dic1.items() + dic2.items()) return dict(dic1.items() + dic2.items())
def url_for_sort(key, order): def url_for_sort(key, order):
return base_url + '?' + urlencode(merge(query_params, {'page': 1, 'sort_key': key, 'sort_order': order})) if order is None:
return ''
else:
return base_url + '?' + urlencode(merge(query_params, {'page': 1, 'sort_key': key, 'sort_order': order}))
%> %>
<a class="discussion-sort-link ${cls}" href="javascript:void(0)" sort-url="${url_for_sort(key, order)}">${title}</a> <a class="discussion-sort-link ${cls}" href="javascript:void(0)" sort-url="${url_for_sort(key, order)}">${title}</a>
</%def> </%def>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment