Update translation strings.

This commit is contained in:
Andrey Antukh 2020-10-07 16:52:18 +02:00 committed by Alonso Torres
parent 2765883152
commit d914ab1390
21 changed files with 940 additions and 730 deletions

File diff suppressed because it is too large Load diff

View file

@ -89,20 +89,20 @@
:type "text" :type "text"
:tab-index "2" :tab-index "2"
:help-icon i/at :help-icon i/at
:label (t locale "auth.email-label")}]] :label (t locale "auth.email")}]]
[:div.fields-row [:div.fields-row
[:& fm/input [:& fm/input
{:type "password" {:type "password"
:name :password :name :password
:tab-index "3" :tab-index "3"
:help-icon i/eye :help-icon i/eye
:label (t locale "auth.password-label")}]] :label (t locale "auth.password")}]]
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "auth.login-submit-label") {:label (t locale "auth.login-submit")
:on-click on-submit}] :on-click on-submit}]
(when cfg/login-with-ldap (when cfg/login-with-ldap
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "auth.login-with-ldap-submit-label") {:label (t locale "auth.login-with-ldap-submit")
:on-click on-submit}])]])) :on-click on-submit}])]]))
(mf/defc login-page (mf/defc login-page
@ -122,7 +122,7 @@
(t locale "auth.forgot-password")]] (t locale "auth.forgot-password")]]
[:div.link-entry [:div.link-entry
[:span (t locale "auth.register-label") " "] [:span (t locale "auth.register") " "]
[:a {:on-click #(st/emit! (rt/nav :auth-register)) [:a {:on-click #(st/emit! (rt/nav :auth-register))
:tab-index "6"} :tab-index "6"}
(t locale "auth.register")]]] (t locale "auth.register")]]]
@ -137,11 +137,11 @@
{:on-click login-with-gitlab} {:on-click login-with-gitlab}
[:img.logo [:img.logo
{:src "/images/icons/brand-gitlab.svg"}] {:src "/images/icons/brand-gitlab.svg"}]
(t locale "auth.login-with-gitlab-submit-label")]) (t locale "auth.login-with-gitlab-submit")])
[:div.links.demo [:div.links.demo
[:div.link-entry [:div.link-entry
[:span (t locale "auth.create-demo-profile-label") " "] [:span (t locale "auth.create-demo-profile") " "]
[:a {:on-click #(st/emit! da/create-demo-profile) [:a {:on-click #(st/emit! da/create-demo-profile)
:tab-index "6"} :tab-index "6"}
(t locale "auth.create-demo-profile")]]]]]) (t locale "auth.create-demo-profile")]]]]])

View file

@ -69,15 +69,15 @@
[:div.fields-row [:div.fields-row
[:& fm/input {:type "password" [:& fm/input {:type "password"
:name :password-1 :name :password-1
:label (t locale "auth.new-password-label")}]] :label (t locale "auth.new-password")}]]
[:div.fields-row [:div.fields-row
[:& fm/input {:type "password" [:& fm/input {:type "password"
:name :password-2 :name :password-2
:label (t locale "auth.confirm-password-label")}]] :label (t locale "auth.confirm-password")}]]
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "auth.recovery-submit-label")}]])) {:label (t locale "auth.recovery-submit")}]]))
;; --- Recovery Request Page ;; --- Recovery Request Page

View file

@ -44,12 +44,12 @@
:form form} :form form}
[:div.fields-row [:div.fields-row
[:& fm/input {:name :email [:& fm/input {:name :email
:label (t locale "auth.email-label") :label (t locale "auth.email")
:help-icon i/at :help-icon i/at
:type "text"}]] :type "text"}]]
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "auth.recovery-request-submit-label")}]])) {:label (t locale "auth.recovery-request-submit")}]]))
;; --- Recovery Request Page ;; --- Recovery Request Page

View file

@ -51,7 +51,7 @@
(st/emit! (rt/nav :dashboard-projects {:team-id (get-in data [:claims :team-id])}) (st/emit! (rt/nav :dashboard-projects {:team-id (get-in data [:claims :team-id])})
du/fetch-profile du/fetch-profile
(dm/success message))) (dm/success message)))
(let [message (tr "auth.notifications.validation-email-sent" (:email data))] (let [message (tr "notifications.validation-email-sent" (:email data))]
(st/emit! (rt/nav :auth-login) (st/emit! (rt/nav :auth-login)
(dm/success message))))) (dm/success message)))))
@ -91,23 +91,23 @@
[:div.fields-row [:div.fields-row
[:& fm/input {:name :fullname [:& fm/input {:name :fullname
:tab-index "1" :tab-index "1"
:label (t locale "auth.fullname-label") :label (t locale "auth.fullname")
:type "text"}]] :type "text"}]]
[:div.fields-row [:div.fields-row
[:& fm/input {:type "email" [:& fm/input {:type "email"
:name :email :name :email
:tab-index "2" :tab-index "2"
:help-icon i/at :help-icon i/at
:label (t locale "auth.email-label")}]] :label (t locale "auth.email")}]]
[:div.fields-row [:div.fields-row
[:& fm/input {:name :password [:& fm/input {:name :password
:tab-index "3" :tab-index "3"
:hint (t locale "auth.password-length-hint") :hint (t locale "auth.password-length-hint")
:label (t locale "auth.password-label") :label (t locale "auth.password")
:type "password"}]] :type "password"}]]
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "auth.register-submit-label")}]])) {:label (t locale "auth.register-submit")}]]))
;; --- Register Page ;; --- Register Page
@ -130,7 +130,7 @@
(t locale "auth.login-here")]] (t locale "auth.login-here")]]
[:div.link-entry [:div.link-entry
[:span (t locale "auth.create-demo-profile-label") " "] [:span (t locale "auth.create-demo-profile") " "]
[:a {:on-click #(st/emit! da/create-demo-profile) [:a {:on-click #(st/emit! da/create-demo-profile)
:tab-index "5"} :tab-index "5"}
(t locale "auth.create-demo-profile")]]]]) (t locale "auth.create-demo-profile")]]]])

