Commit 7be71958 by Damien Moulard

access to ABCD calendar

parent 601455ba
......@@ -17,3 +17,4 @@ db.sqlite3
shop/shop_admin_settings.json
shop/errors.log
.idea
members/settings.json
\ No newline at end of file
......@@ -19,7 +19,12 @@ default_msettings = {'msg_accueil': {'title': 'Message borne accueil',
'title': 'Horaires ouverture magasin',
'type': 'textarea',
'value': ''
}
},
'abcd_calendar_link' : {
'title': 'Lien vers le calendrier ABCD',
'type': 'text',
'value': ''
}
}
def config(request):
......
......@@ -18,7 +18,9 @@ $(document).ready(function() {
if (current_location !== "home") {
goto('home');
}
toggleHeader();
if (document.getElementById("topnav").className !== "topnav") {
toggleHeader();
}
});
$('#nav_my_info').on('click', (e) => {
e.preventDefault();
......@@ -41,4 +43,8 @@ $(document).ready(function() {
}
toggleHeader();
});
$('#nav_calendar').prop("href", abcd_calendar_link);
$('#nav_calendar').on('click', () => {
toggleHeader();
});
});
......@@ -213,7 +213,7 @@ function init_calendar_page() {
default_initial_view = 'listWeek';
header_toolbar = {
left: 'title',
center: 'dayGridMonth,listWeek,timeGridDay',
center: '',
right: 'prev,next today'
};
} else {
......
......@@ -91,7 +91,6 @@ def index(request, exception=None):
context['partnerData'] = partnerData
# TODO test with partner who's not attached
if partnerData["parent_id"] is not False:
partnerData["parent_name"] = partnerData["parent_id"][1]
partnerData["parent_id"] = partnerData["parent_id"][0]
......@@ -104,6 +103,10 @@ def index(request, exception=None):
if hasattr(settings, 'SHIFT_EXCHANGE_DAYS_TO_HIDE'):
days_to_hide = settings.SHIFT_EXCHANGE_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:
# may arrive when switching database without cleaning cookie
......
......@@ -10,9 +10,16 @@
<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_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) #}
<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()">
<i class="fa fa-bars"></i>
</a>
......
......@@ -90,6 +90,7 @@
"parent_name" : "{{partnerData.parent_name}}",
}
var days_to_hide = "{{daysToHide}}"
var abcd_calendar_link = "{{abcd_calendar_link}}"
</script>
<script src="{% static "js/all_common.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