Enhanced searchbar

This commit is contained in:
Dominik Süß 2016-10-21 19:03:30 +02:00 committed by Simon Michael
parent 4b6ad55cd8
commit 7d6887898a
2 changed files with 21 additions and 8 deletions

View File

@ -44,11 +44,13 @@ hledgerLayout vd title content = do
-- | Global toolbar/heading area. -- | Global toolbar/heading area.
topbar :: ViewData -> HtmlUrl AppRoute topbar :: ViewData -> HtmlUrl AppRoute
topbar VD{..} = [hamlet| topbar VD{..} = [hamlet|
<div#spacer .col-md-4 .col-sm-2 .col-xs-2> <div#spacer .col-md-4 .col-sm-4 .col-xs-2>
<p .visible-xs .visible-sm> <h1>
<button .btn .btn-default type="button" data-toggle="offcanvas"><span class="glyphicon glyphicon-align-left"> <button .visible-xs .btn .btn-default type="button" data-toggle="offcanvas">
<div#topbar .col-md-8 .col-sm-10 .col-xs-10> <span .glyphicon .glyphicon-align-left .tgl-icon>
<div#topbar .col-md-8 .col-sm-8 .col-xs-10>
<h1>#{title} <h1>#{title}
|] |]
where where
title = takeFileName $ journalFilePath j title = takeFileName $ journalFilePath j
@ -92,10 +94,13 @@ searchform :: ViewData -> HtmlUrl AppRoute
searchform VD{..} = [hamlet| searchform VD{..} = [hamlet|
<div#searchformdiv .row> <div#searchformdiv .row>
<form#searchform .form-inline method=GET> <form#searchform .form-inline method=GET>
<div .form-group .col-md-12> <div .form-group .col-md-12 .col-sm-12 .col-xs-12>
<input .form-control name=q value=#{q} title="Enter hledger search patterns to filter the data below" placeholder="Search"> <div #searchbar .input-group>
<button .btn .btn-default type=submit title="Apply search terms">Search <input .form-control name=q value=#{q} title="Enter hledger search patterns to filter the data below" placeholder="Search">
<button .btn .btn-default type=button data-toggle="modal" data-target="#helpmodal" title="Show search and general help">? <div .input-group-btn>
<button .btn .btn-default type=submit title="Apply search terms">
<span .glyphicon .glyphicon-search>
<button .btn .btn-default type=button data-toggle="modal" data-target="#helpmodal" title="Show search and general help">?
|] |]
where where
filtering = not $ null q filtering = not $ null q

View File

@ -178,6 +178,14 @@ ul {
float: left; float: left;
} }
.tgl-icon {
font-size:large;
}
#searchbar {
width: 100% !important;
}
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.row-offcanvas { .row-offcanvas {
position: relative; position: relative;