View file

@ -53,9 +53,9 @@
(mf/deps project) (mf/deps project)
(st/emitf (modal/show (st/emitf (modal/show
{:type :confirm {:type :confirm
:title "Deleting project" :title (t locale "modals.delete-project-confirm.title")
:message "Are you sure you wan't to delete this project?" :message (t locale "modals.delete-project-confirm.message")
:accept-label "Delete project" :accept-label (t locale "modals.delete-project-confirm.accept")
:on-accept delete-fn}))) :on-accept delete-fn})))
on-create-clicked on-create-clicked
@ -69,7 +69,7 @@
[:header.dashboard-header [:header.dashboard-header
(if (:is-default project) (if (:is-default project)
[:div.dashboard-title [:div.dashboard-title
[:h1 (t locale "dashboard.header.draft")]] [:h1 (t locale "dashboard.draft-title")]]
(if (:edition @local) (if (:edition @local)
[:& inline-edition {:content (:name project) [:& inline-edition {:content (:name project)
@ -81,8 +81,8 @@
[:div.icon {:on-click on-menu-click} i/actions] [:div.icon {:on-click on-menu-click} i/actions]
[:& context-menu {:on-close on-menu-close [:& context-menu {:on-close on-menu-close
:show (:menu-open @local) :show (:menu-open @local)
:options [[(t locale "dashboard.grid.rename") on-edit] :options [[(t locale "labels.rename") on-edit]
[(t locale "dashboard.grid.delete") on-delete]]}]])) [(t locale "labels.delete") on-delete]]}]]))
[:a.btn-secondary.btn-small {:on-click on-create-clicked} [:a.btn-secondary.btn-small {:on-click on-create-clicked}
(t locale "dashboard.new-file")]])) (t locale "dashboard.new-file")]]))

View file

@ -75,11 +75,13 @@
(mf/deps file) (mf/deps file)
(fn [event] (fn [event]
(dom/stop-propagation event) (dom/stop-propagation event)
(st/emit! (modal/show {:type :confirm (st/emit! (modal/show
:title "Deleting file" {:type :confirm
:message "Are you sure you want to delete this file?" :title (t locale "modals.delete-file-confirm.title")
:on-accept delete-fn :message (t locale "modals.delete-file-confirm.message")
:accept-label "Delete file"})))) :accept-label (t locale "modals.delete-file-confirm.accept")
:on-accept delete-fn}))))
on-navigate on-navigate
(mf/use-callback (mf/use-callback
(mf/deps id) (mf/deps id)
@ -107,10 +109,10 @@
(dom/stop-propagation event) (dom/stop-propagation event)
(st/emit! (modal/show (st/emit! (modal/show
{:type :confirm {:type :confirm
:message (t locale "dashboard.grid.add-shared-message" (:name file)) :message (t locale "modals.add-shared-confirm.message" (:name file))
:title "Adding as shared library" :title (t locale "modals.add-shared-confirm.title")
:hint (t locale "dashboard.grid.add-shared-hint") :hint (t locale "modals.add-shared-confirm.hint")
:accept-label (t locale "dashboard.grid.add-shared-accept") :accept-label (t locale "modals.add-shared-confirm.accept")
:on-accept add-shared})))) :on-accept add-shared}))))
on-del-shared on-del-shared
@ -119,12 +121,13 @@
(fn [event] (fn [event]
(dom/prevent-default event) (dom/prevent-default event)
(dom/stop-propagation event) (dom/stop-propagation event)
(modal/show! :confirm (st/emit! (modal/show
{:title "Unsharing file" {:type :confirm
:message (t locale "dashboard.grid.remove-shared-message" (:name file)) :title (t locale "modals.remove-shared-confirm.title")
:hint (t locale "dashboard.grid.remove-shared-hint") :message (t locale "modals.remove-shared-confirm.message" (:name file))
:accept-label (t locale "dashboard.grid.remove-shared-accept") :hint (t locale "modals.remove-shared-confirm.hint")
:on-accept del-shared}))) :accept-label (t locale "modals.remove-shared-confirm.accept")
:on-accept del-shared}))))
on-menu-click on-menu-click
(mf/use-callback (mf/use-callback
@ -167,18 +170,18 @@
i/actions] i/actions]
[:& context-menu {:on-close on-close [:& context-menu {:on-close on-close
:show (:menu-open @local) :show (:menu-open @local)
:options [[(t locale "dashboard.grid.rename") on-edit] :options [[(t locale "labels.rename") on-edit]
[(t locale "dashboard.grid.delete") on-delete] [(t locale "labels.delete") on-delete]
(if (:is-shared file) (if (:is-shared file)
[(t locale "dashboard.grid.remove-shared") on-del-shared] [(t locale "dashboard.remove-shared") on-del-shared]
[(t locale "dashboard.grid.add-shared") on-add-shared])]}]]])) [(t locale "dashboard.add-shared") on-add-shared])]}]]]))
(mf/defc empty-placeholder (mf/defc empty-placeholder
[] []
(let [locale (mf/deref i18n/locale)] (let [locale (mf/deref i18n/locale)]
[:div.grid-empty-placeholder [:div.grid-empty-placeholder
[:div.icon i/file-html] [:div.icon i/file-html]
[:div.text (t locale "dashboard.grid.empty-files")]])) [:div.text (t locale "dashboard.empty-files")]]))
(mf/defc grid (mf/defc grid
[{:keys [id opts files] :as props}] [{:keys [id opts files] :as props}]
@ -240,7 +243,7 @@
[:div.grid-item.placeholder {:on-click on-load-more} [:div.grid-item.placeholder {:on-click on-load-more}
[:div.placeholder-icon i/arrow-down] [:div.placeholder-icon i/arrow-down]
[:div.placeholder-label [:div.placeholder-label
(t locale "dashboard.grid.show-all-files")]])])) (t locale "dashboard.show-all-files")]])]))
(mf/defc line-grid (mf/defc line-grid
[{:keys [project-id opts files on-load-more] :as props}] [{:keys [project-id opts files on-load-more] :as props}]

View file

@ -37,7 +37,7 @@
[:* [:*
[:header.dashboard-header [:header.dashboard-header
[:div.dashboard-title [:div.dashboard-title
[:h1 (tr "dashboard.header.libraries")]]] [:h1 (tr "dashboard.libraries-title")]]]
[:section.dashboard-container [:section.dashboard-container
[:& grid {:files files}]]])) [:& grid {:files files}]]]))

