Skip to content

Commit

Permalink
feat(templates): delete display table;
Browse files Browse the repository at this point in the history
- Display primary keys of records that are going to be deleted in the confirm delete view.
  • Loading branch information
JVickery-TBS committed Oct 23, 2024
1 parent bc3f436 commit a392066
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ckanext/recombinant/templates/recombinant/confirm_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,36 @@

{% block primary_content_inner %}
{% block form %}
{% set to_delete = bulk_delete.split('\n') %}
{% set primary_keys = h.recombinant_primary_key_fields(resource.name) %}
<p>{{ ungettext(
'Are you sure you want to delete {num} record? This action cannot be undone.',
'Are you sure you want to delete {num} records? This action cannot be undone.',
num).format(num=num) }}</p>

<div class="mrgn-tp-lg mrgn-bttm-lg col-md-6">
<table class="table table-responsive">
<thead>
<th scope="col" class="col-sm-1 border-0"></th>
{% for c in primary_keys %}
<th scope="col">{{ c['label'][h.lang()] }}</th>
{% endfor %}
</thead>
<tbody>
{% for r in to_delete %}
<tr>
<td class="text-danger border-0"><i class="fa fa-minus-circle" aria-hidden="true"></i></td>
{% for _r in r.split(',') %}
<td class="bg-danger text-danger">{{ _r }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>

<div class="clearfix"></div>

<p class="form-actions">
<form id="recombinant-confirm-delete-form" action="{{ h.url_for('recombinant.delete_records',id=dataset.id, resource_id=resource.id) }}" method="post">
{{ h.csrf_input() }}
Expand Down

0 comments on commit a392066

Please sign in to comment.