From 23ee74977bf59569aa1015f1c40bb6c106c6bdb2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 3 Mar 2016 20:26:28 +0200 Subject: [PATCH] Add settings section dummy pages. --- src/uxbox/router.cljs | 6 +++++- src/uxbox/ui.cljs | 5 ++++- src/uxbox/ui/dashboard.cljs | 33 ------------------------------ src/uxbox/ui/users.cljs | 40 ++++++++++++++++++------------------- 4 files changed, 28 insertions(+), 56 deletions(-) diff --git a/src/uxbox/router.cljs b/src/uxbox/router.cljs index d7fc22eaa8..5c3c79844f 100644 --- a/src/uxbox/router.cljs +++ b/src/uxbox/router.cljs @@ -60,9 +60,13 @@ ["/" [["auth/login" :auth/login] ["auth/register" :auth/register] ["auth/recover" :auth/recover-password] + + ["settings/" [["profile" :settings/profile] + ["password" :settings/password] + ["notifications" :settings/notifications]]] + ["dashboard/" [["projects" :dashboard/projects] ["elements" :dashboard/elements] - ["user-settings" :dashboard/user-settings] ["icons" :dashboard/icons] ["colors" :dashboard/colors]]] ["workspace/" [[page-route :workspace/page]]]]]) diff --git a/src/uxbox/ui.cljs b/src/uxbox/ui.cljs index 17a6449032..abd5093901 100644 --- a/src/uxbox/ui.cljs +++ b/src/uxbox/ui.cljs @@ -18,6 +18,7 @@ [uxbox.ui.lightbox :as ui-lightbox] [uxbox.ui.auth :as ui-auth] [uxbox.ui.dashboard :as ui-dashboard] + [uxbox.ui.settings :as ui-settings] [uxbox.ui.workspace :refer (workspace)] [uxbox.ui.mixins :as mx] [uxbox.ui.shapes])) @@ -46,7 +47,9 @@ :dashboard/elements (ui-dashboard/elements-page) :dashboard/icons (ui-dashboard/icons-page) :dashboard/colors (ui-dashboard/colors-page) - :dashboard/user-settings (ui-dashboard/user-settings-page) + :settings/profile (ui-settings/profile-page) + :settings/password (ui-settings/password-page) + :settings/notifications (ui-settings/notifications-page) :workspace/page (let [projectid (:project-uuid params) pageid (:page-uuid params)] (workspace projectid pageid)) diff --git a/src/uxbox/ui/dashboard.cljs b/src/uxbox/ui/dashboard.cljs index 517bb6ca58..eec1e09532 100644 --- a/src/uxbox/ui/dashboard.cljs +++ b/src/uxbox/ui/dashboard.cljs @@ -139,36 +139,3 @@ :transfer-state colors-page-transfer-state :name "colors" :mixins [mx/static]})) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Page: User settings -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defn user-settings-page-render - [own] - (html - [:main.dashboard-main - (header) - [:section.dashboard-content - (ui.library-bar/library-bar) - [:section.dashboard-grid.library - (elements/page-title) - (elements/grid)]]])) - -(defn user-settings-page-will-mount - [own] - (rs/emit! (dd/initialize :dashboard/user-settings)) - own) - -(defn user-settings-page-transfer-state - [old-state state] - (rs/emit! (dd/initialize :dashboard/user-settings)) - state) - -(def ^:static user-settings-page - (mx/component - {:render user-settings-page-render - :will-mount user-settings-page-will-mount - :transfer-state user-settings-page-transfer-state - :name "user-settings-page" - :mixins [mx/static]})) diff --git a/src/uxbox/ui/users.cljs b/src/uxbox/ui/users.cljs index 5567ac77c5..be214a5a0a 100644 --- a/src/uxbox/ui/users.cljs +++ b/src/uxbox/ui/users.cljs @@ -17,27 +17,25 @@ (defn menu-render [own open?] - (let [open-settings-dialog #(lightbox/open! :settings) - ;;open-user-settings #(dashboard/user-settings-page/open! :user-settings) - ] - (html - [:ul.dropdown {:class (when-not open? - "hide")} - [:li - i/page - [:span "Page settings"]] - [:li - i/grid - [:span {:on-click open-settings-dialog} "Grid settings"]] - [:li - i/eye - [:span "Preview"]] - [:li - i/user - [:span "Your account"]] - [:li {:on-click #(rs/emit! (da/logout))} - i/exit - [:span "Exit"]]]))) + (let [open-settings-dialog #(lightbox/open! :settings)] + (html + [:ul.dropdown {:class (when-not open? + "hide")} + [:li + i/page + [:span "Page settings"]] + [:li {:on-click open-settings-dialog} + i/grid + [:span "Grid settings"]] + [:li + i/eye + [:span "Preview"]] + [:li {:on-click #(r/go :settings/profile)} + i/user + [:span "Your account"]] + [:li {:on-click #(rs/emit! (da/logout))} + i/exit + [:span "Exit"]]]))) (def user-menu (mx/component