0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 08:29:42 -05:00

Use strings for layout ids instead keywords.

This commit is contained in:
Andrey Antukh 2016-03-15 22:25:45 +02:00
parent a522682ee4
commit 098d38e079
3 changed files with 29 additions and 24 deletions

View file

@ -28,11 +28,11 @@
{:name [sc/required sc/string] {:name [sc/required sc/string]
:width [sc/required sc/integer] :width [sc/required sc/integer]
:height [sc/required sc/integer] :height [sc/required sc/integer]
:layout [sc/keyword]}) :layout [sc/required sc/string]})
(def ^:static +create-page-schema+ (def ^:static +create-page-schema+
{:name [sc/required sc/string] {:name [sc/required sc/string]
:layout [sc/keyword] :layout [sc/required sc/string]
:width [sc/required sc/integer] :width [sc/required sc/integer]
:height [sc/required sc/integer] :height [sc/required sc/integer]
:project [sc/required sc/uuid]}) :project [sc/required sc/uuid]})
@ -41,7 +41,7 @@
{:name [sc/required sc/string] {:name [sc/required sc/string]
:width [sc/required sc/integer] :width [sc/required sc/integer]
:height [sc/required sc/integer] :height [sc/required sc/integer]
:layout [sc/keyword]}) :layout [sc/required sc/string]})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Helpers ;; Helpers

View file

@ -32,28 +32,33 @@
(def +ordering-options+ {:name "ds.project-ordering.by-name" (def +ordering-options+ {:name "ds.project-ordering.by-name"
:created "ds.project-ordering.by-creation-date"}) :created "ds.project-ordering.by-creation-date"})
(def +layouts+ {:mobile {:name "Mobile" (def +layouts+
:id "mobile" {"mobile"
:width 320 {:name "Mobile"
:height 480} :id "mobile"
:tablet {:name "Tablet" :width 320
:id "tablet" :height 480}
:width 1024 "tablet"
:height 768} {:name "Tablet"
:notebook {:name "Notebook" :id "tablet"
:id "notebook" :width 1024
:width 1366 :height 768}
:height 768} "notebook"
:desktop {:name "Desktop" {:name "Notebook"
:id "desktop" :id "notebook"
:width 1920 :width 1366
:height 1080}}) :height 768}
"desktop"
{:name "Desktop"
:id "desktop"
:width 1920
:height 1080}})
(def ^:static ^:private (def ^:static ^:private
+project-defaults+ {:name "" +project-defaults+ {:name ""
:width 1920 :width 1920
:height 1080 :height 1080
:layout :desktop}) :layout "desktop"})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Top Menu ;; Top Menu

View file

@ -167,10 +167,10 @@
:on-change #(update-size :height %)}]] :on-change #(update-size :height %)}]]
[:div.input-radio.radio-primary [:div.input-radio.radio-primary
(layout-input local page :mobile) (layout-input local page "mobile")
(layout-input local page :tablet) (layout-input local page "tablet")
(layout-input local page :notebook) (layout-input local page "notebook")
(layout-input local page :desktop)] (layout-input local page "desktop")]
(when valid? (when valid?
[:input#project-btn.btn-primary [:input#project-btn.btn-primary