You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2013/12/16 21:03:48 UTC

[28/50] git commit: updated refs/heads/1744-single-config-file to 1c344a9

Faxuton: UI Fixes


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

Branch: refs/heads/1744-single-config-file
Commit: 555ad0ff711ea271ef96a537cb9fa72c99edd765
Parents: 5310b40
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Dec 9 09:45:33 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Dec 9 09:46:36 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                            |  4 ++--
 src/fauxton/app/initialize.js                       |  4 ++--
 src/fauxton/app/modules/databases/base.js           |  2 +-
 src/fauxton/app/modules/databases/resources.js      |  4 +++-
 src/fauxton/app/modules/databases/views.js          | 14 ++++++++------
 src/fauxton/app/modules/documents/routes.js         |  4 ++++
 src/fauxton/app/modules/documents/views.js          | 16 +++++++++-------
 src/fauxton/app/templates/databases/item.html       |  2 +-
 .../app/templates/documents/all_docs_layout.html    |  2 +-
 src/fauxton/app/templates/documents/sidebar.html    | 14 +++++++-------
 .../app/templates/documents/view_editor.html        |  2 +-
 11 files changed, 39 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index e8a12be..5e046ff 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -220,7 +220,7 @@ module.exports = function(grunt) {
       proxy: {
         target: {
           host: 'localhost',
-          port: 5984,
+          port: 5684,
           https: false
         },
         // This sets the Host header in the proxy so that you can use external
@@ -358,7 +358,7 @@ module.exports = function(grunt) {
     }
 
     if (!!filepath.match(/[Ss]pec.js$/)) {
-      grunt.task.run(['mochaSetup','jst', 'concat:test_config_js', 'mocha_phantomjs']);
+      //grunt.task.run(['mochaSetup','jst', 'concat:test_config_js', 'mocha_phantomjs']);
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/initialize.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/initialize.js b/src/fauxton/app/initialize.js
index 7a4a1c1..ebba91c 100644
--- a/src/fauxton/app/initialize.js
+++ b/src/fauxton/app/initialize.js
@@ -22,8 +22,8 @@ function() {
   // creation.
   var app = {
     // The root path to run the application.
-    root: "/utils/fauxton/",
-    version: "1.0",
+    root: "/",
+    version: "1.0.dev",
     // Host is used as prefix for urls
     host: "../.." ,
   };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/modules/databases/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/base.js b/src/fauxton/app/modules/databases/base.js
index a5b4542..2e768e9 100644
--- a/src/fauxton/app/modules/databases/base.js
+++ b/src/fauxton/app/modules/databases/base.js
@@ -29,7 +29,7 @@ function(app, FauxtonAPI, Databases, Views) {
   Databases.databaseUrl = function(database) {
     var name = _.isObject(database) ? database.id : database;
 
-    return ["/database/", name, "/_all_docs?limit=10"].join('');
+    return ["/database/", name, "/_all_docs?limit=" + Databases.DocLimit].join('');
   };
 
   return Databases;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/modules/databases/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/resources.js b/src/fauxton/app/modules/databases/resources.js
index 237c4ce..a577847 100644
--- a/src/fauxton/app/modules/databases/resources.js
+++ b/src/fauxton/app/modules/databases/resources.js
@@ -22,6 +22,8 @@ define([
 function(app, FauxtonAPI, Documents) {
   var Databases = FauxtonAPI.module();
 
+  Databases.DocLimit = 20;
+
   Databases.Model = Backbone.Model.extend({
     initialize: function(options) {
       this.status = new Databases.Status({
@@ -51,7 +53,7 @@ function(app, FauxtonAPI, Documents) {
       if (context === "index") {
         return "/database/" + this.id + "/_all_docs";
       } else if (context === "web-index") {
-        return "#/database/"+ encodeURIComponent(this.get("name"))  + "/_all_docs?limit=100";
+        return "#/database/"+ encodeURIComponent(this.get("name"))  + "/_all_docs?limit=" + Databases.DocLimit;
       } else if (context === "changes") {
         return "/database/" + this.id + "/_changes?descending=true&limit=100&include_docs=true";
       } else if (context === "app") {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/modules/databases/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/views.js b/src/fauxton/app/modules/databases/views.js
index 9a197a9..5d46cd3 100644
--- a/src/fauxton/app/modules/databases/views.js
+++ b/src/fauxton/app/modules/databases/views.js
@@ -12,12 +12,13 @@
 
 define([
   "app",
-
+  
   "modules/fauxton/components",
   "api",
+  "modules/databases/resources"
 ],
 
-function(app, Components, FauxtonAPI) {
+function(app, Components, FauxtonAPI, Databases) {
   var Views = {};
 
   Views.Item = FauxtonAPI.View.extend({
@@ -27,7 +28,8 @@ function(app, Components, FauxtonAPI) {
     serialize: function() {
       return {
         encoded: encodeURIComponent(this.model.get("name")),
-        database: this.model
+        database: this.model,
+        docLimit: Databases.DocLimit
       };
     }
   });
@@ -66,7 +68,7 @@ function(app, Components, FauxtonAPI) {
         // TODO: switch to using a model, or Databases.databaseUrl()
         // Neither of which are in scope right now
         // var db = new Database.Model({id: dbname});
-        var url = ["/database/", encodeURIComponent(dbname), "/_all_docs?limit=10"].join('');
+        var url = ["/database/", encodeURIComponent(dbname), "/_all_docs?limit=" + Databases.DocLimit].join('');
         FauxtonAPI.navigate(url);
       }
     },
@@ -154,7 +156,7 @@ function(app, Components, FauxtonAPI) {
           type: "success",
           clear: true
         });
-        var route = "#/database/" +  name + "/_all_docs?limit=100";
+        var route = "#/database/" +  name + "/_all_docs?limit=" + Databases.DocLimit;
         app.router.navigate(route, { trigger: true });
       }
       ).error(function(xhr) {
@@ -203,7 +205,7 @@ function(app, Components, FauxtonAPI) {
           type: "success",
           clear: true
         });
-        var route = "#/database/" +  name + "/_all_docs?limit=100";
+        var route = "#/database/" +  name + "/_all_docs?limit=" + Databases.DocLimit;
         app.router.navigate(route, { trigger: true });
       }
       ).error(function(xhr) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/modules/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/routes.js b/src/fauxton/app/modules/documents/routes.js
index dc59f3f..56d2116 100644
--- a/src/fauxton/app/modules/documents/routes.js
+++ b/src/fauxton/app/modules/documents/routes.js
@@ -276,6 +276,10 @@ function(app, FauxtonAPI, Documents, Databases) {
     newViewEditor: function () {
       var params = app.getParams();
 
+      if (this.toolsView) {
+        this.toolsView.remove();
+      }
+
       this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.ViewEditor({
         ddocs: this.data.designDocs,
         params: params,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/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 1fe4cb7..af3c4c3 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -17,6 +17,7 @@ define([
        "modules/fauxton/components",
 
        "modules/documents/resources",
+       "modules/databases/resources",
        "modules/pouchdb/base",
 
        // Libs
@@ -27,7 +28,7 @@ define([
 
 ],
 
-function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
+function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColumns) {
   var Views = {};
 
   Views.Tabs = FauxtonAPI.View.extend({
@@ -46,7 +47,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
       return {
         // TODO make this not hard coded here
         changes_url: '#' + this.database.url('changes'),
-        db_url: '#' + this.database.url('index') + '?limit=100',
+        db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit,
       };
     },
 
@@ -802,7 +803,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
             type: 'error',
             clear: true
           });
-          FauxtonAPI.navigate('/database/' + databaseId + '/_all_docs?limit=20');
+          FauxtonAPI.navigate('/database/' + databaseId + '/_all_docs?limit=' + Databases.DocLimit);
         }
         deferred.reject();
      });
@@ -1250,7 +1251,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
       }
 
       promise.then(function () {
-        FauxtonAPI.navigate('/database/' + that.database.id + '/_all_docs?limit=100');
+        FauxtonAPI.navigate('/database/' + that.database.id + '/_all_docs?limit=' + Databases.DocLimit);
         FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
       });
     },
@@ -1383,7 +1384,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
       var promise = FauxtonAPI.Deferred();
 
       if (!this.database.allDocs) {
-        this.database.buildAllDocs({limit: "100", include_docs: true});
+        this.database.buildAllDocs({limit: Databases.DocLimit.toString(), include_docs: true});
         promise = this.database.allDocs.fetch();
       } else {
         promise.resolve();
@@ -1629,11 +1630,12 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
       return {
         changes_url: '#' + this.database.url('changes'),
         permissions_url: '#' + this.database.url('app') + '/permissions',
-        db_url: '#' + this.database.url('index') + '?limit=100',
+        db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit,
         database: this.collection.database,
         database_url: '#' + this.database.url('app'), 
         docLinks: docLinks,
-        showNewView: this.showNewView
+        showNewView: this.showNewView,
+        docLimit: Databases.DocLimit
       };
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/templates/databases/item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/databases/item.html b/src/fauxton/app/templates/databases/item.html
index a8801b0..701e58e 100644
--- a/src/fauxton/app/templates/databases/item.html
+++ b/src/fauxton/app/templates/databases/item.html
@@ -13,7 +13,7 @@ the License.
 -->
 
 <td>
-  <a href="#/database/<%=encoded%>/_all_docs?limit=100"><%= database.get("name") %></a>
+  <a href="#/database/<%=encoded%>/_all_docs?limit=<%=docLimit%>"><%= database.get("name") %></a>
 </td>
 <td><%= database.status.humanSize() %></td>
 <td><%= database.status.numDocs() %></td>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/templates/documents/all_docs_layout.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/all_docs_layout.html b/src/fauxton/app/templates/documents/all_docs_layout.html
index cdbd161..785937e 100644
--- a/src/fauxton/app/templates/documents/all_docs_layout.html
+++ b/src/fauxton/app/templates/documents/all_docs_layout.html
@@ -12,7 +12,7 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav">
-  <li><a id="toggle-query" class="fonticon-plus fonticon" href="#query" data-toggle="tab">Advanced Options</a></li>
+  <li><a id="toggle-query" class="fonticon-plus fonticon" href="#query" data-toggle="tab">Index Options</a></li>
 </ul>
 <div class="tab-content">
   <div class="tab-pane" id="query">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/src/fauxton/app/templates/documents/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/sidebar.html b/src/fauxton/app/templates/documents/sidebar.html
index cd6dedc..4faae4c 100644
--- a/src/fauxton/app/templates/documents/sidebar.html
+++ b/src/fauxton/app/templates/documents/sidebar.html
@@ -16,8 +16,8 @@ the License.
   <header class="row-fluid">
     <div class="span5">
       <div class="btn-group">
-        <button class="btn">Docs</button>
-        <button class="btn dropdown-toggle" data-toggle="dropdown">
+        <button class="btn dropdown-toggle dropdown-toggle-btn" data-toggle="dropdown">
+          Docs
           <span class="caret"></span>
         </button>
         <ul class="dropdown-menu">
@@ -34,8 +34,8 @@ the License.
 
     <div class="span4 offset1">
       <div class="btn-group">
-        <button class="btn">Add</button>
-        <button class="btn dropdown-toggle" data-toggle="dropdown">
+        <button class="btn dropdown-toggle dropdown-toggle-btn" data-toggle="dropdown">
+          Add
           <span class="caret"></span>
         </button>
         <ul class="dropdown-menu">
@@ -58,11 +58,11 @@ the License.
 
   <nav>
     <ul class="nav nav-list">
-      <li class="active"><a id="all-docs" href="#<%= database.url('index') %>?limit=100" class="toggle-view"><i class="icon-list"></i> All documents</a></li>
-      <li><a id="design-docs" href='#<%= database.url("index") %>?limit=100&startkey="_design"&endkey="_e"'  class="toggle-view"><i class="icon-list"></i> All design docs</a></li>
+      <li class="active"><a id="all-docs" href="#<%= database.url('index') %>?limit=<%= docLimit %>" class="toggle-view"><i class="icon-list"></i> All documents</a></li>
+      <li><a id="design-docs" href='#<%= database.url("index") %>?limit=<%= docLimit %>&startkey="_design"&endkey="_e"'  class="toggle-view"><i class="icon-list"></i> All design docs</a></li>
     </ul>
     <ul class="nav nav-list views">
-      <li class="nav-header">Secondary Indices</li>
+      <li class="nav-header">Secondary Indexes</li>
       <% if (showNewView) { %>
         <li><a id="new-view" href="#<%= database.url('app') %>/new_view" class="new"><i class="icon-plus"></i> New</a></li>
         <% } %>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/555ad0ff/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 bb6e0af..7f5d233 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -68,7 +68,7 @@ the License.
           <div class="control-group">
             <button class="button green save fonticon-circle-check">Save</button>
             <button class="button btn-info preview">Preview</button>
-            <% if (!this.newView) { %>
+            <% if (!newView) { %>
             <button class="button delete outlineGray fonticon-circle-x">Delete</button>
             <% } %>
           </div>