This commit is contained in:
Matthias 2021-10-04 22:47:26 +02:00
parent 950ae247a5
commit 4dbf87da56
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
3 changed files with 41 additions and 33 deletions

View File

@ -0,0 +1,14 @@
{% load i18n %}
{% load plugin_extras %}
<h4>{% trans "Settings" %}</h4>
{% plugin_settings plugin_key as plugin_settings %}
<table class='table table-striped table-condensed'>
{% include "InvenTree/settings/header.html" %}
<tbody>
{% for setting in plugin_settings %}
{% include "InvenTree/settings/setting.html" with key=setting%}
{% endfor %}
</tbody>
</table>

View File

@ -0,0 +1,25 @@
{% load i18n %}
{% load inventree_extras %}
<h4>{% trans "URLs" %}</h4>
{% define plugin.base_url as base %}
<p>{% blocktrans %}The Base-URL for this plugin is <a href="/{{ base }}" target="_blank"><strong>{{ base }}</strong></a>.{% endblocktrans %}</p>
<table class='table table-striped table-condensed'>
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "URL" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for key, entry in plugin.urlpatterns.reverse_dict.items %}{% if key %}
<tr>
<td>{{key}}</td>
<td>{{entry.1}}</td>
<td><a class="btn btn-primary btn-small" href="/{{ base }}{{entry.1}}" target="_blank">{% trans 'open in new tab' %}</a></td>
</tr>
{% endif %}{% endfor %}
</tbody>
</table>

View File

@ -77,43 +77,12 @@
{% mixin_enabled plugin 'settings' as settings %} {% mixin_enabled plugin 'settings' as settings %}
{% if settings %} {% if settings %}
<h4>{% trans "Settings" %}</h4> {% include 'InvenTree/settings/mixins/settings.html' %}
{% plugin_settings plugin_key as plugin_settings %}
<table class='table table-striped table-condensed'>
{% include "InvenTree/settings/header.html" %}
<tbody>
{% for setting in plugin_settings %}
{% include "InvenTree/settings/setting.html" with key=setting%}
{% endfor %}
</tbody>
</table>
{% endif %} {% endif %}
{% mixin_enabled plugin 'urls' as urls %} {% mixin_enabled plugin 'urls' as urls %}
{% if urls %} {% if urls %}
<h4>{% trans "URLs" %}</h4> {% include 'InvenTree/settings/mixins/urls.html' %}
{% define plugin.base_url as base %}
<p>{% blocktrans %}The Base-URL for this plugin is <a href="/{{ base }}" target="_blank"><strong>{{ base }}</strong></a>.{% endblocktrans %}</p>
<table class='table table-striped table-condensed'>
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "URL" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for key, entry in plugin.urlpatterns.reverse_dict.items %}{% if key %}
<tr>
<td>{{key}}</td>
<td>{{entry.1}}</td>
<td><a class="btn btn-primary btn-small" href="/{{ base }}{{entry.1}}" target="_blank">{% trans 'open in new tab' %}</a></td>
</tr>
{% endif %}{% endfor %}
</tbody>
</table>
{% endif %} {% endif %}
{% endblock %} {% endblock %}