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

@ -17,8 +17,8 @@
<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 />