🌐 Project, sitemap and layers i18n

Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
This commit is contained in:
mathieu.brunot 2019-08-10 20:52:41 +02:00
parent 775166f5f2
commit 1d5bfd33d4
No known key found for this signature in database
GPG key ID: 81584BEAF692D7E0
5 changed files with 48 additions and 17 deletions

View file

@ -93,16 +93,16 @@
(assoc-value :height (:width data))))]
[:form {:on-submit on-submit}
[:input#project-name.input-text
{:placeholder "New project name"
{:placeholder (tr "ds.project.placeholder")
:type "text"
:value (:name data)
:auto-focus true
:on-change update-name}]
[:div.project-size
[:div.input-element.pixels
[:span "Width"]
[:span (tr "ds.width")]
[:input#project-witdh.input-text
{:placeholder "Width"
{:placeholder (tr "ds.width")
:type "number"
:min 0 ;;TODO check this value
:max 666666 ;;TODO check this value
@ -110,9 +110,9 @@
:on-change (partial update-size :width)}]]
[:a.toggle-layout {:on-click swap-size} i/toggle]
[:div.input-element.pixels
[:span "Height"]
[:span (tr "ds.height")]
[:input#project-height.input-text
{:placeholder "Height"
{:placeholder (tr "ds.height")
:type "number"
:min 0 ;;TODO check this value
:max 666666 ;;TODO check this value
@ -124,7 +124,7 @@
;; Submit
[:input#project-btn.btn-primary
{:value "Go go go!"
{:value (tr "ds.go")
:class (when-not valid? "btn-disabled")
:disabled (not valid?)
:type "submit"}]]))))
@ -140,7 +140,7 @@
:render
(fn [own]
[:div.lightbox-body
[:h3 "New project"]
[:h3 (tr "ds.project.new")]
(create-project-form)
[:a.close {:on-click #(st/emit! (udl/close-lightbox))}
i/close]]))

View file

@ -18,7 +18,8 @@
[uxbox.main.ui.shapes.icon :as icon]
[uxbox.main.ui.workspace.sortable :refer [use-sortable]]
[uxbox.util.data :refer [classnames]]
[uxbox.util.dom :as dom]))
[uxbox.util.dom :as dom]
[uxbox.util.i18n :refer (tr)]))
;; --- Helpers
@ -168,7 +169,7 @@
[:div#layers.tool-window
[:div.tool-window-bar
[:div.tool-window-icon i/layers]
[:span "Layers"]
[:span (tr "ds.layers")]
[:div.tool-window-close {:on-click on-click} i/close]]
[:& layers-list {:shapes (:shapes page)
:selected selected}]]))

View file

@ -88,16 +88,16 @@
(st/emit! (udp/persist-page-update-form id data))))]
[:form
[:input#project-name.input-text
{:placeholder "Page name"
{:placeholder (tr "ds.page.placeholder")
:type "text"
:value (:name data "")
:auto-focus true
:on-change update-name}]
[:div.project-size
[:div.input-element.pixels
[:span "Width"]
[:span (tr "ds.width")]
[:input#project-witdh.input-text
{:placeholder "Width"
{:placeholder (tr "ds.width")
:type "number"
:min 0
:max 4000
@ -105,9 +105,9 @@
:on-change #(update-size :width %)}]]
[:a.toggle-layout {:on-click toggle-sizes} i/toggle]
[:div.input-element.pixels
[:span "Height"]
[:span (tr "ds.height")]
[:input#project-height.input-text
{:placeholder "Height"
{:placeholder (tr "ds.height")
:type "number"
:min 0
:max 4000
@ -121,7 +121,7 @@
(layout-input data "desktop")]
[:input#project-btn.btn-primary
{:value "Go go go!"
{:value (tr "ds.go")
:disabled (not valid?)
:on-click on-save
:type "button"}]])))
@ -135,8 +135,8 @@
(let [creation? (nil? id)]
[:div.lightbox-body
(if creation?
[:h3 "New page"]
[:h3 "Edit page"])
[:h3 (tr "ds.page.new")]
[:h3 (tr "ds.page.edit")])
(page-form page)
[:a.close {:on-click on-cancel} i/close]])))