Skip to content

Commit

Permalink
fix: readonly submit line
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed May 21, 2023
1 parent dc0ec29 commit 1d6eb34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/unfold/static/unfold/css/styles.css

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/unfold/templates/admin/submit_line.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div {% if not is_popup %}id="submit-row"{% endif %} class="relative z-20 {% if not is_popup %} mt-20 lg:mt-8{% endif %}">
<div class="{% if not is_popup %}bottom-0 fixed left-0 right-0 xl:left-72{% endif %}" :class="{'xl:left-0': !sidebarDesktopOpen}">
<div class="bg-white dark:bg-gray-900 {% if not is_popup %}border-t px-4 py-4 relative scrollable-top lg:px-12 dark:border-gray-800{% endif %}">
<div class="container flex flex-col-reverse items-center mx-auto lg:flex-row-reverse">
<div class="container flex flex-col-reverse gap-3 items-center mx-auto lg:flex-row-reverse">
{% block submit-row %}
{% if show_save %}
<button type="submit" name="_save" class="bg-primary-600 block border border-transparent font-medium px-3 py-2 rounded-md text-sm text-white w-full lg:w-auto">
Expand All @@ -12,13 +12,13 @@
{% endif %}

{% for action in actions_submit_line %}
<button type="submit" name="{{ action.action_name }}" class="border font-medium mb-3 px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:mb-0 lg:mr-3 lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
<button type="submit" name="{{ action.action_name }}" class="border font-medium px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
{{ action.description }}
</button>
{% endfor %}

{% if show_save_and_continue %}
<button type="submit" name="_continue" class="border font-medium hidden mb-3 px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:block lg:mb-0 lg:mr-3 lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
<button type="submit" name="_continue" class="border font-medium hidden px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:block lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
{% if can_change %}
{% translate 'Save and continue editing' %}
{% else %}
Expand All @@ -28,19 +28,19 @@
{% endif %}

{% if show_close %}
<a href="{% url opts|admin_urlname:'changelist' %}" class="border font-medium hidden mb-3 px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:block lg:mb-0 lg:mr-3 lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
<a href="{% url opts|admin_urlname:'changelist' %}" class="border font-medium hidden px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:block lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
{% translate 'Close' %}
</a>
{% endif %}

{% if show_save_and_add_another %}
<button type="submit" name="_addanother" class="border font-medium hidden mb-3 px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:block lg:mb-0 lg:mr-3 lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
<button type="submit" name="_addanother" class="border font-medium hidden px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:block lg:w-auto dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
{% translate 'Save and add another' %}
</button>
{% endif %}

{% if show_save_as_new %}
<button type="submit" name="_saveasnew" class="border font-medium mb-3 px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 lg:mb-0 lg:mr-3 dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
<button type="submit" name="_saveasnew" class="border font-medium px-3 py-2 rounded-md text-sm text-gray-500 transition-all w-full hover:bg-gray-50 dark:border-gray-700 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-900">
{% translate 'Save as new' %}
</button>
{% endif %}
Expand All @@ -49,7 +49,7 @@
{% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}

<p class="deletelink-box mr-auto w-full lg:w-auto">
<a href="{% add_preserved_filters delete_url %}" class="block border border-red-500 font-medium mb-3 px-3 py-2 rounded-md text-center text-sm text-red-500 whitespace-nowrap lg:mb-0 lg:mr-3 dark:border-transparent dark:bg-red-500/20 dark:text-red-500">
<a href="{% add_preserved_filters delete_url %}" class="block border border-red-500 font-medium px-3 py-2 rounded-md text-center text-sm text-red-500 whitespace-nowrap dark:border-transparent dark:bg-red-500/20 dark:text-red-500">
{% translate "Delete" %} {{ opts.verbose_name }}
</a>
</p>
Expand Down

0 comments on commit 1d6eb34

Please sign in to comment.