From 05da80b71d8e05ebc362837e23eee9c0c6533ee2 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 15 Apr 2013 17:28:30 -0700 Subject: [PATCH 1/2] web: use full width for search box, update search help --- hledger-web/Handler/Common.hs | 33 +++++++++++++++++---------------- hledger-web/static/style.css | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/hledger-web/Handler/Common.hs b/hledger-web/Handler/Common.hs index fa562e94f..3f853f2e1 100644 --- a/hledger-web/Handler/Common.hs +++ b/hledger-web/Handler/Common.hs @@ -72,38 +72,39 @@ searchform :: ViewData -> HtmlUrl AppRoute searchform VD{..} = [hamlet| - +
- + -
- Search: - \ # - - + + + +
$if filtering \ # - clear search + clear \ # help
- + Leave blank to see journal (all transactions), or click account links to see transactions under that account.
- Transactions/postings may additionally be filtered by: -
+ Transactions/postings may additionally be filtered by acct:REGEXP (target account), # + code:REGEXP (transaction code), # desc:REGEXP (description), # date:PERIODEXP (date), # - edate:PERIODEXP (secondary date), # -
- status:BOOL (cleared status), # + date2:PERIODEXP (secondary date), # + tag:TAG[=REGEX] (tag and optionally tag value), # + depth:N (accounts at or above this depth), # + status:*, status:!, status: (cleared status), # real:BOOL (real/virtual-ness), # - empty:BOOL (posting amount = 0). + empty:BOOL (is amount zero), # + amt:N (test magnitude of single-commodity amount).
- not: to negate, enclose space-containing patterns in quotes, multiple filters are AND'ed. + Prepend not: to negate, enclose multi-word patterns in quotes, multiple search terms are AND'ed. |] where filtering = not $ null q diff --git a/hledger-web/static/style.css b/hledger-web/static/style.css index 7e672f4ec..fb63ab806 100644 --- a/hledger-web/static/style.css +++ b/hledger-web/static/style.css @@ -87,7 +87,7 @@ body { margin:0; } .navlinkcurrent { font-weight:bold; } .form { margin:0em; } -#searchformdiv { margin:0 0 1em 0; white-space:nowrap; } +#searchformdiv { margin:0 0 1em 0; } #searchform { margin:0; } #searchform span { padding:4px; } #stopfilterlink { font-weight:bold; } From f17a93ec272b7c3d45aa23c51497207f98460a77 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 15 Apr 2013 17:29:32 -0700 Subject: [PATCH 2/2] docs: update query docs to match hledger-web search help --- MANUAL.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/MANUAL.md b/MANUAL.md index 214e6763e..a59715393 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -872,14 +872,16 @@ the following: - `REGEX` - match account names by this regular expression - `acct:REGEX` - same as above -- `amt:N` - match postings with a single-commodity amount less than, greater than or equal to N. (Multi-commodity amounts are always matched.) - `code:REGEX` - match by transaction code (eg check number) - `desc:REGEX` - match transaction descriptions by regular expression - `date:PERIODEXPR` - match dates within the specified [period](#period-expressions) -- `edate:PERIODEXPR` - as above, but match secondary dates -- `status:1` or `status:0` - match cleared/uncleared transactions +- `date2:PERIODEXPR` - as above, but match secondary dates - `tag:NAME[=REGEX]` - match by (exact, case sensitive) [tag](#tags) name, and optionally match the tag value by regular expression - `depth:N` - match (or display, depending on command) accounts at or above this [depth](#depth-limiting) +- `status:1` or `status:0` - match cleared/uncleared transactions +- `real:1` or `real:0` - match real/virtual-ness +- `empty:1` or `empty:0` - match if amount is/is not zero +- `amt:N` - match postings with a single-commodity amount less than, greater than or equal to N. (Multi-commodity amounts are always matched.) - `not:` before any of the above negates the match