Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[2375] Add suggestions when a search returns no results

  • Loading branch information...
commit a76d69015d9d14bd908f1a459d12eb9b37810ef2 1 parent 9dbaef2
@aron aron authored
View
7 ckan/public/base/less/dataset.less
@@ -51,6 +51,13 @@
color: #000;
}
+.filter-list .extra {
+ margin-top: 10px;
+ font-size: 18px;
+ font-weight: normal;
+ color: #000;
+}
+
.search-giant {
position: relative;
}
View
8 ckan/templates/package/search.html
@@ -29,7 +29,8 @@
</form>
<div class="filter-list">
<strong py:choose="" class="results">
- <py:when test="request.params">${c.page.item_count} datasets<py:if test="c.q"> found for &#147;${c.q}&#148;</py:if></py:when>
+ <py:when test="request.params and c.page.item_count">${c.page.item_count} datasets<py:if test="c.q"> found for &#147;${c.q}&#148;</py:if></py:when>
+ <py:when test="request.params and c.page.item_count == 0">Sorry no datasets found for &#147;${c.q}&#148;</py:when>
<py:otherwise>All datasets</py:otherwise>
</strong>
<py:for each="(field, value) in c.fields">
@@ -42,14 +43,13 @@
<a href="${c.remove_field(field, value)}" class="remove icon-remove icon-white">[remove]</a>
</span>
</py:for>
+ <p class="extra" py:if="request.params and c.page.item_count == 0">Try another search term,
+ browse the datasets below or <a href="${h.url_for(action='new', id=None)}">add your own data</a>.</p>
</div>
<py:if test="c.query_error">
<p i18n:msg="item_count"><strong>There was an error while searching.</strong>
Please try again.</p>
</py:if>
- <py:if test="c.page.item_count == 0 and request.params">
- <p i18n:msg="">Would you like to <a href="${h.url_for(action='new', id=None)}">create a new dataset?</a></p>
- </py:if>
${h.snippet('snippets/package_list.html', packages=c.page.items)}
</div>
${c.page.pager(q=c.q)}
Please sign in to comment.
Something went wrong with that request. Please try again.