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

View file

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