Skip to content

Commit

Permalink
Make it possible to add additional CSS classes to language selector
Browse files Browse the repository at this point in the history
  • Loading branch information
nonprofittechy committed Aug 2, 2024
1 parent 7120b40 commit dae5acf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docassemble/AssemblyLine/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def get_language_list_dropdown(
languages_path: Optional[str] = None,
event_name="al_change_language",
icon="fa-solid fa-language",
extra_class:str="text-light",
) -> str:
"""
Get a Bootstrap 5 dropdown menu for language selection that can be added to navigation bar.
Expand All @@ -103,13 +104,13 @@ def get_language_list_dropdown(
languages_path: the path to the languages.yml file (defaults to data/sources/languages.yml)
event_name: the name of the event to trigger when the language is changed
icon: the name of the icon to use for the dropdown menu (defaults to fa-solid fa-language)
extra_class: additional classes to add to the link
Returns:
A string containing the HTML for a dropdown menu for language selection.
"""
list_start = f"""<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-light" href="#" id="languageSelector" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Language selection">
<i class="{icon}"></i>
<a class="nav-link dropdown-toggle { extra_class }" href="#" id="languageSelector" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Language selection">
<i class="{ icon }"></i>
</a>
<div class="dropdown-menu" aria-labelledby="languageSelector">
"""
Expand Down

0 comments on commit dae5acf

Please sign in to comment.