   (-> @stage :volatile :val-atom deref)
 
 
+
+
  )

                 [?p :created-at ?created-at]
                 [?p :expired ?expired]]]
    (mapv (partial zipmap [:id :domain :username :password :user-id :created-at :expired])
         (d/q query db))))




;; --- html templating ---

  [pw owner]
  {[:.pw-domain] (content (:domain pw))
   [:.pw-username] (content (:username pw))
   [:.pw-password] (content (apply str (repeat (count (:password pw)) "*")))
   [:.pw-created-at] (content (.toLocaleString (:created-at pw)))
   [:.pw-expired] (content (.toLocaleString (:expired pw)))})


(deftemplate passwords "templates/passwords.html"
  [app owner state]
  {[:#password-list] (content (map #(password % owner) (get-passwords app)))
   [:#pw-domain-input] (do-> (set-attr :value (:domain-input-text state))
                             (listen :on-change #(handle-text-change % owner :domain-input-text)))
   [:#pw-username-input] (do-> (set-attr :value (:username-input-text state))
                               (listen :on-change #(handle-text-change % owner :username-input-text)))
   [:#pw-password-input] (do-> (set-attr :value (:password-input-text state))
                               (listen :on-change #(handle-text-change % owner :password-input-text)))
   [:#modal-new-pw-btn] (listen :on-click #(do
                                             (add-password owner)
                                             (om/set-state! owner :domain-input-text "")
                                             (om/set-state! owner :username-input-text "")
                                             (om/set-state! owner :password-input-text "")))})


;; --- views ---

;; --- *hust* (start-all-services) *hust* ---

