1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #8530: Indicate CSV or YAML as format for "all data" export

This commit is contained in:
jeremystretch
2022-02-03 10:22:38 -05:00
parent ff3b48fa59
commit 24f48b11e6
3 changed files with 37 additions and 36 deletions

View File

@@ -1,31 +1,31 @@
<div class="dropdown">
<button type="button" class="btn btn-sm btn-purple dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="mdi mdi-download"></i>&nbsp;Export
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="?{% if url_params %}{{ url_params.urlencode }}&{% endif %}export=table">Current View</a></li>
<li><a class="dropdown-item" href="?{% if url_params %}{{ url_params.urlencode }}&{% endif %}export">All Data</a></li>
{% if export_templates %}
<button type="button" class="btn btn-sm btn-purple dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="mdi mdi-download"></i>&nbsp;Export
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="?{% if url_params %}{{ url_params }}&{% endif %}export=table">Current View</a></li>
<li><a class="dropdown-item" href="?{% if url_params %}{{ url_params }}&{% endif %}export">All Data ({{ data_format }})</a></li>
{% if export_templates %}
<li>
<hr class="dropdown-divider">
</li>
{% for et in export_templates %}
<li>
<hr class="dropdown-divider">
</li>
{% for et in export_templates %}
<li>
<a class="dropdown-item"
href="?{% if url_params %}{{ url_params.urlencode }}&{% endif %}export={{ et.name }}"{% if et.description %}
title="{{ et.description }}"{% endif %}>
<a class="dropdown-item" href="?{% if url_params %}{{ url_params }}&{% endif %}export={{ et.name }}"
{% if et.description %} title="{{ et.description }}"{% endif %}
>
{{ et.name }}
</a>
</li>
{% endfor %}
{% endif %}
{% if add_exporttemplate_link %}
<li>
<hr class="dropdown-divider">
</li>
<li>
<a class="dropdown-item" href="{{ add_exporttemplate_link }}">Add export template...</a>
</li>
{% endif %}
</ul>
{% endfor %}
{% endif %}
{% if perms.extras.add_exporttemplate %}
<li>
<hr class="dropdown-divider">
</li>
<li>
<a class="dropdown-item" href="{% url 'extras:exporttemplate_add' %}?content_type={{ content_type.pk }}">Add export template...</a>
</li>
{% endif %}
</ul>
</div>