Commit 7be71958 by Damien Moulard

access to ABCD calendar

parent 601455ba
...@@ -17,3 +17,4 @@ db.sqlite3 ...@@ -17,3 +17,4 @@ db.sqlite3
shop/shop_admin_settings.json shop/shop_admin_settings.json
shop/errors.log shop/errors.log
.idea .idea
members/settings.json
\ No newline at end of file
...@@ -19,7 +19,12 @@ default_msettings = {'msg_accueil': {'title': 'Message borne accueil', ...@@ -19,7 +19,12 @@ default_msettings = {'msg_accueil': {'title': 'Message borne accueil',
'title': 'Horaires ouverture magasin', 'title': 'Horaires ouverture magasin',
'type': 'textarea', 'type': 'textarea',
'value': '' 'value': ''
} },
'abcd_calendar_link' : {
'title': 'Lien vers le calendrier ABCD',
'type': 'text',
'value': ''
}
} }
def config(request): def config(request):
......
...@@ -18,7 +18,9 @@ $(document).ready(function() { ...@@ -18,7 +18,9 @@ $(document).ready(function() {
if (current_location !== "home") { if (current_location !== "home") {
goto('home'); goto('home');
} }
toggleHeader(); if (document.getElementById("topnav").className !== "topnav") {
toggleHeader();
}
}); });
$('#nav_my_info').on('click', (e) => { $('#nav_my_info').on('click', (e) => {
e.preventDefault(); e.preventDefault();
...@@ -41,4 +43,8 @@ $(document).ready(function() { ...@@ -41,4 +43,8 @@ $(document).ready(function() {
} }
toggleHeader(); toggleHeader();
}); });
$('#nav_calendar').prop("href", abcd_calendar_link);
$('#nav_calendar').on('click', () => {
toggleHeader();
});
}); });
...@@ -213,7 +213,7 @@ function init_calendar_page() { ...@@ -213,7 +213,7 @@ function init_calendar_page() {
default_initial_view = 'listWeek'; default_initial_view = 'listWeek';
header_toolbar = { header_toolbar = {
left: 'title', left: 'title',
center: 'dayGridMonth,listWeek,timeGridDay', center: '',
right: 'prev,next today' right: 'prev,next today'
}; };
} else { } else {
......
...@@ -91,7 +91,6 @@ def index(request, exception=None): ...@@ -91,7 +91,6 @@ def index(request, exception=None):
context['partnerData'] = partnerData context['partnerData'] = partnerData
# TODO test with partner who's not attached
if partnerData["parent_id"] is not False: if partnerData["parent_id"] is not False:
partnerData["parent_name"] = partnerData["parent_id"][1] partnerData["parent_name"] = partnerData["parent_id"][1]
partnerData["parent_id"] = partnerData["parent_id"][0] partnerData["parent_id"] = partnerData["parent_id"][0]
...@@ -104,6 +103,10 @@ def index(request, exception=None): ...@@ -104,6 +103,10 @@ def index(request, exception=None):
if hasattr(settings, 'SHIFT_EXCHANGE_DAYS_TO_HIDE'): if hasattr(settings, 'SHIFT_EXCHANGE_DAYS_TO_HIDE'):
days_to_hide = settings.SHIFT_EXCHANGE_DAYS_TO_HIDE days_to_hide = settings.SHIFT_EXCHANGE_DAYS_TO_HIDE
context['daysToHide'] = days_to_hide context['daysToHide'] = days_to_hide
msettings = MConfig.get_settings('members')
if 'abcd_calendar_link' in msettings:
context['abcd_calendar_link'] = msettings['abcd_calendar_link']['value']
else: else:
# may arrive when switching database without cleaning cookie # may arrive when switching database without cleaning cookie
......
...@@ -10,9 +10,16 @@ ...@@ -10,9 +10,16 @@
<a href="#" class="nav_item" id="nav_my_info">Mes Infos</a> <a href="#" class="nav_item" id="nav_my_info">Mes Infos</a>
<a href="#" class="nav_item" id="nav_my_shifts">Mes Services</a> <a href="#" class="nav_item" id="nav_my_shifts">Mes Services</a>
<a href="#" class="nav_item" id="nav_shifts_exchange">Échange de services</a> <a href="#" class="nav_item" id="nav_shifts_exchange">Échange de services</a>
<a href="#" class="nav_item" id="nav_calendar">Calendrier ABCD</a> <a
href="javascript:void(0);"
target="_blank"
class="nav_item"
id="nav_calendar"
>
Calendrier ABCD
</a>
{# Disconnection button must have this id (logic in all_common.js) #} {# Disconnection button must have this id (logic in all_common.js) #}
<a href="#" id="deconnect">Déconnexion</a> <a href="javascript:void(0);" id="deconnect">Déconnexion</a>
<a href="javascript:void(0);" class="icon" onclick="toggleHeader()"> <a href="javascript:void(0);" class="icon" onclick="toggleHeader()">
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</a> </a>
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
"parent_name" : "{{partnerData.parent_name}}", "parent_name" : "{{partnerData.parent_name}}",
} }
var days_to_hide = "{{daysToHide}}" var days_to_hide = "{{daysToHide}}"
var abcd_calendar_link = "{{abcd_calendar_link}}"
</script> </script>
<script src="{% static "js/all_common.js" %}?v="></script> <script src="{% static "js/all_common.js" %}?v="></script>
<script src="{% static "js/members-space-home.js" %}?v="></script> <script src="{% static "js/members-space-home.js" %}?v="></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment