Skip to content

Commit 5a14447

Browse files
committed
Add option to display label on sidebar
1 parent 536f9e9 commit 5a14447

File tree

4 files changed

+49
-6
lines changed

4 files changed

+49
-6
lines changed

atlas/configuration/config.py.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ NOM_APPLICATION = "Nom de l application"
5151
# ex "/atlas" pour une URL: http://mon-domaine/atlas OU "" si l'application est accessible à la racine du domaine
5252
URL_APPLICATION = "/atlas"
5353

54+
# Afficher ou non les labels dans la barre latérale
55+
AFFICHAGE_LABEL_SIDEBAR = False
56+
5457
#################################
5558
#################################
5659
###### Modules activation #######

atlas/configuration/config_schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class Meta:
174174
AFFICHAGE_EN_CE_MOMENT = fields.Boolean(load_default=True)
175175
AFFICHAGE_RANG_STAT = fields.Boolean(load_default=True)
176176
AFFICHAGE_NOUVELLES_ESPECES = fields.Boolean(load_default=True)
177+
AFFICHAGE_LABEL_SIDEBAR = fields.Boolean(load_default=False)
177178
AFFICHAGE_RECHERCHE_AVANCEE = fields.Boolean(load_default=False)
178179
AFFICHAGE_GRAPH_ALTITUDES = fields.Boolean(load_default=True)
179180
AFFICHAGE_GRAPH_PHENOLOGIE = fields.Boolean(load_default=True)

atlas/static/css/atlas.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ sidebar {
388388
#sidebar_menu li {
389389
height: 60px !important;
390390
min-height: 60px;
391-
line-height: 60px;
392391
color: white;
393392
cursor: pointer;
394393
text-align: center;

atlas/templates/core/sideBar.html

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,48 @@
1+
<style>
2+
{% if configuration.AFFICHAGE_LABEL_SIDEBAR %}
3+
#sidebar_menu {
4+
width: 120px;
5+
li {
6+
height: unset !important;
7+
8+
.short_title {
9+
padding-top: 0.5rem;
10+
font-size: 0.8rem;
11+
font-weight: bold;
12+
text-transform: uppercase;
13+
}
14+
}
15+
}
16+
main {
17+
margin-left: 120px;
18+
}
19+
{% else %}
20+
.sidebar-brand > a {
21+
justify-content: center;
22+
}
23+
{% endif %}
24+
</style>
25+
126
<ul id="sidebar_menu" class="sidebar-nav">
227

328
<li class="sidebar-brand">
429
<a href="{{ url_for('main.index') }}" id="menu-toggle"
5-
class="d-flex justify-content-center align-items-center p-3 w-100 h-100"
30+
class="d-flex align-items-center flex-column p-3 w-100 h-100"
631
data-bs-toggle="tooltip"
732
title="{{ _('back.to.home') }}"
833
data-bs-placement="right">
934
<span id="main_icon" class="fa fa-home"></span>
35+
{% if configuration.AFFICHAGE_LABEL_SIDEBAR %}
36+
<div class="short_title">{{ _("home") | upper }}</div>
37+
{% endif %}
1038
</a>
1139
</li>
1240

1341
{% for page_key, page_values in configuration.STATIC_PAGES.items()|sort(attribute='1.order') %}
1442
{% if 'url' in page_values %}
1543
<li class="sidebar-brand">
1644
<a href="{{ page_values.url }}" target="_blank"
17-
class="d-flex justify-content-center align-items-center p-3 w-100 h-100"
45+
class="d-flex align-items-center flex-column p-3 w-100 h-100"
1846
data-bs-toggle="tooltip"
1947
title="{{ page_values.title }}"
2048
data-bs-placement="right">
@@ -25,12 +53,15 @@
2553
{% else %}
2654
<span class="fas {{ page_values.picto }}"></span>
2755
{% endif %}
56+
{% if configuration.AFFICHAGE_LABEL_SIDEBAR and 'label' in page_values %}
57+
<div class="short_title">{{ page_values.short_title }}</div>
58+
{% endif %}
2859
</a>
2960
</li>
3061
{% else %}
3162
<li class="sidebar-brand">
3263
<a href="{{ url_for('main.get_staticpages', page=page_key) }}"
33-
class="d-flex justify-content-center align-items-center p-3 w-100 h-100"
64+
class="d-flex flex-column align-items-center p-3 w-100 h-100"
3465
data-bs-toggle="tooltip"
3566
title="{{ page_values.title }}"
3667
data-bs-placement="right">
@@ -41,29 +72,38 @@
4172
{% else %}
4273
<span class="fas {{ page_values.picto }}"></span>
4374
{% endif %}
75+
{% if configuration.AFFICHAGE_LABEL_SIDEBAR and 'short_title' in page_values %}
76+
<div class="short_title">{{ page_values.short_title }}</div>
77+
{% endif %}
4478
</a>
4579
</li>
4680
{% endif %}
4781
{% endfor %}
4882
{% if configuration.AFFICHAGE_RECHERCHE_AVANCEE %}
4983
<li class="sidebar-brand">
5084
<a href="{{ url_for('main.advanced_search') }}"
51-
class="d-flex justify-content-center align-items-center p-3 w-100 h-100"
85+
class="d-flex flex-column align-items-center p-3 w-100 h-100"
5286
data-bs-toggle="tooltip"
5387
title="{{ _('advanced_search') }}"
5488
data-bs-placement="right">
5589
<span class="fa fa-search"></span>
90+
{% if configuration.AFFICHAGE_LABEL_SIDEBAR %}
91+
<div class="short_title">{{ _("advanced_search") | upper }}</div>
92+
{% endif %}
5693
</a>
5794
</li>
5895
{% endif %}
5996

6097
<li class="sidebar-brand">
6198
<a href="{{ url_for('main.photos') }}"
62-
class="d-flex justify-content-center align-items-center p-3 w-100 h-100"
99+
class="d-flex flex-column align-items-center p-3 w-100 h-100"
63100
data-bs-toggle="tooltip"
64101
title="{{ _('gallery.title') }}"
65102
data-bs-placement="right">
66103
<span class="fa fa-camera"></span>
104+
{% if configuration.AFFICHAGE_LABEL_SIDEBAR %}
105+
<div class="short_title">{{ _("photos") | upper }}</div>
106+
{% endif %}
67107
</a>
68108
</li>
69109

0 commit comments

Comments
 (0)