couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [50/50] [abbrv] couchdb commit: updated refs/heads/api-options to bd721a5
Date Wed, 22 Jan 2014 14:49:32 GMT
Get group_level working


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

Branch: refs/heads/api-options
Commit: bd721a5371b95aae6bf7d4a09b9e48c26d5a4693
Parents: ab41b1b
Author: Garren Smith <garren.smith@gmail.com>
Authored: Wed Dec 18 15:45:40 2013 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Wed Jan 22 16:46:43 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/resources.js   |  9 ++++++-
 .../documents/templates/all_docs_list.html      |  6 -----
 src/fauxton/app/addons/documents/views.js       | 26 ++++++++------------
 .../documents/advanced_options_menu.html        |  5 ++--
 src/fauxton/assets/less/fauxton.less            |  4 +++
 5 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/bd721a53/src/fauxton/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/resources.js b/src/fauxton/app/addons/documents/resources.js
index 831d5e3..4f43243 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -470,8 +470,15 @@ function(app, FauxtonAPI) {
 
     totalRows: function() {
       if (this.params.reduce) { return "unknown_reduce";}
+      var total = "unknown";
 
-      return this.viewMeta.total_rows || "unknown";
+      if (this.viewMeta.total_rows) {
+        total = this.viewMeta.total_rows;
+      } else if (this.length > 0) {
+        total = this.length;
+      }
+
+      return total;
     },
 
     updateSeq: function() {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bd721a53/src/fauxton/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/all_docs_list.html b/src/fauxton/app/addons/documents/templates/all_docs_list.html
index 335b040..1bad602 100644
--- a/src/fauxton/app/addons/documents/templates/all_docs_list.html
+++ b/src/fauxton/app/addons/documents/templates/all_docs_list.html
@@ -29,12 +29,6 @@ the License.
   <p>
 
   <div id="item-numbers"> </div>
-
-  <% if (requestDuration) { %>
-    <span class="view-request-duration">
-    View request duration: <strong> <%= requestDuration %> </strong> 
-    </span>
-  <% } %>
   </p>
   <table class="all-docs table table-striped table-condensed">
     <tbody></tbody>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bd721a53/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index fa82076..67fcdd7 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -610,15 +610,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
     },
 
     serialize: function() {
-      var requestDuration = false;
-
-      if (this.collection.requestDurationInString) {
-        requestDuration = this.collection.requestDurationInString();
-      }
 
       return {
         viewList: this.viewList,
-        requestDuration: requestDuration,
+        requestDuration: false,
         expandDocs: this.expandDocs
       };
     },
@@ -1044,7 +1039,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
     },
 
     updateRows: function (event) {
-      console.log('boom', event);
       var $groupLevel = this.$('#group-level-label'),
           params = {
             include_docs: false,
@@ -1063,8 +1057,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
       } else {
         $groupLevel.hide();
       }
-
-      console.log(params);
       this.eventer.trigger('options:param_update', params);
     },
 
@@ -1072,7 +1064,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
       if (params.reduce) {
         var $reduce = this.$('#reduce');
         $reduce.prop("checked", true);
-        this.$('#group-level').show();
+        this.$('#group-level-label').show();
+        this.$('option[value="' + params.group_level + '"]').prop('selected', true);
 
       } else if (params.include_docs) {
         var $include_docs = this.$('#include-docs');
@@ -1112,9 +1105,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
         this.showPreview = options.showPreview;
       }
 
-      if (this.eventer) { 
-        this.listenTo(this.eventer, 'options:param_update', this.optionsParamsUpdate);
-      }
+      this.eventer && this.listenTo(this.eventer, 'options:param_update', this.optionsParamsUpdate);
     },
 
     events: {
@@ -1137,12 +1128,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
     optionsParamsUpdate: function (params) {
        var $form = this.$el.find("form.view-query-update");
 
+       if (!params.group_level) {
+        this.$("select[name='group_level']").attr('disabled', 'disabled');
+       }
+
        if (params.reduce && params.group_level) {
         $form.find("select[name='group_level']").val(params.group_level).removeAttr('disabled');
         delete params.group_level;
-       } else {
-        $form.find("select[name='group_level']").attr('disabled');
-       }
+       } 
+
       _.each(params, function(val, key) {
         $form.find("input[name='"+key+"']").prop('checked', val);
       });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bd721a53/src/fauxton/app/templates/documents/advanced_options_menu.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/advanced_options_menu.html b/src/fauxton/app/templates/documents/advanced_options_menu.html
index 9763e4b..ff1783c 100644
--- a/src/fauxton/app/templates/documents/advanced_options_menu.html
+++ b/src/fauxton/app/templates/documents/advanced_options_menu.html
@@ -1,8 +1,9 @@
   <div class="row-fluid custom-inputs">
     <div class="controls controls-row">
       <div class="checkbox inline">  
-        <input id="include-docs" type="checkbox" name="include_docs" value="true">
 
-        <label for="include_docs">Include Docs</label>  
+        <input id="include-docs" type="checkbox" name="include-docs" value="true">
 
+        <label for="include_docs">
+          Include Docs</label>  
       </div> 
       <% if (hasReduce) { %>
       <div class="checkbox inline">  

http://git-wip-us.apache.org/repos/asf/couchdb/blob/bd721a53/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index e1cfa06..b020f67 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -1000,3 +1000,7 @@ div.spinner {
 #delete-database {
   float: right;
 }
+
+#item-numbers {
+  float: right;
+}


Mime
View raw message