luci2: drop LuCI2.uci end replace it with LuCI2.UCIContext instance, switch LuCI2...
[project/luci2/ui.git] / luci2 / htdocs / luci2 / view / system.users.js
index 5447238..6b30d30 100644 (file)
@@ -94,6 +94,7 @@ L.ui.view.extend({
                widget: function(sid)
                {
             var t = $('<table />')
+                .addClass('table table-condensed table-hover')
                 .attr('id', this.id(sid))
                 .append($('<tr />')
                     .append($('<th />')
@@ -131,6 +132,7 @@ L.ui.view.extend({
                     {
                         $(r.insertCell(-1))
                             .append($('<input />')
+                                .addClass('form-control')
                                 .attr('type', 'radio')
                                 .attr('name', '%s_%s'.format(this.id(sid), this.choices[i][0]))
                                 .attr('value', j)
@@ -219,21 +221,19 @@ L.ui.view.extend({
 
     execute: function() {
         var self = this;
-        L.ui.listAvailableACLs().then(function(acls) {
+        return L.ui.listAvailableACLs().then(function(acls) {
             var m = new L.cbi.Map('rpcd', {
                 caption:     L.tr('Guest Logins'),
                 description: L.tr('Manage user accounts and permissions for accessing the LuCI ui.'),
-                collabsible: true
+                readonly:    !self.options.acls.users
             });
 
             var s = m.section(L.cbi.TypedSection, 'login', {
-                caption:      function(sid) {
-                    var u = sid ? this.fields.username.textvalue(sid) : undefined;
-                    return u ? L.tr('Login "%s"').format(u) : L.tr('New login');
-                },
+                caption:      L.tr('Accounts'),
+                collabsible:  true,
                 addremove:    true,
-                add_caption:  L.tr('Add new user …'),
-                teasers:      [ '__shadow', '__acls' ]
+                add_caption:  L.tr('Add account …'),
+                teasers:      [ 'username', '__shadow', '__acls' ]
             });
 
             s.option(L.cbi.InputValue, 'username', {
@@ -277,6 +277,9 @@ L.ui.view.extend({
                 var sh = this.section.fields.__shadow.formvalue(sid);
                 var pw = this.section.fields.password.formvalue(sid);
 
+                if (!sh && !pw)
+                    return;
+
                 if (sh)
                     pw = '$p$' + this.section.fields.username.formvalue(sid);
 
@@ -296,7 +299,7 @@ L.ui.view.extend({
 
             var o = s.option(self.aclTable, '__acls', {
                 caption:     L.tr('User ACLs'),
-                description: L.tr('Specifies the access levels of this account. The "-" column means no access, "R" stands for read only access and "F" for full access.')
+                description: L.tr('Specifies the access levels of this account. The "N" column means no access, "R" stands for read only access and "F" for full access.')
             });
 
             var groups = [ ];