couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [7/7] couchdb commit: updated refs/heads/Update-Sidebar-Ui to eb1c7c0
Date Tue, 01 Apr 2014 20:50:41 GMT
add metadata as a sidebar option


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

Branch: refs/heads/Update-Sidebar-Ui
Commit: eb1c7c0fca5014f1dc17df4768d09582a4766b54
Parents: 8995cac
Author: suelockwood <deathbear@apache.org>
Authored: Tue Apr 1 10:51:21 2014 -0400
Committer: suelockwood <deathbear@apache.org>
Committed: Tue Apr 1 14:35:13 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/routes.js          | 16 +++++++++++++---
 .../addons/documents/templates/design_doc_menu.html | 13 ++++++++-----
 .../app/addons/documents/templates/sidebar.html     |  3 +--
 src/fauxton/app/addons/documents/views.js           |  5 ++++-
 4 files changed, 26 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb1c7c0f/src/fauxton/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/routes.js b/src/fauxton/app/addons/documents/routes.js
index 90cf8b2..1924644 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -17,10 +17,11 @@ define([
 
        // Modules
        "addons/documents/views",
-       "addons/databases/base"
+       "addons/databases/base",
+       "addons/documents/resources"
 ],
 
-function(app, FauxtonAPI, Documents, Databases) {
+function(app, FauxtonAPI, Documents, Databases, Resources) {
 
   var DocEditorRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "one_pane",
@@ -160,6 +161,10 @@ function(app, FauxtonAPI, Documents, Databases) {
         route: "tempFn",
         roles: ['_admin']
       },
+      "database/:database/_design/:ddoc/metadata": {
+        route: "designDocMetadata",
+        roles: ['_admin']
+      },
       "database/:database/new_view": "newViewEditor",
       "database/:database/new_view/:designDoc": "newViewEditor"
     },
@@ -193,7 +198,12 @@ function(app, FauxtonAPI, Documents, Databases) {
         database: this.data.database
       }));
     },
-
+    designDocMetadata:  function(database, ddoc){
+      var DesignDocInfo = new Resources.DdocInfo({_id: "_design/"+ddoc},{database: this.data.database
});
+      this.setView("#dashboard-lower-content", new Documents.Views.DdocInfo({
+        model: DesignDocInfo
+      }));
+    },
     tempFn:  function(databaseName, ddoc, fn){
       this.setView("#dashboard-upper-content", new Documents.Views.temp({}));
       this.crumbs = function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb1c7c0f/src/fauxton/app/addons/documents/templates/design_doc_menu.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/design_doc_menu.html b/src/fauxton/app/addons/documents/templates/design_doc_menu.html
index ee45ed6..c5bd392 100644
--- a/src/fauxton/app/addons/documents/templates/design_doc_menu.html
+++ b/src/fauxton/app/addons/documents/templates/design_doc_menu.html
@@ -12,13 +12,16 @@ License for the specific language governing permissions and limitations
under
 the License.
 -->
 <li class="nav-header">
-	<span  class="fonticon-play js-collapse-toggle" data-toggle="collapse" data-target="#<%=designDoc%>">
+	<span  class="fonticon-play js-collapse-toggle" data-toggle="collapse" data-target="#<%=
ddoc_clean %>">
 		<%= designDoc%>
 	</span>
-	<div class="new-button">
+	<div class="new-button"></div>
+	<ul class="accordion-body collapse" id="<%= ddoc_clean %>">
+		<li>
+			<a id="<%= ddoc_clean %>_metadata" href="#database/<%= database_encoded %>/_design/<%=
ddoc_encoded %>/metadata" class="toggle-view">
+			  Design Doc Metadata
+			</a>
+		</li>
 
-	</div>
-
-	<ul class="accordion-body collapse" id="<%=designDoc%>">
 	</ul>
 </li>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb1c7c0f/src/fauxton/app/addons/documents/templates/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/sidebar.html b/src/fauxton/app/addons/documents/templates/sidebar.html
index 59d76e1..f276c5e 100644
--- a/src/fauxton/app/addons/documents/templates/sidebar.html
+++ b/src/fauxton/app/addons/documents/templates/sidebar.html
@@ -34,7 +34,7 @@ the License.
       </div>
         <button id="delete-database" class="btn pull-right"><i class="icon-trash"></i>
Database</button>
     </div>
-  </header> --> 
+  </header> -->
 
 
     <ul class="nav nav-list">
@@ -43,7 +43,6 @@ the License.
       <% _.each(docLinks, function (link) { %>
         <li><a href="<%= database_url + '/' + link.url %>"><%= link.title
%></a></li>
       <% }); %>
-
       <li class="active"><a id="all-docs" href="#<%= database.url('index') %>"
class="toggle-view"> All documents</a></li>
       <li><a id="design-docs" href='#<%= database.url("index") %>?startkey="_design"&endkey="_e"'
 class="toggle-view"> All design docs</a></li>
     </ul>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb1c7c0f/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 6153e40..abac4db 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1956,7 +1956,10 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
       var ddocName = this.model.id.replace(/^_design\//,"");
       return{
         database: this.collection.database,
-        designDoc: ddocName
+        designDoc: ddocName,
+        ddoc_clean: app.utils.removeSpecialCharacters(ddocName),
+        ddoc_encoded: app.utils.safeURLName(ddocName),
+        database_encoded: app.utils.safeURLName(this.model.collection.database.id),
       };
     },
     beforeRender: function(manage) {


Mime
View raw message