couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject git commit: updated refs/heads/api-options to 5703588
Date Wed, 18 Dec 2013 14:55:10 GMT
Updated Branches:
  refs/heads/api-options 8f7c3f83c -> 57035883c


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/57035883
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/57035883
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/57035883

Branch: refs/heads/api-options
Commit: 57035883c4de52f79cd3d8e0a51f733e6ccb3c51
Parents: 8f7c3f8
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 Dec 18 15:45:40 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/resources.js  | 10 +++++++-
 src/fauxton/app/modules/documents/views.js      | 26 ++++++++------------
 .../documents/advanced_options_menu.html        |  5 ++--
 .../templates/documents/all_docs_layout.html    |  2 +-
 .../app/templates/documents/all_docs_list.html  |  6 -----
 .../templates/documents/all_docs_number.html    |  9 ++++---
 src/fauxton/assets/less/fauxton.less            |  4 +++
 7 files changed, 33 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/57035883/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 8633605..4a6210b 100644
--- a/src/fauxton/app/modules/documents/resources.js
+++ b/src/fauxton/app/modules/documents/resources.js
@@ -443,7 +443,15 @@ function(app, FauxtonAPI) {
     },
 
     totalRows: function() {
-      return this.viewMeta.total_rows || "unknown";
+      var total = "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/57035883/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 596e0da..bd68747 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -587,15 +587,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
       };
     },
@@ -989,7 +984,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,
@@ -1008,8 +1002,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
       } else {
         $groupLevel.hide();
       }
-
-      console.log(params);
       this.eventer.trigger('options:param_update', params);
     },
 
@@ -1017,7 +1009,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');
@@ -1057,9 +1050,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: {
@@ -1082,12 +1073,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/57035883/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/57035883/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 526c200..6b4a31b 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">Query
Options</a></li>
+  <li><a id="toggle-query" class="fonticon-plus fonticon" href="#query" data-bypass="true"
data-toggle="tab">Query Options</a></li>
 </ul>
 <div class="tab-content">
   <div class="tab-pane" id="query">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/57035883/src/fauxton/app/templates/documents/all_docs_list.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/all_docs_list.html b/src/fauxton/app/templates/documents/all_docs_list.html
index 335b040..1bad602 100644
--- a/src/fauxton/app/templates/documents/all_docs_list.html
+++ b/src/fauxton/app/templates/documents/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/57035883/src/fauxton/app/templates/documents/all_docs_number.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/all_docs_number.html b/src/fauxton/app/templates/documents/all_docs_number.html
index c4ea8f6..0a928ed 100644
--- a/src/fauxton/app/templates/documents/all_docs_number.html
+++ b/src/fauxton/app/templates/documents/all_docs_number.html
@@ -13,9 +13,12 @@ the License.
 -->
 <% if (totalRows === "unknown"){ %>
   Showing 0 documents. <a href="#/database/<%=database%>/new"> Create your first
document.</a>
-<% } else { %>
-  Showing <%=offset%> - <%= numModels %> of <%= totalRows %> rows
-<%}%>
+<% } else if (offset && numModels) { %>
+<!--Showing <%=offset%> - <%= numModels %> of -->
+<%= totalRows %> rows
+<%} else {%>
+  Showing <%= totalRows %> rows
+<% } %>
 <% if (updateSeq) { %>
   -- Update Sequence: <%= updateSeq %>
 <% } %>

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


Mime
View raw message