Browse Source

HUE-2363 [sentry] Hide the 3 top right icons of privileges when in a popup

Improved css classes for 'with grant' and advanced links in the 3 cases: right panel, modal, table
Enrico Berti 11 years ago
parent
commit
b6c3433
2 changed files with 34 additions and 13 deletions
  1. 8 10
      apps/security/src/security/templates/hive.mako
  2. 26 3
      apps/security/static/css/security.css

+ 8 - 10
apps/security/src/security/templates/hive.mako

@@ -47,10 +47,8 @@ ${ layout.menubar(section='hive') }
 <div data-bind="visible: status() != 'deleted' && status() != 'alreadydeleted'" class="acl-block acl-block-airy">
 
   <!-- ko if: editing() -->
-    <div class="pull-right">
-      <a title="${ _('Grant this privilege') }" class="pointer" style="margin-right: 4px" data-bind="visible: grantOption() || $root.is_sentry_admin, click: function(){ $root.grantToPrivilege($data); $('#grantPrivilegeModal').modal('show'); }">
-        <i class="fa fa-send"></i>
-      </a>
+    <div class="pull-right privilege-actions">
+      <a title="${ _('Grant this privilege') }" class="pointer" style="margin-right: 4px" data-bind="visible: grantOption() || $root.is_sentry_admin, click: function(){ $root.grantToPrivilege($data); $('#grantPrivilegeModal').modal('show'); }"><i class="fa fa-send"></i></a>
       <a class="pointer" style="margin-right: 4px" data-bind="click: function() { if (editing()) { editing(false); }}"><i class="fa fa-eye"></i></a>
       <a class="pointer" style="margin-right: 4px" data-bind="click: remove"><i class="fa fa-times"></i></a>
     </div>
@@ -71,13 +69,15 @@ ${ layout.menubar(section='hive') }
 
     <select data-bind="options: $root.availableActions, select2: { update: $data.action, type: 'action'}" style="width: 100px"></select>
 
-    <div class="inline-block" style="vertical-align: middle">
-      <label>&nbsp;&nbsp;<input type="checkbox" data-bind="checked: grantOption"> ${ _('With grant') }</label>
+    <div class="inline-block with-grant-checkbox">
+      <label class="checkbox"><input type="checkbox" data-bind="checked: grantOption"> ${ _('With grant') }</label>
     </div>
 
     <span class="showAdvancedSpace">&nbsp;&nbsp;</span>
     <a class="pointer showAdvanced" data-bind="click: function(){ showAdvanced(true); }, visible: ! showAdvanced()"><i class="fa fa-cog"></i> ${ _('Advanced') }</a>
 
+    <div class="clearfix"></div>
+
     <div class="acl-block-section" data-bind="visible: showAdvanced">
       <input type="text" data-bind="value: serverName" placeholder="serverName" style="margin-left: 29px">
       <select data-bind="options: $root.availablePrivileges, select2: { update: $data.privilegeScope, type: 'scope'}" style="width: 100px"></select>
@@ -86,10 +86,8 @@ ${ layout.menubar(section='hive') }
 
   <!-- ko ifnot: editing() -->
     <!-- ko ifnot: $root.isApplyingBulk() -->
-    <div class="pull-right">
-      <a title="${ _('Grant this privilege') }" class="pointer" style="margin-right: 4px" data-bind="visible: grantOption() || $root.is_sentry_admin, click: function(){ $root.grantToPrivilege($data); $('#grantPrivilegeModal').modal('show'); }">
-        <i class="fa fa-send"></i>
-      </a>
+    <div class="pull-right privilege-actions">
+      <a title="${ _('Grant this privilege') }" class="pointer" style="margin-right: 4px" data-bind="visible: grantOption() || $root.is_sentry_admin, click: function(){ $root.grantToPrivilege($data); $('#grantPrivilegeModal').modal('show'); }"><i class="fa fa-send"></i></a>
       <a title="${ _('Edit this privilege') }" class="pointer" style="margin-right: 4px" data-bind="click: function() { if (! editing()) { editing(true); }}"><i class="fa fa-pencil"></i></a>
       <a title="${ _('Delete this privilege') }" class="pointer" style="margin-right: 4px" data-bind="click: remove"><i class="fa fa-times"></i></a>
     </div>

+ 26 - 3
apps/security/static/css/security.css

@@ -116,13 +116,13 @@
 }
 
 .modal .showAdvanced {
-  display: block;
+  float:left;
   margin-top: 4px;
   margin-left: 6px;
 }
 
 .span6 .acl-block .showAdvanced {
-  display: block;
+  float:left;
   margin-top: 4px;
   margin-left: 6px;
 }
@@ -251,7 +251,7 @@ h1.emptyMessage {
   height: 18px;
 }
 
-#createRoleModal, #bulkActionsModal {
+#createRoleModal, #bulkActionsModal, #grantPrivilegeModal {
   width: 800px;
   left: 50%;
   margin-left: -400px!important;
@@ -316,4 +316,27 @@ h1.emptyMessage {
 .actionbar-main {
   padding: 0!important;
   padding-bottom: 10px!important;
+}
+
+#grantPrivilegeModal .privilege-actions {
+  display: none;
+}
+
+.with-grant-checkbox {
+  vertical-align: middle;
+}
+
+.with-grant-checkbox label {
+  line-height: 22px;
+}
+
+.span6 .acl-block .with-grant-checkbox {
+  float: left;
+  margin-right: 6px;
+  margin-top: 2px;
+  clear: both;
+}
+
+table .showAdvanced {
+  float: none;
 }