From eaf19cc8c9be6e53c0ae7a1fba48a947c41d2ee6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 19 Feb 2014 15:10:18 -0400 Subject: add tip about metadata driven views (and more flexible view filtering) While writing this documentation, I realized that there needed to be a way to stay in a view like tag=* while adding a filter like tag=work that applies to the same field. So, there are really two ways a view can be refined. It can have a new "field=explicitvalue" filter added to it, which does not change the "shape" of the view, but narrows the files it shows. Or, it can have a new view added, which adds another level of subdirectories. So, added a vfilter command, which takes explicit values to add to the filter, and rejects changes that would change the shape of the view. And, made vadd only accept changes that change the shape of the view. And, changed the View data type slightly; now components that can match multiple metadata values can be visible, or not visible. This commit was sponsored by Stelian Iancu. --- Logs/View.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Logs') diff --git a/Logs/View.hs b/Logs/View.hs index 2a26cfa17..15d472bc6 100644 --- a/Logs/View.hs +++ b/Logs/View.hs @@ -71,9 +71,9 @@ branchView view where name = intercalate ";" $ map branchcomp (viewComponents view) branchcomp c - | multiValue (viewFilter c) = branchcomp' c + | viewVisible c = branchcomp' c | otherwise = "(" ++ branchcomp' c ++ ")" - branchcomp' (ViewComponent metafield viewfilter) + branchcomp' (ViewComponent metafield viewfilter _) | metafield == tagMetaField = branchvals viewfilter | otherwise = concat [ forcelegal (fromMetaField metafield) -- cgit v1.2.3