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

View File

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

View File

@ -3,7 +3,7 @@
{% if bookmarks %} {% if bookmarks %}
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
{% for bookmark in bookmarks %} {% 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 }} {{ bookmark.object }}
</a> </a>
{% endfor %} {% endfor %}

View File

@ -1,20 +1,20 @@
{% load i18n %} {% load i18n %}
{% if counts %} {% if counts %}
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
{% for model, count, url in counts %} {% for model, count, url in counts %}
{% if count != None %} <a href="{{ url }}" class="list-group-item list-group-item-action px-1 py-2">
<a href="{{ url }}" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between align-items-center"> <div class="d-flex w-100 justify-content-between align-items-center">
{{ model|meta:"verbose_name_plural"|bettertitle }} {{ 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> </div>
</a> </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 %} {% endfor %}
</div> </div>
{% endif %} {% endif %}

View File

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