View file

@ -30,9 +30,9 @@
(let [create #(st/emit! (dd/create-project {:team-id (:id team)}))] (let [create #(st/emit! (dd/create-project {:team-id (:id team)}))]
[:header.dashboard-header [:header.dashboard-header
[:div.dashboard-title [:div.dashboard-title
[:h1 "Projects"]] [:h1 (t locale "dashboard.projects-title")]]
[:a.btn-secondary.btn-small {:on-click create} [:a.btn-secondary.btn-small {:on-click create}
(t locale "dashboard.header.new-project")]])) (t locale "dashboard.new-project")]]))
(defn files-ref (defn files-ref
[project-id] [project-id]

View file

@ -17,8 +17,6 @@
[okulary.core :as l] [okulary.core :as l]
[rumext.alpha :as mf])) [rumext.alpha :as mf]))
;; --- Component: Search
(def result-ref (def result-ref
(l/derived (l/in [:dashboard-local :search-result]) st/state)) (l/derived (l/in [:dashboard-local :search-result]) st/state))
@ -37,17 +35,17 @@
(empty? search-term) (empty? search-term)
[:div.grid-empty-placeholder [:div.grid-empty-placeholder
[:div.icon i/search] [:div.icon i/search]
[:div.text (t locale "dashboard.search.type-something")]] [:div.text (t locale "dashboard.type-something")]]
(nil? result) (nil? result)
[:div.grid-empty-placeholder [:div.grid-empty-placeholder
[:div.icon i/search] [:div.icon i/search]
[:div.text (t locale "dashboard.search.searching-for" search-term)]] [:div.text (t locale "dashboard.searching-for" search-term)]]
(empty? result) (empty? result)
[:div.grid-empty-placeholder [:div.grid-empty-placeholder
[:div.icon i/search] [:div.icon i/search]
[:div.text (t locale "dashboard.search.no-matches-for" search-term)]] [:div.text (t locale "dashboard.no-matches-for" search-term)]]
:else :else
[:& grid {:files result [:& grid {:files result

View file

@ -107,7 +107,7 @@
{:key :images-search-box {:key :images-search-box
:id "search-input" :id "search-input"
:type "text" :type "text"
:placeholder (t locale "ds.search.placeholder") :placeholder (t locale "dashboard.search-placeholder")
:default-value search-term :default-value search-term
:auto-complete "off" :auto-complete "off"
:on-focus on-search-focus :on-focus on-search-focus
@ -137,11 +137,11 @@
(rx/subs #(reset! teams %))))) (rx/subs #(reset! teams %)))))
[:ul.dropdown.teams-dropdown [:ul.dropdown.teams-dropdown
[:li.title (t locale "dashboard.sidebar.switch-team")] [:li.title (t locale "dashboard.switch-team")]
[:hr] [:hr]
[:li.team-name {:on-click (partial go-projects (:default-team-id profile))} [:li.team-name {:on-click (partial go-projects (:default-team-id profile))}
[:span.team-icon i/logo-icon] [:span.team-icon i/logo-icon]
[:span.team-text "Your penpot"]] [:span.team-text (t locale "dashboard.your-penpot")]]
(for [team (remove :is-default @teams)] (for [team (remove :is-default @teams)]
[:* {:key (:id team)} [:* {:key (:id team)}
@ -152,7 +152,7 @@
[:hr] [:hr]
[:li.action {:on-click on-create-clicked} [:li.action {:on-click on-create-clicked}
(t locale "dashboard.sidebar.create-team")]])) (t locale "dashboard.create-new-team")]]))
(s/def ::member-id ::us/uuid) (s/def ::member-id ::us/uuid)
(s/def ::leave-modal-form (s/def ::leave-modal-form
@ -160,11 +160,10 @@
(mf/defc leave-and-reassign-modal (mf/defc leave-and-reassign-modal
{::mf/register modal/components {::mf/register modal/components
::mf/register-as ::leave-and-reassign ::mf/register-as ::leave-and-reassign}
::mf/props-spec ::kaka-de-vaca}
[{:keys [members profile team accept]}] [{:keys [members profile team accept]}]
(let [form (fm/use-form :spec ::leave-modal-form :initial {}) (let [form (fm/use-form :spec ::leave-modal-form :initial {})
options (into [{:value "" :label "Select a member to promote"}] options (into [{:value "" :label (tr "modals.leave-and-reassign.select-memeber-to-promote")}]
(map #(hash-map :name (:name %) :value (str (:id %))) members)) (map #(hash-map :name (:name %) :value (str (:id %))) members))
on-cancel on-cancel
@ -181,13 +180,13 @@
[:div.modal-container.confirm-dialog [:div.modal-container.confirm-dialog
[:div.modal-header [:div.modal-header
[:div.modal-header-title [:div.modal-header-title
[:h2 "Before you leave"]] [:h2 (tr "modals.leave-and-reassign.title")]]
[:div.modal-close-button [:div.modal-close-button
{:on-click on-cancel} i/close]] {:on-click on-cancel} i/close]]
[:div.modal-content.generic-form [:div.modal-content.generic-form
[:p "You are " (:name team) " owner."] [:p (tr "modals.leave-and-reassign.hint1" (:name team))]
[:p "Select an other member to promote before leave."] [:p (tr "modals.leave-and-reassign.hint2")]
[:& fm/form {:form form} [:& fm/form {:form form}
[:& fm/select {:name :member-id [:& fm/select {:name :member-id
@ -197,14 +196,14 @@
[:div.action-buttons [:div.action-buttons
[:input.cancel-button [:input.cancel-button
{:type "button" {:type "button"
:value "Cancel" :value (tr "labels.cancel")
:on-click on-cancel}] :on-click on-cancel}]
[:input.accept-button [:input.accept-button
{:type "button" {:type "button"
:class (when-not (:valid @form) "btn-disabled") :class (when-not (:valid @form) "btn-disabled")
:disabled (not (:valid @form)) :disabled (not (:valid @form))
:value "Promoto and Leave" :value (tr "modals.leave-and-reassign.promote-and-leave")
:on-click on-accept}]]]]])) :on-click on-accept}]]]]]))
@ -256,12 +255,11 @@
(mf/deps team) (mf/deps team)
(st/emitf (modal/show (st/emitf (modal/show
{:type :confirm {:type :confirm
:title "Leaving team" :title (t locale "modals.leave-confirm.title")
:message "Are you sure you want to leave this team?" :message (t locale "modals.leave-confirm.message")
:accept-label "Leave team" :accept-label (t locale "modals.leave-confirm.accept")
:on-accept leave-fn}))) :on-accept leave-fn})))
on-leave-as-owner-clicked on-leave-as-owner-clicked
(mf/use-callback (mf/use-callback
(mf/deps team @members) (mf/deps team @members)
@ -282,10 +280,9 @@
(mf/deps team) (mf/deps team)
(st/emitf (modal/show (st/emitf (modal/show
{:type :confirm {:type :confirm
:title "Deleting team" :title (t locale "modals.delete-team-confirm.title")
:message (str "Are you sure you want to delete this team?\n" :message (t locale "modals.delete-team-confirm.message")
"All projects and files associated with team will be permanently deleted.") :accept-label (t locale "modals.delete-team-confirm.accept")
:accept-label "Delete team"
:on-accept delete-fn})))] :on-accept delete-fn})))]
(mf/use-layout-effect (mf/use-layout-effect
@ -295,21 +292,21 @@
(rx/subs #(reset! members %))))) (rx/subs #(reset! members %)))))
[:ul.dropdown.options-dropdown [:ul.dropdown.options-dropdown
[:li {:on-click go-members} (t locale "dashboard.sidebar.team-members")] [:li {:on-click go-members} (t locale "labels.members")]
[:li {:on-click go-settings} (t locale "dashboard.sidebar.settings")] [:li {:on-click go-settings} (t locale "labels.settings")]
[:hr] [:hr]
[:li {:on-click on-rename-clicked} (t locale "dashboard.sidebar.rename-team")] [:li {:on-click on-rename-clicked} (t locale "labels.rename")]
(cond (cond
(:is-owner team) (:is-owner team)
[:li {:on-click on-leave-as-owner-clicked} (t locale "dashboard.sidebar.leave-team")] [:li {:on-click on-leave-as-owner-clicked} (t locale "dashboard.leave-team")]
(> (count @members) 1) (> (count @members) 1)
[:li {:on-click on-leave-clicked} (t locale "dashboard.sidebar.leave-team")]) [:li {:on-click on-leave-clicked} (t locale "dashboard.leave-team")])
(when (:is-owner team) (when (:is-owner team)
[:li {:on-click on-delete-clicked} (t locale "dashboard.sidebar.delete-team")])])) [:li {:on-click on-delete-clicked} (t locale "dashboard.delete-team")])]))
(mf/defc sidebar-team-switch (mf/defc sidebar-team-switch
@ -325,7 +322,7 @@
(if (:is-default team) (if (:is-default team)
[:div.team-name [:div.team-name
[:span.team-icon i/logo-icon] [:span.team-icon i/logo-icon]
[:span.team-text (t locale "dashboard.sidebar.default-team-name")]] [:span.team-text (t locale "dashboard.default-team-name")]]
[:div.team-name [:div.team-name
[:span.team-icon [:span.team-icon
[:img {:src (cfg/resolve-media-path (:photo team))}]] [:img {:src (cfg/resolve-media-path (:photo team))}]]
@ -397,18 +394,18 @@
{:on-click go-projects {:on-click go-projects
:class-name (when projects? "current")} :class-name (when projects? "current")}
i/recent i/recent
[:span.element-title (t locale "dashboard.sidebar.projects")]] [:span.element-title (t locale "labels.projects")]]
[:li {:on-click go-drafts [:li {:on-click go-drafts
:class-name (when drafts? "current")} :class-name (when drafts? "current")}
i/file-html i/file-html
[:span.element-title (t locale "dashboard.sidebar.drafts")]] [:span.element-title (t locale "labels.drafts")]]
[:li {:on-click go-libs [:li {:on-click go-libs
:class-name (when libs? "current")} :class-name (when libs? "current")}
i/library i/library
[:span.element-title (t locale "dashboard.sidebar.libraries")]]]] [:span.element-title (t locale "labels.shared-libraries")]]]]
[:hr] [:hr]
@ -423,7 +420,7 @@
:selected? (= (:id item) (:id project))}])] :selected? (= (:id item) (:id project))}])]
[:div.sidebar-empty-placeholder [:div.sidebar-empty-placeholder
[:span.icon i/pin] [:span.icon i/pin]
[:span.text (t locale "dashboard.sidebar.no-projects-placeholder")]])]])) [:span.text (t locale "dashboard.no-projects-placeholder")]])]]))
(mf/defc profile-section (mf/defc profile-section
@ -451,15 +448,15 @@
[:ul.dropdown [:ul.dropdown
[:li {:on-click (partial on-click :settings-profile)} [:li {:on-click (partial on-click :settings-profile)}
[:span.icon i/user] [:span.icon i/user]
[:span.text (t locale "dashboard.sidebar.profile")]] [:span.text (t locale "labels.profile")]]
[:hr] [:hr]
[:li {:on-click (partial on-click :settings-password)} [:li {:on-click (partial on-click :settings-password)}
[:span.icon i/lock] [:span.icon i/lock]
[:span.text (t locale "dashboard.sidebar.password")]] [:span.text (t locale "labels.password")]]
[:hr] [:hr]
[:li {:on-click (partial on-click da/logout)} [:li {:on-click (partial on-click da/logout)}
[:span.icon i/exit] [:span.icon i/exit]
[:span.text (t locale "dashboard.logout")]]]]])) [:span.text (t locale "labels.logout")]]]]]))
(mf/defc sidebar (mf/defc sidebar
{::mf/wrap-props false {::mf/wrap-props false

View file

@ -56,17 +56,17 @@
[:header.dashboard-header [:header.dashboard-header
[:div.dashboard-title [:div.dashboard-title
[:h1 "Projects"]] [:h1 (t locale "labels.members")]]
[:nav [:nav
[:ul [:ul
[:li {:class (when members-section? "active")} [:li {:class (when members-section? "active")}
[:a {:on-click go-members} "MEMBERS"]] [:a {:on-click go-members} (t locale "labels.members")]]
[:li {:class (when settings-section? "active")} [:li {:class (when settings-section? "active")}
[:a {:on-click go-settings} "SETTINGS"]]]] [:a {:on-click go-settings} (t locale "labels.settings")]]]]
(if members-section? (if members-section?
[:a.btn-secondary.btn-small {:on-click invite-member} [:a.btn-secondary.btn-small {:on-click invite-member}
(t locale "dashboard.header.invite-profile")] (t locale "dashboard.invite-profile")]
[:div])])) [:div])]))
(s/def ::email ::us/email) (s/def ::email ::us/email)
@ -78,10 +78,10 @@
{::mf/register modal/components {::mf/register modal/components
::mf/register-as ::invite-member} ::mf/register-as ::invite-member}
[{:keys [team] :as props}] [{:keys [team] :as props}]
(let [roles [{:value "" :label "Role"} (let [roles [{:value "" :label (tr "labels.role")}
{:value "admin" :label "Admin"} {:value "admin" :label (tr "labels.admin")}
{:value "editor" :label "Editor"} {:value "editor" :label (tr "labels.editor")}
{:value "viewer" :label "Viewer"}] {:value "viewer" :label (tr "labels.viewer")}]
initial (mf/use-memo (mf/deps team) (constantly {:team-id (:id team)})) initial (mf/use-memo (mf/deps team) (constantly {:team-id (:id team)}))
form (fm/use-form :spec ::invite-member-form form (fm/use-form :spec ::invite-member-form
@ -99,16 +99,14 @@
mdata {:on-success (partial on-success form)}] mdata {:on-success (partial on-success form)}]
(st/emit! (dd/invite-team-member (with-meta params mdata))))))] (st/emit! (dd/invite-team-member (with-meta params mdata))))))]
(prn "invite-member-modal" @form)
[:div.modal.dashboard-invite-modal.form-container [:div.modal.dashboard-invite-modal.form-container
[:& fm/form {:on-submit on-submit :form form} [:& fm/form {:on-submit on-submit :form form}
[:div.title [:div.title
[:span.text "Invite a new team member"]] [:span.text (tr "modals.invite-member.title")]]
[:div.form-row [:div.form-row
[:& fm/input {:name :email [:& fm/input {:name :email
:label "Introduce an email"}] :label (tr "labels.email")}]
[:& fm/select {:name :role [:& fm/select {:name :role
:options roles}]] :options roles}]]
@ -141,9 +139,9 @@
(mf/deps team member) (mf/deps team member)
(st/emitf (modal/show (st/emitf (modal/show
{:type :confirm {:type :confirm
:title "Promoto to owner" :title (tr "modals.promote-owner-confirm.title")
:message "Are you sure you wan't to promote this user to owner?" :message (tr "modals.promote-owner-confirm.message")
:accept-label "Promote" :accept-label (tr "modals.promote-owner-confirm.accept")
:on-accept set-owner-fn}))) :on-accept set-owner-fn})))
delete-fn delete-fn
@ -154,9 +152,9 @@
(mf/deps team member) (mf/deps team member)
(st/emitf (modal/show (st/emitf (modal/show
{:type :confirm {:type :confirm
:title "Delete team member" :title (tr "modals.delete-team-member-confirm.title")
:message "Are you sure wan't to delete this user from team?" :message (tr "modals.delete-team-member-confirm.message")
:accept-label "Delete" :accept-label (tr "modals.delete-team-member-confirm.accept")
:on-accept delete-fn})))] :on-accept delete-fn})))]
@ -167,16 +165,17 @@
[:* [:*
(cond (cond
(:is-owner member) (:is-owner member)
[:span.label "Owner"] [:span.label (tr "labels.owner")]
(:is-admin member) (:is-admin member)
[:span.label "Admin"] [:span.label (tr "labels.admin")]
(:can-edit member) (:can-edit member)
[:span.label "Editor"] [:span.label (tr "labels.editor")]
:else :else
[:span.label "Viewer"]) [:span.label (tr "labels.viewer")])
(when (and (not (:is-owner member)) (when (and (not (:is-owner member))
(or (:is-admin team) (or (:is-admin team)
(:is-owner team))) (:is-owner team)))
@ -185,19 +184,19 @@
[:& dropdown {:show @show? [:& dropdown {:show @show?
:on-close #(reset! show? false)} :on-close #(reset! show? false)}
[:ul.dropdown.options-dropdown [:ul.dropdown.options-dropdown
[:li {:on-click set-admin} "Admin"] [:li {:on-click set-admin} (tr "labels.admin")]
[:li {:on-click set-editor} "Editor"] [:li {:on-click set-editor} (tr "labels.editor")]
[:li {:on-click set-viewer} "Viewer"] [:li {:on-click set-viewer} (tr "labels.viewer")]
(when (:is-owner team) (when (:is-owner team)
[:* [:*
[:hr] [:hr]
[:li {:on-click set-owner} "Promote to owner"]]) [:li {:on-click set-owner} (tr "dashboard.promote-to-owner")]])
[:hr] [:hr]
(when (and (or (:is-owner team) (when (and (or (:is-owner team)
(:is-admin team)) (:is-admin team))
(not= (:id profile) (not= (:id profile)
(:id member))) (:id member)))
[:li {:on-click delete} "Remove"])]]]])) [:li {:on-click delete} (tr "labels.remove")])]]]]))
(mf/defc team-members (mf/defc team-members
@ -209,9 +208,9 @@
(d/seek :is-owner))] (d/seek :is-owner))]
[:div.dashboard-table [:div.dashboard-table
[:div.table-header [:div.table-header
[:div.table-field.name "Name"] [:div.table-field.name (tr "labels.name")]
[:div.table-field.email "Email"] [:div.table-field.email (tr "labels.email")]
[:div.table-field.permissions "Permissions"]] [:div.table-field.permissions (tr "labels.permissions")]]
[:div.table-rows [:div.table-rows
[:& team-member {:member owner :team team :profile profile}] [:& team-member {:member owner :team team :profile profile}]
(for [item members] (for [item members]
@ -272,7 +271,7 @@
[:div.team-settings [:div.team-settings
[:div.horizontal-blocks [:div.horizontal-blocks
[:div.block.info-block [:div.block.info-block
[:div.label "Team info"] [:div.label (t locale "dashboard.team-info")]
[:div.name (:name team)] [:div.name (:name team)]
[:div.icon [:div.icon
[:span.update-overlay {:on-click on-image-click} i/exit] [:span.update-overlay {:on-click on-image-click} i/exit]
@ -283,16 +282,16 @@
:on-selected on-file-selected}]]] :on-selected on-file-selected}]]]
[:div.block.owner-block [:div.block.owner-block
[:div.label "Team members"] [:div.label (t locale "dashboard.team-members")]
[:div.owner [:div.owner
[:span.icon [:img {:src (cfg/resolve-media-path (:photo-uri profile))}]] [:span.icon [:img {:src (cfg/resolve-media-path (:photo-uri profile))}]]
[:span.text (:fullname profile)]] [:span.text (:fullname profile)]]
[:div.summary [:div.summary
[:span.icon i/user] [:span.icon i/user]
[:span.text (t locale "dashboard.team.num-of-members" (count members-map))]]] [:span.text (t locale "dashboard.num-of-members" (count members-map))]]]
[:div.block.stats-block [:div.block.stats-block
[:div.label "Team projects"] [:div.label (t locale "dashboard.team-projects")]
[:div.projects [:div.projects
[:span.icon i/folder] [:span.icon i/folder]
[:span.text "4 projects"]] [:span.text "4 projects"]]

View file

@ -25,9 +25,9 @@
[{:keys [locale] :as props}] [{:keys [locale] :as props}]
(let [logout (constantly nil)] (let [logout (constantly nil)]
[:header.dashboard-header [:header.dashboard-header
[:h1.dashboard-title (t locale "dashboard.header.your-account")] [:h1.dashboard-title (t locale "dashboard.your-account-title")]
[:a.btn-secondary.btn-small {:on-click logout} [:a.btn-secondary.btn-small {:on-click logout}
(t locale "dashboard.logout")]])) (t locale "labels.logout")]]))
(mf/defc settings (mf/defc settings
[{:keys [route] :as props}] [{:keys [route] :as props}]

View file

@ -53,7 +53,7 @@
(defn- on-success (defn- on-success
[form data] [form data]
(let [email (get-in @form [:clean-data :email-1]) (let [email (get-in @form [:clean-data :email-1])
message (tr "auth.notifications.validation-email-sent" email)] message (tr "notifications.validation-email-sent" email)]
(st/emit! (dm/info message) (st/emit! (dm/info message)
(modal/hide)))) (modal/hide))))
@ -83,30 +83,30 @@
[:div.modal-header [:div.modal-header
[:div.modal-header-title [:div.modal-header-title
[:h2 (t locale "dashboard.settings.change-email-title")]] [:h2 (t locale "modals.change-email.title")]]
[:div.modal-close-button [:div.modal-close-button
{:on-click on-close} i/close]] {:on-click on-close} i/close]]
[:div.modal-content [:div.modal-content
[:& msgs/inline-banner [:& msgs/inline-banner
{:type :info {:type :info
:content (t locale "dashboard.settings.change-email-info" (:email profile))}] :content (t locale "modals.change-email.info" (:email profile))}]
[:div.fields-row [:div.fields-row
[:& fm/input {:type "text" [:& fm/input {:type "text"
:name :email-1 :name :email-1
:label (t locale "dashboard.settings.new-email-label") :label (t locale "modals.change-email.new-email")
:trim true}]] :trim true}]]
[:div.fields-row [:div.fields-row
[:& fm/input {:type "text" [:& fm/input {:type "text"
:name :email-2 :name :email-2
:label (t locale "dashboard.settings.confirm-email-label") :label (t locale "modals.change-email.confirm-email")
:trim true}]]] :trim true}]]]
[:div.modal-footer [:div.modal-footer
[:div.action-buttons [:div.action-buttons
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "dashboard.settings.change-email-submit-label")}]]]]]])) {:label (t locale "modals.change-email.submit")}]]]]]]))

