You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2013/09/25 17:42:30 UTC

[01/11] git commit: updated refs/heads/1871-permissions to 1acae25

Updated Branches:
  refs/heads/1871-permissions 75752877b -> 1acae2594 (forced update)


Padding on dropdowns with icons


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9165a71b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9165a71b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9165a71b

Branch: refs/heads/1871-permissions
Commit: 9165a71b8aab76c70a5f2b80bd71f6d8a7b66a72
Parents: f714311
Author: suelockwood <de...@gmail.com>
Authored: Fri Sep 20 12:48:36 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Fri Sep 20 12:48:36 2013 -0400

----------------------------------------------------------------------
 src/fauxton/assets/less/database.less | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9165a71b/src/fauxton/assets/less/database.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/database.less b/src/fauxton/assets/less/database.less
index 95fc1a0..c6b322d 100644
--- a/src/fauxton/assets/less/database.less
+++ b/src/fauxton/assets/less/database.less
@@ -208,3 +208,9 @@ table.active-tasks{
         font-size: 19px;
     }
 }
+.btn-group{
+    ul.dropdown-menu li a:before{
+        margin-right: 10px;
+    }
+}
+


[08/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
Fauxton: Fix changes table spacing


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/87ed627f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/87ed627f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/87ed627f

Branch: refs/heads/1871-permissions
Commit: 87ed627fdbfd0514a3a15c8c5315f82ff20a1b2e
Parents: 8de942f
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Sep 25 17:02:53 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Sep 25 17:39:29 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/documents/changes.html |  8 ++++----
 src/fauxton/assets/less/database.less            | 12 ++++++++++++
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/87ed627f/src/fauxton/app/templates/documents/changes.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/changes.html b/src/fauxton/app/templates/documents/changes.html
index 5a29644..9408979 100644
--- a/src/fauxton/app/templates/documents/changes.html
+++ b/src/fauxton/app/templates/documents/changes.html
@@ -12,12 +12,12 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<table class="table">
+<table id="changes-table" class="table">
   <thead>
-    <th> seq </th>
+    <th id="seq"> seq </th>
     <th> id </th>
-    <th> changes </th>
-    <th> deleted? </th>
+    <th id="changes"> changes </th>
+    <th id="deleted"> deleted? </th>
   </thead>
   <tbody>
   <% _.each(changes, function (change) { %>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/87ed627f/src/fauxton/assets/less/database.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/database.less b/src/fauxton/assets/less/database.less
index 03c0d7f..4b11427 100644
--- a/src/fauxton/assets/less/database.less
+++ b/src/fauxton/assets/less/database.less
@@ -224,3 +224,15 @@ table.active-tasks{
         }
     }
 }
+table#changes-table {
+
+  #changes {
+    width: 50%;
+  }
+
+  #seq, #deleted {
+    width: 5%;
+  }
+
+}
+


[07/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
Fauxton: bug fixes on views


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/c7249d02
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/c7249d02
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/c7249d02

Branch: refs/heads/1871-permissions
Commit: c7249d0287c749e0b0c86941f29e62ed331bdf5f
Parents: 87ed627
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Sep 25 17:38:24 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Sep 25 17:39:29 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/resources.js | 8 ++++++++
 src/fauxton/app/modules/documents/views.js     | 3 +--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c7249d02/src/fauxton/app/modules/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/resources.js b/src/fauxton/app/modules/documents/resources.js
index de27ab0..bbacb0f 100644
--- a/src/fauxton/app/modules/documents/resources.js
+++ b/src/fauxton/app/modules/documents/resources.js
@@ -98,6 +98,10 @@ function(app, FauxtonAPI) {
           reduce: reduce
         }; 
       } else {
+        if (!views[view]) {
+          views[view] = {};
+        }
+
         views[view].map = map;
       }
 
@@ -515,6 +519,10 @@ function(app, FauxtonAPI) {
       return deferred;
     },
 
