From 791008389ec9213dd51fd52261a79bd803e3c6eb Mon Sep 17 00:00:00 2001 From: Daniel Fehrm Date: Sat, 24 Oct 2020 23:46:28 +0200 Subject: [PATCH] added switch language button to mobile menu (#494) --- .../sass/partials/layout/_navigation.scss | 20 ++++++++++- src/moore/templates/partials/navigation.html | 33 +++++++------------ .../partials/switch_language_button.html | 17 ++++++++++ 3 files changed, 47 insertions(+), 23 deletions(-) create mode 100644 src/moore/templates/partials/switch_language_button.html diff --git a/src/moore/static/sass/partials/layout/_navigation.scss b/src/moore/static/sass/partials/layout/_navigation.scss index 9e8c512d..2f6deaa0 100644 --- a/src/moore/static/sass/partials/layout/_navigation.scss +++ b/src/moore/static/sass/partials/layout/_navigation.scss @@ -24,6 +24,24 @@ $logo-width: 214px; } } + #set_language_form > button { + @media #{$medium-and-down}{ + background: none; + border: none; + width: 100%; + text-align: left; + padding: 0; + + i { + float: left; + margin: 0 32px 0 0; + line-height: 48px; + height: 48px; + color: rgba(0, 0, 0, 0.54); + } + } + } + .collapsible-body{ padding-left: 1.4em; } @@ -117,4 +135,4 @@ $logo-width: 214px; left: 100% !important; } } -} \ No newline at end of file +} diff --git a/src/moore/templates/partials/navigation.html b/src/moore/templates/partials/navigation.html index 8f5d1014..ee7d170f 100644 --- a/src/moore/templates/partials/navigation.html +++ b/src/moore/templates/partials/navigation.html @@ -27,8 +27,16 @@
  • {% trans 'Home' %}
  • {% menu_items parent=site_root sidenav=True top_level=True %} + +
  • +
  • + + {% include "partials/switch_language_button.html" with mobile=True %} + +
  • + {% if user.is_authenticated %} -
  • +
  • face{% trans 'account' %}
  • lock{% trans 'password' %}
  • cancel{% trans 'Log out' %}
  • @@ -42,26 +50,7 @@ - \ No newline at end of file + diff --git a/src/moore/templates/partials/switch_language_button.html b/src/moore/templates/partials/switch_language_button.html new file mode 100644 index 00000000..39293787 --- /dev/null +++ b/src/moore/templates/partials/switch_language_button.html @@ -0,0 +1,17 @@ +
    + {% csrf_token %} + + + +