View file

@ -9,23 +9,23 @@
(ns app.main.ui.settings.delete-account (ns app.main.ui.settings.delete-account
(:require (:require
[cljs.spec.alpha :as s]
[beicon.core :as rx]
[rumext.alpha :as mf]
[app.main.data.auth :as da] [app.main.data.auth :as da]
[app.main.data.messages :as dm] [app.main.data.messages :as dm]
[app.main.data.modal :as modal]
[app.main.data.users :as du] [app.main.data.users :as du]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
[app.main.ui.messages :as msgs] [app.main.ui.messages :as msgs]
[app.main.data.modal :as modal] [app.util.i18n :as i18n :refer [tr t]]
[app.util.router :as rt] [app.util.router :as rt]
[app.util.i18n :as i18n :refer [tr t]])) [beicon.core :as rx]
[cljs.spec.alpha :as s]
[rumext.alpha :as mf]))
(defn on-error (defn on-error
[{:keys [code] :as error}] [{:keys [code] :as error}]
(if (= :owner-teams-with-people code) (if (= :owner-teams-with-people code)
(let [msg (tr "dashboard.notifications.profile-deletion-not-allowed")] (let [msg (tr "notifications.profile-deletion-not-allowed")]
(rx/of (dm/error msg))) (rx/of (dm/error msg)))
(rx/throw error))) (rx/throw error)))
@ -52,19 +52,19 @@
[:div.modal-container.change-email-modal [:div.modal-container.change-email-modal
[:div.modal-header [:div.modal-header
[:div.modal-header-title [:div.modal-header-title
[:h2 (t locale "dashboard.settings.delete-account-title")]] [:h2 (t locale "modals.delete-account.title")]]
[:div.modal-close-button [:div.modal-close-button
{:on-click on-close} i/close]] {:on-click on-close} i/close]]
[:div.modal-content [:div.modal-content
[:& msgs/inline-banner [:& msgs/inline-banner
{:type :warning {:type :warning
:content (t locale "dashboard.settings.delete-account-info")}]] :content (t locale "modals.delete-account.info")}]]
[:div.modal-footer [:div.modal-footer
[:div.action-buttons [:div.action-buttons
[:button.btn-warning.btn-large {:on-click on-accept} [:button.btn-warning.btn-large {:on-click on-accept}
(t locale "dashboard.settings.yes-delete-my-account")] (t locale "modals.delete-account.confirm")]
[:button.btn-secondary.btn-large {:on-click on-close} [:button.btn-secondary.btn-large {:on-click on-close}
(t locale "dashboard.settings.cancel-and-keep-my-account")]]]]])) (t locale "modals.delete-account.cancel")]]]]]))