+    recordStart: function () {
+      return 1;
+    },
+
     totalRows: function() {
       return this.viewMeta.total_rows || "unknown";
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/c7249d02/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 02abff7..8036195 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -537,8 +537,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror, JSHint, re
           return true;
         },
         canShowNextfn: function () {
-          
-          if ((collection.viewMeta.offset + collection.length + 2) >= collection.viewMeta.total_rows) {
+          if (collection.length === 0 || (collection.viewMeta.offset + collection.length + 2) >= collection.viewMeta.total_rows) {
             return false;
           }
 


[02/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
Update the Logo


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/2a90b39c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/2a90b39c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/2a90b39c

Branch: refs/heads/1871-permissions
Commit: 2a90b39ceaa57675d3b01e9198f95eb55ffc8fbd
Parents: 9165a71
Author: suelockwood <de...@gmail.com>
Authored: Wed Sep 25 10:14:31 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Wed Sep 25 10:14:31 2013 -0400

----------------------------------------------------------------------
 src/fauxton/assets/img/couchdb-site.png | Bin 0 -> 4946 bytes
 src/fauxton/assets/img/minilogo.png     | Bin 7497 -> 2927 bytes
 src/fauxton/assets/less/fauxton.less    |   7 +++++--
 3 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2a90b39c/src/fauxton/assets/img/couchdb-site.png
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/img/couchdb-site.png b/src/fauxton/assets/img/couchdb-site.png
new file mode 100644
index 0000000..a9b3a99
Binary files /dev/null and b/src/fauxton/assets/img/couchdb-site.png differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2a90b39c/src/fauxton/assets/img/minilogo.png
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/img/minilogo.png b/src/fauxton/assets/img/minilogo.png
index 6d48d23..63e005c 100644
Binary files a/src/fauxton/assets/img/minilogo.png and b/src/fauxton/assets/img/minilogo.png differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2a90b39c/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 4255a1e..4292ff9 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -155,7 +155,7 @@ a:hover{
       padding: 10px;
       .icon{
         .box-sizing(content-box);
-        background: url(../img/minilogo.png) no-repeat 0 0;
+        background: url(../img/couchdb-site.png) no-repeat 0 0;
         display: block;
         height: 100%;
         width: 100%; 
@@ -178,7 +178,10 @@ a:hover{
         background-color: @orange;
       }
       .closeMenu & {
-        width: 40px;
+        .icon {
+          background: url(../img/minilogo.png) no-repeat 0 0;
+        }
+        width: 45px;
         .burger{
           left: 0;
         }


[09/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
initial implementation


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f0fbb006
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f0fbb006
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f0fbb006

Branch: refs/heads/1871-permissions
Commit: f0fbb006688d811f3081e5fe6c978d0779d7edb3
Parents: c7249d0
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Sep 24 13:31:01 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Sep 25 17:41:35 2013 +0200

----------------------------------------------------------------------
 .gitignore                                      |   1 +
 src/fauxton/app/addons/permissions/base.js      |  25 +++
 src/fauxton/app/addons/permissions/resources.js |  57 ++++++
 src/fauxton/app/addons/permissions/routes.js    |  64 +++++++
 .../app/addons/permissions/templates/item.html  |  17 ++
 .../permissions/templates/permissions.html      |  15 ++
 .../addons/permissions/templates/section.html   |  37 ++++
 src/fauxton/app/addons/permissions/views.js     | 189 +++++++++++++++++++
 src/fauxton/settings.json.default               |   1 +
 9 files changed, 406 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index a4798c9..58f992e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -95,6 +95,7 @@ src/fauxton/app/addons/*
 !src/fauxton/app/addons/contribute
 !src/fauxton/app/addons/auth
 !src/fauxton/app/addons/exampleAuth
+!src/fauxton/app/addons/permissions
 src/fauxton/settings.json*
 !src/fauxton/settings.json.default
 share/www/fauxton

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/app/addons/permissions/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/base.js b/src/fauxton/app/addons/permissions/base.js
new file mode 100644
index 0000000..016ba1c
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/base.js
@@ -0,0 +1,25 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+       "app",
+       "api",
+       "addons/permissions/routes"
+],
+
+function(app, FauxtonAPI, Permissions) {
+
+  Permissions.initialize = function() {};
+
+  return Permissions;
+});
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/app/addons/permissions/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/resources.js b/src/fauxton/app/addons/permissions/resources.js
new file mode 100644
index 0000000..6f4cb7d
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/resources.js
@@ -0,0 +1,57 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+       "app",
+       "api"
+],
+function (app, FauxtonAPI ) {
+  var Permissions = FauxtonAPI.addon();
+
+  Permissions.Security = Backbone.Model.extend({
+    defaults: {
+      admins: {
+        names: [],
+        roles: []
+      },
+
+      members: {
+        names: [],
+        roles: []
+      }
+
+    },
+    
+    isNew: function () {
+      return false;
+    },
+
+    initialize: function (attrs, options) {
+      this.database = options.database;
+    },
+
+    url: function () {
+      return this.database.id + '/_security';
+    },
+
+    addItem: function (value, type, section) {
+      var sectionValues = this.get(section);
+
+      sectionValues[type].push(value);
+      return this.set(section, sectionValues);
+    }
+
+  });
+
+  return Permissions;
+});
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/app/addons/permissions/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/routes.js b/src/fauxton/app/addons/permissions/routes.js
new file mode 100644
index 0000000..f6c6587
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/routes.js
@@ -0,0 +1,64 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+       "app",
+       "api",
+       "modules/databases/base",
+       "addons/permissions/views"
+],
+function (app, FauxtonAPI, Databases, Permissions) {
+  
+  var PermissionsRouteObject = FauxtonAPI.RouteObject.extend({
+    layout: 'one_pane',
+    selectedHeader: 'Databases',
+
+    routes: {
+      'database/:database/permissions': 'permissions'
+    },
+
+    initialize: function (route, masterLayout, options) {
+      var docOptions = app.getParams();
+      docOptions.include_docs = true;
+
+      this.databaseName = options[0];
+      this.database = new Databases.Model({id:this.databaseName});
+      this.security = new Permissions.Security(null, {
+        database: this.database
+      });
+    },
+
+    establish: function () {
+      return [this.database.fetch(), this.security.fetch()];
+    },
+
+    permissions: function () {
+      this.setView('#dashboard-content', new Permissions.Permissions({
+        database: this.database,
+        model: this.security
+      }));
+
+    },
+
+    crumbs: function () {
+      return [
+        {"name": "Databases", "link": "/_all_dbs"},
+        {"name": this.database.id, "link": Databases.databaseUrl(this.database)},
+        {"name": "Permissions", "link": "/permissions"}
+      ];
+    },
+
+  });
+  
+  Permissions.RouteObjects = [PermissionsRouteObject];
+  return Permissions;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/app/addons/permissions/templates/item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/templates/item.html b/src/fauxton/app/addons/permissions/templates/item.html
new file mode 100644
index 0000000..aa01d0b
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/templates/item.html
@@ -0,0 +1,17 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<li> 
+<span> <%= item %> </span>
+<button type="button" style="float:none; margin-bottom:6px" class="close">&times;</button>
+</li> 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/app/addons/permissions/templates/permissions.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/templates/permissions.html b/src/fauxton/app/addons/permissions/templates/permissions.html
new file mode 100644
index 0000000..d247425
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/templates/permissions.html
@@ -0,0 +1,15 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<p>Each database contains lists of admins and members. Admins and members are each defined by names and roles, which are lists of strings.</p>
+<div id="sections"> </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/app/addons/permissions/templates/section.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/templates/section.html b/src/fauxton/app/addons/permissions/templates/section.html
new file mode 100644
index 0000000..102d857
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/templates/section.html
@@ -0,0 +1,37 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<h1> <%= section %> </h1>
+<p id="help"> <%= help %> </p>
+
+<div class="row">
+  <div class="span6">
+    <h3> Names </h3>
+    <ul id="items-names"></ul>
+
+    <form class="permission-item-form form-inline">
+      <input data-section="<%= section %>" data-type="names" type="text" class="item input-small" placeholder="Add Name">
+      <input type="submit" class="btn" value="Add Name" >
+    </form>
+
+  </div>
+  <div class="span6">
+    <h3> Roles </h3>
+    <ul id="items-roles"></ul>
+
+    <form class="permission-item-form form-inline">
+      <input data-section="<%= section %>" data-type="roles" type="text" class="item input-small" placeholder="Add Role">
+      <input type="submit" class="btn" value="Add Role" >
+    </form>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/app/addons/permissions/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/views.js b/src/fauxton/app/addons/permissions/views.js
new file mode 100644
index 0000000..3c5d3c2
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/views.js
@@ -0,0 +1,189 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+       "app",
+       "api",
+       "addons/permissions/resources"
+],
+function (app, FauxtonAPI, Permissions ) {
+  var events = {};
+  Permissions.events = _.extend(events, Backbone.Events);
+
+  Permissions.Permissions = FauxtonAPI.View.extend({
+    template: "addons/permissions/templates/permissions",
+
+    initialize: function (options) {
+      this.database = options.database;
+      this.listenTo(Permissions.events, 'itemRemoved', this.itemRemoved);
+    },
+
+    events: {
+      "submit .permission-item-form": "addItem",
+      'click .close': "removeItem"
+    },
+
+    itemRemoved: function (event) {
+      console.log('item remove');
+      this.model.set({
+        admins: this.adminsView.items(),
+        members: this.membersView.items()
+      });
+
+      this.model.save().then(function () {
+        FauxtonAPI.addNotification({
+          msg: 'Database permissions has been updated.'
+        });
+      });
+    },
+    beforeRender: function () {
+      this.adminsView = this.insertView('#sections', new Permissions.PermissionSection({
+        model: this.model,
+        section: 'admins',
+        help: 'Database admins can update design documents and edit the admin and member lists.'
+      }));
+
+      this.membersView = this.insertView('#sections', new Permissions.PermissionSection({
+        model: this.model,
+        section: 'members',
+        help: 'Database members can access the database. If no members are defined, the database is public.'
+      }));
+    },
+
+    
+    serialize: function () {
+      console.log('s', this.model.toJSON());
+      return {
+        databaseName: this.database.id,
+        security: this.model.toJSON()
+      };
+    }
+  });
+
+  Permissions.PermissionSection = FauxtonAPI.View.extend({
+    template: "addons/permissions/templates/section",
+    initialize: function (options) {
+      this.section = options.section;
+      this.help = options.help;
+    },
+
+    events: {
+      "submit .permission-item-form": "addItem",
+      'click .close': "removeItem"
+    },
+
+    beforeRender: function () {
+      var section = this.model.get(this.section);
+      
+      this.nameViews = [];
+      this.roleViews = [];
+
+      _.each(section.names, function (name) {
+        var nameView = this.insertView('#items-names', new Permissions.PermissionItem({
+          item: name,
+        }));
+        this.nameViews.push(nameView);
+      }, this);
+
+      _.each(section.roles, function (role) {
+        var roleView = this.insertView('#items-roles', new Permissions.PermissionItem({
+          item: role,
+        }));
+        this.roleViews.push(roleView);
+      }, this);
+    },
+
+    getItemFromView: function (viewList) {
+      return _.map(viewList, function (view) {
+        return view.item;
+      });
+    },
+
+    discardRemovedViews: function () {
+      this.nameViews = _.filter(this.nameViews, function (view) {
+        return !view.removed; 
+      });
+
+      this.roleViews = _.filter(this.roleViews, function (view) {
+        return !view.removed; 
+      });
+    },
+
+    items: function () {
+      this.discardRemovedViews();
+
+      return  {
+        names: this.getItemFromView(this.nameViews),
+        roles: this.getItemFromView(this.roleViews)
+      };
+    },
+
+    addItem: function (event) {
+      event.preventDefault();
+      var $item = this.$(event.currentTarget).find('.item'),
+          value = $item.val(),
+          section = $item.data('section'),
+          type = $item.data('type'),
+          that = this;
+
+      this.model.addItem(value, type, section);
+      this.model.save().then(function () {
+        that.render();
+        FauxtonAPI.addNotification({
+          msg: 'Database permissions has been updated.'
+        });
+      });
+    },
+
+    serialize: function () {
+      return {
+        section: this.section,
+        help: this.help
+      };
+    }
+
+  });
+
+  Permissions.PermissionItem = FauxtonAPI.View.extend({
+    template: "addons/permissions/templates/item",
+    initialize: function (options) {
+      this.item = options.item;
+      this.viewsList = options.viewsList;
+    },
+
+    events: {
+      'click .close': "removeItem"
+    },
+
+    removeItem: function (event) {
+      var that = this;
+      event.preventDefault();
+      
+      this.removed = true;
+      Permissions.events.trigger('itemRemoved');
+
+      this.$el.hide('fast', function () {
+        that.remove();
+      });
+    },
+
+
+    serialize: function () {
+      return {
+        item: this.item
+      };
+    }
+
+  });
+
+  return Permissions;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f0fbb006/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index 81cb4cb..30088f0 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -6,6 +6,7 @@
   { "name": "stats" },
   { "name":  "replication" },
   { "name": "contribute" },
+  { "name": "permissions" },
   { "name": "auth" }
   ],
     "template": {


[11/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
more tests and error notifications


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/1acae259
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/1acae259
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/1acae259

Branch: refs/heads/1871-permissions
Commit: 1acae2594a084088fbcf685912e87fec8d77fe08
Parents: 481cd4f
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Sep 25 16:35:49 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Sep 25 17:41:36 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/permissions/resources.js | 17 +++-
 .../app/addons/permissions/tests/viewsSpec.js   | 82 +++++++++++++++++++-
 src/fauxton/app/addons/permissions/views.js     | 30 ++++---
 3 files changed, 114 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1acae259/src/fauxton/app/addons/permissions/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/resources.js b/src/fauxton/app/addons/permissions/resources.js
index 5829971..66eaffd 100644
--- a/src/fauxton/app/addons/permissions/resources.js
+++ b/src/fauxton/app/addons/permissions/resources.js
@@ -28,9 +28,8 @@ function (app, FauxtonAPI ) {
         names: [],
         roles: []
       }
-
     },
-    
+
     isNew: function () {
       return false;
     },
@@ -46,9 +45,19 @@ function (app, FauxtonAPI ) {
     addItem: function (value, type, section) {
       var sectionValues = this.get(section);
 
-      if (!sectionValues || !sectionValues[type]) { return; }
+      if (!sectionValues || !sectionValues[type]) { 
+        return {
+          error: true,
+          msg: 'Section ' + section + 'does not exist'
+        };
+      }
 
-      if (sectionValues[type].indexOf(value) > -1) { return; }
+      if (sectionValues[type].indexOf(value) > -1) { 
+        return {
+          error: true,
+          msg: 'Role/Name has already been added'
+        }; 
+      }
 
       sectionValues[type].push(value);
       return this.set(section, sectionValues);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1acae259/src/fauxton/app/addons/permissions/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/tests/viewsSpec.js b/src/fauxton/app/addons/permissions/tests/viewsSpec.js
index 73afec2..e5330c0 100644
--- a/src/fauxton/app/addons/permissions/tests/viewsSpec.js
+++ b/src/fauxton/app/addons/permissions/tests/viewsSpec.js
@@ -18,6 +18,49 @@ define([
   var assert = testUtils.assert,
   ViewSandbox = testUtils.ViewSandbox;
 
+  describe('Permission View', function () {
+
+    beforeEach(function () {
+      security = new Models.Security({'admins': {
+        'names': ['_user'],
+        'roles': []
+      }
+      }, {database: 'fakedb'});
+
+      section = new Views.Permissions({
+        database: 'fakedb',
+        model: security
+      });
+
+      viewSandbox = new ViewSandbox();
+      viewSandbox.renderView(section); 
+    });
+
+    afterEach(function () {
+      viewSandbox.remove();
+    });
+
+    describe('itemRemoved', function () {
+
+      it('Should set model', function () {
+        var saveMock = sinon.spy(security, 'set');
+        Views.events.trigger('itemRemoved');
+
+        assert.ok(saveMock.calledOnce);
+        var args = saveMock.args; 
+        assert.deepEqual(args[0][0], {"admins":{"names":["_user"],"roles":[]},"members":{"names":[],"roles":[]}});
+      });
+
+      it('Should save model', function () {
+        var saveMock = sinon.spy(security, 'save');
+        Views.events.trigger('itemRemoved');
+
+        assert.ok(saveMock.calledOnce);
+      });
+    });
+
+  });
+
   describe('PermissionsSection', function () {
     var section, security;
 
@@ -29,7 +72,8 @@ define([
       }, {database: 'fakedb'});
 
       section = new Views.PermissionSection({
-        section: 'admins'
+        section: 'admins',
+        model: security
       });
 
       viewSandbox = new ViewSandbox();
@@ -40,6 +84,42 @@ define([
       viewSandbox.remove();
     });
 
+    describe('#discardRemovedViews', function () {
+      it('Should not filter out active views', function () {
+        section.discardRemovedViews();
+
+        assert.equal(section.nameViews.length, 1);
+
+      });
+
+      it('Should filter out removed views', function () {
+        section.nameViews[0].removed = true;
+        section.discardRemovedViews();
+
+        assert.equal(section.nameViews.length, 0);
+
+      });
+
+    });
+
+    describe('#getItemFromView', function () {
+
+      it('Should return item list', function () {
+        var items = section.getItemFromView(section.nameViews);
+
+        assert.deepEqual(items, ['_user']);
+      });
+
+    });
+
+    describe('#addItems', function () {
+
+      it('Should add item to model', function () {
+        //todo add a test here
+
+      });
+
+    });
 
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1acae259/src/fauxton/app/addons/permissions/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/views.js b/src/fauxton/app/addons/permissions/views.js
index 3c5d3c2..4c2987b 100644
--- a/src/fauxton/app/addons/permissions/views.js
+++ b/src/fauxton/app/addons/permissions/views.js
@@ -27,13 +27,7 @@ function (app, FauxtonAPI, Permissions ) {
       this.listenTo(Permissions.events, 'itemRemoved', this.itemRemoved);
     },
 
-    events: {
-      "submit .permission-item-form": "addItem",
-      'click .close': "removeItem"
-    },
-
     itemRemoved: function (event) {
-      console.log('item remove');
       this.model.set({
         admins: this.adminsView.items(),
         members: this.membersView.items()
@@ -43,8 +37,14 @@ function (app, FauxtonAPI, Permissions ) {
         FauxtonAPI.addNotification({
           msg: 'Database permissions has been updated.'
         });
+        }, function (xhr) {
+        FauxtonAPI.addNotification({
+          msg: 'Could not update permissions - reason: ' + xhr.responseText,
+          type: 'error'
+        });
       });
     },
+
     beforeRender: function () {
       this.adminsView = this.insertView('#sections', new Permissions.PermissionSection({
         model: this.model,
@@ -59,12 +59,9 @@ function (app, FauxtonAPI, Permissions ) {
       }));
     },
 
-    
     serialize: function () {
-      console.log('s', this.model.toJSON());
       return {
         databaseName: this.database.id,
-        security: this.model.toJSON()
       };
     }
   });
@@ -135,12 +132,25 @@ function (app, FauxtonAPI, Permissions ) {
           type = $item.data('type'),
           that = this;
 
-      this.model.addItem(value, type, section);
+      var resp = this.model.addItem(value, type, section);
+
+      if (resp && resp.error) {
+        return FauxtonAPI.addNotification({
+          msg: resp.msg,
+          type: 'error'
+        });
+      }
+
       this.model.save().then(function () {
         that.render();
         FauxtonAPI.addNotification({
           msg: 'Database permissions has been updated.'
         });
+      }, function (xhr) {
+        FauxtonAPI.addNotification({
+          msg: 'Could not update permissions - reason: ' + xhr.responseText,
+          type: 'error'
+        });
       });
     },
 


[10/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
added resource and some view tests


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/481cd4f9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/481cd4f9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/481cd4f9

Branch: refs/heads/1871-permissions
Commit: 481cd4f99711035b89b09aa532b0c44fe913a976
Parents: f0fbb00
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Sep 24 19:26:14 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Sep 25 17:41:35 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/permissions/resources.js |  4 +
 .../addons/permissions/tests/resourceSpec.js    | 51 +++++++++++++
 .../app/addons/permissions/tests/viewsSpec.js   | 79 ++++++++++++++++++++
 3 files changed, 134 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/481cd4f9/src/fauxton/app/addons/permissions/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/resources.js b/src/fauxton/app/addons/permissions/resources.js
index 6f4cb7d..5829971 100644
--- a/src/fauxton/app/addons/permissions/resources.js
+++ b/src/fauxton/app/addons/permissions/resources.js
@@ -46,6 +46,10 @@ function (app, FauxtonAPI ) {
     addItem: function (value, type, section) {
       var sectionValues = this.get(section);
 
+      if (!sectionValues || !sectionValues[type]) { return; }
+
+      if (sectionValues[type].indexOf(value) > -1) { return; }
+
       sectionValues[type].push(value);
       return this.set(section, sectionValues);
     }

http://git-wip-us.apache.org/repos/asf/couchdb/blob/481cd4f9/src/fauxton/app/addons/permissions/tests/resourceSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/tests/resourceSpec.js b/src/fauxton/app/addons/permissions/tests/resourceSpec.js
new file mode 100644
index 0000000..f73687a
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/tests/resourceSpec.js
@@ -0,0 +1,51 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+       'api',
+       'addons/permissions/resources',
+      'testUtils'
+], function (FauxtonAPI, Models, testUtils) {
+  var assert = testUtils.assert;
+
+  describe('Permissions', function () {
+
+    describe('#addItem', function () {
+      var security;
+      
+      beforeEach(function () {
+        security = new Models.Security(null, {database: 'fakedb'});
+      });
+
+      it('Should add value to section', function () {
+
+        security.addItem('_user', 'names', 'admins');
+        assert.equal(security.get('admins').names[0], '_user');
+      });
+
+      it('Should handle incorrect type', function () {
+        security.addItem('_user', 'asdasd', 'admins');
+      });
+
+      it('Should handle incorrect section', function () {
+        security.addItem('_user', 'names', 'Asdasd');
+      });
+
+      it('Should reject duplicates', function () {
+        security.addItem('_user', 'names', 'admins');
+        security.addItem('_user', 'names', 'admins');
+        assert.equal(security.get('admins').names.length, 1);
+      });
+    });
+
+  });
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/481cd4f9/src/fauxton/app/addons/permissions/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/tests/viewsSpec.js b/src/fauxton/app/addons/permissions/tests/viewsSpec.js
new file mode 100644
index 0000000..73afec2
--- /dev/null
+++ b/src/fauxton/app/addons/permissions/tests/viewsSpec.js
@@ -0,0 +1,79 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+       'api',
+       'addons/permissions/views',
+       'addons/permissions/resources',
+       'testUtils'
+], function (FauxtonAPI, Views, Models, testUtils) {
+  var assert = testUtils.assert,
+  ViewSandbox = testUtils.ViewSandbox;
+
+  describe('PermissionsSection', function () {
+    var section, security;
+
+    beforeEach(function () {
+      security = new Models.Security({'admins': {
+        'names': ['_user'],
+        'roles': []
+      }
+      }, {database: 'fakedb'});
+
+      section = new Views.PermissionSection({
+        section: 'admins'
+      });
+
+      viewSandbox = new ViewSandbox();
+      viewSandbox.renderView(section); 
+    });
+
+    afterEach(function () {
+      viewSandbox.remove();
+    });
+
+
+  });
+
+  describe('PermissionItem', function () {
+    var item;
+
+    beforeEach(function () {
+      item = new Views.PermissionItem({
+        item: '_user'
+      });
+
+      viewSandbox = new ViewSandbox();
+      viewSandbox.renderView(item); 
+    });
+
+    afterEach(function () {
+      viewSandbox.remove();
+    });
+
+    it('should trigger event on remove item', function () {
+      var eventSpy = sinon.spy();
+
+      Views.events.on('itemRemoved', eventSpy);
+
+      item.$('.close').click();
+      
+      assert.ok(eventSpy.calledOnce); 
+    });
+
+    it('should set removed to true', function () {
+      item.$('.close').click();
+      
+      assert.ok(item.removed); 
+    });
+  });
+
+});


[05/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
CSS fix for adding a new view to a design doc that doesn't exist.
More footer css fixes


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/c5d0cf4e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/c5d0cf4e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/c5d0cf4e

Branch: refs/heads/1871-permissions
Commit: c5d0cf4e8a3f72b14303dab93346c3cadabb42a6
Parents: 1d01163
Author: suelockwood <de...@gmail.com>
Authored: Wed Sep 25 11:26:20 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Wed Sep 25 11:26:20 2013 -0400

----------------------------------------------------------------------
 src/fauxton/app/templates/documents/view_editor.html |  9 ++++++---
 src/fauxton/assets/index.underscore                  |  2 +-
 src/fauxton/assets/less/database.less                | 10 ++++++++++
 src/fauxton/assets/less/fauxton.less                 |  1 +
 4 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c5d0cf4e/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index 8e9d5bc..b1ca470 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -24,8 +24,9 @@ the License.
         <div class="errors-container"></div>
         <form class="form-horizontal view-query-save">
 
-          <div class="control-group">
-            <label for="ddoc">Design document <a href="<%=getDocUrl('design_doc')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
+          <div class="control-group design-doc-group">
+            <div class="span3">
+              <label for="ddoc">Design document <a href="<%=getDocUrl('design_doc')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
               <select id="ddoc">
                 <optgroup label="Select a document">
                   <option id="new-doc">New document</option>
@@ -38,7 +39,9 @@ the License.
                   <% }); %>
                 </optgroup>
               </select>
-            <div id="new-ddoc-section" class="span5 offset1" style="display:none">
+            </div>
+
+            <div id="new-ddoc-section" class="span5" style="display:none">
               <label class="control-label" for="new-ddoc"> _design/ </label>
               <div class="controls">
                 <input type="text" id="new-ddoc" placeholder="newDesignDoc">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/c5d0cf4e/src/fauxton/assets/index.underscore
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/index.underscore b/src/fauxton/assets/index.underscore
index 3d273d3..cbf5bd6 100644
--- a/src/fauxton/assets/index.underscore
+++ b/src/fauxton/assets/index.underscore
@@ -37,7 +37,7 @@
     <div id="app-container"></div>
 
     <footer>
-      <div id="footer-content" class="container"></div>
+      <div id="footer-content"></div>
     </footer>
   </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/c5d0cf4e/src/fauxton/assets/less/database.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/database.less b/src/fauxton/assets/less/database.less
index c6b322d..03c0d7f 100644
--- a/src/fauxton/assets/less/database.less
+++ b/src/fauxton/assets/less/database.less
@@ -214,3 +214,13 @@ table.active-tasks{
     }
 }
 
+.design-doc-group{
+    .span3 { margin: 0;}
+    #new-ddoc-section {
+        margin-top: 10px;
+        label{ width: 100px}
+        .controls{
+            margin-left: 100px;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/c5d0cf4e/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index d2bd3eb..e79d42e 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -37,6 +37,7 @@ footer {
   margin-left: @navWidth;
   padding: 5px 10px;
   background-color: #F2F2F2;
+  width: 100%;
 }
 
 .hide-text {


[04/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
Add 'html/contributing.html' to 'Makefile.am'


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/1d011639
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/1d011639
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/1d011639

Branch: refs/heads/1871-permissions
Commit: 1d0116399e9946b9e58d007326711667aaf088f6
Parents: 55d6dfa
Author: Klaus Trainer <kl...@posteo.de>
Authored: Wed Sep 25 16:55:35 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Sep 25 17:02:27 2013 +0200

----------------------------------------------------------------------
 share/doc/build/Makefile.am | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1d011639/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 97fef79..af2325a 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -102,6 +102,7 @@ html_files = \
     html/changes.html \
     html/config_reference.html \
     html/configuring.html \
+    html/contributing.html \
     html/ddocs.html \
     html/index.html \
     html/intro.html \


[06/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
More Button styling fixes


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8de942f2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8de942f2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8de942f2

Branch: refs/heads/1871-permissions
Commit: 8de942f2db0b48f534f02557b04e09641d584b7e
Parents: c5d0cf4
Author: suelockwood <de...@gmail.com>
Authored: Wed Sep 25 11:27:53 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Wed Sep 25 11:27:53 2013 -0400

----------------------------------------------------------------------
 src/fauxton/assets/less/fauxton.less | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8de942f2/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index e79d42e..ddf66f6 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -604,6 +604,7 @@ tbody {padding-top: 10px;}
 }
 
 .button{
+  .button-style;
   .transition(all @transitionSpeed @transitionEaseType);
   border: none;
   background-color: @redButton;


[03/11] git commit: updated refs/heads/1871-permissions to 1acae25

Posted by ga...@apache.org.
Fix for the buttons and the footer


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/55d6dfa1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/55d6dfa1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/55d6dfa1

Branch: refs/heads/1871-permissions
Commit: 55d6dfa15312174fc0672c17e33a829ec1364b88
Parents: 2a90b39
Author: suelockwood <de...@gmail.com>
Authored: Wed Sep 25 10:58:56 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Wed Sep 25 10:58:56 2013 -0400

----------------------------------------------------------------------
 src/fauxton/app/templates/fauxton/api_bar.html |  2 -
 src/fauxton/assets/less/fauxton.less           | 54 +++++++++++++++++++--
 src/fauxton/assets/less/variables.less         | 10 ++++
 3 files changed, 60 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/55d6dfa1/src/fauxton/app/templates/fauxton/api_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/fauxton/api_bar.html b/src/fauxton/app/templates/fauxton/api_bar.html
index a1a31a6..cbed3d5 100644
--- a/src/fauxton/app/templates/fauxton/api_bar.html
+++ b/src/fauxton/app/templates/fauxton/api_bar.html
@@ -17,7 +17,6 @@ the License.
   <span class="fonticon-plus icon"></span>
 </button>
 <div class="api-navbar" style="display: none">
-  <div class="container">
     <div class="input-prepend input-append">
       <span class="add-on">
         API reference
@@ -28,5 +27,4 @@ the License.
       <input type="text" class="input-xxlarge" value="<%= endpoint %>">
       <a href="<%= endpoint %>" target="_blank" class="btn">Show me</a>
     </div>
-  </div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/55d6dfa1/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 4292ff9..d2bd3eb 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -33,9 +33,10 @@ body {
 footer {
   position: fixed;
   bottom: 0;
-  padding: 20px;
   font-size: 10px;
   margin-left: @navWidth;
+  padding: 5px 10px;
+  background-color: #F2F2F2;
 }
 
 .hide-text {
@@ -617,10 +618,55 @@ tbody {padding-top: 10px;}
   }
 }
 
-a.button, a.button:visited, a.button:active {
-  &.cancel-button{
-    color: @fontGrey;
+
+.button-style{
+  background-color: @redButton;
+  color: #fff;
+  padding: 10px 15px;
+  &:before{
+    padding-right: 5px;
+  }
+  &.outlineGray{
+    border: 1px solid @grayLight;
+    background-color: transparent;
+    color: @grayDark;
+    &:hover{
+      border: 1px solid @orange;
+    }
+  }
+  &.green{
+    background-color: @green;
+  }
+
+  &.round-btn {
+    .border-radius(@radius);
   }
+  .icon {
+    margin-right: 10px;
+    font-size: 20px;
+  }
+  &:hover {
+    color: #fff;
+    text-decoration: none;
+    background-color: @orange;
+  }
+  a&,
+  a&:visited,
+  a&:active{
+    color: #fff;
+  }
+  &:disabled {
+    opacity: 0.5;
+  }
+}
+
+
+
+
+a.button, 
+a.button:visited, 
+a.button:active {
+  .button-style;
 }
 
 .select{

http://git-wip-us.apache.org/repos/asf/couchdb/blob/55d6dfa1/src/fauxton/assets/less/variables.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/variables.less b/src/fauxton/assets/less/variables.less
index f81b063..bf97b5d 100644
--- a/src/fauxton/assets/less/variables.less
+++ b/src/fauxton/assets/less/variables.less
@@ -60,6 +60,16 @@
 /*buttons */
 @redButton: @red;
 @linkColor: @red;
+@blue:                  #049cdb;
+@blueDark:              #0064cd;
+@green:                 #7FA30C;
+//@red:                   #9d261d;
+@yellow:                #ffcc00;
+@pink:                  #c3325f;
+@purple:                #7a43b6;
+
+
+
 
 @boxShadow: 2px 2px rgba(0,0,0,0.2);
 @boxShadowOff: 2px 2px rgba(0,0,0,0);