Skip to content

Commit

Permalink
fix: app index template (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Jul 22, 2023
1 parent c6a4bcd commit 1cf5af2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion src/unfold/templates/admin/app_index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% extends "admin/index.html" %}
{% extends "admin/base.html" %}

{% load i18n %}

{% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %}

{% if not is_popup %}
Expand All @@ -21,4 +24,20 @@
{% endblock %}
{% endif %}

{% block branding %}
<h1 id="site-name">
<a href="{% url 'admin:index' %}">
{{ site_header|default:_('Django administration') }}
</a>
</h1>
{% endblock %}

{% block content %}
<div class="flex flex-row -mx-4">
<div class="flex-grow px-4">
{% include "unfold/helpers/app_list_default.html" %}
</div>
</div>
{% endblock %}

{% block sidebar %}{% endblock %}
2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/helpers/app_list_default.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</caption>

{% for model in app.models %}
<tr class="model-{{ model.object_name|lower }}{% if model.admin_url in request.path %} current-model{% endif %} {% cycle "bg-white dark:bg-gray-900" "bg-gray-50 dark:bg-gray-800" %}">
<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]' %}">
{% if model.admin_url %}
<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 %}">
<a href="{{ model.admin_url }}"{% if model.admin_url in request.path %} aria-current="page"{% endif %}>
Expand Down

0 comments on commit 1cf5af2

Please sign in to comment.