View file

@ -33,7 +33,7 @@
(defn- on-success (defn- on-success
[form] [form]
(st/emit! (dm/success (tr "dashboard.notifications.profile-saved")))) (st/emit! (dm/success (tr "notifications.profile-saved"))))
(defn- on-submit (defn- on-submit
[form event] [form event]
@ -51,25 +51,25 @@
:on-submit on-submit :on-submit on-submit
:form form} :form form}
[:h2 (t locale "dashboard.settings.language-change-title")] [:h2 (t locale "labels.language")]
[:div.fields-row [:div.fields-row
[:& fm/select {:options [{:label "English" :value "en"} [:& fm/select {:options [{:label "English" :value "en"}
{:label "Français" :value "fr"} {:label "Français" :value "fr"}
{:label "Español" :value "es"} {:label "Español" :value "es"}
{:label "Русский" :value "ru"}] {:label "Русский" :value "ru"}]
:label (t locale "dashboard.settings.language-label") :label (t locale "dashboard.select-ui-language")
:default "en" :default "en"
:name :lang}]] :name :lang}]]
[:h2 (t locale "dashboard.settings.theme-change-title")] [:h2 (t locale "dashboard.theme-change")]
[:div.fields-row [:div.fields-row
[:& fm/select {:label (t locale "dashboard.settings.theme-label") [:& fm/select {:label (t locale "dashboard.select-ui-theme")
:name :theme :name :theme
:default "default" :default "default"
:options [{:label "Default" :value "default"}]}]] :options [{:label "Default" :value "default"}]}]]
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "dashboard.settings.profile-submit-label")}]])) {:label (t locale "dashboard.update-settings")}]]))
;; --- Password Page ;; --- Password Page

