Skip to content

Commit

Permalink
feat(search): Create "sort-by" template #290
Browse files Browse the repository at this point in the history
* refactor former template _filter-querystring.html together with new
include _sort-by-button.html into a wrapping template _filter-row.html,
because both includes needed to be placed into the same row
* rename inludes in calling page templates
  • Loading branch information
plutonik-a committed Nov 28, 2017
1 parent 3000ad7 commit 3a946b7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 20 deletions.
34 changes: 16 additions & 18 deletions pages/search/_filter-querystring.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<div class="row">
<div class="hsg-width-one-whole">
<div class="hsg-search-inputs-horizontal">
<form class="filter-form" id="queryFilters" action="?">
<div class="hsg-search-input">
<input id="exactPhrase" type="checkbox" name="match" value="exact_phrase" />
<label for="exactPhrase" class="c-indicator">Exact Phrase</label>
</div>
<div class="hsg-search-input">
<input id="caseSensitive" type="checkbox" name="match" value="case_sensitive" />
<label for="caseSensitive" class="c-indicator">Case Sensitive</label>
</div>
<div class="hsg-search-input">
<input id="punctuationSensitive" type="checkbox" name="match" value="punctuation_sensitive" />
<label for="punctuationSensitive" class="c-indicator">Punctuation Sensitive</label>
</div>
</form>
</div>
<div class="hsg-width-two-thirds">
<div class="hsg-search-inputs-horizontal">
<form class="filter-form" id="queryFilters" action="?">
<div class="hsg-search-input">
<input id="exactPhrase" type="checkbox" name="match" value="exact_phrase" />
<label for="exactPhrase" class="c-indicator">Exact Phrase</label>
</div>
<div class="hsg-search-input">
<input id="caseSensitive" type="checkbox" name="match" value="case_sensitive" />
<label for="caseSensitive" class="c-indicator">Case Sensitive</label>
</div>
<div class="hsg-search-input">
<input id="punctuationSensitive" type="checkbox" name="match" value="punctuation_sensitive" />
<label for="punctuationSensitive" class="c-indicator">Punctuation Sensitive</label>
</div>
</form>
</div>
</div>
5 changes: 5 additions & 0 deletions pages/search/_filter-row.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<div class="row">
<div data-template="templates:include" data-template-path="pages/search/_filter-querystring.html"/>
<div data-template="templates:include" data-template-path="pages/search/_sort-by-button.html"/>
</div>
28 changes: 28 additions & 0 deletions pages/search/_sort-by-button.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<div class="hsg-width-one-third">
<div class="pull-right">
<form class="sorting">
<div class="form-group">
<p class="form-control-static">Sort by:</p>
</div>
<div class="btn-group">
<button type="button" class="hsg-sort-button dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="">
<span data-template="search:sort-by-value"/>
<i class="glyphicon glyphicon-chevron-down"/>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li>
<a href="#" name="sort-by" id="relevance" data-template="search:sort-by">Relevance</a>
</li>
<li>
<a href="#" name="sort-by" id="date_asc" data-template="search:sort-by">Dates (oldest first)</a>
</li>
<li>
<a href="#" name="sort-by" id="date_desc" data-template="search:sort-by">Dates (most recent first)</a>
</li>
</ul>
</div>
<input type="hidden" name="sorting" value="date_desc"/>
</form>
</div>
</div>
2 changes: 1 addition & 1 deletion pages/search/search-landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div data-template="templates:include" data-template-path="pages/search/_search-bar.html"/>

<div data-template="templates:include" data-template-path="pages/search/_filter-querystring.html"/>
<div data-template="templates:include" data-template-path="pages/search/_filter-row.html"/>

<div class="row" data-template="search:filters">
<div class="hsg-width-one-whole" data-template="app:fix-links">
Expand Down
2 changes: 1 addition & 1 deletion pages/search/search-result.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div data-template="templates:include" data-template-path="pages/search/_search-bar.html"/>

<div data-template="templates:include" data-template-path="pages/search/_filter-querystring.html" class="hsg-search-results"/>
<div data-template="templates:include" data-template-path="pages/search/_filter-row.html" class="hsg-search-results"/>

<div class="row hsg-search-results" data-template="search:filters">
<!-- filter sidebar -->
Expand Down

0 comments on commit 3a946b7

Please sign in to comment.