Clean up dashboard widgets

This commit is contained in:
Jeremy Stretch 2024-01-02 14:49:25 -05:00
parent f746ab178d
commit 6fc83eb7e7
5 changed files with 69 additions and 74 deletions

View File

@ -115,9 +115,7 @@ Blocks:
<div class="page-wrapper">
{# Page header #}
<div class="page-header mt-2 d-print-none">
<div class="container-xl">
<div class="container-xl mt-2 d-print-none">
{% if config.BANNER_TOP %}
<div class="text-center mx-3">
{{ config.BANNER_TOP|safe }}
@ -155,7 +153,6 @@ Blocks:
</div>
{% endblock header %}
</div>
</div>
{# /Page header #}
{# Page body #}

View File

@ -9,8 +9,7 @@
gs-id="{{ widget.id }}"
>
<div class="card grid-stack-item-content">
<div class="card-header text-center text-{{ widget.fg_color }} bg-{{ widget.color|default:"secondary" }} p-1">
<div class="float-start ps-1">
<div class="card-header text-{{ widget.fg_color }} bg-{{ widget.color|default:"secondary" }} px-2 py-1 d-flex flex-row">
<a href="#"
hx-get="{% url 'extras:dashboardwidget_config' id=widget.id %}"
hx-target="#htmx-modal-content"
@ -19,8 +18,11 @@
>
<i class="mdi mdi-cog text-{{ widget.fg_color }}"></i>
</a>
<div class="card-title flex-fill text-center">
{% if widget.title %}
<span class="fs-4 fw-bold">{{ widget.title }}</span>
{% endif %}
</div>
<div class="float-end pe-1">
<a href="#"
hx-get="{% url 'extras:dashboardwidget_delete' id=widget.id %}"
hx-target="#htmx-modal-content"
@ -30,11 +32,7 @@
<i class="mdi mdi-close text-{{ widget.fg_color }}"></i>
</a>
</div>
{% if widget.title %}
<strong>{{ widget.title }}</strong>
{% endif %}
</div>
<div class="card-body p-2 overflow-auto">
<div class="card-body p-2 pt-1 overflow-auto">
{% render_widget widget %}
</div>
</div>

View File

@ -3,7 +3,7 @@
{% if bookmarks %}
<div class="list-group list-group-flush">
{% for bookmark in bookmarks %}
<a href="{{ bookmark.object.get_absolute_url }}" class="list-group-item list-group-item-action">
<a href="{{ bookmark.object.get_absolute_url }}" class="list-group-item list-group-item-action px-1 py-2">
{{ bookmark.object }}
</a>
{% endfor %}

View File

@ -1,20 +1,20 @@
{% load i18n %}
{% if counts %}
<div class="list-group list-group-flush">
{% for model, count, url in counts %}
{% if count != None %}
<a href="{{ url }}" class="list-group-item list-group-item-action">
<a href="{{ url }}" class="list-group-item list-group-item-action px-1 py-2">
<div class="d-flex w-100 justify-content-between align-items-center">
{{ model|meta:"verbose_name_plural"|bettertitle }}
<h6 class="mb-1">{{ count }}</h6>
{% if count is None %}
<span title="{% trans "No permission" %}">
<i class="mdi mdi-lock-outline"></i>
</span>
{% else %}
<strong>{{ count }}</strong>
{% endif %}
</div>
</a>
{% else %}
<div class="list-group-item list-group-item-action d-flex w-100 justify-content-between align-items-center">
{{ model|meta:"verbose_name_plural"|bettertitle }}
<h6 class="mb-1" title="{% trans "No permission" %}"><i class="mdi mdi-lock-outline"></i></h6>
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}

View File

@ -2,9 +2,9 @@
{% if feed and not feed.bozo %}
<div class="list-group list-group-flush">
{% for entry in feed.entries %}
<div class="list-group-item px-1">
<h6><a href="{{ entry.link }}">{{ entry.title }}</a></h6>
<div>
<div class="list-group-item px-1 py-2">
<a href="{{ entry.link }}" class="text-body">{{ entry.title }}</a>
<div class="text-secondary">
{{ entry.summary|safe }}
</div>
</div>