show base url in settings

This commit is contained in:
Matthias 2021-09-18 02:09:22 +02:00
parent ca1fce4cf3
commit dafed332bc
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,7 @@
import logging
from django.conf.urls import url, include
from django.conf import settings
import plugins.plugin as plugin
@ -30,6 +31,10 @@ class IntegrationPlugin(plugin.InvenTreePlugin):
return self.urlpatterns
return None
@property
def base_url(self):
return f'{settings.PLUGIN_URL}/{self.plugin_name()}/'
@property
def urlpatterns(self):
"""

View File

@ -22,4 +22,10 @@
</tbody>
</table>
{% if plugin.has_urls %}
<h4>{% trans "URLs" %}</h4>
<p>{% blocktrans with base=plugin.base_url %}The Base-URL for this plugin is <strong>{{ base }}</strong>.{% endblocktrans %}</p>
{% endif %}
{% endblock %}