Skip to content
Snippets Groups Projects
Commit a03926e0 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#274 - added macros

parent 0d91637c
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@
<@navbar.navbar "home" settings/>
<#import "../transactions/transactionsMacros.ftl" as transactionsMacros>
<#import "searchMacros.ftl" as searchMacros>
<main>
<div class="card main-card background-color">
......@@ -22,62 +23,9 @@
</div>
<form name="NewSearch" action="<@s.url '/search'/>" method="post">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="row no-margin-bottom valign-wrapper">
<div class="col s10 m7 offset-m1 l6 offset-l2">
<div class="input-field">
<input id="searchText" type="text" name="searchText" value="${search.getSearchText()}">
<label for="searchText">${locale.getString("search")}</label>
</div>
</div>
<div class="col s2 m3 l4">
<div class="hide-on-small-only">
<button class="btn waves-effect waves-light budgetmaster-blue" type="submit" name="action">
<i class="material-icons left">search</i>${locale.getString("search.submit")}
</button>
</div>
<div class="hide-on-med-and-up">
<button class="btn waves-effect waves-light budgetmaster-blue" type="submit" name="action">
<i class="material-icons">search</i>
</button>
</div>
</div>
</div>
<div class="row">
<div class="col s8 offset-s2 m4 offset-m2 l3 offset-l3">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchName" <#if search.isSearchName()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.name')}</span>
</label>
</div>
</div>
<div class="col s8 offset-s2 m6 l6">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchDescription" <#if search.isSearchDescription()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.description')}</span>
</label>
</div>
</div>
<div class="col s8 offset-s2 m4 offset-m2 l3 offset-l3">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchCategory" <#if search.isSearchCategory()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.category')}</span>
</label>
</div>
</div>
<div class="col s8 offset-s2 m6 l6">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchTags" <#if search.isSearchTags()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.tags')}</span>
</label>
</div>
</div>
</div>
<@searchMacros.searchTextAndButton search/>
<@searchMacros.checkboxes search/>
</form>
<div class="row search-container">
......
<#macro searchTextAndButton search>
<div class="row no-margin-bottom valign-wrapper">
<div class="col s10 m7 offset-m1 l6 offset-l2">
<div class="input-field">
<input id="searchText" type="text" name="searchText" value="${search.getSearchText()}">
<label for="searchText">${locale.getString("search")}</label>
</div>
</div>
<div class="col s2 m3 l4">
<div class="hide-on-small-only">
<button class="btn waves-effect waves-light budgetmaster-blue" type="submit" name="action">
<i class="material-icons left">search</i>${locale.getString("search.submit")}
</button>
</div>
<div class="hide-on-med-and-up">
<button class="btn waves-effect waves-light budgetmaster-blue" type="submit" name="action">
<i class="material-icons">search</i>
</button>
</div>
</div>
</div>
</#macro>
<#macro checkboxes search>
<div class="row">
<div class="col s8 offset-s2 m4 offset-m2 l3 offset-l3">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchName" <#if search.isSearchName()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.name')}</span>
</label>
</div>
</div>
<div class="col s8 offset-s2 m6 l6">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchDescription" <#if search.isSearchDescription()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.description')}</span>
</label>
</div>
</div>
<div class="col s8 offset-s2 m4 offset-m2 l3 offset-l3">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchCategory" <#if search.isSearchCategory()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.category')}</span>
</label>
</div>
</div>
<div class="col s8 offset-s2 m6 l6">
<div class="search-checkbox-container">
<label>
<input type="checkbox" name="searchTags" <#if search.isSearchTags()>checked="checked"</#if>>
<span class="text-color">${locale.getString('search.in.tags')}</span>
</label>
</div>
</div>
</div>
</#macro>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment