Make doc version shorter in search results

pull/421/merge
Thibaut Courouble 9 years ago
parent b78244fb53
commit d5b372e254

@ -7,6 +7,7 @@ class app.models.Doc extends app.Model
@slug_without_version = @slug.split('~')[0]
@fullName = "#{@name}" + if @version then " #{@version}" else ''
@icon = @slug_without_version
@short_version = @version.split(' ')[0] if @version
@text = @toEntry().text
reset: (data) ->

@ -24,7 +24,7 @@ templates.sidebarResult = (entry) ->
"""<span class="_list-enable" data-enable="#{entry.doc.slug}">Enable</span>"""
else
"""<span class="_list-reveal" data-reset-list title="Reveal in list"></span>"""
addons += """<span class="_list-count">#{entry.doc.version}</span>""" if entry.doc.version and not entry.isIndex()
addons += """<span class="_list-count">#{entry.doc.short_version}</span>""" if entry.doc.version and not entry.isIndex()
"""<a href="#{entry.fullPath()}" class="_list-item _list-hover _list-result _icon-#{entry.doc.icon}">#{addons}<span class="_list-text">#{$.escape entry.name}</span></a>"""
templates.sidebarNoResults = ->

Loading…
Cancel
Save