DetailView sub title bread crumbs addded

DetailView sub title bread crumbs addded for command and file help
This commit is contained in:
davewiththenicehat 2021-06-04 17:35:50 -04:00
parent 9eb1c0532f
commit 86bd79d7ec
2 changed files with 21 additions and 15 deletions

View file

@ -57,6 +57,9 @@ class HelpEntry(SharedMemoryModel):
db_key = models.CharField(
"help key", max_length=255, unique=True, help_text="key to search for"
)
@lazy_property
def key(self):
return self.db_key
# help category
db_help_category = models.CharField(
"help category",
@ -64,6 +67,9 @@ class HelpEntry(SharedMemoryModel):
default="General",
help_text="organizes help entries in lists",
)
@lazy_property
def help_category(self):
return self.db_help_category
# the actual help entry text, in any formatting.
db_entrytext = models.TextField(
"help entry", blank=True, help_text="the main body of help text"

View file

@ -9,16 +9,16 @@
{% load addclass %}
<div class="row">
<div class="col">
<!-- main content -->
<!-- main content -->
<div class="card mb-3">
<div class="card-body">
<h1 class="card-title">{{ view.page_title }} ({{ object|title }})</h1>
<hr />
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'help' %}">Help Index</a></li>
<li class="breadcrumb-item"><a href="{% url 'help' %}#{{ object.db_help_category }}">{{ object.db_help_category|title }}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ object.db_key|title }}</li>
<li class="breadcrumb-item"><a href="{% url 'help' %}#{{ object.help_category }}">{{ object.help_category|title }}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ object.key|title }}</li>
</ol>
<hr />
@ -26,7 +26,7 @@
<!-- left column -->
<div class="col-lg-9 col-sm-12">
<p>{{ entry_text }}</p>
{% if topic_previous or topic_next %}
<hr />
<!-- navigation -->
@ -37,7 +37,7 @@
<a class="page-link" href="{{ topic_previous.web_get_detail_url }}">Previous ({{ topic_previous|title }})</a>
</li>
{% endif %}
{% if topic_next %}
<li class="page-item">
<a class="page-link" href="{{ topic_next.web_get_detail_url }}">Next ({{ topic_next|title }})</a>
@ -47,40 +47,40 @@
</nav>
<!-- end navigation -->
{% endif %}
</div>
<!-- end left column -->
<!-- right column (sidebar) -->
<div class="col-lg-3 col-sm-12">
{% if request.user.is_staff %}
<!-- admin button -->
<a class="btn btn-info btn-block mb-3" href="{{ object.web_get_admin_url }}">Admin</a>
<!-- end admin button -->
<hr />
{% endif %}
<div class="card mb-3">
<div class="card-header">{{ object.db_help_category|title }}</div>
<ul class="list-group list-group-flush">
{% for topic in topic_list %}
<a href="{{ topic.web_get_detail_url }}" class="list-group-item {% if topic == object %}active disabled{% endif %}">{{ topic|title }}</a>
{% endfor %}
</ul>
</div>
</div>
<!-- end right column -->
</div>
<hr />
</div>
</div>
<!-- end main content -->
</div>
</div>
{% endblock %}