From 74cf290dbe7a94a5a633e1b2b2907b8563bb8f20 Mon Sep 17 00:00:00 2001 From: Zambom Date: Wed, 1 Feb 2017 02:47:01 -0200 Subject: [PATCH] Adding pendencies subject breadcrumb and menu button active --- amadeus/static/js/pendencies.js | 32 +++++++++++++++++++++++++++----- amadeus/templates/base.html | 4 ++-- notifications/templates/notifications/_view.html | 2 +- notifications/templates/notifications/index.html | 4 +++- notifications/views.py | 1 + 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/amadeus/static/js/pendencies.js b/amadeus/static/js/pendencies.js index 9d2634d..736df31 100644 --- a/amadeus/static/js/pendencies.js +++ b/amadeus/static/js/pendencies.js @@ -13,18 +13,40 @@ $('.pendencies-content').on('show.bs.collapse', function(e) { } }); +$('.pendencies-content').on('shown.bs.collapse', function (e) { + if($(this).is(e.target)){ + var breadcrumb = $(".breadcrumb")[0]; + var li = $(breadcrumb).find('li:last-child'); + var li_text = $(li).html(); + var url = $("#pend_url").val(); + var new_li = $(li).clone(); + + new_li.html($(this).parent().find('.panel-title').data('title')); + + $(li).html("" + li_text + ""); + $(li).append("/"); + + new_li.appendTo(breadcrumb); + } +}); + $('.pendencies-content').on('hidden.bs.collapse', function(e) { - if($(this).is(e.target)){ + if($(this).is(e.target)){ var btn = $(this).parent().find('.fa-angle-down'); btn = btn[0]; $(btn).switchClass("fa-angle-down", "fa-angle-right", 250, "easeInOutQuad"); - } -}); -$('.pendencies-content').on('hidden.bs.collapse', function(e) { - if($(this).is(e.target)){ + var breadcrumb = $(".breadcrumb")[0]; + + $(breadcrumb).find('li:last-child').remove(); + + var li = $(breadcrumb).find('li:last-child'); + var text = $(li).find('a').text(); + + $(li).html(text); + var panel_id = $(this).data('id'), pendencies = $(this).find('.pendencies'), history = $(this).find('.history'), diff --git a/amadeus/templates/base.html b/amadeus/templates/base.html index 740f8c9..1d462dc 100644 --- a/amadeus/templates/base.html +++ b/amadeus/templates/base.html @@ -185,7 +185,7 @@
  • -
  • +
  • {% if notifications_count > 0 %} @@ -234,7 +234,7 @@
  • -
  • +
  • {% if notifications_count > 0 %} diff --git a/notifications/templates/notifications/_view.html b/notifications/templates/notifications/_view.html index c5d510b..325ba8c 100644 --- a/notifications/templates/notifications/_view.html +++ b/notifications/templates/notifications/_view.html @@ -5,7 +5,7 @@
    -