Skip to content

Commit

Permalink
chore: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Oct 29, 2023
2 parents 1461c09 + 5328f78 commit 60ae597
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 262 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.10.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
rev: v0.1.1
hooks:
- id: ruff
- repo: https://github.com/compilerla/conventional-pre-commit
Expand Down
3 changes: 0 additions & 3 deletions src/unfold/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ def label_tag(self) -> SafeText:
"class": " ".join(LABEL_CLASSES + ["mb-2"]),
}

if not self.is_first:
attrs["class"] = "inline"

label = self.field["label"]

return format_html(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{% block object-tools-items %}
{% url opts|admin_urlname:'permissions' original.pk|admin_urlquote as history_url %}

<a href="{% add_preserved_filters history_url %}" class="permissionslink mx-1 px-3 py-2 rounded-md transition-all hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200">
{% trans "Object permissions" %}
</a>
{% trans "Object permissions" as title %}
{% add_preserved_filters history_url as link %}
{% include "unfold/helpers/tab_action.html" with title=title link=link %}

{{ block.super }}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% load admin_urls i18n %}

{% if has_export_permission %}
<li class="border-r flex-grow text-center last:border-0 dark:border-gray-700">
<a href="{% url opts|admin_urlname:'export' %}{{ cl.get_query_string }}" class="block px-4 py-2 text-gray-500 whitespace-nowrap hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200">
{% trans "Export" %}
</a>
</li>
{% trans "Export" as title %}
{% url opts|admin_urlname:'export' as link %}
{% include "unfold/helpers/tab_action.html" with title=title link=link|add:cl.get_query_string %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% load admin_urls i18n %}

{% if has_import_permission %}
<li class="border-r flex-grow text-center last:border-0 dark:border-gray-700">
<a href="{% url opts|admin_urlname:"import" %}" class="block px-4 py-2 text-gray-500 whitespace-nowrap hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200">
{% trans "Import" %}
</a>
</li>
{% trans "Import" as title %}
{% url opts|admin_urlname:"import" as link %}
{% include "unfold/helpers/tab_action.html" with title=title link=link %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "admin/change_form.html" %}

{% load admin_urls i18n %}
{% load url from simple_history_compat%}
{% load url from simple_history_compat %}

{% block breadcrumbs %}
<div class="px-4 lg:px-12">
Expand Down
211 changes: 0 additions & 211 deletions src/unfold/static/unfold/css/simplebar.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/unfold/static/unfold/css/styles.css

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions src/unfold/static/unfold/js/simplebar.js

This file was deleted.

11 changes: 5 additions & 6 deletions src/unfold/templates/admin/change_form_object_tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
{% block object-tools-items %}
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}

<a href="{% add_preserved_filters history_url %}" class="historylink mx-1 px-3 py-2 rounded-md transition-all hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200">
{% trans 'History' %}
</a>
{% trans 'History' as title %}
{% add_preserved_filters history_url as link %}
{% include "unfold/helpers/tab_action.html" with title=title link=link %}

{% if has_absolute_url %}
<a href="{{ absolute_url }}" target="_blank" class="viewsitelink mx-1 px-3 py-2 rounded-md transition-all hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200">
{% trans 'View on site' %}
</a>
{% trans 'View on site' as title %}
{% include "unfold/helpers/tab_action.html" with title=title link=absolute_url blank=1 %}
{% endif %}
{% endblock %}
2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/change_list_filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<label for="show-filters" id="changelist-filter-close" class="flex-grow"></label>

<div class="bg-white flex mr-4 my-4 overflow-hidden rounded shadow-sm w-96 dark:bg-gray-800">
<div class="flex-grow h-full overflow-auto relative" data-simplebar>
<div class="flex-grow h-full overflow-auto relative">
<h3 class="border-b flex font-medium mb-6 px-6 py-4 text-gray-700 text-sm dark:text-gray-200 dark:border-gray-700">
{% trans "Filter results" %}

Expand Down
4 changes: 0 additions & 4 deletions src/unfold/templates/unfold/helpers/account_links.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
</span>
</div>

