浏览代码

[security] Changed radio button to prettier font awesome radio

Enrico Berti 11 年之前
父节点
当前提交
1862d64
共有 2 个文件被更改,包括 12 次插入7 次删除
  1. 11 6
      apps/security/src/security/templates/hive.mako
  2. 1 1
      apps/security/static/js/hive.ko.js

+ 11 - 6
apps/security/src/security/templates/hive.mako

@@ -49,23 +49,28 @@ ${ layout.menubar(section='hive') }
       <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>
-    <input value="db" data-bind="attr: { name: 'privilege-' + $index() }, checked: type" type="radio" />
-    <input type="text" data-bind="hivechooser: $data.path, enable: type() == 'db'" placeholder="dbName.tableName">
 
-    <input value="uri" data-bind="attr: { name: 'privilege-' + $index() }, checked: type" type="radio"/>
-    <input type="text" data-bind="filechooser: $data.URI, enable: type() == 'uri'" placeholder="URI">
+    <div class="inline-block" style="vertical-align: middle">
+      <a class="pointer" style="padding-top: 4px" data-bind="click: function(){ privilegeType('db'); }"><i class="fa fa-fw fa-1halfx muted" data-bind="css: {'fa-circle-o': privilegeType() != 'db' , 'fa-check-circle-o': privilegeType() == 'db'}"></i></a>
+    </div>
+    <input type="text" data-bind="hivechooser: $data.path, enable: privilegeType() == 'db'" placeholder="dbName.tableName">
+
+    <div class="inline-block" style="vertical-align: middle">
+      <a class="pointer" style="padding-top: 4px" data-bind="click: function(){ privilegeType('uri'); }"><i class="fa fa-fw fa-1halfx muted" data-bind="css: {'fa-circle-o': privilegeType() != 'uri' , 'fa-check-circle-o': privilegeType() == 'uri'}"></i></a>
+    </div>
+    <input type="text" data-bind="filechooser: $data.URI, enable: privilegeType() == 'uri'" placeholder="URI">
 
     <select data-bind="options: $root.availableActions, select2: { update: $data.action, type: 'action'}" style="width: 100px"></select>
 
     <span class="showAdvancedSpace">&nbsp;&nbsp;</span><a class="pointer showAdvanced" data-bind="click: function(){ showAdvanced(true); }, visible: ! showAdvanced()"><i class="fa fa-cog"></i> ${ _('Show advanced') }</a>
 
     <div class="acl-block-section" data-bind="visible: showAdvanced">
-      <input type="text" data-bind="value: serverName" placeholder="serverName">
+      <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>
     </div>
 
   <!-- /ko -->
-  
+
   <!-- ko ifnot: editing() -->
     <div class="pull-right">
       <a class="pointer" style="margin-right: 4px" data-bind="click: function() { if (! editing()) { editing(true); }}"><i class="fa fa-pencil"></i></a>

+ 1 - 1
apps/security/static/js/hive.ko.js

@@ -67,7 +67,7 @@ var Privilege = function (vm, privilege) {
   self.grantor = ko.observable(typeof privilege.grantor != "undefined" && privilege.grantor != null ? privilege.grantor : "");
 
   // UI
-  self.type = ko.observable("db");
+  self.privilegeType = ko.observable("db");
   self.showAdvanced = ko.observable(false);
   self.path = ko.computed({
     read: function () {