Updated Branches:
refs/heads/fauxton 2172a0b3f -> da7860c42
Don't show edit links for reduction rows
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/da7860c4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/da7860c4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/da7860c4
Branch: refs/heads/fauxton
Commit: da7860c4270e8cb8ea18678384ec6ba06cf594bb
Parents: 2172a0b
Author: Russell Branca <chewbranca@gmail.com>
Authored: Mon Mar 18 17:12:01 2013 -0700
Committer: Russell Branca <chewbranca@gmail.com>
Committed: Mon Mar 18 17:12:01 2013 -0700
----------------------------------------------------------------------
src/fauxton/app/modules/documents/resources.js | 8 ++++++++
.../app/templates/documents/all_docs_item.html | 10 ++++++----
.../app/templates/documents/index_row_docular.html | 10 ++++++----
3 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/da7860c4/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 3724369..5a08fb4 100644
--- a/src/fauxton/app/modules/documents/resources.js
+++ b/src/fauxton/app/modules/documents/resources.js
@@ -51,6 +51,10 @@ function(app, FauxtonAPI, Views) {
return this.id.match(/^_design/) ? "design doc" : "doc";
},
+ isEditable: function() {
+ return this.docType() != "reduction";
+ },
+
isDdoc: function() {
return this.docType() === "design doc";
},
@@ -123,6 +127,10 @@ function(app, FauxtonAPI, Views) {
return this.id.match(/^_design/) ? "design doc" : "doc";
},
+ isEditable: function() {
+ return this.docType() != "reduction";
+ },
+
prettyJSON: function() {
//var data = this.get("doc") ? this.get("doc") : this;
return JSON.stringify(this, null, " ");
http://git-wip-us.apache.org/repos/asf/couchdb/blob/da7860c4/src/fauxton/app/templates/documents/all_docs_item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/all_docs_item.html b/src/fauxton/app/templates/documents/all_docs_item.html
index a407ba5..c4c0754 100644
--- a/src/fauxton/app/templates/documents/all_docs_item.html
+++ b/src/fauxton/app/templates/documents/all_docs_item.html
@@ -16,9 +16,11 @@ the License.
<td>
<div>
<pre class="prettyprint"><%= doc.prettyJSON() %></pre>
- <div class="btn-group">
- <a href="#<%= doc.url('app') %>" 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>
+ <% if (doc.isEditable()) { %>
+ <div class="btn-group">
+ <a href="#<%= doc.url('app') %>" 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>
http://git-wip-us.apache.org/repos/asf/couchdb/blob/da7860c4/src/fauxton/app/templates/documents/index_row_docular.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/index_row_docular.html b/src/fauxton/app/templates/documents/index_row_docular.html
index c9ae6a4..26c0280 100644
--- a/src/fauxton/app/templates/documents/index_row_docular.html
+++ b/src/fauxton/app/templates/documents/index_row_docular.html
@@ -16,9 +16,11 @@ the License.
<td>
<div>
<pre class="prettyprint"><%= doc.prettyJSON() %></pre>
- <div class="btn-group">
- <a href="#<%= doc.url('app') %>" 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>
+ <% if (doc.isEditable()) { %>
+ <div class="btn-group">
+ <a href="#<%= doc.url('app') %>" 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>
\ No newline at end of file
|