mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-13 23:32:17 -06:00
Closes #345: Bulk edit: allow user to select all objects on page or all matching query
This commit is contained in:
@@ -5,17 +5,26 @@
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="redirect_url" value="{{ request.path }}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" />
|
||||
<input type="hidden" name="pk_all" value="{% for row in table.rows %}{{ row.record.pk|default:'' }}{% if not forloop.last %},{% endif %}{% endfor %}" />
|
||||
{% if table.paginator.num_pages > 1 %}
|
||||
<div id="select_all_box" class="hidden alert alert-info">
|
||||
<div class="checkbox-inline">
|
||||
<label for="select_all">
|
||||
<input type="checkbox" id="select_all" name="_all" />
|
||||
Select <strong>all {{ table.rows|length }} {{ table.data.verbose_name_plural }}</strong> matching query
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% render_table table table_template|default:'table.html' %}
|
||||
{% block extra_actions %}{% endblock %}
|
||||
{% if bulk_edit_url and table.model|user_can_change:request.user %}
|
||||
<button type="submit" name="_edit" formaction="{% url bulk_edit_url %}" class="btn btn-warning btn-sm">
|
||||
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
|
||||
Edit Selected
|
||||
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit Selected
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if bulk_delete_url and table.model|user_can_delete:request.user %}
|
||||
<button type="submit" name="_delete" formaction="{% url bulk_delete_url %}" class="btn btn-danger btn-sm">
|
||||
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
|
||||
Delete Selected
|
||||
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete Selected
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user