Skip to content

Commit

Permalink
merge templates
Browse files Browse the repository at this point in the history
  • Loading branch information
DoroWolf authored Dec 17, 2024
1 parent 3effd75 commit cd5c576
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 232 deletions.
230 changes: 0 additions & 230 deletions assets/templates/help_doc_base_detail.html

This file was deleted.

19 changes: 19 additions & 0 deletions assets/templates/help_doc_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
font-family: 'Noto Sans SC', 'Noto Sans HK', 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
}

{% if module_.base %}
body {
background-color: white;
--theme-color-title: #9f430b;
--theme-color-main: #e1996d;
--theme-color-main-2: #e9af8b;
--theme-color-main-3: #f5d9c5;
--theme-color-secondary: #fae0de;
--theme-color-tertiary: #f8f4fc;
--theme-color-highlight: #d6804a;
}
{% else %}
body {
background-color: white;
--theme-color-title: #305e7a;
Expand All @@ -50,6 +62,7 @@
--theme-color-tertiary: #f8faf6;
--theme-color-highlight: #6d98b3;
}
{% endif %}

h2 {
background-color: var(--theme-color-main);
Expand Down Expand Up @@ -135,6 +148,12 @@
border-top: 2px solid var(--theme-color-highlight);
}

{% if module_.base %}
.authors {
display: none;
}
{% endif %}

.help-contents {
background-color: var(--theme-color-tertiary);
}
Expand Down
3 changes: 1 addition & 2 deletions modules/core/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ async def bot_help(msg: Bot.MessageSession, module: str):
pass
elif any((module_.alias, module_.desc, module_.developers, help_.return_formatted_help_doc(), regex_list)):
try:
template = 'help_doc_base_detail' if module_.base else 'help_doc_detail'
html_content = env.get_template(f'{template}.html').render(msg=msg,
html_content = env.get_template('help_doc_detail.html').render(msg=msg,
module=module_,
help=help_,
help_name=help_name,
Expand Down

0 comments on commit cd5c576

Please sign in to comment.