From 098d38e079377a0d48e109f24947475d29220506 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 15 Mar 2016 22:25:45 +0200 Subject: [PATCH] Use strings for layout ids instead keywords. --- src/uxbox/data/projects.cljs | 6 ++-- src/uxbox/ui/dashboard/projects.cljs | 39 ++++++++++++--------- src/uxbox/ui/workspace/sidebar/sitemap.cljs | 8 ++--- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/uxbox/data/projects.cljs b/src/uxbox/data/projects.cljs index e75b29885..2187f9ff2 100644 --- a/src/uxbox/data/projects.cljs +++ b/src/uxbox/data/projects.cljs @@ -28,11 +28,11 @@ {:name [sc/required sc/string] :width [sc/required sc/integer] :height [sc/required sc/integer] - :layout [sc/keyword]}) + :layout [sc/required sc/string]}) (def ^:static +create-page-schema+ {:name [sc/required sc/string] - :layout [sc/keyword] + :layout [sc/required sc/string] :width [sc/required sc/integer] :height [sc/required sc/integer] :project [sc/required sc/uuid]}) @@ -41,7 +41,7 @@ {:name [sc/required sc/string] :width [sc/required sc/integer] :height [sc/required sc/integer] - :layout [sc/keyword]}) + :layout [sc/required sc/string]}) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Helpers diff --git a/src/uxbox/ui/dashboard/projects.cljs b/src/uxbox/ui/dashboard/projects.cljs index df1f6684c..c4d14b87e 100644 --- a/src/uxbox/ui/dashboard/projects.cljs +++ b/src/uxbox/ui/dashboard/projects.cljs @@ -32,28 +32,33 @@ (def +ordering-options+ {:name "ds.project-ordering.by-name" :created "ds.project-ordering.by-creation-date"}) -(def +layouts+ {:mobile {:name "Mobile" - :id "mobile" - :width 320 - :height 480} - :tablet {:name "Tablet" - :id "tablet" - :width 1024 - :height 768} - :notebook {:name "Notebook" - :id "notebook" - :width 1366 - :height 768} - :desktop {:name "Desktop" - :id "desktop" - :width 1920 - :height 1080}}) +(def +layouts+ + {"mobile" + {:name "Mobile" + :id "mobile" + :width 320 + :height 480} + "tablet" + {:name "Tablet" + :id "tablet" + :width 1024 + :height 768} + "notebook" + {:name "Notebook" + :id "notebook" + :width 1366 + :height 768} + "desktop" + {:name "Desktop" + :id "desktop" + :width 1920 + :height 1080}}) (def ^:static ^:private +project-defaults+ {:name "" :width 1920 :height 1080 - :layout :desktop}) + :layout "desktop"}) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Top Menu diff --git a/src/uxbox/ui/workspace/sidebar/sitemap.cljs b/src/uxbox/ui/workspace/sidebar/sitemap.cljs index dfd526996..9df0a03a1 100644 --- a/src/uxbox/ui/workspace/sidebar/sitemap.cljs +++ b/src/uxbox/ui/workspace/sidebar/sitemap.cljs @@ -167,10 +167,10 @@ :on-change #(update-size :height %)}]] [:div.input-radio.radio-primary - (layout-input local page :mobile) - (layout-input local page :tablet) - (layout-input local page :notebook) - (layout-input local page :desktop)] + (layout-input local page "mobile") + (layout-input local page "tablet") + (layout-input local page "notebook") + (layout-input local page "desktop")] (when valid? [:input#project-btn.btn-primary