2024-01-17 16:25:42 -05:00
|
|
|
{% extends 'generic/_base.html' %}
|
2018-01-10 15:48:07 -05:00
|
|
|
{% load helpers %}
|
|
|
|
{% load form_helpers %}
|
2023-07-29 03:30:25 +07:00
|
|
|
{% load i18n %}
|
2018-01-10 15:48:07 -05:00
|
|
|
|
2024-05-02 17:02:51 -04:00
|
|
|
{% comment %}
|
|
|
|
Blocks:
|
|
|
|
- title: Page title
|
|
|
|
- tabs: Page tabs
|
|
|
|
- content: Primary page content
|
|
|
|
|
|
|
|
Context:
|
|
|
|
- form: The bulk edit form class
|
|
|
|
- obj_type_plural: The plural form of the object type
|
|
|
|
- selected_objects: A queryset matching the objects selected for bulk renaming
|
|
|
|
- return_url: The URL to which the user is redirected after submitting the form
|
|
|
|
{% endcomment %}
|
|
|
|
|
2023-08-02 14:53:32 -04:00
|
|
|
{% block title %}
|
|
|
|
{% trans "Renaming" %} {{ selected_objects|length }} {{ obj_type_plural|bettertitle }}
|
|
|
|
{% endblock %}
|
2021-04-18 11:35:42 -07:00
|
|
|
|
2024-01-17 16:25:42 -05:00
|
|
|
{% block tabs %}
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<button class="nav-link active" type="button" role="tab" aria-controls="edit-form" aria-selected="true">
|
|
|
|
{% trans "Bulk Rename" %}
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
{% endblock tabs %}
|
|
|
|
|
2018-01-10 15:48:07 -05:00
|
|
|
{% block content %}
|
2021-04-21 11:31:28 -07:00
|
|
|
<div class="row mb-3">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-7">
|
2021-07-11 21:24:36 -04:00
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-07-29 03:30:25 +07:00
|
|
|
<th>{% trans "Current Name" %}</th>
|
|
|
|
<th>{% trans "New Name" %}</th>
|
2021-07-11 21:24:36 -04:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for obj in selected_objects %}
|
|
|
|
<tr{% if obj.new_name and obj.name != obj.new_name %} class="success"{% endif %}>
|
|
|
|
<td>{{ obj.name }}</td>
|
|
|
|
<td>{{ obj.new_name }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2021-04-21 11:31:28 -07:00
|
|
|
</div>
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-5">
|
2021-04-21 11:31:28 -07:00
|
|
|
<form action="" method="post" class="form form-horizontal">
|
|
|
|
{% csrf_token %}
|
|
|
|
<div class="card">
|
2023-07-29 03:30:25 +07:00
|
|
|
<h5 class="card-header">{% trans "Rename" %}</h5>
|
2021-04-21 11:31:28 -07:00
|
|
|
<div class="card-body">
|
|
|
|
{% render_form form %}
|
2018-01-10 15:48:07 -05:00
|
|
|
</div>
|
2021-04-21 11:31:28 -07:00
|
|
|
</div>
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-12 my-3 text-end">
|
2024-01-17 16:25:42 -05:00
|
|
|
<a href="{{ return_url }}" class="btn btn-outline-secondary">{% trans "Cancel" %}</a>
|
2023-07-29 03:30:25 +07:00
|
|
|
<button type="submit" name="_preview" class="btn btn-primary">{% trans "Preview" %}</button>
|
2021-04-21 11:31:28 -07:00
|
|
|
{% if '_preview' in request.POST and not form.errors %}
|
2023-07-29 03:30:25 +07:00
|
|
|
<button type="submit" name="_apply" class="btn btn-primary">{% trans "Apply" %}</button>
|
2021-04-21 11:31:28 -07:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</form>
|
2018-01-10 15:48:07 -05:00
|
|
|
</div>
|
2021-04-21 11:31:28 -07:00
|
|
|
</div>
|
2021-05-17 16:27:27 -04:00
|
|
|
{% endblock content %}
|