Clean up object view template

This commit is contained in:
Jeremy Stretch 2024-01-03 15:01:21 -05:00
parent 693cc27e45
commit 1b0182b787
2 changed files with 22 additions and 25 deletions

View File

@ -141,12 +141,12 @@ Blocks:
{# Title #} {# Title #}
<div class="col"> <div class="col">
<h2 class="page-title">{% block title %}{% endblock title %}</h2> <h2 class="page-title mb-1">{% block title %}{% endblock title %}</h2>
{% block subtitle %}{% endblock %} {% block subtitle %}{% endblock %}
</div> </div>
{# Controls #} {# Controls #}
<div class="col-auto ms-auto d-print-none"> <div class="col-auto d-print-none">
{% block controls %}{% endblock controls %} {% block controls %}{% endblock controls %}
</div> </div>

View File

@ -19,24 +19,25 @@ Context:
{% endcomment %} {% endcomment %}
{% block header %} {% block header %}
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center mb-2">
{# Breadcrumbs #} {# Breadcrumbs #}
<nav class="breadcrumb-container px-3" aria-label="breadcrumb"> <ol class="breadcrumb" aria-label="breadcrumbs">
<ol class="breadcrumb"> {% block breadcrumbs %}
{% block breadcrumbs %} <li class="breadcrumb-item">
<li class="breadcrumb-item"><a href="{% url object|viewname:'list' %}">{{ object|meta:'verbose_name_plural'|bettertitle }}</a></li> <a href="{% url object|viewname:'list' %}">{{ object|meta:'verbose_name_plural'|bettertitle }}</a>
{% endblock breadcrumbs %} </li>
</ol> {% endblock breadcrumbs %}
</nav> </ol>
{# Object identifier #} {# Object identifier #}
<div class="float-end px-3"> <code class="d-block text-muted px-0">
<code class="text-muted"> {% block object_identifier %}
{% block object_identifier %} {{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }}
{{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }} {% if object.slug %}({{ object.slug }}){% endif %}
{% if object.slug %}({{ object.slug }}){% endif %} {% endblock object_identifier %}
{% endblock object_identifier %} </code>
</code>
</div>
</div> </div>
{{ block.super }} {{ block.super }}
{% endblock header %} {% endblock header %}
@ -44,7 +45,7 @@ Context:
{% block title %}{{ object }}{% endblock %} {% block title %}{{ object }}{% endblock %}
{% block subtitle %} {% block subtitle %}
<div class="object-subtitle"> <div class="text-secondary fs-5">
<span>{% trans "Created" %} {{ object.created|annotated_date }}</span> <span>{% trans "Created" %} {{ object.created|annotated_date }}</span>
{% if object.last_updated %} {% if object.last_updated %}
<span class="separator">&middot;</span> <span class="separator">&middot;</span>
@ -55,8 +56,7 @@ Context:
{% block controls %} {% block controls %}
{# Clone/Edit/Delete Buttons #} {# Clone/Edit/Delete Buttons #}
<div class="controls"> <div class="btn-list">
<div class="control-group">
{% plugin_buttons object %} {% plugin_buttons object %}
{# Extra buttons #} {# Extra buttons #}
@ -75,15 +75,12 @@ Context:
{% delete_button object %} {% delete_button object %}
{% endif %} {% endif %}
</div>
<div class="control-group">
{% custom_links object %} {% custom_links object %}
</div>
</div> </div>
{% endblock controls %} {% endblock controls %}
{% block tabs %} {% block tabs %}
<ul class="nav nav-tabs px-3"> <ul class="nav nav-tabs mb-2 px-3">
{# Primary tab #} {# Primary tab #}
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<a class="nav-link{% if not tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a> <a class="nav-link{% if not tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>