Skip to content

Commit

Permalink
fix: changeform / changelist responsive improvements (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav authored Aug 20, 2024
1 parent 9747e54 commit 7907fc1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/unfold/static/unfold/css/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/helpers/fieldset_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</div>
{% endif %}
{% else %}
<div class="{% if adminform.model_admin.compressed_fields %} min-w-48 lg:mt-2 w-48{% endif %}">
<div class="{% if adminform.model_admin.compressed_fields %}lg:min-w-48 lg:mt-2{% endif %}">
{{ field.label_tag }}
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/helpers/navigation.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n %}

<div class="relative min-w-sidebar transition-width w-sidebar z-30">
<nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 fixed max-h-screen transition-width w-sidebar dark:bg-gray-900 dark:border-gray-800">
<nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 bottom-0 fixed max-h-screen top-0 transition-width w-sidebar dark:bg-gray-900 dark:border-gray-800">
<div class="flex flex-col min-h-screen min-w-sidebar dark:bg-gray-950/20">
<div class="border-b border-gray-200 mb-5 py-3 dark:border-gray-800">
<div class="flex font-medium h-10 items-center px-6 text-gray-900 tracking-tight dark:text-gray-100 xl:text-base">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
<input type="text" aria-label="{% trans 'Choose file to upload' %}" value="{% if widget.value %}{{ widget.value.url }}{% else %}{% trans 'Choose file to upload' %}{% endif %}" disabled class="bg-white flex-grow font-medium px-3 py-2 text-ellipsis dark:bg-gray-900 {% if widget.value %}text-gray-500 dark:text-gray-300{% else %}text-gray-300 dark:text-gray-300{% endif %}">

<div class="flex flex-none items-center leading-none self-stretch">
<input type="{{ widget.type }}" name="{{ widget.name }}" class="{{ widget.file_input_class }}" {% include "django/forms/widgets/attrs.html" %} />
<div class="hidden">
<input type="{{ widget.type }}" name="{{ widget.name }}" {% include "django/forms/widgets/attrs.html" %} />
</div>

{% if widget.is_initial %}
<a href="{{ widget.value.url }}" class="border-r cursor-pointer text-gray-400 px-3 hover:text-gray-700 dark:border-gray-700 dark:text-gray-500 dark:hover:text-gray-200" target="_blank">
<span class="material-symbols-outlined">download</span>
</a>
{% endif %}

<label for="{{ widget.attrs.id }}" class="cursor-pointer text-gray-400 px-3 hover:text-gray-700 dark:text-gray-500 dark:hover:text-gray-200">
<span class="material-symbols-outlined">file_upload</span>
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templatetags/unfold_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"before:content-[attr(data-label)]",
"before:font-semibold",
"before:mr-auto",
"before:text-gray-100",
"before:text-gray-900",
"lg:before:hidden",
"lg:border-t",
"lg:border-gray-200",
Expand Down

0 comments on commit 7907fc1

Please sign in to comment.