X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/390a606c867e39c828628322621419d9d2bce453..51b7f4ab41479e5a0cbfc171a274a82fd4100140:/forum/skins/default/templates/osqaadmin/nodeman.html diff --git a/forum/skins/default/templates/osqaadmin/nodeman.html b/forum/skins/default/templates/osqaadmin/nodeman.html index af8d1ce..500e05b 100644 --- a/forum/skins/default/templates/osqaadmin/nodeman.html +++ b/forum/skins/default/templates/osqaadmin/nodeman.html @@ -7,14 +7,37 @@ $(function() { var $form = $('#changelist-search'); + $('#all-node-type-link').click(function() { + $('#type-filter-container').find('input').remove(); + $form.submit(); + }); + $('.node-type-link').click(function() { - $form.find('#id_state_type').val('any'); - $form.find('#id_node_type').val($(this).attr('href').substring(1)); + var link_type = $(this).attr('href').substring(1); + + if ($('#type-filter-container').find('input[value=' + link_type + ']').length == 0) { + $('#type-filter-container').append($("")); + } else { + $('#type-filter-container').find('input[value=' + link_type + ']').remove(); + } + + $form.submit(); + }); + + $('#all-state-link').click(function() { + $('#state-filter-container').find('input').remove(); $form.submit(); }); $('.state-type-link').click(function() { - $form.find('#id_state_type').val($(this).attr('href').substring(1)); + var state_type = $(this).attr('href').substring(1); + + if ($('#state-filter-container').find('input[value=' + state_type + ']').length == 0) { + $('#state-filter-container').append($("")); + } else { + $('#state-filter-container').find('input[value=' + state_type + ']').remove(); + } + $form.submit(); }); @@ -114,6 +137,46 @@ } }); + var resize_data = null; + + $('.col-resizer').mousedown(function(e) { + var $to_resize = $(this).prev(); + + resize_data = { + resizer: $(this), + to_resize: $to_resize, + start_width: $to_resize.innerWidth(), + x_start: e.pageX, + } + }); + + $('body').mousemove(function(e) { + if (resize_data != null) { + var new_size = (resize_data.start_width - (resize_data.x_start - e.pageX)) + 'px'; + resize_data.to_resize.css({'max-width': new_size, 'min-width': new_size}) + resize_data.resizer.css('max-width', '3px'); + } + }); + + $('body').mouseup(function() { + if (resize_data != null) + resize_data = null; + }); + + $('#filter-panel-header').click(function() { + $('#filter-panel').slideToggle(); + }); + + $('#state-filter-type').change(function() { + $('#state-filter-type-hidden').val($(this).val()); + $form.submit(); + }); + + $('#reset-text-filter').click(function() { + $('#text-filter-input').val(''); + $form.submit(); + return false; + }); }); @@ -185,15 +276,34 @@
-

{% trans "Filter" %}

+

{% trans "Filter" %} ({% trans "Click to show/hide" %})

+

{% trans "By type" %}

{% trans "By state" %}

{% trans "By author(s)" %}

{% if not authors.count %} @@ -276,6 +408,7 @@
{{ show_form.show }}
{% endcomment %} +
@@ -284,6 +417,7 @@ @@ -295,31 +429,38 @@ {% declare %} current_sort = nodes.paginator.current_sort - added_at = current_sort == "added_at" and "descending" or (current_sort == "added_at_asc" and "ascending" or "") - score = current_sort == "score" and "descending" or (current_sort == "score_asc" and "ascending" or "") - act_at = current_sort == "act_at" and "descending" or (current_sort == "act_at_asc" and "ascending" or "") + added_at = current_sort == "added_at" and "ascending" or (current_sort == "added_at_asc" and "descending" or "") + author = current_sort == "author" and "ascending" or (current_sort == "author_asc" and "descending" or "") + score = current_sort == "score" and "ascending" or (current_sort == "score_asc" and "descending" or "") + act_at = current_sort == "act_at" and "ascending" or (current_sort == "act_at_asc" and "descending" or "") + act_by = current_sort == "act_by" and "ascending" or (current_sort == "act_by_asc" and "descending" or "") added_at_link = current_sort == "added_at" and nodes.paginator.added_at_asc_sort_link or nodes.paginator.added_at_sort_link + author_link = current_sort == "author_asc" and nodes.paginator.author_sort_link or nodes.paginator.author_asc_sort_link score_link = current_sort == "score" and nodes.paginator.score_asc_sort_link or nodes.paginator.score_sort_link act_at_link = current_sort == "act_at" and nodes.paginator.act_at_asc_sort_link or nodes.paginator.act_at_sort_link + act_by_link = current_sort == "act_by_asc" and nodes.paginator.act_by_sort_link or nodes.paginator.act_by_asc_sort_link {% enddeclare %} {% spaceless %} - - {% ifequal filter_form.node_type.data "all" %} - {% trans "Type" %} - {% endifequal %} + + {% trans "Type" %} {% trans "Summary" %} + {% trans "State" %} - {% trans "Author" %} + + {% trans "Author" %} + {% trans "Added at" %} - + + + {% trans "Last activity by" %} - {% trans "Last acivity by" %} {% trans "Last activity at" %} @@ -328,21 +469,38 @@ + {% with filter_form.state_type.data as state_type %} {% for node in nodes.paginator.page %} - {% ifequal filter_form.node_type.data "all" %} - {{ node.friendly_name }} - {% endifequal %} - - {{ node.headline }}
+ {{ node.friendly_name }} + {% declare %} + is_root = node.abs_parent == None + title = is_root and node.title or node.abs_parent.title + + anchor = "%s" % html.hyperlink(node.get_absolute_url(), title) + anchor = ((not is_root) and node.abs_parent.nis.deleted) and "%s" % anchor or anchor + anchor = is_root and anchor or "(%s)" % anchor + anchor = html.mark_safe(anchor) + + td_class = "" + td_class = node.nis.accepted and "accepted" or td_class + td_class = node.nis.deleted and "deleted" or td_class + {% enddeclare %} + + {{ anchor }}
{{ node.summary }} - {{ node.state_list|join:", " }} - {{ node.author.username }} + + {% for state in node.states.all %} + {{ state.state_type }} {% diff_date state.action.at %} {% trans "by" %} + {{ state.action.by.decorated_name }}
+ {% endfor %} + + {{ node.author.decorated_name }} {% diff_date node.added_at %} - {{ node.score }} - {{ node.last_activity_by.username }} + + {{ node.last_activity_by.decorated_name }} {% diff_date node.last_activity_at %} {% for t in node.tags.all %} @@ -352,6 +510,7 @@ {% endfor %} + {% endwith %} {{ nodes.paginator.page_numbers }}