couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter addition
Date Tue, 30 Sep 2014 08:32:27 GMT
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/72#discussion_r18204674
  
    --- Diff: app/addons/fauxton/templates/breadcrumbs.html ---
    @@ -12,11 +12,20 @@
     the License.
     -->
     
    -<% _.each(_.initial(crumbs), function(crumb) { %>
    +<% _.each(_.initial(crumbs), function(crumb, index) { %>
     <li>
    -<a href="#<%- crumb.link %>" class="fonticon <%- crumb.className %>"><%-
crumb.name %></a>
    +  <a href="#<%- crumb.link %>" class="fonticon <%- crumb.className %>"><%-
crumb.name %></a>
     </li>
    +
    +<%
    +// fussy logic to only place the divider between text entries
    +var nextCrumbHasLabel = crumbs[index+1].name != "";
    +if (index < crumbs.length && crumb.name && nextCrumbHasLabel) {
    --- End diff --
    
    This has too much logic for a template. What would be better here is to define a function
in the `serialize` method that you could call here, something like:
    
        if (isNextTextLabel(index, crumb)) { 
          /* add divider */ 
        }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message