You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2014/07/22 09:32:45 UTC
[46/51] [abbrv] fauxton commit: updated refs/heads/Update-Sidebar to
c713f63
Add accordian to sections
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/4f65da99
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/4f65da99
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/4f65da99
Branch: refs/heads/Update-Sidebar
Commit: 4f65da99d488aac632f428ed28257637439a56f5
Parents: 0636139
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jun 3 16:44:18 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Jul 22 09:28:59 2014 +0200
----------------------------------------------------------------------
app/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 +++++++++----
4 files changed, 41 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4f65da99/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 cdcb3ed..b9dad2e 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/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-fauxton/blob/4f65da99/app/addons/documents/sidebarviews.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/sidebarviews.js b/app/addons/documents/sidebarviews.js
index 88233f6..d800154 100644
--- a/app/addons/documents/sidebarviews.js
+++ b/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-fauxton/blob/4f65da99/app/addons/documents/templates/design_doc_menu.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/design_doc_menu.html b/app/addons/documents/templates/design_doc_menu.html
index beb0c85..e471103 100644
--- a/app/addons/documents/templates/design_doc_menu.html
+++ b/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-fauxton/blob/4f65da99/app/addons/documents/templates/index_menu_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/index_menu_item.html b/app/addons/documents/templates/index_menu_item.html
index 04995f3..42dc2db 100644
--- a/app/addons/documents/templates/index_menu_item.html
+++ b/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>