From fb4c555d85f3faa81dba717730a0bfdfb6099f5c Mon Sep 17 00:00:00 2001 From: Nivesh Mittapally Date: Wed, 21 Jun 2023 16:45:55 +0530 Subject: [PATCH 1/2] feat: added info box template sample --- static/js/global_layout.js | 8 ++++++++ templates/EnigmaOps/showAccessHistory.html | 22 ++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/static/js/global_layout.js b/static/js/global_layout.js index 529a9a40..e225245a 100644 --- a/static/js/global_layout.js +++ b/static/js/global_layout.js @@ -17,3 +17,11 @@ function showNotification(type, message, title=undefined) { $("#notification_title").html(title); $("#notification_bar").show(); } + + +function showTooltip(id) { + $(`#${id}`).removeClass("hidden"); +} +function hideTooltip(id) { + $(`#${id}`).addClass("hidden"); +} diff --git a/templates/EnigmaOps/showAccessHistory.html b/templates/EnigmaOps/showAccessHistory.html index e6297f5e..0ed6148a 100644 --- a/templates/EnigmaOps/showAccessHistory.html +++ b/templates/EnigmaOps/showAccessHistory.html @@ -157,8 +157,26 @@

No exact match found

{{ each_access.access_desc }}
{{ each_access.requestId }}
- {% access_status_content each_access.status|safe %} - {{ each_access.accessCategory }} + +
+
{% access_status_content each_access.status|safe %}
+ +
+ + + + + + {{ each_access.accessCategory }} + {{ each_access.accessRequestType }} From c46bd1663446b48d4f53aa65b613dcac176e5ef2 Mon Sep 17 00:00:00 2001 From: Nivesh Mittapally Date: Wed, 21 Jun 2023 20:56:42 +0530 Subject: [PATCH 2/2] feat: added tooltip using jquery powertip library --- static/css/jquery.powertip.min.css | 1 + static/js/global_layout.js | 8 ------ static/js/jquery.powertip.min.js | 8 ++++++ static/js/showAccessHistory.js | 15 +++++++++++ templates/EnigmaOps/showAccessHistory.html | 31 +++++++++++----------- 5 files changed, 39 insertions(+), 24 deletions(-) create mode 100644 static/css/jquery.powertip.min.css create mode 100644 static/js/jquery.powertip.min.js diff --git a/static/css/jquery.powertip.min.css b/static/css/jquery.powertip.min.css new file mode 100644 index 00000000..5ea23f48 --- /dev/null +++ b/static/css/jquery.powertip.min.css @@ -0,0 +1 @@ +#powerTip{cursor:default;background-color:#333;background-color:rgba(0,0,0,.8);border-color:#333;border-color:rgba(0,0,0,.8);border-radius:6px;color:#fff;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:attr(class) " ";position:absolute;height:0;width:0;text-indent:100%;overflow:hidden}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before,#powerTip.ne:before,#powerTip.nw:before{bottom:-10px}#powerTip.n:before,#powerTip.ne-alt:before,#powerTip.ne:before,#powerTip.nw-alt:before,#powerTip.nw:before{border-top-color:inherit;border-top-style:solid;border-top-width:10px}#powerTip.e:before{border-right-color:inherit;border-right-style:solid;border-right-width:10px;left:-10px}#powerTip.s:before,#powerTip.se:before,#powerTip.sw:before{top:-10px}#powerTip.s:before,#powerTip.se-alt:before,#powerTip.se:before,#powerTip.sw-alt:before,#powerTip.sw:before{border-bottom-color:inherit;border-bottom-style:solid;border-bottom-width:10px}#powerTip.w:before{border-left-color:inherit;border-left-style:solid;border-left-width:10px;right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} diff --git a/static/js/global_layout.js b/static/js/global_layout.js index e225245a..529a9a40 100644 --- a/static/js/global_layout.js +++ b/static/js/global_layout.js @@ -17,11 +17,3 @@ function showNotification(type, message, title=undefined) { $("#notification_title").html(title); $("#notification_bar").show(); } - - -function showTooltip(id) { - $(`#${id}`).removeClass("hidden"); -} -function hideTooltip(id) { - $(`#${id}`).addClass("hidden"); -} diff --git a/static/js/jquery.powertip.min.js b/static/js/jquery.powertip.min.js new file mode 100644 index 00000000..82a931d8 --- /dev/null +++ b/static/js/jquery.powertip.min.js @@ -0,0 +1,8 @@ +/*! + PowerTip v1.3.2 (2022-03-06) + https://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2022 Steven Benner (https://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ +!function(e,t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(p){var f=p(document),w=p(window),e=p("body"),d="displayController",h="hasActiveHover",v="forcedOpen",m="hasMouseMove",T="mouseOnToPopup",a="originalTitle",l="powertip",c="powertipjq",u="powertiptarget",g=".powertip",y=180/Math.PI,t=["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu"],b={elements:[],tooltips:null,isTipOpen:!1,isFixedTipOpen:!1,isClosing:!1,tipOpenImminent:!1,activeHover:null,currentX:0,currentY:0,previousX:0,previousY:0,desyncTimeout:null,closeDelayTimeout:null,mouseTrackingActive:!1,delayInProgress:!1,windowWidth:0,windowHeight:0,scrollTop:0,scrollLeft:0},H={none:0,top:1,bottom:2,left:4,right:8};function k(){var o=this;o.top="auto",o.left="auto",o.right="auto",o.bottom="auto",o.set=function(e,t){p.isNumeric(t)&&(o[e]=Math.round(t))}}function P(o,n,i){var s=null,t=null;function r(e,t){a(),o.data(h)?l():e?(t&&o.data(v,!0),c(),i.showTip(o)):(b.tipOpenImminent=!0,s=setTimeout(function(){var e,t;s=null,e=Math.abs(b.previousX-b.currentX),t=Math.abs(b.previousY-b.currentY),e+t",{id:r.popupId}),(e=0===e.length?p("body"):e).append(l),b.tooltips=b.tooltips?b.tooltips.add(l):l),r.followMouse&&(l.data(m)||(f.on("mousemove"+g,i),w.on("scroll"+g,i),l.data(m,!0))),this.showTip=function(t){t.data(h,!0),l.queue(function(e){!function o(t){var e;if(!t.data(h))return;if(b.isTipOpen)return b.isClosing||n(b.activeHover),void l.delay(100).queue(function(e){o(t),e()});t.trigger("powerTipPreRender");e=M(t);{if(!e)return;l.empty().append(e)}t.trigger("powerTipRender");b.activeHover=t;b.isTipOpen=!0;l.data(T,r.mouseOnToPopup);l.addClass(r.popupClass);!r.followMouse||t.data(v)?(s(t),b.isFixedTipOpen=!0):i();t.data(v)||r.followMouse||f.on("click"+g,function(e){e=e.target;e!==t[0]&&(r.mouseOnToPopup&&(e===l[0]||p.contains(l[0],e))||p.powerTip.hide())});r.mouseOnToPopup&&!r.manual&&-1=t.left&&b.currentX<=t.left+e&&b.currentY>=t.top&&b.currentY<=t.top+o}function M(e){var t,o,n=e.data(l),i=e.data(c),s=e.data(u);return n?o=n=p.isFunction(n)?n.call(e[0]):n:i?0<(i=p.isFunction(i)?i.call(e[0]):i).length&&(o=i.clone(!0,!0)):s&&0<(t=p("#"+s)).length&&(o=t.html()),o}function Y(e,t,o){var n=b.scrollTop,i=b.scrollLeft,s=n+b.windowHeight,r=i+b.windowWidth,a=H.none;return(e.tops||Math.abs(e.bottom-b.windowHeight)>s)&&(a|=H.bottom),(e.leftr)&&(a|=H.left),(e.left+t>r||e.right + + {% endblock %} {% block nav_breadcrumb %} @@ -157,23 +159,20 @@

No exact match found

{{ each_access.access_desc }}
{{ each_access.requestId }}
- -
-
{% access_status_content each_access.status|safe %}
- + +
+ {% access_status_content each_access.status|safe %} +
+ - - - - {{ each_access.accessCategory }}