Coding standards

This commit is contained in:
Romain Neutron
2012-02-02 15:43:12 +01:00
parent 879166bbe1
commit a9c7ed23cb
19 changed files with 67 additions and 56 deletions

View File

@@ -83,10 +83,10 @@
</tbody>
</table>
<script>
$(document).ready(function(){
var $editor = $('#list-editor-search-results');
$('th.sortable', $editor).bind('click', function(){
var $this = $(this);
@@ -95,7 +95,7 @@
var $form = $this.closest('.editor').find('form[name="list-editor-search"]');
if((sort == $('input[name="srt"]', $form).val())
if((sort == $('input[name="srt"]', $form).val())
&& ($('input[name="ord"]', $form).val() == 'asc'))
{
var ord = 'desc';
@@ -112,19 +112,19 @@
})
.bind('mouseover', function(){$(this).addClass('hover');})
.bind('mouseout', function(){$(this).removeClass('hover');});
$('tbody tr', $editor).bind('click', function(){
var $this = $(this);
var usr_id = $('input[name="usr_id"]', $this).val();
var counters = $('#ListManager .counter.current, #ListManager .lists .list.selected .counter');
if($this.hasClass('selected'))
{
$this.removeClass('selected');
p4.ListManager.getList().removeUser(usr_id);
counters.each(function(i,el){
var n = parseInt($(el).text());
$(el).text(n - 1);
@@ -134,15 +134,15 @@
{
$this.addClass('selected');
p4.ListManager.getList().addUser(usr_id);
counters.each(function(i,el){
var n = parseInt($(el).text());
$(el).text(n + 1);
});
}
});
});
</script>
{% endmacro %}
{% endmacro %}

View File

@@ -1,3 +1,3 @@
{% import 'prod/actions/Feedback/ListsMacros.html.twig' as ListsMacros %}
{{ ListsMacros.ResultTable(results, list, sort, ord) }}
{{ ListsMacros.ResultTable(results, list, sort, ord) }}

View File

@@ -21,7 +21,7 @@
</div>
<form name="list-editor-search" method="POST" action="/prod/push/edit-list/{{ list.getId() }}/">
<div class="PNB" style="top:40px;height:40px;bottom:auto;">
<select name="like_field">
<option value="usr_login">
{% trans 'Push::filter on login' %}
@@ -48,9 +48,9 @@
<button type="submit">
{% trans 'boutton::chercher' %}
</button>
</div>
<div class="PNB" style="top:80px;height:120px;bottom:auto;">
<table style="table-layout:fixed;">
@@ -113,7 +113,7 @@
</tr>
</table>
</div>
<input type="hidden" name="page" value="" />
<input type="hidden" name="srt" value="{{ sort }}" />
<input type="hidden" name="ord" value="{{ ord }}" />