diff --git a/assets/javascripts/collections/collection.coffee b/assets/javascripts/collections/collection.coffee index a5628d8a..b902a498 100644 --- a/assets/javascripts/collections/collection.coffee +++ b/assets/javascripts/collections/collection.coffee @@ -48,3 +48,8 @@ class app.Collection findAllBy: (attr, value) -> model for model in @models when model[attr] is value + + countAllBy: (attr, value) -> + i = 0 + i += 1 for model in @models when model[attr] is value + i diff --git a/assets/javascripts/templates/sidebar_tmpl.coffee b/assets/javascripts/templates/sidebar_tmpl.coffee index bb5dc623..a1a4c3ca 100644 --- a/assets/javascripts/templates/sidebar_tmpl.coffee +++ b/assets/javascripts/templates/sidebar_tmpl.coffee @@ -10,7 +10,7 @@ templates.sidebarDoc = (doc, options = {}) -> link += """""" link += """#{doc.release}""" if doc.release link += """#{doc.name}""" - link += " #{doc.version}" if options.disabled and doc.version + link += " #{doc.version}" if options.fullName or options.disabled and doc.version link + "" templates.sidebarType = (type) -> diff --git a/assets/javascripts/views/sidebar/doc_list.coffee b/assets/javascripts/views/sidebar/doc_list.coffee index c59be416..d9823a10 100644 --- a/assets/javascripts/views/sidebar/doc_list.coffee +++ b/assets/javascripts/views/sidebar/doc_list.coffee @@ -37,7 +37,10 @@ class app.views.DocList extends app.View return render: => - @html @tmpl('sidebarDoc', app.docs.all()) + html = '' + for doc in app.docs.all() + html += @tmpl('sidebarDoc', doc, fullName: app.docs.countAllBy('name', doc.name) > 1) + @html html @renderDisabled() unless app.isSingleDoc() or app.disabledDocs.size() is 0 return