couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [2/2] fauxton commit: updated refs/heads/secondary-indexes to c746181
Date Thu, 31 Jul 2014 17:14:52 GMT
This stuff can't be tables. Boo.


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

Branch: refs/heads/secondary-indexes
Commit: c746181ab2438a912507869db9c3a91e89c84699
Parents: e47611c
Author: deathbearbrown <deathbearbrown@gmail.com>
Authored: Thu Jul 31 13:14:47 2014 -0400
Committer: deathbearbrown <deathbearbrown@gmail.com>
Committed: Thu Jul 31 13:14:47 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/assets/less/documents.less |  2 +-
 .../documents/templates/all_docs_item.html      | 26 ++++---
 .../documents/templates/all_docs_list.html      |  6 +-
 .../documents/templates/index_row_tabular.html  | 25 -------
 app/addons/documents/views.js                   |  9 ++-
 app/addons/indexes/assets/less/indexes.less     | 74 ++++++++++++++++++++
 .../assets/less/new-index-placeholder.less      |  3 +
 .../indexes/templates/index_row_docular.html    | 16 ++---
 app/addons/indexes/views.js                     |  3 +-
 assets/less/templates.less                      |  1 +
 10 files changed, 111 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index add707e..229d46b 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -53,7 +53,7 @@ button.beautify {
         position: relative;
     }
 
