|
1 | 1 | {% load i18n %} |
2 | 2 |
|
3 | 3 | {% if app_list %} |
4 | | - {% for app in app_list %} |
5 | | - <div class="app-{{ app.app_label }} module{% if app.app_url in request.path %} current-app{% endif %}"> |
6 | | - <table class="border border-spacing-none border-separate rounded-md shadow-sm text-gray-700 text-sm w-full dark:border-gray-800 {% if not forloop.last %}mb-8{% endif %}"> |
7 | | - <caption class="font-semibold mb-4 text-gray-700 text-left dark:text-gray-200"> |
8 | | - <a href="{{ app.app_url }}" class="section" title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}"> |
9 | | - {{ app.name }} |
10 | | - </a> |
11 | | - </caption> |
| 4 | + {% for app in app_list %} |
| 5 | + <div class="app-{{ app.app_label }} module{% if app.app_url in request.path %} current-app{% endif %}"> |
| 6 | + <div class="bg-gray-50 mb-6 rounded-md p-3 dark:bg-gray-800"> |
| 7 | + <table class="border border-gray-400/10 border-spacing-none border-separate rounded-md overflow-hidden shadow-sm text-gray-700 text-sm w-full dark:border-gray-800"> |
| 8 | + <caption class="font-semibold mb-3 text-gray-700 text-left dark:text-gray-200"> |
| 9 | + <a href="{{ app.app_url }}" class="section" title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}"> |
| 10 | + {{ app.name }} |
| 11 | + </a> |
| 12 | + </caption> |
12 | 13 |
|
13 | | - {% for model in app.models %} |
14 | | - <tr class="model-{{ model.object_name|lower }}{% if model.admin_url in request.path %} current-model{% endif %} {% cycle '' 'bg-gray-50 dark:bg-white/[.02]' %}"> |
15 | | - {% if model.admin_url %} |
16 | | - <th scope="row" class="font-normal p-3 text-left dark:text-gray-400 {% if not forloop.last %}border-b dark:border-gray-800{% endif %}"> |
17 | | - <a href="{{ model.admin_url }}"{% if model.admin_url in request.path %} aria-current="page"{% endif %}> |
18 | | - {{ model.name }} |
19 | | - </a> |
20 | | - </th> |
21 | | - {% else %} |
22 | | - <th scope="row" class="font-normal p-3 text-left dark:text-gray-400 {% if not forloop.last %}border-b dark:border-gray-800{% endif %}"> |
23 | | - {{ model.name }} |
24 | | - </th> |
25 | | - {% endif %} |
| 14 | + {% for model in app.models %} |
| 15 | + <tr class="bg-white dark:bg-gray-900 model-{{ model.object_name|lower }}{% if model.admin_url in request.path %} current-model{% endif %}"> |
| 16 | + {% if model.admin_url %} |
| 17 | + <th scope="row" class="font-normal p-3 text-left dark:text-gray-200 {% if not forloop.last %}border-b border-gray-100 dark:border-gray-800{% endif %}"> |
| 18 | + <a href="{{ model.admin_url }}"{% if model.admin_url in request.path %} aria-current="page"{% endif %}> |
| 19 | + {{ model.name }} |
| 20 | + </a> |
| 21 | + </th> |
| 22 | + {% else %} |
| 23 | + <th scope="row" class="font-normal p-3 text-left dark:text-gray-400 {% if not forloop.last %}border-b border-gray-100 dark:border-gray-800{% endif %}"> |
| 24 | + {{ model.name }} |
| 25 | + </th> |
| 26 | + {% endif %} |
26 | 27 |
|
27 | | - {% if model.add_url %} |
28 | | - <td class="{% if not forloop.last %}border-b dark:border-gray-800{% endif %} p-3 text-right"> |
29 | | - <a href="{{ model.add_url }}" class="addlink text-gray-500 transition-all underline dark:text-gray-400 dark:hover:text-gray-200"> |
30 | | - {% translate 'Add' %} |
31 | | - </a> |
32 | | - </td> |
33 | | - {% else %} |
34 | | - <td class="{% if not forloop.last %}border-b dark:border-gray-800{% endif %} p-3 text-right"></td> |
35 | | - {% endif %} |
| 28 | + <td class="{% if not forloop.last %}border-b border-gray-100 dark:border-gray-800{% endif %} p-3 text-right"> |
| 29 | + <div class="flex flex-row items-center ml-auto gap-4 justify-end"> |
| 30 | + {% if model.add_url %} |
| 31 | + <a href="{{ model.add_url }}" class="addlink block leading-none text-gray-400 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200" title="{% translate 'Add' %}"> |
| 32 | + <span class="material-symbols-outlined">add</span> |
| 33 | + </a> |
| 34 | + {% endif %} |
36 | 35 |
|
37 | | - {% if model.admin_url and show_changelinks %} |
38 | | - {% if model.view_only %} |
39 | | - <td class="{% if not forloop.last %}border-b dark:border-gray-800{% endif %} p-3 text-right"> |
40 | | - <a href="{{ model.admin_url }}" class="viewlink text-gray-500 transition-all underline dark:text-gray-400 dark:hover:text-gray-200"> |
41 | | - {% translate 'View' %} |
42 | | - </a> |
43 | | - </td> |
44 | | - {% else %} |
45 | | - <td class="{% if not forloop.last %}border-b dark:border-gray-800{% endif %} p-3 text-right"> |
46 | | - <a href="{{ model.admin_url }}" class="changelink text-gray-500 transition-all underline dark:text-gray-400 dark:hover:text-gray-200"> |
47 | | - {% translate 'Change' %} |
48 | | - </a> |
49 | | - </td> |
50 | | - {% endif %} |
51 | | - {% elif show_changelinks %} |
52 | | - <td class="{% if not forloop.last %}border-b dark:border-gray-800{% endif %} p-3 text-right"></td> |
53 | | - {% endif %} |
54 | | - </tr> |
55 | | - {% endfor %} |
56 | | - </table> |
57 | | - </div> |
58 | | - {% endfor %} |
| 36 | + {% if model.admin_url and show_changelinks %} |
| 37 | + {% if model.view_only %} |
| 38 | + <a href="{{ model.admin_url }}" class="viewlink block leading-none text-gray-400 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200" title="{% translate 'View' %} "> |
| 39 | + <span class="material-symbols-outlined">visibility</span> |
| 40 | + </a> |
| 41 | + {% else %} |
| 42 | + <a href="{{ model.admin_url }}" class="changelink block leading-none text-gray-400 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200" title="{% translate 'Change' %}"> |
| 43 | + <span class="material-symbols-outlined">edit_square</span> |
| 44 | + </a> |
| 45 | + {% endif %} |
| 46 | + {% elif show_changelinks %} |
| 47 | + {% endif %} |
| 48 | + </div> |
| 49 | + </td> |
| 50 | + |
| 51 | + </tr> |
| 52 | + {% endfor %} |
| 53 | + </table> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + {% endfor %} |
59 | 57 | {% else %} |
60 | | - <p>{% translate 'You don’t have permission to view or edit anything.' %}</p> |
| 58 | + <p> |
| 59 | + {% translate 'You don’t have permission to view or edit anything.' %} |
| 60 | + </p> |
61 | 61 | {% endif %} |
0 commit comments