Skip to content

Commit

Permalink
scaffold workspace-save button/handler
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jun 6, 2016
1 parent c42868d commit 1fadae1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
6 changes: 6 additions & 0 deletions src/cljs/ulysses/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@

;; workspace management ----

(register-handler
:workspace-save
(fn [db _]
; TODO
db))

;; NOTE most of the code in this section interfaces with
;; db :workspaces -- eventually, all five handlers
;; should really just be plain http requests so that
Expand Down
34 changes: 22 additions & 12 deletions src/cljs/ulysses/pages/builder.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -174,24 +174,34 @@
[text-input
:placeholder "Name"
:value new-name]]}]))
(classes-attr :btn :btn-sm :btn-default)
(classes-attr :btn :btn-sm :btn-info)
"Rename"])))

(defn workspace-save []
[hink
(partial dispatch [:workspace-save])
(classes-attr :btn :btn-sm :btn-primary)
"Save"])

(defn workspace-delete [workspace-current]
[hink
(fn []
(dispatch
[:modal
{:title [:span "Delete Workspace " [:i (:name workspace-current)]]
:action-label "Delete"
:action-brand :danger
:on-action #(dispatch [:workspace-delete])
:children "Are you sure you want to delete this workspace?"}]))
(classes-attr :btn :btn-sm :btn-danger)
"Delete"])

(defn workspace-footer [workspace-current]
(when workspace-current
[:div.workspace-footer
[workspace-rename workspace-current]
[hink
(fn []
(dispatch
[:modal
{:title [:span "Delete Workspace " [:i (:name workspace-current)]]
:action-label "Delete"
:action-brand :danger
:on-action #(dispatch [:workspace-delete])
:children "Are you sure you want to delete this workspace?"}]))
(classes-attr :btn :btn-sm :btn-danger)
"Delete"]]))
[workspace-delete workspace-current]
[workspace-save]]))

(defn pool-row [fam]
(let [{:keys [faculty fundingCoverageScore]} fam
Expand Down

0 comments on commit 1fadae1

Please sign in to comment.