template remake
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
const selectAllCheckbox = document.getElementById("select-all");
|
||||
if (selectAllCheckbox) {
|
||||
selectAllCheckbox.addEventListener("click", function(){
|
||||
const checkboxes = document.querySelectorAll("input[name='invoices[]']");
|
||||
const checkboxes = document.querySelectorAll("input[name='invoices']");
|
||||
checkboxes.forEach(chk => chk.checked = selectAllCheckbox.checked);
|
||||
});
|
||||
}
|
||||
@@ -27,7 +27,6 @@
|
||||
<h1>Добавление участников лотереи: {{ lottery.name }}</h1>
|
||||
<p>{{ lottery.description }}</p>
|
||||
|
||||
<!-- Форма фильтрации -->
|
||||
<form method="get" class="mb-4">
|
||||
<input type="hidden" name="lottery_id" value="{{ lottery.id }}">
|
||||
<div class="row">
|
||||
@@ -67,7 +66,6 @@
|
||||
|
||||
<p><strong>Найдено подходящих счетов: {{ invoice_count }}</strong></p>
|
||||
|
||||
<!-- Форма добавления участников -->
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="table-responsive">
|
||||
@@ -88,29 +86,27 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for invoice in form.fields.invoices.queryset %}
|
||||
{% for invoice in invoices %}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="invoices[]" value="{{ invoice.id }}"></td>
|
||||
<td>{{ invoice.created_at|date:"d.m.Y H:i" }}</td>
|
||||
<td>{% if invoice.closed_at %}{{ invoice.closed_at|date:"d.m.Y H:i"}}{% else %}—{% endif %}</td>
|
||||
<td><input type="checkbox" name="invoices" value="{{ invoice.id }}"></td>
|
||||
<td>{{ invoice.created_at|date:"Y-m-d H:i" }}</td>
|
||||
<td>{% if invoice.closed_at %}{{ invoice.closed_at|date:"Y-m-d H:i" }}{% else %}—{% endif %}</td>
|
||||
<td>{{ invoice.ext_id|default:"—" }}</td>
|
||||
<td>{{ invoice.client.name|default:"Не указан" }}</td>
|
||||
<td>{{ invoice.client.club_card_number|default:"—" }}</td>
|
||||
<td>{{ invoice.sum|default:"—" }}</td>
|
||||
<td>{{ invoice.bonus|default:"—" }}</td>
|
||||
<td>{{ invoice.start_bonus|default:"—" }}</td>
|
||||
<td>{{ invoice.deposit_sum|default:"—" }}</td>
|
||||
<td>{{ invoice.sum|floatformat:2|default:"—" }}</td>
|
||||
<td>{{ invoice.bonus|floatformat:2|default:"—" }}</td>
|
||||
<td>{{ invoice.start_bonus|floatformat:2|default:"—" }}</td>
|
||||
<td>{{ invoice.deposit_sum|floatformat:2|default:"—" }}</td>
|
||||
<td>{{ invoice.notes|default:"—" }}</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="11" class="text-center">Нет доступных счетов</td>
|
||||
</tr>
|
||||
<tr><td colspan="11" class="text-center">Нет доступных счетов</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Добавить выбранные счета</button>
|
||||
<button type="submit" class="btn btn-success">Добавить выбранные счета</button>
|
||||
</form>
|
||||
|
||||
<a href="{% url 'admin:draw_lotteryparticipant_changelist' %}" class="btn btn-secondary mt-3">Вернуться к списку участников</a>
|
||||
|
||||
Reference in New Issue
Block a user