Commit d1ed046a authored by stef's avatar stef
Browse files

[enh] alcts confirm also on list view

parent 05574d43
......@@ -12,22 +12,17 @@
$("#sortedlist").tablesorter();
$('#sortedlist').tableFilter();
$('.confirm_form').submit(function() {
var self=this;
var email=$(this).find('input:first').attr('value');
if(email) {
$.ajax({url: '/confirm/'+$(this).attr('id')+'/'+email, success: function(data) { $(self).html(data); }});
} else {
$(this).parent().find('.email-box').css('color','red');
};
return false;
var self=this;
$.ajax({url: '/confirm/'+$(this).attr('id')+'/'+$(this).children('input:first').attr('value'), success: function(data) { $(self).find('.info-validate').html(data); }});
return false;
});
$(".confirm > .button").click(function(){
$(this).next().toggleClass('hidden');
});
$(this).parent().parent().parent().find('.info-validate').toggle();
});
$(".cancel-button").click(function(){
$(this).parent().parent().parent().parent().addClass('hidden');
});
});
$(this).parent().parent().hide();
});
});
</script>
{% endblock %}
......@@ -56,30 +51,24 @@
<tbody>
{% for violation in violations %}
<tr>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.country }}</a></td>
<td>
<a class="cell-link" href="/view/{{violation.pk}}">{{ violation.country }}</a>
<div class="info-validate">
<form method="get" id="{{ violation.pk }}" class="confirm_form" >
<label>{% trans "In order to <strong>validate your action</strong>, please enter your email address" %}</label>
<input type="text" name="email" />
<input type="hidden" value="{{ violation.pk }}" />
<input type="submit" value="{% trans "confirm" %}" />
<input class="cancel-button" type="button" value="{% trans "cancel" %}" />
</form>
</div>
</td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.operator }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.contract }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.resource }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.type }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.media }}</a></td>
<td>{{ violation.confirmations }} <div class="confirm"><a class="button">+1</a>
<div class="hidden confirm_popup alpha60">
<div>
<h3>{% trans "Confirmation" %}</h3>
<div>
<small>{% trans "I attest the existence of this infringement" %}<br />
<a href="/view/{{violation.pk}}">{{ violation.operator }} ({{ violation.country }}) {{ violation.contract }}</a></small>
<form method="get" class="confirm_form" id="{{ violation.pk }}">
<div class="email-box">{% trans "E-mail" %}: <input type="text" name="email" /></div>
//{% trans "required" %}<br />
<input type="hidden" value="{{ violation.pk }}" />
<input type="submit" value="confirm" />
<input class="cancel-button" type="button" value="{% trans "cancel" %}" />
</form>
</div>
</div>
</div>
</td>
<td>{{ violation.confirmations }} <div class="confirm"><a class="button">confirm</a></td>
</tr>
{% endfor %}
</tbody>
......
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