mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-19 10:08:44 -06:00
Closes #13102: Establish initial translation support in templates
--------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{% if url %}
|
||||
{% load i18n %}
|
||||
<a href="{{ url }}" type="button" class="btn btn-sm btn-success">
|
||||
<i class="mdi mdi-plus-thick"></i> Add
|
||||
<i class="mdi mdi-plus-thick"></i> {% trans "Add" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
<form action="{{ form_url }}?return_url={{ return_url }}" method="post">
|
||||
{% csrf_token %}
|
||||
{% for field, value in form_data.items %}
|
||||
@@ -5,11 +6,11 @@
|
||||
{% endfor %}
|
||||
{% if bookmark %}
|
||||
<button type="submit" class="btn btn-sm btn-info">
|
||||
<i class="mdi mdi-bookmark-minus"></i> Unbookmark
|
||||
<i class="mdi mdi-bookmark-minus"></i> {% trans "Unbookmark" %}
|
||||
</button>
|
||||
{% else %}
|
||||
<button type="submit" class="btn btn-sm btn-info">
|
||||
<i class="mdi mdi-bookmark-check"></i> Bookmark
|
||||
<i class="mdi mdi-bookmark-check"></i> {% trans "Bookmark" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% if url %}
|
||||
<button type="submit" name="_delete" formaction="{{ url }}" class="btn btn-danger btn-sm">
|
||||
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete Selected
|
||||
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete Selected" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% if url %}
|
||||
<button type="submit" name="_edit" formaction="{{ url }}" class="btn btn-warning btn-sm">
|
||||
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit Selected
|
||||
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit Selected" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% if url %}
|
||||
<a href="{{ url }}" class="btn btn-sm btn-success" role="button">
|
||||
<i class="mdi mdi-content-copy" aria-hidden="true"></i> Clone
|
||||
<i class="mdi mdi-content-copy" aria-hidden="true"></i> {% trans "Clone" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
<a href="#"
|
||||
hx-get="{{ url }}"
|
||||
hx-target="#htmx-modal-content"
|
||||
@@ -5,5 +6,5 @@
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#htmx-modal"
|
||||
>
|
||||
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete
|
||||
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> {% trans "Delete" %}
|
||||
</a>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
<a href="{{ url }}" class="btn btn-sm btn-warning" role="button">
|
||||
<span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
|
||||
<span class="mdi mdi-pencil" aria-hidden="true"></span> {% trans "Edit" %}
|
||||
</a>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{% load i18n %}
|
||||
<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> Export
|
||||
<i class="mdi mdi-download"></i> {% trans "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>
|
||||
<li><a class="dropdown-item" href="?{% if url_params %}{{ url_params }}&{% endif %}export=table">{% trans "Current View" %}</a></li>
|
||||
<li><a class="dropdown-item" href="?{% if url_params %}{{ url_params }}&{% endif %}export">{% trans "All Data" %} ({{ data_format }})</a></li>
|
||||
{% if export_templates %}
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
@@ -24,7 +25,7 @@
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="{% url 'extras:exporttemplate_add' %}?content_type={{ content_type.pk }}">Add export template...</a>
|
||||
<a class="dropdown-item" href="{% url 'extras:exporttemplate_add' %}?content_type={{ content_type.pk }}">{% trans "Add export template" %}...</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% if url %}
|
||||
<a href="{{ url }}" type="button" class="btn btn-sm btn-info">
|
||||
<i class="mdi mdi-upload"></i> Import
|
||||
<i class="mdi mdi-upload"></i> {% trans "Import" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{% load i18n %}
|
||||
<form action="{{ url }}" method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<i class="mdi mdi-sync" aria-hidden="true"></i> Sync
|
||||
<i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user