From 5c709a54161413c743ce79def07565babc0bdf4f Mon Sep 17 00:00:00 2001 From: Skia Date: Fri, 1 Sep 2017 18:31:48 +0200 Subject: [PATCH] core: great rework of the header bar Signed-off-by: Skia --- core/static/core/style.scss | 177 +++++++++++++++++++-------------- core/templates/core/base.jinja | 149 +++++++++++++++------------ 2 files changed, 190 insertions(+), 136 deletions(-) diff --git a/core/static/core/style.scss b/core/static/core/style.scss index ca5997e3..8234e5de 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -66,42 +66,87 @@ a { /*--------------------------------HEADER-------------------------------*/ -#logo { - margin-left: 5%; - display: inline-block; - width: 185px; - height: 100px; +#header_language_chooser { + position: absolute; + top: 1em; + width: 5%; + text-align: center; + input { + display: block; + width: 100%; + padding: 0px; + margin: 0px; + } + form { + display: block; + } } header { - display: block; - position: absolute; - top: 0px; - right: 2%; - background-color: $secondary-light-color; - margin: 0 10px; - padding: 0 10px; - border-radius: 0 0 10px 10px; - ul { + width: 90%; + margin: 0 auto; + display: flex; + + #header_logo { display: inline-block; - list-style-type: none; - margin: 0px; - padding-right: 3px; - vertical-align: middle; - } - a { - display: inline-block; - color: inherit; - text-decoration: none; - padding: 1em; - &:hover { - color: $primary-dark-color; + flex: none; + background-size: 100% 100%; + padding: 0.2em; + a { + display: inline-block; + margin: 0px; + width: 100%; + height: 100%; } } - form { - display: inline-block; - padding: 1em; - width: 150px; + + #header_connect_links { + margin: 0.6em 0.6em 0em auto; + form { + display: inline; + width: 100%; + label { + display: inline; + } + } + a { + display: button; + } + } + + #header_bar { + background-color: $secondary-light-color; + display: flex; + flex: auto; + width: 80%; + + #header_bars_infos { + width: 35ch; + flex: initial; + list-style-type: none; + margin: 0.2em 0.2em; + } + + #header_search { + display: inline-block; + flex: auto; + margin: 0.8em 0em; + } + + #header_user_links { + width: 120ch; + flex: initial; + text-align: right; + margin: 1.2em 0em; + a { + text-decoration: none; + margin: 0em 1em; + color: $black-color; + &:hover { + color: $secondary-color; + } + } + } } } @@ -111,18 +156,6 @@ header { padding: 0.3em 1%; } -#language_chooser { - position: absolute; - text-align: center; - left: 5px; - top: 5px; - input { - margin: 2px; - width: 3em; - height: 2em; - } -} - #notif { display: none; position: absolute; @@ -135,41 +168,35 @@ header { } } -#alert_box p, #info_box p { - margin: 0px; - padding: 0px; +#info_boxes { + display: flex; + width: 90%; + margin: 0 auto; + p { + margin: 0px; + padding: 0px; + } + #alert_box, #info_box { + font-size: smaller; + display: inline-block; + flex: auto; + vertical-align: top; + padding: 2px; + margin: 0.2em 1.5%; + min-width: 10%; + max-width: 46%; + min-height: 20px; + } + #info_box { + border: solid 1px $primary-neutral-light-color; + background: $white-color; + } + #alert_box { + border: solid 1px grey; + background: gold; + } } -#alert_box { - font-size: smaller; - display: inline-block; - border: solid 1px grey; - vertical-align: top; - padding: 2px; - margin: 4px; - margin-top: 60px; - min-width: 10%; - max-width: 30%; - min-height: 20px; -} - -#info_box { - font-size: smaller; - display: inline-block; - border: solid 1px $primary-neutral-light-color; - vertical-align: top; - padding: 2px; - margin: 4px; - margin-top: 60px; - min-width: 10%; - max-width: 30%; - min-height: 20px; - background: $white-color; -} - -#alert_box { - background: gold; -} /*---------------------------------NAV---------------------------------*/ diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 31a4d563..0ec3be80 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -14,69 +14,11 @@ + + {% block header %} {% if not popup %} - - {% set sith = get_sith() %} - {% if sith.alert_msg %} -
- {{ sith.alert_msg|markdown }} -
- {% endif %} - {% if sith.info_msg %} -
- {{ sith.info_msg|markdown }} -
- {% endif %} -
- {% if not user.is_authenticated() %} - {% trans %}Login{% endtrans %} - {% trans %}Register{% endtrans %} - {% else %} - - {{ user.get_display_name() }} - 🔔 ({{ user.notifications.filter(viewed=False).count() }}) - - {% trans %}Tools{% endtrans %} - {% trans %}Logout{% endtrans %} -
- - -
- {% endif %} -
- {% else %} -
{{ user.get_display_name() }}
- {% endif %} - {% endblock %} - -
+
{% for language in LANGUAGES %}
{% csrf_token %} @@ -86,6 +28,91 @@ {% endfor %}
+
+ {% if not user.is_authenticated() %} + + + {% else %} + + + {% endif %} +
+ +
+ {% set sith = get_sith() %} + {% if sith.alert_msg %} +
+ {{ sith.alert_msg|markdown }} +
+ {% endif %} + {% if sith.info_msg %} +
+ {{ sith.info_msg|markdown }} +
+ {% endif %} +
+ + {% else %}{# if not popup #} +
{{ user.get_display_name() }}
+ {% endif %} + + + {% endblock %} + + {% block nav %} {% if not popup %}