last opened ressource preselected in dialogs
This commit is contained in:
parent
1610c1933d
commit
2136241a8f
|
@ -80,7 +80,7 @@ class AgendaHomepageView(TemplateView):
|
|||
|
||||
class AgendaServiceActivityView(TemplateView, cbv.ServiceViewMixin):
|
||||
template_name = 'agenda/service-activity.html'
|
||||
cookies_to_clear = [('agenda-tabs', )]
|
||||
cookies_to_clear = [('agenda-tabs', ), ('active-agenda', ), ('last-ressource', )]
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(AgendaServiceActivityView, self).get_context_data(**kwargs)
|
||||
|
@ -323,7 +323,7 @@ class DeleteEventView(cbv.DeleteView):
|
|||
|
||||
class AgendaServiceActValidationView(TemplateView):
|
||||
template_name = 'agenda/act-validation.html'
|
||||
cookies_to_clear = [('agenda-tabs', )]
|
||||
cookies_to_clear = [('agenda-tabs', ), ('active-agenda', ), ('last-ressource', )]
|
||||
|
||||
def acts_of_the_day(self):
|
||||
acts = list(Act.objects \
|
||||
|
@ -453,7 +453,7 @@ class UnlockAllView(CreateView):
|
|||
|
||||
class AgendasTherapeutesView(AgendaHomepageView):
|
||||
template_name = 'agenda/agendas-therapeutes.html'
|
||||
cookies_to_clear = [('agenda-tabs', )]
|
||||
cookies_to_clear = [('agenda-tabs', ), ('active-agenda', ), ('last-ressource', )]
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(AgendasTherapeutesView, self).get_context_data(**kwargs)
|
||||
|
@ -681,7 +681,7 @@ class AjaxRessourceDisponibilityColumnView(AjaxWorkerDisponibilityColumnView):
|
|||
class PeriodicEventsView(cbv.ListView):
|
||||
model = EventWithAct
|
||||
template_name = 'agenda/periodic-events.html'
|
||||
cookies_to_clear = [('agenda-tabs', )]
|
||||
cookies_to_clear = [('agenda-tabs', ), ('active-agenda', ), ('last-ressource', )]
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if 'worker_id' in kwargs:
|
||||
|
|
|
@ -328,6 +328,10 @@ function event_dialog(url, title, width, btn_text) {
|
|||
$(function() {
|
||||
$('#tabs').tabs({
|
||||
load: function(event, ui) {
|
||||
var tab = $(ui.tab).attr('id').split('-');
|
||||
if(tab[0] == 'ressource')
|
||||
$.cookie('last-ressource', tab[1], { path: COOKIE_PATH });
|
||||
|
||||
$('#tabs > div > div').accordion({active: false,
|
||||
autoHeight: false,
|
||||
collapsible: true});
|
||||
|
|
Reference in New Issue