View file

@ -73,27 +73,27 @@
[:& fm/form {:class "password-form" [:& fm/form {:class "password-form"
:on-submit on-submit :on-submit on-submit
:form form} :form form}
[:h2 (t locale "dashboard.settings.password-change-title")] [:h2 (t locale "dashboard.password-change")]
[:div.fields-row [:div.fields-row
[:& fm/input [:& fm/input
{:type "password" {:type "password"
:name :password-old :name :password-old
:label (t locale "dashboard.settings.old-password-label")}]] :label (t locale "labels.old-password")}]]
[:div.fields-row [:div.fields-row
[:& fm/input [:& fm/input
{:type "password" {:type "password"
:name :password-1 :name :password-1
:label (t locale "dashboard.settings.new-password-label")}]] :label (t locale "labels.new-password")}]]
[:div.fields-row [:div.fields-row
[:& fm/input [:& fm/input
{:type "password" {:type "password"
:name :password-2 :name :password-2
:label (t locale "dashboard.settings.confirm-password-label")}]] :label (t locale "labels.confirm-password")}]]
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "dashboard.settings.profile-submit-label")}]])) {:label (t locale "dashboard.update-settings")}]]))
;; --- Password Page ;; --- Password Page

View file

@ -33,7 +33,7 @@
(defn- on-success (defn- on-success
[form] [form]
(st/emit! (dm/success (tr "dashboard.notifications.profile-saved")))) (st/emit! (dm/success (tr "notifications.profile-saved"))))
(defn- on-error (defn- on-error
[form error] [form error]
@ -61,7 +61,7 @@
[:& fm/input [:& fm/input
{:type "text" {:type "text"
:name :fullname :name :fullname
:label (t locale "dashboard.settings.fullname-label")}]] :label (t locale "dashboard.your-name")}]]
[:div.fields-row [:div.fields-row
[:& fm/input [:& fm/input
@ -69,20 +69,20 @@
:name :email :name :email
:disabled true :disabled true
:help-icon i/at :help-icon i/at
:label (t locale "dashboard.settings.email-label")}] :label (t locale "dashboard.your-email")}]
[:div.options [:div.options
[:div.change-email [:div.change-email
[:a {:on-click #(modal/show! :change-email {})} [:a {:on-click #(modal/show! :change-email {})}
(t locale "dashboard.settings.change-email-label")]]]] (t locale "dashboard.change-email")]]]]
[:& fm/submit-button [:& fm/submit-button
{:label (t locale "dashboard.settings.profile-submit-label")}] {:label (t locale "dashboard.update-settings")}]
[:div.links [:div.links
[:div.link-item [:div.link-item
[:a {:on-click #(modal/show! :delete-account {})} [:a {:on-click #(modal/show! :delete-account {})}
(t locale "dashboard.settings.remove-account-label")]]]])) (t locale "dashboard.remove-account")]]]]))
;; --- Profile Photo Form ;; --- Profile Photo Form
@ -103,7 +103,7 @@
[:form.avatar-form [:form.avatar-form
[:div.image-change-field [:div.image-change-field
[:span.update-overlay {:on-click on-image-click} (t locale "dashboard.settings.update-photo-label")] [:span.update-overlay {:on-click on-image-click} (t locale "labels.update")]
[:img {:src photo}] [:img {:src photo}]
[:& file-uploader {:accept "image/jpeg,image/png" [:& file-uploader {:accept "image/jpeg,image/png"
:multi false :multi false

View file

@ -59,7 +59,7 @@
[:div.sidebar-content-section [:div.sidebar-content-section
[:div.back-to-dashboard {:on-click go-dashboard} [:div.back-to-dashboard {:on-click go-dashboard}
[:span.icon i/arrow-down] [:span.icon i/arrow-down]
[:span.text "Dashboard"]]] [:span.text (t locale "labels.dashboard")]]]
[:hr] [:hr]
[:div.sidebar-content-section [:div.sidebar-content-section
@ -67,17 +67,17 @@
[:li {:class (when profile? "current") [:li {:class (when profile? "current")
:on-click go-settings-profile} :on-click go-settings-profile}
i/user i/user
[:span.element-title (t locale "dashboard.sidebar.profile")]] [:span.element-title (t locale "labels.profile")]]
[:li {:class (when password? "current") [:li {:class (when password? "current")
:on-click go-settings-password} :on-click go-settings-password}
i/lock i/lock
[:span.element-title (t locale "dashboard.sidebar.password")]] [:span.element-title (t locale "labels.password")]]
[:li {:class (when options? "current") [:li {:class (when options? "current")
:on-click go-settings-options} :on-click go-settings-options}
i/tree i/tree
[:span.element-title (t locale "dashboard.sidebar.settings")]]]]])) [:span.element-title (t locale "labels.settings")]]]]]))
(mf/defc sidebar (mf/defc sidebar
{::mf/wrap [mf/memo]} {::mf/wrap [mf/memo]}

View file

@ -96,23 +96,34 @@
edit-input-ref (mf/use-ref nil) edit-input-ref (mf/use-ref nil)
add-shared-fn #(st/emit! nil (dw/set-file-shared (:id file) true)) add-shared-fn
on-add-shared (st/emitf (dw/set-file-shared (:id file) true))
#(modal/show! :confirm-dialog
{:message (t locale "dashboard.grid.add-shared-message" (:name file)) del-shared-fn
:hint (t locale "dashboard.grid.add-shared-hint") (st/emitf (dw/set-file-shared (:id file) false))
:accept-text (t locale "dashboard.grid.add-shared-accept")
:not-danger? true on-add-shared
:on-accept add-shared-fn}) (mf/use-fn
(mf/deps file)
(st/emitf (modal/show
{:type :confirm
:message (t locale "modals.add-shared-confirm.message" (:name file))
:title (t locale "modals.add-shared-confirm.title")
:hint (t locale "modals.add-shared-confirm.hint")
:accept-label (t locale "modals.add-shared-confirm.accept")
:on-accept add-shared-fn})))
remove-shared-fn #(st/emit! nil (dw/set-file-shared (:id file) false))
on-remove-shared on-remove-shared
#(modal/show! :confirm-dialog (mf/use-fn
{:message (t locale "dashboard.grid.remove-shared-message" (:name file)) (mf/deps file)
:hint (t locale "dashboard.grid.remove-shared-hint") (st/emitf (modal/show
:accept-text (t locale "dashboard.grid.remove-shared-accept") {:type :confirm
:not-danger? false :title (t locale "modals.remove-shared-confirm.title")
:on-accept remove-shared-fn}) :message (t locale "modals.remove-shared-confirm.message" (:name file))
:hint (t locale "modals.remove-shared-confirm.hint")
:accept-label (t locale "modals.remove-shared-confirm.accept")
:on-accept del-shared-fn})))
handle-blur (fn [event] handle-blur (fn [event]
(let [value (-> edit-input-ref mf/ref-val dom/get-value)] (let [value (-> edit-input-ref mf/ref-val dom/get-value)]
@ -132,7 +143,7 @@
[:div.menu-section [:div.menu-section
[:div.btn-icon-dark.btn-small {:on-click #(reset! show-menu? true)} i/actions] [:div.btn-icon-dark.btn-small {:on-click #(reset! show-menu? true)} i/actions]
[:div.project-tree {:alt (t locale "header.sitemap")} [:div.project-tree {:alt (t locale "workspace.sitemap")}
[:span.project-name [:span.project-name
{:on-click #(st/emit! (rt/navigate :dashboard-project {:team-id team-id {:on-click #(st/emit! (rt/navigate :dashboard-project {:team-id team-id
:project-id (:project-id file)}))} :project-id (:project-id file)}))}
@ -205,9 +216,9 @@
(if (:is-shared file) (if (:is-shared file)
[:li {:on-click on-remove-shared} [:li {:on-click on-remove-shared}
[:span (t locale "dashboard.grid.remove-shared")]] [:span (t locale "dashboard.remove-shared")]]
[:li {:on-click on-add-shared} [:li {:on-click on-add-shared}
[:span (t locale "dashboard.grid.add-shared")]]) [:span (t locale "dashboard.add-shared")]])
]]])) ]]]))
;; --- Header Component ;; --- Header Component

View file

@ -88,7 +88,7 @@
[:div.item-name (:name library)] [:div.item-name (:name library)]
[:div.item-contents (contents-str library)] [:div.item-contents (contents-str library)]
[:input.item-button {:type "button" [:input.item-button {:type "button"
:value (tr "workspace.libraries.remove") :value (tr "labels.remove")
:on-click #(unlink-library (:id library))}]]) :on-click #(unlink-library (:id library))}]])
]] ]]
[:div.section [:div.section