|
2 | 2 |
|
3 | 3 | {% if not is_popup %} |
4 | 4 | {% if tabs_list or inlines_list or actions_list or actions_detail or actions_items or nav_global %} |
5 | | - <div class="flex items-start flex-col mb-4 text-sm w-full md:border-b dark:md:border-base-800 md:border-l-0 md:flex-row md:items-center md:justify-end"> |
6 | | - {% if inlines_list or tabs_list %} |
7 | | - <ul class="border rounded flex flex-col w-full md:flex-row md:border-b-0 md:border-t-0 md:border-l-0 md:border-r-0 dark:border-base-800"> |
8 | | - {% for item in tabs_list %} |
9 | | - {% if item.has_permission %} |
10 | | - <li class="border-b last:border-b-0 md:border-b-0 md:mr-8 dark:border-base-800"> |
11 | | - <a href="{% if item.link_callback %}{{ item.link_callback }}{% else %}{{ item.link }}{% endif %}{% if item.inline %}#{{ item.inline }}{% endif %}" |
12 | | - class="block px-3 py-2 md:py-4 md:px-0 dark:border-base-800 {% if item.active and not item.inline %} border-b font-semibold -mb-px text-primary-600 hover:text-primary-600 dark:text-primary-500 dark:hover:text-primary-500 md:border-primary-500 dark:md:!border-primary-600{% else %}font-medium hover:text-primary-600 dark:hover:text-primary-500{% endif %}" |
13 | | - {% if item.inline %} |
14 | | - x-on:click="activeTab = '{{ item.inline }}'" |
15 | | - x-bind:class="{'border-b border-base-200 dark:border-base-800 md:border-primary-500 dark:md:!border-primary-600 font-semibold -mb-px text-primary-600 dark:text-primary-500': activeTab == '{{ item.inline }}'}" |
16 | | - {% endif %} |
17 | | - > |
18 | | - {{ item.title }} |
19 | | - </a> |
20 | | - </li> |
21 | | - {% endif %} |
22 | | - {% endfor %} |
| 5 | + <div class="flex items-start flex-col mb-4 md:border-b dark:md:border-base-800 md:border-l-0 md:flex-row md:items-center"> |
| 6 | + {% include "unfold/helpers/tab_items.html" %} |
23 | 7 |
|
24 | | - {% if inlines_list %} |
25 | | - <li class="border-b last:border-b-0 md:border-b-0 md:mr-8 dark:border-base-800"> |
26 | | - <a class="block cursor-pointer font-medium px-3 py-2 md:py-4 md:px-0" |
27 | | - href="#general" |
28 | | - x-on:click="activeTab = 'general'" |
29 | | - x-bind:class="{'border-b border-base-200 dark:border-base-800 md:border-primary-500 dark:md:!border-primary-600 font-semibold -mb-px text-primary-600 dark:text-primary-500': activeTab == 'general', 'hover:text-primary-600 dark:hover:text-primary-500 dark:border-base-800': activeTab != 'general'}"> |
30 | | - {% trans "General" %} |
31 | | - </a> |
32 | | - </li> |
33 | | - |
34 | | - {% for inline in inlines_list %} |
35 | | - <li class="border-b last:border-b-0 md:border-b-0 md:mr-8 dark:border-base-800"> |
36 | | - <a class="block cursor-pointer font-medium px-3 py-2 md:py-4 md:px-0" |
37 | | - href="#{{ inline.opts.verbose_name|slugify }}" |
38 | | - x-on:click="activeTab = '{{ inline.opts.verbose_name|slugify }}'" |
39 | | - x-bind:class="{'border-b border-base-200 dark:border-base-800 md:border-primary-500 dark:md:!border-primary-600 font-semibold -mb-px text-primary-600 dark:text-primary-500': activeTab == '{{ inline.opts.verbose_name|slugify }}', 'hover:text-primary-600 dark:hover:text-primary-500 dark:border-base-800': activeTab != '{{ inline.opts.verbose_name|slugify }}'}"> |
40 | | - {% if inline.formset.max_num == 1 %} |
41 | | - {{ inline.opts.verbose_name|capfirst }} |
42 | | - {% else %} |
43 | | - {{ inline.opts.verbose_name_plural|capfirst }} |
44 | | - {% endif %} |
45 | | - </a> |
46 | | - </li> |
47 | | - {% endfor %} |
48 | | - {% endif %} |
49 | | - </ul> |
50 | | - {% endif %} |
51 | | - |
52 | | - {% if actions_list or actions_detail or actions_items or nav_global %} |
53 | | - <ul class="border flex flex-col font-medium mb-4 mt-2 rounded shadow-sm md:flex-row md:mb-2 md:mt-0 dark:border-base-700 max-md:w-full"> |
54 | | - {% for action in actions_list %} |
55 | | - {% include "unfold/helpers/tab_action.html" with title=action.title link=action.path %} |
56 | | - {% endfor %} |
57 | | - |
58 | | - {% for action in actions_detail %} |
59 | | - {% include "unfold/helpers/tab_action.html" with title=action.title link=action.path %} |
60 | | - {% endfor %} |
61 | | - |
62 | | - {% if actions_items %} |
63 | | - {{ actions_items }} |
64 | | - {% endif %} |
65 | | - |
66 | | - {% if nav_global %} |
67 | | - {{ nav_global }} |
68 | | - {% endif %} |
69 | | - </ul> |
70 | | - {% endif %} |
| 8 | + {% include "unfold/helpers/tab_actions.html" %} |
71 | 9 | </div> |
72 | 10 | {% endif %} |
73 | | - |
74 | 11 | {% endif %} |
0 commit comments