mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-28 02:06:10 -06:00
This commit is contained in:
parent
9580ac2946
commit
db1786c385
@ -10,7 +10,7 @@
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
<div>
|
||||
{% add_button prerequisite_model %}
|
||||
{% add_button prerequisite_model request.path %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{% if url %}
|
||||
{% load i18n %}
|
||||
<a href="{{ url }}" type="button" class="btn btn-primary">
|
||||
<a href="{{ url }}{% if return_url %}?return_url={{ return_url }}{% endif %}" type="button" class="btn btn-primary">
|
||||
<i class="mdi mdi-plus-thick"></i> {% trans "Add" %}
|
||||
</a>
|
||||
{% endif %}
|
@ -146,7 +146,7 @@ def sync_button(instance):
|
||||
#
|
||||
|
||||
@register.inclusion_tag('buttons/add.html')
|
||||
def add_button(model, action='add'):
|
||||
def add_button(model, return_url=None, action='add'):
|
||||
try:
|
||||
url = reverse(get_viewname(model, action))
|
||||
except NoReverseMatch:
|
||||
@ -154,6 +154,7 @@ def add_button(model, action='add'):
|
||||
|
||||
return {
|
||||
'url': url,
|
||||
'return_url': return_url,
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user