Skip to content

Commit

Permalink
refactor(search): Refactor search templates
Browse files Browse the repository at this point in the history
* refactor main search button into include template
* delete obsolete wrapping containers and restructure markup there
* reformat code for a cleaner view
  • Loading branch information
plutonik-a committed Nov 24, 2017
1 parent 432c36f commit 4e8ea4d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 44 deletions.
6 changes: 6 additions & 0 deletions pages/search/_filter-date.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,11 @@ <h3 class="hsg-sidebar-title-second-level">To</h3>
</fieldset>
</div>
</div>

<button class="hsg-sidebar-reset-btn" name="reset-filters" type="reset" value="reset_filters">
<span class="glyphicon glyphicon-remove" aria-hidden="true"/>
Reset Date
</button>

</form>
</section>
28 changes: 13 additions & 15 deletions pages/search/_search-bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
<div class="row">
<div class="hsg-width-one-whole" data-template="app:fix-links">
<h1>Search</h1>
<section class="hsg-search-section" role="search">
<p>Read these <a href="$app/search/tips">tips and caveats</a> to understand the
limitations of this search engine and how to make the most of its scope,
phrase, boolean, wildcard, and proximity options.
<p>Read these <a href="$app/search/tips">tips and caveats</a> to understand the
limitations of this search engine and how to make the most of its scope,
phrase, boolean, wildcard, and proximity options.
</p>
<form method="get" action="$app/search" class="main-form" id="searchForm">
<p class="form-group searchbox">
<label for="q" class="sr-only">Search</label>
<input type="search" name="q" class="form-control" id="q" data-template="templates:form-control"/>
<button type="submit" class="hsg-link-button search-button btn">
<span class="hsg-search-submit-text">Search</span>
<i class="hsg-search-icon"></i>
</button>
</p>
<form method="get" action="$app/search" class="main-form" id="searchForm">
<p class="form-group searchbox">
<label for="q" class="sr-only">Search</label>
<input type="search" name="q" class="form-control" id="q" data-template="templates:form-control"/>
<button type="submit" class="hsg-link-button search-button btn">
<span class="hsg-search-submit-text">Search</span>
<i class="hsg-search-icon"></i>
</button>
</p>
</form>
</section>
</form>
</div>
</div>
6 changes: 6 additions & 0 deletions pages/search/_submit-search-button.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form method="get" action="?" class="main-form">
<button class="hsg-link-button hsg-main-search-button" type="submit" value="Search">
<span class="glyphicon glyphicon-search" aria-hidden="true"/>Search
</button>
</form>
33 changes: 15 additions & 18 deletions pages/search/search-landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
<div data-template="templates:surround" data-template-with="templates/site.html"
data-template-at="content">
<div id="static-title" class="hidden">Search</div>

<div class="row">
<div class="hsg-breadcrumb-wrapper">
<ol class="breadcrumb" data-template="app:fix-links">
<li>
<a href="$app">Home</a>
</li>
<li>
<a href="$app/search">Search</a>
</li>
<li><a href="$app">Home</a></li>
<li><a href="$app/search">Search</a></li>
</ol>
</div>
</div>
Expand All @@ -19,22 +16,22 @@

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

<div class="row">
<div class="hsg-width-one-whole" data-template="app:fix-links">
<p>To limit your results to certain parts of the website, check the appropriate box(es), and then click “Search”:</p>
<div data-template="templates:include" data-template-path="pages/search/_filter-sections.html"/>
</div>
</div>

<div class="row">
<div class="hsg-width-one-whole">
<div id="content-inner" data-template="app:fix-links">
<section class="hsg-search-section" role="search">
<p>To limit your results to certain parts of the website, check the appropriate box(es), and then click “Search”:</p>

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

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

<button class="hsg-link-button hsg-main-search-button" type="submit" value="Search">
<span class="glyphicon glyphicon-search" aria-hidden="true"/>Search
</button>
</section>
</div>
<div class="row">
<div class="hsg-width-one-whole">
<div data-template="templates:include" data-template-path="pages/search/_submit-search-button.html"/>
</div>
</div>
</div>
16 changes: 5 additions & 11 deletions pages/search/search-result.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<div data-template="templates:surround" data-template-with="templates/site.html" data-template-at="content">
<div id="static-title" class="hidden">Search</div>

<div class="row">
<div class="hsg-breadcrumb-wrapper">
<ol class="breadcrumb" data-template="app:fix-links">
<li>
<a href="$app">Home</a>
</li>
<li>
<a href="$app/search">Search</a>
</li>
<li><a href="$app">Home</a></li>
<li><a href="$app/search">Search</a></li>
</ol>
</div>
</div>
Expand Down Expand Up @@ -97,11 +94,8 @@ <h3 class="hsg-search-result-heading">
</div>
</div>

<form method="get" action="?" class="main-form">
<button class="hsg-link-button hsg-main-search-button" type="submit" value="Search">
<span class="glyphicon glyphicon-search" aria-hidden="true"/>Search
</button>
</form>
<div data-template="templates:include" data-template-path="pages/search/_submit-search-button.html"/>

</section>
</div>
</div>
Expand Down

0 comments on commit 4e8ea4d

Please sign in to comment.