forked from netbox-community/netbox
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes netbox-community#345: Bulk edit: allow user to select all obje…
…cts on page or all matching query
- Loading branch information
1 parent
029035b
commit a17b56c
Showing
5 changed files
with
34 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,9 @@ | ||
{% load render_table from django_tables2 %} | ||
{% load helpers %} | ||
{% if table.model|user_can_change:request.user or table.model|user_can_delete:request.user %} | ||
<form method="post" class="form form-horizontal"> | ||
{% 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 %}" /> | ||
{% render_table table table_template|default:'table.html' %} | ||
{% if perms.dcim.add_interface %} | ||
<button type="submit" name="_edit" formaction="{% url 'dcim:interface_add_multi' %}" class="btn btn-primary btn-sm"> | ||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> | ||
Add Interfaces | ||
</button> | ||
{% endif %} | ||
{% 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 | ||
</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 | ||
</button> | ||
{% endif %} | ||
</form> | ||
{% else %} | ||
{% render_table table table_template|default:'table.html' %} | ||
{% endif %} | ||
{% extends 'utilities/obj_table.html' %} | ||
|
||
{% block extra_actions %} | ||
{% if perms.dcim.add_interface %} | ||
<button type="submit" name="_edit" formaction="{% url 'dcim:interface_add_multi' %}" class="btn btn-primary btn-sm"> | ||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Interfaces | ||
</button> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters