-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add object button available in changeform
- Loading branch information
1 parent
3e4c5f3
commit 2a62b64
Showing
4 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
{% load i18n admin_urls %} | ||
|
||
{% block object-tools-items %} | ||
{% if has_add_permission %} | ||
<li class="flex flex-row items-center"> | ||
{% url cl.opts|admin_urlname:"add" as add_url %} | ||
|
||
<span class="block bg-gray-200 h-5 mx-4 w-px dark:bg-gray-700"></span> | ||
|
||
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink bg-primary-600 block flex items-center h-9 justify-center -my-1 rounded-full w-9" title="{% blocktranslate with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktranslate %}"> | ||
<span class="material-symbols-outlined text-white">add</span> | ||
</a> | ||
</li> | ||
{% include "unfold/helpers/add_link.html" %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% load i18n admin_urls %} | ||
|
||
{% if cl %} | ||
{% url cl.opts|admin_urlname:"add" as add_url %} | ||
{% blocktranslate with name=cl.opts.verbose_name asvar title %}Add {{ name }}{% endblocktranslate %} | ||
{% else %} | ||
{% url opts|admin_urlname:"add" as add_url %} | ||
{% blocktranslate with name=opts.verbose_name asvar title %}Add {{ name }}{% endblocktranslate %} | ||
{% endif %} | ||
|
||
{% if add_url %} | ||
<li class="flex flex-row items-center"> | ||
<span class="block bg-gray-200 h-5 mx-4 w-px dark:bg-gray-700"></span> | ||
|
||
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink bg-primary-600 flex items-center h-9 justify-center -my-1 rounded-full w-9" title="{{ title }}"> | ||
<span class="material-symbols-outlined text-white">add</span> | ||
</a> | ||
</li> | ||
{% endif %} |