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 #}
<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 %}
</div>
{# Controls #}
<div class="col-auto ms-auto d-print-none">
<div class="col-auto d-print-none">
{% block controls %}{% endblock controls %}
</div>

View File

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