Commit a5437c5c authored by Dave Griffiths's avatar Dave Griffiths
Browse files

split the chooser by household (and filtered by current village)

parent 5ad51470
......@@ -423,13 +423,7 @@
(inexact->exact (round (* 256 0.9)))))
(define (update-individual-filter)
(let ((search (db-filter-only db "sync" "individual" (filter-get)
(list "photo" "file")
(list "name" "varchar")))))
'linear-layout (get-id "choose-pics") 'contents
(define (build-photo-buttons search)
(lambda (e)
......@@ -465,7 +459,34 @@
(text-view 0 (ktv-get e "name") 20 (layout 'wrap-content 'wrap-content -1 'centre 0)))
(define (update-individual-filter-inner households)
(lambda (household)
(let ((search (db-filter-only db "sync" "individual"
(append (filter-get)
(list (list "parent" "varchar" "="
(ktv-get household "unique_id"))))
(list "photo" "file")
(list "name" "varchar")))))
(apply vert
(cons (text-view 0 (ktv-get household "name") 20 fillwrap)
(build-photo-buttons search)))
(define (update-individual-filter)
(msg "update if")
(let ((households (db-filter-only db "sync" "household"
(list (list "parent" "varchar" "=" (get-setting-value "current-village")))
(list (list "name" "varchar")))))
(msg households)
'linear-layout (get-id "choose-pics") 'contents
(update-individual-filter-inner households))))
(define (image/name-from-unique-id db table unique-id)
(let ((e (get-entity-by-unique db table unique-id)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment