Skip to content

Commit

Permalink
chore: caption toc button dependent on content
Browse files Browse the repository at this point in the history
  • Loading branch information
SilvanVerhoeven committed Aug 9, 2024
1 parent aea76e2 commit 9e027aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 8 additions & 2 deletions myhpi/core/templates/core/toc_button.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@
{%if toc|hasTocContent or attachments %}
<div id="sidebar-toggle" class="d-grid d-lg-none d-print-none">
<button type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebar-offcanvas"
aria-controls="sidebar-offcanvas" class="btn btn-light mb-3" aria-label="{% translate 'Table of contents and attachments' %}">
aria-controls="sidebar-offcanvas" class="btn btn-light mb-3" aria-label="{% translate 'Table of contents and Attachments' %}">
{% bs_icon 'list-ol' size='1.3rem' %}
{% translate "Table of contents and attachments" %}
{% if toc|hasTocContent and attachments %}
{% translate "Table of contents and Attachments" %}
{% elif toc|hasTocContent %}
{% translate "Table of contents" %}
{% else %}
{% translate "Attachments" %}
{% endif %}
</button>
</div>
{% endif %}
8 changes: 5 additions & 3 deletions myhpi/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-08 20:23+0200\n"
"POT-Creation-Date: 2024-08-09 21:23+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -151,11 +151,13 @@ msgstr "Sichtbarkeit"
#: myhpi/core/templates/core/sidebar.html:25
#: myhpi/core/templates/core/sidebar.html:46
#: myhpi/core/templates/core/sidebar.html:52
#: myhpi/core/templates/core/toc_button.html:15
msgid "Table of contents"
msgstr "Inhaltsverzeichnis"

#: myhpi/core/templates/core/sidebar.html:31
#: myhpi/core/templates/core/sidebar.html:57
#: myhpi/core/templates/core/toc_button.html:17
msgid "Attachments"
msgstr "Anhänge"

Expand All @@ -164,8 +166,8 @@ msgid "Close"
msgstr "Schließen"

#: myhpi/core/templates/core/toc_button.html:10
#: myhpi/core/templates/core/toc_button.html:12
msgid "Table of contents and attachments"
#: myhpi/core/templates/core/toc_button.html:13
msgid "Table of contents and Attachments"
msgstr "Inhaltsverzeichnis und Anhänge"

#: myhpi/polls/models.py:66
Expand Down

0 comments on commit 9e027aa

Please sign in to comment.