welco/welco/contrib/alfortville/templates/alfortville/dg-table.html

64 lines
1.7 KiB
HTML

{% extends "welco/base.html" %}
{% load i18n static %}
{% block bodyargs %}class="mail-dg-table"{% endblock %}
{% block breadcrumb %}
{{block.super}}
<a href=".">{{home_screen_title}}</a>
{% endblock %}
{% block content %}
<form method="post" action="qualif-many">
<div class="source-mail all">
<div class="cell document top">
{% if source.get_queryset %}
<div>
<table class="main">
<thead>
<th>{% trans 'Post Date' %}</th>
<th>{% trans 'Reference' %}</th>
<th>{% trans 'Subject' %}</th>
<th>{% trans 'User' %}</th>
<th>{% trans 'Category' %}</th>
<th>{% trans 'Related Forms' %}</th>
<th><input type="checkbox" title="{% trans "Click to (un)toggle all mails" %}" id="click-all-pks"/></th>
</thead>
<tbody>
{% for object in mails %}
<tr data-mail-id="{{object.id}}">
<td class="r">{{object.post_date|date:"d F Y"|lower}}</td>
<td class="r">{{object.reference|default:'-'}}</td>
<td class="r">{{object.subject|default:'-'}}</td>
<td class="r">{{object.contact_name }}</td>
<td class="r">{{object.categories|join:", " }}</td>
<td class="r">{% for association in object.associations.all %}{{association.formdef_name}}{% if not forloop.last %}, {% endif %}{% endfor %}</td>
<td><input type="checkbox" name="pks" value="{{object.id}}"/></td>
</tr>
{% endfor %}
</tbody>
<script>
$('td.r').click(function() {
window.open('../?' + $(this).parent().data('mail-id'), target='_welco_dg');
});
$('input#click-all-pks').click(function(e) {
$('input[name="pks"]').prop('checked', $(this).prop('checked'));
});
</script>
</table>
</div>
<div id="dg-transmit">
{% csrf_token %}
<button>Transmettre</button>
</form>
{%else %}
<p class="no-mail-table">
{% trans 'There is currently no mail in this list.' %}
</p>
{% endif %}
</div>
</div>
{% endblock %}