new design for docs
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/1e0c6c1e Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/1e0c6c1e Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/1e0c6c1e Branch: refs/heads/doc-design Commit: 1e0c6c1e9c2f8608846968fe5ab3eae939da115a Parents: 9d43717 Author: Robert Kowalski <[email protected]> Authored: Thu Nov 13 16:33:35 2014 +0100 Committer: Robert Kowalski <[email protected]> Committed: Fri Nov 21 11:49:06 2014 +0100 ---------------------------------------------------------------------- app/addons/documents/assets/less/documents.less | 78 +++++++++++--------- app/addons/documents/routes-documents.js | 1 - .../documents/templates/all_docs_item.html | 30 +++++--- .../documents/templates/all_docs_list.html | 5 +- app/addons/documents/templates/ddoc_info.html | 4 +- app/addons/documents/views.js | 30 +------- 6 files changed, 69 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1e0c6c1e/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 bc71274..5ad8189 100644 --- a/app/addons/documents/assets/less/documents.less +++ b/app/addons/documents/assets/less/documents.less @@ -17,16 +17,6 @@ @import "changes.less"; @import "sidenav.less"; -tr.all-docs-item { - border: none; - background: transparent; - .btn-group { - position: absolute; - right: 0; - top: 6px; - } -} - button.beautify { margin-top: 20px; } @@ -50,30 +40,6 @@ button.beautify { margin-right: 17px; } -/** used in all_docs_list.html **/ -.view { - table td div { - position: relative; - } - - table td div div { - display: none; - line-height: 1; - position: absolute; - right: 4px; - top: 4px; - } - - table td div:hover div a.edits { - padding-left: 16px; - padding-right: 16px; - } - - table td div:hover div { - display: block; - } -} - /** used in view_editor.html **/ .design-doc-group { .span3 { @@ -109,6 +75,10 @@ button.beautify { padding-right: 20px; } +.metadata-page { + padding: 20px; +} + button.string-edit { position: absolute; padding: 0; @@ -178,3 +148,43 @@ button.string-edit[disabled] { margin-bottom: 0px; } } + +#doc-list{ + padding-top: 30px; + .all-docs-item { + .show-select { + .select { + display:block; + width: 10%; + } + .doc-item { + width: 90%; + } + } + } + div.doc-row { + margin-bottom: 20px; + .doc-item { + float: left; + width: 100%; + vertical-align: top; + position: relative; + .border-radius(5px 5px 5px 5px); + .box-shadow(3px 4px 0 rgba(0, 0, 0, 0.3)); + border: 1px solid #000; + header { + font-weight: bold; + position: relative; + padding: 20px; + background-color: #777; + color: #3a2c2b; + border-bottom: 1px solid #000; + .header-id-number { + color: #fff; + margin-left: 10px; + } + } + + } + } +} http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1e0c6c1e/app/addons/documents/routes-documents.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/routes-documents.js b/app/addons/documents/routes-documents.js index bb07402..1fd7232 100644 --- a/app/addons/documents/routes-documents.js +++ b/app/addons/documents/routes-documents.js @@ -344,7 +344,6 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou return this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({ database: options.database, collection: options.indexedDocs, - nestedView: Documents.Views.Row, viewList: true, ddocInfo: this.ddocInfo(options.designDoc, options.designDocs, options.view), docParams: options.docParams, http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1e0c6c1e/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..83a78a7 100644 --- a/app/addons/documents/templates/all_docs_item.html +++ b/app/addons/documents/templates/all_docs_item.html @@ -1,4 +1,4 @@ -<!-- +<%/* 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 @@ -10,17 +10,23 @@ 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 <%- 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/1e0c6c1e/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 c77fc05..cede46b 100644 --- a/app/addons/documents/templates/all_docs_list.html +++ b/app/addons/documents/templates/all_docs_list.html @@ -26,11 +26,8 @@ the License. </div> </div> <% } %> - <p> - <table class="all-docs table table-striped table-condensed"> - <tbody></tbody> - </table> + <div id="doc-list"></div> <% if (endOfResults) { %> <div class="end-of-results text-center well"> http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1e0c6c1e/app/addons/documents/templates/ddoc_info.html ---------------------------------------------------------------------- diff --git a/app/addons/documents/templates/ddoc_info.html b/app/addons/documents/templates/ddoc_info.html index 5c180ec..fe4d72c 100644 --- a/app/addons/documents/templates/ddoc_info.html +++ b/app/addons/documents/templates/ddoc_info.html @@ -11,7 +11,7 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> -<div> +<div class="metadata-page"> <header class="page-header"> <h2>Design Document Metadata: _design/<%-Ddoc%> </h2> <p class="help">Information about the specified design document, including the index, index size and current status of the design document and associated index information.<a href="<%- getDocUrl('design_doc_metadata') %>" class="help-link" target="_blank" data-bypass="true"><i class="icon-question-sign"></i></a></p> @@ -58,4 +58,4 @@ the License. </dl> </div> </div> -</div> \ No newline at end of file +</div> http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1e0c6c1e/app/addons/documents/views.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js index 2b4fe1a..de9b0e7 100644 --- a/app/addons/documents/views.js +++ b/app/addons/documents/views.js @@ -176,8 +176,8 @@ 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: 'show-select all-docs-item doc-row', initialize: function (options) { this.checked = options.checked; @@ -196,6 +196,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) serialize: function() { return { + docId: this.model.get('_id'), doc: this.model, checked: this.checked }; @@ -241,28 +242,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) } }); - Views.Row = FauxtonAPI.View.extend({ - template: "addons/documents/templates/index_row_docular", - tagName: "tr", - - events: { - "click button.delete": "destroy" - }, - - destroy: function (event) { - event.preventDefault(); - window.alert('Cannot delete a document generated from a view.'); - }, - - serialize: function() { - return { - doc: this.model, - url: this.model.url('app') - }; - } - }); - - Views.AllDocsNumber = FauxtonAPI.View.extend({ template: "addons/documents/templates/all_docs_number", @@ -336,7 +315,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) }, initialize: function (options) { - this.nestedView = options.nestedView || Views.Document; this.rows = {}; this.viewList = !!options.viewList; @@ -566,7 +544,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) id = doc.cid; } - this.rows[id] = this.insertView("table.all-docs tbody", new this.nestedView({ + this.rows[id] = this.insertView('#doc-list', new Views.Document({ model: doc, checked: isChecked }));