-    table td div div {
+    table td div div.btn-group {
         display: none;
         line-height: 1;
         position: absolute;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_item.html b/app/addons/documents/templates/all_docs_item.html
index a8ef20f..4526df2 100644
--- a/app/addons/documents/templates/all_docs_item.html
+++ b/app/addons/documents/templates/all_docs_item.html
@@ -12,15 +12,21 @@ License for the specific language governing permissions and limitations
under
 the License.
 -->
 
-<td class="select"><input <%- checked ? 'checked="checked"' : '' %> type="checkbox"
class="js-row-select"></td>
-<td>
-  <div>
+<div class="select"><input <%- checked ? 'checked="checked"' : '' %> type="checkbox"
class="js-row-select"></div>
+<div class="doc-item">
+
+  <header>
+    _id <span class="header-id-number">"<%=docID%>"</span>
+
+  <% if (doc.isEditable()) { %>
+    <div class="btn-group">
+      <a href="#<%= doc.url('web-index') %>" class="btn btn-small edits">Edit
<%- doc.docType() %></a>
+      <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i
class="icon icon-trash"></i></button>
+    </div>
+  <% } %>
+  </header>
+  <div class="doc-data">
     <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
-    <% if (doc.isEditable()) { %>
-      <div class="btn-group">
-        <a href="#<%= doc.url('web-index') %>" class="btn btn-small edits">Edit
<%- doc.docType() %></a>
-        <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i
class="icon icon-trash"></i></button>
-      </div>
-    <% } %>
   </div>
-</td>
+</div>
+<div class="clearfix"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_list.html b/app/addons/documents/templates/all_docs_list.html
index a643427..d132eb2 100644
--- a/app/addons/documents/templates/all_docs_list.html
+++ b/app/addons/documents/templates/all_docs_list.html
@@ -29,9 +29,9 @@ the License.
   <p>
 
   <div id="item-numbers"> </div>
-  <table class="all-docs table table-striped table-condensed">
-    <tbody></tbody>
-  </table>
+  <div id="doc-list">
+
+  </div>
 
   <% if (endOfResults) { %>
   <div class="text-center well">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/documents/templates/index_row_tabular.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/index_row_tabular.html b/app/addons/documents/templates/index_row_tabular.html
deleted file mode 100644
index f5f68fa..0000000
--- a/app/addons/documents/templates/index_row_tabular.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
-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.
--->
-
-<td class="select"><input type="checkbox"></td>
-<td>
-  <div>
-    <pre class="prettyprint"><%- JSON.stringify(doc.get("key")) %></pre>
-  </div>
-</td>
-<td>
-  <div>
-    <pre class="prettyprint"><%- JSON.stringify(doc.get("value")) %></pre>
-  </div>
-</td>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 8bde439..8f02867 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -152,9 +152,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
   Views.Document = FauxtonAPI.View.extend({
     template: "addons/documents/templates/all_docs_item",
-    tagName: "tr",
-    className: "all-docs-item",
-
+    className: "all-docs-item doc-row",
     initialize: function (options) {
       this.checked = options.checked;
     },
@@ -172,6 +170,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     serialize: function() {
       return {
+        docID: this.model.get('_id'),
         doc: this.model,
         checked: this.checked
       };
@@ -426,7 +425,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     },
 
     toggleDocument: function (event) {
-      var $row = this.$(event.target).closest('tr'),
+      var $row = this.$(event.target).closest('.doc-row'),
           docId = $row.attr('data-id'),
           db = this.database.get('id'),
           rev = this.collection.get(docId).get('_rev'),
@@ -558,7 +557,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
         if (this.bulkDeleteDocsCollection) {
           isChecked = this.bulkDeleteDocsCollection.get(doc.id);
         }
-        this.rows[doc.id] = this.insertView("table.all-docs tbody", new this.nestedView({
+        this.rows[doc.id] = this.insertView("#doc-list", new this.nestedView({
           model: doc,
           checked: isChecked
         }));

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/indexes/assets/less/indexes.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/indexes.less b/app/addons/indexes/assets/less/indexes.less
new file mode 100644
index 0000000..79b4612
--- /dev/null
+++ b/app/addons/indexes/assets/less/indexes.less
@@ -0,0 +1,74 @@
+// 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.
+
+@import "new-index-placeholder.less";
+
+.view table td div.doc-menu-item div.dropdown{
+
+  display: block;
+}
+
+#doc-list{
+  margin-top: 30px;
+  div.doc-row {
+    margin-bottom:20px;
+    div.select {
+      width: 10%;
+      float: left;
+      vertical-align: top;
+    }
+    .doc-item {
+      float:left;
+      width:90%;
+      vertical-align: top;
+      header {
+        position: relative;
+        height: 50px;
+        background-color: #777;
+        color: #3a2c2b;
+        .header-id-number{
+          color: #fff;
+        }
+      }
+      &:hover{
+        .btn-group{
+          display:block;
+        }
+      }
+      //temporary
+      .btn-group{
+        position:absolute;
+        top:10px;
+        right:10px;
+        display:none;
+      }
+      position: relative;
+      .doc-menu {
+        position:absolute;
+        right: 0px;
+        top: 0px;
+        .doc-menu-item{
+          a {
+            text-decoration: none;
+          }
+          .dropdown-menu {
+            left:auto;
+            right: 0px;
+          }
+          display: inline-block;
+          width: 30px;
+          height: 30px;
+        }
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/indexes/assets/less/new-index-placeholder.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/new-index-placeholder.less b/app/addons/indexes/assets/less/new-index-placeholder.less
new file mode 100644
index 0000000..05ed2c1
--- /dev/null
+++ b/app/addons/indexes/assets/less/new-index-placeholder.less
@@ -0,0 +1,3 @@
+.watermark-logo {
+  background: transparent url('../img/couchWatermark.png') no-repeat 0 0;
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/indexes/templates/index_row_docular.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/index_row_docular.html b/app/addons/indexes/templates/index_row_docular.html
index 0055a1d..ba88d06 100644
--- a/app/addons/indexes/templates/index_row_docular.html
+++ b/app/addons/indexes/templates/index_row_docular.html
@@ -12,11 +12,13 @@ License for the specific language governing permissions and limitations
under
 the License.
 -->
 <% if (doc.isEditable()) { %>
-  <td class="select"><input type="checkbox"></td>
+  <div class="select"><input type="checkbox"></div>
 <% } %>
-<td>
+
+<div class="doc-item">
   <header>
-    <p>_id <span>"<%=docID%>"</span></p>
+    _id <span class="header-id-number">"<%=docID%>"</span>
+
     <div class="doc-menu">
       <a href="#<%= url %>" class="doc-menu-item icon fonticon-pencil"></a>
       <% if (doc.isEditable()) { %>
@@ -26,10 +28,8 @@ the License.
       <div id="view-doc-menu" class="doc-menu-item"></div>
     </div>
   </header>
-  <div>
+  <div class="doc-data">
     <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
-
-
-
   </div>
-</td>
+</div>
+<div class="clearfix"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 35ea283..0a9f933 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -55,8 +55,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
   Views.Row = FauxtonAPI.View.extend({
     template: "addons/indexes/templates/index_row_docular",
-    tagName: "tr",
-
+    className: "doc-row",
     events: {
       "click button.delete": "destroy"
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c746181a/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index 63c0027..166ddcd 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -498,6 +498,7 @@
 }
 #right-content{
   .two-pane &{
+    padding: 0 20px;
     border-left: 1px solid #999;
     .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
   }


Mime
View raw message