{% extends 'generic/_base.html' %} {% load helpers %} {% load form_helpers %} {% load i18n %} {% 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 %} {% block title %} {% trans "Renaming" %} {{ selected_objects|length }} {{ obj_type_plural|bettertitle }} {% endblock %} {% block tabs %} {% endblock tabs %} {% block content %}
{% if has_label_field %} {% for obj in selected_objects %} {% with current_target=obj|getattr:field_name %} {% endwith %} {% endfor %} {% else %} {% with field_label=field_name|title %} {% endwith %} {% for obj in selected_objects %} {% with obj_name=obj|getattr:field_name %} {% endwith %} {% endfor %} {% endif %}
{% trans "Current Name" %} {% trans "New Name" %} {% trans "Current Label" %} {% trans "New Label" %}
{{ obj.name }} {% if field_name == 'name' %}{{ obj.new_name }}{% endif %} {{ obj.label }} {% if field_name == 'label' %}{{ obj.new_name }}{% endif %}
{% blocktrans %}Current {{ field_label }}{% endblocktrans %} {% blocktrans %}New {{ field_label }}{% endblocktrans %}
{{ obj_name }} {{ obj.new_name }}
{% csrf_token %}

{% trans "Rename" %}

{% render_form form %}
{% trans "Cancel" %} {% if '_preview' in request.POST and not form.errors %} {% endif %}
{% endblock content %}