Add note about docs and search

This commit is contained in:
Thibaut 2015-02-08 09:53:10 -05:00
parent 5066259cdc
commit 2696402458
3 changed files with 19 additions and 14 deletions

View file

@ -18,10 +18,11 @@ templates.sidebarResult = (entry) ->
"""<a href="#{entry.fullPath()}" class="_list-item _list-hover _list-result _icon-#{entry.doc.slug}"><span class="_list-reveal" data-reset-list title="Reveal in list"></span>#{$.escape entry.name}</a>"""
templates.sidebarNoResults = ->
info = if app.isSingleDoc() or app.disabledDocs.isEmpty() then '' else """
<span class="_list-noresults-note">Note: documentations must be <a class="_list-noresults-link" data-pick-docs>enabled</a> to appear in the search.</span>
"""
""" <div class="_list-noresults">No results. #{info}</div> """
html = """ <div class="_list-note">No results.</div> """
html += """
<div class="_list-note">Note: documentations must be <a class="_list-note-link" data-pick-docs>enabled</a> to appear in the search.</div>
""" unless app.isSingleDoc() or app.disabledDocs.isEmpty()
html
templates.sidebarPageLink = (count) ->
"""<span class="_list-item _list-pagelink">Show more\u2026 (#{count})</span>"""
@ -39,7 +40,10 @@ templates.sidebarDisabledList = (options) ->
templates.sidebarDisabled = (options) ->
"""<h6 class="_list-title"><span class="_list-arrow"></span>Disabled (#{options.count})</h6>"""
templates.sidebarVote = '<a href="https://trello.com/b/6BmTulfx/devdocs-documentation" class="_list-link" target="_blank">Vote for new documentation</a>'
templates.sidebarPickerNote = """
<div class="_list-note">Tip: for faster and better search results, select only the docs you need.</div>
<a href="https://trello.com/b/6BmTulfx/devdocs-documentation" class="_list-link" target="_blank">Vote for new documentation</a>
"""
sidebarFooter = (html) -> """<div class="_sidebar-footer">#{html}</div>"""

View file

@ -28,7 +28,7 @@ class app.views.DocPicker extends app.View
render: ->
@html @tmpl('sidebarLabel', app.docs.all(), checked: true) +
@tmpl('sidebarLabel', app.disabledDocs.all()) +
@tmpl('sidebarVote') +
@tmpl('sidebarPickerNote') +
@tmpl('sidebarSave')
@refreshElements()

View file

@ -214,19 +214,20 @@
}
}
._list-noresults {
padding: .5rem .75rem;
//
// List note
//
._list-note {
margin: .5rem .75rem;
line-height: 1.25rem;
font-size: .8125rem;
color: $textColorLight;
& + & { margin-top: .25rem; }
}
._list-noresults-note {
display: block;
margin-top: .25rem;
}
._list-noresults-link { cursor: pointer; }
._list-note-link { cursor: pointer; }
//
// List hover clone