89 lines
3.2 KiB
HTML
89 lines
3.2 KiB
HTML
{% extends "lingo/invoicing/manager_campaign_detail.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
<a href="{% url 'lingo-manager-invoicing-pool-detail' pk=object.pk pool_pk=pool.pk %}">{% trans "Pool" %}</a>
|
|
{% endblock %}
|
|
|
|
{% block appbar %}
|
|
<h2 id="pool-title">
|
|
{% if pool.success_count %}<span class="tag tag-success">{{ pool.success_count }}</span>{% endif %}
|
|
{% if pool.warning_count %}<span class="tag tag-warning">{{ pool.warning_count }}</span>{% endif %}
|
|
{% if pool.error_count %}<span class="tag tag-error">{{ pool.error_count }}</span>{% endif %}
|
|
{{ pool.created_at|date:"DATETIME_FORMAT" }}
|
|
</h2>
|
|
{% if pool.draft and pool.status != 'registered' and pool.status != 'running' %}
|
|
<span class="actions">
|
|
<a href="{% url 'lingo-manager-invoicing-pool-delete' pk=object.pk pool_pk=pool.pk %}" rel="popup">{% trans "Delete" %}</a>
|
|
</span>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
{% if pool.status == 'failed' %}
|
|
<div class="pk-error">
|
|
<p>{% trans "Error while running pool." %}</p>
|
|
{% if pool.exception %}<pre>{{ pool.exception }}</pre>{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
<table class="main pools">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans "PK" %}</th>
|
|
<th>{% trans "Invoice PK" %}</th>
|
|
<th>{% trans "Label" %}</th>
|
|
<th>{% trans "Slug" %}</th>
|
|
<th>{% trans "Quantity" %}</th>
|
|
<th>{% trans "Unit amount" %}</th>
|
|
<th>{% trans "Total amount" %}</th>
|
|
<th>{% trans "User" %}</th>
|
|
<th>{% trans "Payer" %}</th>
|
|
<th>{% trans "Status" %}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for line in lines %}
|
|
<tr data-line-id="{{ line.pk }}">
|
|
<td class="line_id">{{ line.pk }}</td>
|
|
<td>{{ line.invoice_id|default:'' }}</td>
|
|
<td>{{ line.label }}</td>
|
|
<td>{{ line.slug }}</td>
|
|
<td>{{ line.quantity }}</td>
|
|
<td>{{ line.unit_amount }}</td>
|
|
<td>{{ line.total_amount }}</td>
|
|
<td>{{ line.user_external_id }}</td>
|
|
<td>{{ line.payer_external_id }}</td>
|
|
<td class="status">
|
|
<span class="tag tag-{{ line.status }}">{{ line.get_status_display }}</span>
|
|
{% if line.status != 'success' %}({{ line.get_error_display }}){% endif %}
|
|
{% if line.from_injected_line_id %}({% trans "Injected" %}){% endif %}
|
|
</td>
|
|
<td><a class="details-toggle">{% trans "see details" %}</a></td>
|
|
</tr>
|
|
<tr data-details-for-line-id="{{ line.pk }}" style="display: none">
|
|
<td colspan="10">
|
|
<pre>{{ line.pricing_data|pprint }}</pre>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<script>
|
|
$(function() {
|
|
$('a.details-toggle').on('click', function() {
|
|
var line_id = $(this).parents('tr').data('line-id');
|
|
var $details = $('tr[data-details-for-line-id=' + line_id + ']');
|
|
if ($details.is(':visible')) {
|
|
$(this).text('{% trans "see details" %}');
|
|
$details.hide();
|
|
} else {
|
|
$(this).text('{% trans "hide details" %}');
|
|
$details.show();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|