{% if nav_global %}
{{ nav_global }}
{% endif %}

{% if site_url %}
<a href="{{ site_url }}" target="_blank" class="mx-1 px-3 py-2 rounded hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200">
{% translate 'View site' %}
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/helpers/app_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h3 class="font-medium my-3 px-6 text-gray-900 text-sm first:mt-0 dark:text-gray
<div class="absolute bottom-0 left-72 right-0 top-0 z-50 peer-checked:block" x-cloak x-show="openAllApplications">
<label class="absolute bg-gray-900 bg-opacity-80 backdrop-blur-sm bottom-0 left-0 right-0 top-0 z-10 w-screen" for="show-applications"></label>

<div class="bg-white flex flex-col h-full overflow-x-hidden overflow-y-auto py-5 px-8 relative text-sm w-80 z-20 dark:bg-gray-900 dark:border-r dark:border-gray-800" data-simplebar x-on:click.outside="openAllApplications = false" x-on:keydown.escape.window="openAllApplications = false">
<div class="bg-white flex flex-col h-full overflow-x-hidden overflow-y-auto py-5 px-8 relative text-sm w-80 z-20 dark:bg-gray-900 dark:border-r dark:border-gray-800" x-on:click.outside="openAllApplications = false" x-on:keydown.escape.window="openAllApplications = false">
{% for app in app_list %}
<div class="mb-6 last:mb-0">
<h3 class="mb-4 font-medium overflow-hidden text-ellipsis text-gray-700 whitespace-nowrap dark:text-gray-200">
Expand Down
5 changes: 5 additions & 0 deletions src/unfold/templates/unfold/helpers/tab_action.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<li class="border-b flex-grow text-center md:border-b-0 md:border-r last:border-0 dark:border-gray-800">
<a href="{{ link }}" class="block px-4 py-2 text-gray-500 text-left whitespace-nowrap hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200"{% if blank %} target="_blank"{% endif %}>
{{ title }}
</a>
</li>
15 changes: 8 additions & 7 deletions src/unfold/templates/unfold/helpers/tab_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@
</ul>
{% endif %}

{% if actions_list or actions_items %}
<ul class="border flex mb-4 mt-2 rounded-md shadow-sm md:mb-2 md:mt-0 dark:border-gray-700 max-md:w-full">
{% if actions_list or actions_items or nav_global %}
<ul class="border flex flex-col mb-4 mt-2 rounded-md shadow-sm md:flex-row md:mb-2 md:mt-0 dark:border-gray-800 max-md:w-full">
{% for action in actions_list %}
<li class="border-r flex-grow text-center last:border-0 dark:border-gray-700">
<a href="{{ action.path }}" class="block px-4 py-2 text-gray-500 whitespace-nowrap hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200">
{{ action.title }}
</a>
</li>
{% include "unfold/helpers/tab_action.html" with title=action.title link=action.path %}
{% endfor %}

{% if actions_items %}
{{ actions_items }}
{% endif %}

{% if nav_global %}
{{ nav_global }}
{% endif %}
</ul>
{% endif %}
</div>
{% endif %}

{% endif %}
2 changes: 0 additions & 2 deletions src/unfold/templates/unfold/layouts/skeleton.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
{% endfor %}

<link href="{% static 'unfold/css/styles.css' %}" rel="stylesheet">
<link href="{% static 'unfold/css/simplebar.css' %}" rel="stylesheet">

<script src="{% static 'unfold/js/simplebar.js' %}"></script>
<script src="{% static 'unfold/js/alpine.persist.js' %}" defer></script>
<script src="{% static 'unfold/js/alpine.js' %}" defer></script>
<script src="{% static 'unfold/js/htmx.js' %}"></script>
Expand Down
1 change: 1 addition & 0 deletions src/unfold/templatetags/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def tab_list(context, opts) -> str:
request=context.request,
context={
"tab_list": tabs,
"nav_global": context.get("nav_global"),
"actions_list": context.get("actions_list"),
"actions_items": context.get("actions_items"),
"is_popup": context.get("is_popup"),
Expand Down

0 comments on commit 60ae597

Please sign in to comment.