(use-modules (alterator configd html)
             (alterator configd form))

(lambda (self objects options)
  (let ((url (string-append "/" (string-join objects "/")))
        (url-args (cond-plistq 'url-args options))
        (template-args (cond-plistq 'template-args options))
        (action (cond-plistq 'action options)))
    (list
     'scm
     (woo-catch
      (thunk (if (cond-assoc "add" url-args)
                 (html:redirect "/xkb/avail_layout")
                 (workflow-form url action url-args template-args)))
      (lambda(reason)
        (html:error (workflow-form url "read" url-args template-args) reason))))))
