couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [7/7] couchdb commit: updated refs/heads/Update-Sidebar-Ui to 1ec81fb
Date Tue, 03 Jun 2014 14:44:40 GMT
Add accordian to sections


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

Branch: refs/heads/Update-Sidebar-Ui
Commit: 1ec81fb3361f120962e328ddaf83ebb88e3b89fe
Parents: a929349
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Jun 3 16:44:18 2014 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Jun 3 16:44:18 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                                 |  2 ++
 .../addons/documents/assets/less/documents.less | 16 +++++++++++
 .../app/addons/documents/sidebarviews.js        | 30 +++++++-------------
 .../documents/templates/design_doc_menu.html    |  1 -
 .../documents/templates/index_menu_item.html    | 20 +++++++++----
 5 files changed, 43 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1ec81fb3/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 240b4e0..f864239 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -169,6 +169,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/databases/templates/newdatabase.html \
     fauxton/app/addons/databases/templates/sidebar.html \
     fauxton/app/addons/documents/templates/advanced_options.html \
+    fauxton/app/addons/documents/templates/attachments_footer.html \
     fauxton/app/addons/documents/templates/all_docs_item.html \
     fauxton/app/addons/documents/templates/all_docs_layout.html \
     fauxton/app/addons/documents/templates/all_docs_list.html \
@@ -176,6 +177,7 @@ FAUXTON_FILES = \
     fauxton/app/addons/documents/templates/changes.html \
     fauxton/app/addons/documents/templates/ddoc_info.html \
     fauxton/app/addons/documents/templates/delete_database_modal.html \
+    fauxton/app/addons/documents/templates/design_doc_menu.html \
     fauxton/app/addons/documents/templates/design_doc_selector.html \
     fauxton/app/addons/documents/templates/doc.html \
     fauxton/app/addons/documents/templates/doc_field_editor.html \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1ec81fb3/src/fauxton/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/assets/less/documents.less b/src/fauxton/app/addons/documents/assets/less/documents.less
index cdcb3ed..b9dad2e 100644
--- a/src/fauxton/app/addons/documents/assets/less/documents.less
+++ b/src/fauxton/app/addons/documents/assets/less/documents.less
@@ -250,6 +250,7 @@ button.beautify {
     }
     > ul.accordion-body{
       > li {
+        cursor: pointer;
         a{
           padding-left: 36px;
         }
@@ -263,6 +264,21 @@ button.beautify {
           font-size: 20px;
         }
       }
+
+      li {
+        > a.down .fonticon-play {
+          .rotate(90deg);
+        }
+
+        &:hover {
+          .fonticon-play {
+            color: white;
+
+          }
+        }
+
+      }
+
     }
   }
   

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1ec81fb3/src/fauxton/app/addons/documents/sidebarviews.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/sidebarviews.js b/src/fauxton/app/addons/documents/sidebarviews.js
index 88233f6..d800154 100644
--- a/src/fauxton/app/addons/documents/sidebarviews.js
+++ b/src/fauxton/app/addons/documents/sidebarviews.js
@@ -129,31 +129,22 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     className:  "nav nav-list",
     template: "addons/documents/templates/design_doc_menu",
     events: {
-      "click button": "no",
       "click .js-collapse-toggle": "toggleArrow"
     },
-    initialize: function(){
 
-    },
     toggleArrow:  function(e){
       this.$(e.currentTarget).toggleClass("down");
     },
-    no: function(event){
-      event.preventDefault();
-      alert("no");
-    },
     buildIndexList: function(collection, selector, ddocType){
       var design = this.model.id.replace(/^_design\//,"");
 
-      _.each(_.keys(collection[selector]), function(key){
-        this.insertView(".accordion-body", new Views.IndexItem({
-          selector: selector,
-          ddoc: design,
-          index: key,
-          ddocType: ddocType,
-          database: this.model.collection.database.id
-        }));
-      }, this);
+      this.insertView(".accordion-body", new Views.IndexItem({
+        selector: selector,
+        ddoc: design,
+        collection: collection[selector],
+        ddocType: ddocType,
+        database: this.model.collection.database.id
+      }));
     },
 
     serialize: function(){
@@ -217,7 +208,7 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
   Views.IndexItem = FauxtonAPI.View.extend({
     template: "addons/documents/templates/index_menu_item",
-    tagName: "li",
+    tagName: 'li',
 
     initialize: function(options){
       this.index = options.index;
@@ -231,11 +222,12 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     serialize: function() {
       return {
         icon: this.ddocType,
-        type:  this.ddocType,
+        ddocType:  this.ddocType,
         index: this.index,
         ddoc: this.ddoc,
         database: this.database,
-        selected: this.selected
+        selected: this.selected,
+        collection: this.collection
       };
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1ec81fb3/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 beb0c85..e471103 100644
--- a/src/fauxton/app/addons/documents/templates/design_doc_menu.html
+++ b/src/fauxton/app/addons/documents/templates/design_doc_menu.html
@@ -23,7 +23,6 @@ the License.
 	<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">
-			<div class="fonticon-play"></div>
 			<span class="cloudant-sidenav-info fonticon"></span>
 			  Design Doc Metadata
 			</a>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1ec81fb3/src/fauxton/app/addons/documents/templates/index_menu_item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/index_menu_item.html b/src/fauxton/app/addons/documents/templates/index_menu_item.html
index 04995f3..42dc2db 100644
--- a/src/fauxton/app/addons/documents/templates/index_menu_item.html
+++ b/src/fauxton/app/addons/documents/templates/index_menu_item.html
@@ -11,10 +11,18 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
+<a class="js-collapse-toggle" data-toggle="collapse"  data-target="#<%- ddocType %>"
>
+  <div class="fonticon-play"></div>
+  <span class="cloudant-sidenav-info fonticon"></span>
+  <%- ddocType %>
+  </a>
+  <ul class="accordion-body collapse" id="<%= ddocType %>">
+  <% _.each(collection, function (item, index) { %>
+  <li>
+  <a id="<%- removeSpecialCharacters(ddoc) %>_<%- removeSpecialCharacters(index)
%>" href="#/database/<%- safeURL(database) %>/_design/<%= safeURL(ddoc)%>/_<%=ddocType%>/<%=
safeURL(index) %>" class="toggle-view">
+    <%- index %>
+  </a>
+  </li>
+  <% }); %>
+</ul>
 
-<a id="<%- removeSpecialCharacters(ddoc) %>_<%- removeSpecialCharacters(index)
%>" href="#/database/<%- safeURL(database) %>/_design/<%= safeURL(ddoc)%>/_<%=type%>/<%=
safeURL(index) %>" class="toggle-view">
-  <% if (icon) { %>
-  <i class="fonticon-<%- icon %>"></i> 
-  <% } %>
-  <%- index %>
-</a>


Mime
View raw message