Make web help topics lowercase for proper sorting
This commit is contained in:
parent
d00915d092
commit
52704d7c93
2 changed files with 5 additions and 4 deletions
|
|
@ -816,9 +816,9 @@ class CmdSetHelp(CmdHelp):
|
||||||
"with access to that command.")
|
"with access to that command.")
|
||||||
elif inherits_from(match, "evennia.help.filehelp.FileHelpEntry"):
|
elif inherits_from(match, "evennia.help.filehelp.FileHelpEntry"):
|
||||||
warning = (f"'{querystr}' matches (or partially matches) the name/alias of the "
|
warning = (f"'{querystr}' matches (or partially matches) the name/alias of the "
|
||||||
"file-based help file '{match.key}'. File-help entries cannot be "
|
f"file-based help topic '{match.key}'. File-help entries cannot be "
|
||||||
"modified from in-game (they are files on-disk). If you continue, "
|
"modified from in-game (they are files on-disk). If you continue, "
|
||||||
"your help entry *may* shadow the file-based one's name partly or "
|
"your help entry may shadow the file-based one's name partly or "
|
||||||
"completely.")
|
"completely.")
|
||||||
if warning:
|
if warning:
|
||||||
# show a warning for a clashing help-entry type. Even if user accepts this
|
# show a warning for a clashing help-entry type. Even if user accepts this
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ def get_help_category(help_entry, slugify_cat=True):
|
||||||
# if one does not exist, create a category for ease of use with web views html templates
|
# if one does not exist, create a category for ease of use with web views html templates
|
||||||
if not hasattr(help_entry, 'web_help_category'):
|
if not hasattr(help_entry, 'web_help_category'):
|
||||||
setattr(help_entry, 'web_help_category', slugify(help_category))
|
setattr(help_entry, 'web_help_category', slugify(help_category))
|
||||||
|
help_category = help_category.lower()
|
||||||
return slugify(help_category) if slugify_cat else help_category
|
return slugify(help_category) if slugify_cat else help_category
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -58,7 +59,7 @@ def get_help_topic(help_entry):
|
||||||
# if one does not exist, create a key for ease of use with web views html templates
|
# if one does not exist, create a key for ease of use with web views html templates
|
||||||
if not hasattr(help_entry, 'web_help_key'):
|
if not hasattr(help_entry, 'web_help_key'):
|
||||||
setattr(help_entry, 'web_help_key', slugify(help_topic))
|
setattr(help_entry, 'web_help_key', slugify(help_topic))
|
||||||
return help_topic
|
return help_topic.lower()
|
||||||
|
|
||||||
|
|
||||||
def can_read_topic(cmd_or_topic, account):
|
def can_read_topic(cmd_or_topic, account):
|
||||||
|
|
@ -187,7 +188,7 @@ class HelpMixin():
|
||||||
all_entries = list(all_topics.values())
|
all_entries = list(all_topics.values())
|
||||||
|
|
||||||
# sort the entries
|
# sort the entries
|
||||||
all_entries = sorted(all_entries, key=get_help_topic) # sort alphabetically
|
all_entries.sort(key=get_help_topic) # sort alphabetically
|
||||||
all_entries.sort(key=get_help_category) # group by categories
|
all_entries.sort(key=get_help_category) # group by categories
|
||||||
|
|
||||||
return all_entries
|
return all_entries
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue