Skip to content

Commit

Permalink
feat(search): Create component "refine search" #289
Browse files Browse the repository at this point in the history
* refactor class hsg-search-inputs for vertical and horizontal alignment
* extract checkboxes for refining search as include
„filter-querystring-include.html“
* add css to component
  • Loading branch information
plutonik-a committed Nov 14, 2017
1 parent 99adbc1 commit 8e50b55
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
32 changes: 30 additions & 2 deletions app/scss/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,48 @@ input[type=search] {
// Search results page

.hsg-search-section {
margin-bottom: 4rem;
.pagination {
margin: 0;
}
}

.hsg-search-inputs {
.hsg-search-inputs-vertical {
@extend .c-inputs-stacked;
margin: 2rem 0;
.hsg-search-input-label {
@extend .c-input;
}
}

.hsg-search-inputs-horizontal {
margin-bottom: 1em;

.hsg-search-input {
cursor: pointer;
display: inline-block;
margin-right: $margin-horizontal-base;
}

input[type="checkbox"] {
cursor: pointer;
margin: 0;
width: 12px;
height: 14px;
position: relative;
left: 0;
vertical-align: middle;
}

label{
width: auto;
margin: 0 0 0 5px;
position: relative;
left: 0;
display: inline-block;
vertical-align: middle;
}
}

.hsg-search-help {
margin: 0 0 2rem 0;
}
Expand Down
19 changes: 19 additions & 0 deletions pages/search/filter-querystring-include.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<div class="row">
<div class="hsg-width-one-whole" data-template="app:fix-links">
<div class="hsg-search-inputs-horizontal">
<div class="hsg-search-input">
<input id="exactPhrase" type="checkbox" name="" />
<label for="exactPhrase" class="c-indicator">Exact Phrase</label>
</div>
<div class="hsg-search-input">
<input id="caseSensitive" type="checkbox" name="" />
<label for="caseSensitive" class="c-indicator">Case Sensitive</label>
</div>
<div class="hsg-search-input">
<input id="punctuationSensitive" type="checkbox" name="" />
<label for="punctuationSensitive" class="c-indicator">Punctuation Sensitive</label>
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions pages/search/search-bar-include.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ <h1>Search</h1>
</button>
</p>

<!--
<button class="hsg-link-button" type="submit" value="Search">
<span class="glyphicon glyphicon-search" aria-hidden="true"/>Search
</button>
-->
</form>
</section>
</div>
Expand Down
6 changes: 4 additions & 2 deletions pages/search/search-landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

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

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

<div class="row">
<div class="hsg-width-one-whole">
<div id="content-inner" data-template="app:fix-links">
Expand All @@ -25,7 +27,7 @@
<div data-template="search:load-sections">
<p>To limit your results to certain parts of the website, check the
appropriate box(es), and then click “Search”:</p>
<div class="hsg-search-inputs">
<div class="hsg-search-inputs-vertical">
<label class="hsg-search-input-label" data-template="templates:each"
data-template-from="sections" data-template-to="section">
<input type="checkbox" name="within" data-template="search:section-checkbox-value-attribute-and-title"/>
Expand All @@ -37,7 +39,7 @@
data-template-param="volume-id">
<p>Restrict search to the following <em>Foreign Relations</em>
volume(s):</p>
<div class="hsg-search-inputs" data-template="templates:each"
<div class="hsg-search-inputs-vertical" data-template="templates:each"
data-template-from="volumes" data-template-to="volume">
<label class="hsg-search-input-label">
<input type="checkbox" name="volume-id" checked="checked" data-template="search:volume-checkbox-value-attribute-and-title"/>
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 @@ -18,7 +18,7 @@

<div class="row">
<nav class="hsg-width-one-third">
<div class="hsg-search-inputs">
<div class="hsg-search-inputs-vertical">
<label class="hsg-search-input-label" data-template="templates:each"
data-template-from="sections" data-template-to="section">
<input type="checkbox" name="within" data-template="search:section-checkbox-value-attribute-and-title"/>
Expand Down
2 changes: 1 addition & 1 deletion pages/search/select-volumes.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<section class="hsg-search-section">
<p class="hsg-search-help">Select <em>Foreign Relations</em> volumes for
full text search:</p>
<div class="hsg-search-inputs" data-template="search:select-volumes"/>
<div class="hsg-search-inputs-vertical" data-template="search:select-volumes"/>
<button class="hsg-link-button" type="submit" value="Search">
<span class="glyphicon glyphicon-search" aria-hidden="true"/>Search
</button>
Expand Down

0 comments on commit 8e50b55

Please sign in to comment.