mirror of
https://github.com/penpot/penpot.git
synced 2025-04-01 09:31:26 -05:00
✨ Update translation strings.
This commit is contained in:
parent
2765883152
commit
d914ab1390
21 changed files with 940 additions and 730 deletions
File diff suppressed because it is too large
Load diff
|
@ -89,20 +89,20 @@
|
|||
:type "text"
|
||||
:tab-index "2"
|
||||
:help-icon i/at
|
||||
:label (t locale "auth.email-label")}]]
|
||||
:label (t locale "auth.email")}]]
|
||||
[:div.fields-row
|
||||
[:& fm/input
|
||||
{:type "password"
|
||||
:name :password
|
||||
:tab-index "3"
|
||||
:help-icon i/eye
|
||||
:label (t locale "auth.password-label")}]]
|
||||
:label (t locale "auth.password")}]]
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "auth.login-submit-label")
|
||||
{:label (t locale "auth.login-submit")
|
||||
:on-click on-submit}]
|
||||
(when cfg/login-with-ldap
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "auth.login-with-ldap-submit-label")
|
||||
{:label (t locale "auth.login-with-ldap-submit")
|
||||
:on-click on-submit}])]]))
|
||||
|
||||
(mf/defc login-page
|
||||
|
@ -122,7 +122,7 @@
|
|||
(t locale "auth.forgot-password")]]
|
||||
|
||||
[:div.link-entry
|
||||
[:span (t locale "auth.register-label") " "]
|
||||
[:span (t locale "auth.register") " "]
|
||||
[:a {:on-click #(st/emit! (rt/nav :auth-register))
|
||||
:tab-index "6"}
|
||||
(t locale "auth.register")]]]
|
||||
|
@ -137,11 +137,11 @@
|
|||
{:on-click login-with-gitlab}
|
||||
[:img.logo
|
||||
{: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.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)
|
||||
:tab-index "6"}
|
||||
(t locale "auth.create-demo-profile")]]]]])
|
||||
|
|
|
@ -69,15 +69,15 @@
|
|||
[:div.fields-row
|
||||
[:& fm/input {:type "password"
|
||||
:name :password-1
|
||||
:label (t locale "auth.new-password-label")}]]
|
||||
:label (t locale "auth.new-password")}]]
|
||||
|
||||
[:div.fields-row
|
||||
[:& fm/input {:type "password"
|
||||
:name :password-2
|
||||
:label (t locale "auth.confirm-password-label")}]]
|
||||
:label (t locale "auth.confirm-password")}]]
|
||||
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "auth.recovery-submit-label")}]]))
|
||||
{:label (t locale "auth.recovery-submit")}]]))
|
||||
|
||||
;; --- Recovery Request Page
|
||||
|
||||
|
|
|
@ -44,12 +44,12 @@
|
|||
:form form}
|
||||
[:div.fields-row
|
||||
[:& fm/input {:name :email
|
||||
:label (t locale "auth.email-label")
|
||||
:label (t locale "auth.email")
|
||||
:help-icon i/at
|
||||
:type "text"}]]
|
||||
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "auth.recovery-request-submit-label")}]]))
|
||||
{:label (t locale "auth.recovery-request-submit")}]]))
|
||||
|
||||
|
||||
;; --- Recovery Request Page
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
(st/emit! (rt/nav :dashboard-projects {:team-id (get-in data [:claims :team-id])})
|
||||
du/fetch-profile
|
||||
(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)
|
||||
(dm/success message)))))
|
||||
|
||||
|
@ -91,23 +91,23 @@
|
|||
[:div.fields-row
|
||||
[:& fm/input {:name :fullname
|
||||
:tab-index "1"
|
||||
:label (t locale "auth.fullname-label")
|
||||
:label (t locale "auth.fullname")
|
||||
:type "text"}]]
|
||||
[:div.fields-row
|
||||
[:& fm/input {:type "email"
|
||||
:name :email
|
||||
:tab-index "2"
|
||||
:help-icon i/at
|
||||
:label (t locale "auth.email-label")}]]
|
||||
:label (t locale "auth.email")}]]
|
||||
[:div.fields-row
|
||||
[:& fm/input {:name :password
|
||||
:tab-index "3"
|
||||
:hint (t locale "auth.password-length-hint")
|
||||
:label (t locale "auth.password-label")
|
||||
:label (t locale "auth.password")
|
||||
:type "password"}]]
|
||||
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "auth.register-submit-label")}]]))
|
||||
{:label (t locale "auth.register-submit")}]]))
|
||||
|
||||
;; --- Register Page
|
||||
|
||||
|
@ -130,7 +130,7 @@
|
|||
(t locale "auth.login-here")]]
|
||||
|
||||
[: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)
|
||||
:tab-index "5"}
|
||||
(t locale "auth.create-demo-profile")]]]])
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
(mf/deps project)
|
||||
(st/emitf (modal/show
|
||||
{:type :confirm
|
||||
:title "Deleting project"
|
||||
:message "Are you sure you wan't to delete this project?"
|
||||
:accept-label "Delete project"
|
||||
:title (t locale "modals.delete-project-confirm.title")
|
||||
:message (t locale "modals.delete-project-confirm.message")
|
||||
:accept-label (t locale "modals.delete-project-confirm.accept")
|
||||
:on-accept delete-fn})))
|
||||
|
||||
on-create-clicked
|
||||
|
@ -69,7 +69,7 @@
|
|||
[:header.dashboard-header
|
||||
(if (:is-default project)
|
||||
[:div.dashboard-title
|
||||
[:h1 (t locale "dashboard.header.draft")]]
|
||||
[:h1 (t locale "dashboard.draft-title")]]
|
||||
|
||||
(if (:edition @local)
|
||||
[:& inline-edition {:content (:name project)
|
||||
|
@ -81,8 +81,8 @@
|
|||
[:div.icon {:on-click on-menu-click} i/actions]
|
||||
[:& context-menu {:on-close on-menu-close
|
||||
:show (:menu-open @local)
|
||||
:options [[(t locale "dashboard.grid.rename") on-edit]
|
||||
[(t locale "dashboard.grid.delete") on-delete]]}]]))
|
||||
:options [[(t locale "labels.rename") on-edit]
|
||||
[(t locale "labels.delete") on-delete]]}]]))
|
||||
[:a.btn-secondary.btn-small {:on-click on-create-clicked}
|
||||
(t locale "dashboard.new-file")]]))
|
||||
|
||||
|
|
|
@ -75,11 +75,13 @@
|
|||
(mf/deps file)
|
||||
(fn [event]
|
||||
(dom/stop-propagation event)
|
||||
(st/emit! (modal/show {:type :confirm
|
||||
:title "Deleting file"
|
||||
:message "Are you sure you want to delete this file?"
|
||||
:on-accept delete-fn
|
||||
:accept-label "Delete file"}))))
|
||||
(st/emit! (modal/show
|
||||
{:type :confirm
|
||||
:title (t locale "modals.delete-file-confirm.title")
|
||||
:message (t locale "modals.delete-file-confirm.message")
|
||||
:accept-label (t locale "modals.delete-file-confirm.accept")
|
||||
:on-accept delete-fn}))))
|
||||
|
||||
on-navigate
|
||||
(mf/use-callback
|
||||
(mf/deps id)
|
||||
|
@ -107,10 +109,10 @@
|
|||
(dom/stop-propagation event)
|
||||
(st/emit! (modal/show
|
||||
{:type :confirm
|
||||
:message (t locale "dashboard.grid.add-shared-message" (:name file))
|
||||
:title "Adding as shared library"
|
||||
:hint (t locale "dashboard.grid.add-shared-hint")
|
||||
:accept-label (t locale "dashboard.grid.add-shared-accept")
|
||||
: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}))))
|
||||
|
||||
on-del-shared
|
||||
|
@ -119,12 +121,13 @@
|
|||
(fn [event]
|
||||
(dom/prevent-default event)
|
||||
(dom/stop-propagation event)
|
||||
(modal/show! :confirm
|
||||
{:title "Unsharing file"
|
||||
:message (t locale "dashboard.grid.remove-shared-message" (:name file))
|
||||
:hint (t locale "dashboard.grid.remove-shared-hint")
|
||||
:accept-label (t locale "dashboard.grid.remove-shared-accept")
|
||||
:on-accept del-shared})))
|
||||
(st/emit! (modal/show
|
||||
{:type :confirm
|
||||
:title (t locale "modals.remove-shared-confirm.title")
|
||||
: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}))))
|
||||
|
||||
on-menu-click
|
||||
(mf/use-callback
|
||||
|
@ -167,18 +170,18 @@
|
|||
i/actions]
|
||||
[:& context-menu {:on-close on-close
|
||||
:show (:menu-open @local)
|
||||
:options [[(t locale "dashboard.grid.rename") on-edit]
|
||||
[(t locale "dashboard.grid.delete") on-delete]
|
||||
:options [[(t locale "labels.rename") on-edit]
|
||||
[(t locale "labels.delete") on-delete]
|
||||
(if (:is-shared file)
|
||||
[(t locale "dashboard.grid.remove-shared") on-del-shared]
|
||||
[(t locale "dashboard.grid.add-shared") on-add-shared])]}]]]))
|
||||
[(t locale "dashboard.remove-shared") on-del-shared]
|
||||
[(t locale "dashboard.add-shared") on-add-shared])]}]]]))
|
||||
|
||||
(mf/defc empty-placeholder
|
||||
[]
|
||||
(let [locale (mf/deref i18n/locale)]
|
||||
[:div.grid-empty-placeholder
|
||||
[:div.icon i/file-html]
|
||||
[:div.text (t locale "dashboard.grid.empty-files")]]))
|
||||
[:div.text (t locale "dashboard.empty-files")]]))
|
||||
|
||||
(mf/defc grid
|
||||
[{:keys [id opts files] :as props}]
|
||||
|
@ -240,7 +243,7 @@
|
|||
[:div.grid-item.placeholder {:on-click on-load-more}
|
||||
[:div.placeholder-icon i/arrow-down]
|
||||
[:div.placeholder-label
|
||||
(t locale "dashboard.grid.show-all-files")]])]))
|
||||
(t locale "dashboard.show-all-files")]])]))
|
||||
|
||||
(mf/defc line-grid
|
||||
[{:keys [project-id opts files on-load-more] :as props}]
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
[:*
|
||||
[:header.dashboard-header
|
||||
[:div.dashboard-title
|
||||
[:h1 (tr "dashboard.header.libraries")]]]
|
||||
[:h1 (tr "dashboard.libraries-title")]]]
|
||||
[:section.dashboard-container
|
||||
[:& grid {:files files}]]]))
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
(let [create #(st/emit! (dd/create-project {:team-id (:id team)}))]
|
||||
[:header.dashboard-header
|
||||
[:div.dashboard-title
|
||||
[:h1 "Projects"]]
|
||||
[:h1 (t locale "dashboard.projects-title")]]
|
||||
[:a.btn-secondary.btn-small {:on-click create}
|
||||
(t locale "dashboard.header.new-project")]]))
|
||||
(t locale "dashboard.new-project")]]))
|
||||
|
||||
(defn files-ref
|
||||
[project-id]
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
[okulary.core :as l]
|
||||
[rumext.alpha :as mf]))
|
||||
|
||||
;; --- Component: Search
|
||||
|
||||
(def result-ref
|
||||
(l/derived (l/in [:dashboard-local :search-result]) st/state))
|
||||
|
||||
|
@ -37,17 +35,17 @@
|
|||
(empty? search-term)
|
||||
[:div.grid-empty-placeholder
|
||||
[:div.icon i/search]
|
||||
[:div.text (t locale "dashboard.search.type-something")]]
|
||||
[:div.text (t locale "dashboard.type-something")]]
|
||||
|
||||
(nil? result)
|
||||
[:div.grid-empty-placeholder
|
||||
[: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)
|
||||
[:div.grid-empty-placeholder
|
||||
[: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
|
||||
[:& grid {:files result
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
{:key :images-search-box
|
||||
:id "search-input"
|
||||
:type "text"
|
||||
:placeholder (t locale "ds.search.placeholder")
|
||||
:placeholder (t locale "dashboard.search-placeholder")
|
||||
:default-value search-term
|
||||
:auto-complete "off"
|
||||
:on-focus on-search-focus
|
||||
|
@ -137,11 +137,11 @@
|
|||
(rx/subs #(reset! teams %)))))
|
||||
|
||||
[:ul.dropdown.teams-dropdown
|
||||
[:li.title (t locale "dashboard.sidebar.switch-team")]
|
||||
[:li.title (t locale "dashboard.switch-team")]
|
||||
[:hr]
|
||||
[:li.team-name {:on-click (partial go-projects (:default-team-id profile))}
|
||||
[: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)]
|
||||
[:* {:key (:id team)}
|
||||
|
@ -152,7 +152,7 @@
|
|||
|
||||
[:hr]
|
||||
[: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 ::leave-modal-form
|
||||
|
@ -160,11 +160,10 @@
|
|||
|
||||
(mf/defc leave-and-reassign-modal
|
||||
{::mf/register modal/components
|
||||
::mf/register-as ::leave-and-reassign
|
||||
::mf/props-spec ::kaka-de-vaca}
|
||||
::mf/register-as ::leave-and-reassign}
|
||||
[{:keys [members profile team accept]}]
|
||||
(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))
|
||||
|
||||
on-cancel
|
||||
|
@ -181,13 +180,13 @@
|
|||
[:div.modal-container.confirm-dialog
|
||||
[:div.modal-header
|
||||
[:div.modal-header-title
|
||||
[:h2 "Before you leave"]]
|
||||
[:h2 (tr "modals.leave-and-reassign.title")]]
|
||||
[:div.modal-close-button
|
||||
{:on-click on-cancel} i/close]]
|
||||
|
||||
[:div.modal-content.generic-form
|
||||
[:p "You are " (:name team) " owner."]
|
||||
[:p "Select an other member to promote before leave."]
|
||||
[:p (tr "modals.leave-and-reassign.hint1" (:name team))]
|
||||
[:p (tr "modals.leave-and-reassign.hint2")]
|
||||
|
||||
[:& fm/form {:form form}
|
||||
[:& fm/select {:name :member-id
|
||||
|
@ -197,14 +196,14 @@
|
|||
[:div.action-buttons
|
||||
[:input.cancel-button
|
||||
{:type "button"
|
||||
:value "Cancel"
|
||||
:value (tr "labels.cancel")
|
||||
:on-click on-cancel}]
|
||||
|
||||
[:input.accept-button
|
||||
{:type "button"
|
||||
:class (when-not (:valid @form) "btn-disabled")
|
||||
:disabled (not (:valid @form))
|
||||
:value "Promoto and Leave"
|
||||
:value (tr "modals.leave-and-reassign.promote-and-leave")
|
||||
:on-click on-accept}]]]]]))
|
||||
|
||||
|
||||
|
@ -256,12 +255,11 @@
|
|||
(mf/deps team)
|
||||
(st/emitf (modal/show
|
||||
{:type :confirm
|
||||
:title "Leaving team"
|
||||
:message "Are you sure you want to leave this team?"
|
||||
:accept-label "Leave team"
|
||||
:title (t locale "modals.leave-confirm.title")
|
||||
:message (t locale "modals.leave-confirm.message")
|
||||
:accept-label (t locale "modals.leave-confirm.accept")
|
||||
:on-accept leave-fn})))
|
||||
|
||||
|
||||
on-leave-as-owner-clicked
|
||||
(mf/use-callback
|
||||
(mf/deps team @members)
|
||||
|
@ -282,10 +280,9 @@
|
|||
(mf/deps team)
|
||||
(st/emitf (modal/show
|
||||
{:type :confirm
|
||||
:title "Deleting team"
|
||||
:message (str "Are you sure you want to delete this team?\n"
|
||||
"All projects and files associated with team will be permanently deleted.")
|
||||
:accept-label "Delete team"
|
||||
:title (t locale "modals.delete-team-confirm.title")
|
||||
:message (t locale "modals.delete-team-confirm.message")
|
||||
:accept-label (t locale "modals.delete-team-confirm.accept")
|
||||
:on-accept delete-fn})))]
|
||||
|
||||
(mf/use-layout-effect
|
||||
|
@ -295,21 +292,21 @@
|
|||
(rx/subs #(reset! members %)))))
|
||||
|
||||
[:ul.dropdown.options-dropdown
|
||||
[:li {:on-click go-members} (t locale "dashboard.sidebar.team-members")]
|
||||
[:li {:on-click go-settings} (t locale "dashboard.sidebar.settings")]
|
||||
[:li {:on-click go-members} (t locale "labels.members")]
|
||||
[:li {:on-click go-settings} (t locale "labels.settings")]
|
||||
[:hr]
|
||||
[:li {:on-click on-rename-clicked} (t locale "dashboard.sidebar.rename-team")]
|
||||
[:li {:on-click on-rename-clicked} (t locale "labels.rename")]
|
||||
|
||||
(cond
|
||||
(: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)
|
||||
[: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)
|
||||
[: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
|
||||
|
@ -325,7 +322,7 @@
|
|||
(if (:is-default team)
|
||||
[:div.team-name
|
||||
[: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
|
||||
[:span.team-icon
|
||||
[:img {:src (cfg/resolve-media-path (:photo team))}]]
|
||||
|
@ -397,18 +394,18 @@
|
|||
{:on-click go-projects
|
||||
:class-name (when projects? "current")}
|
||||
i/recent
|
||||
[:span.element-title (t locale "dashboard.sidebar.projects")]]
|
||||
[:span.element-title (t locale "labels.projects")]]
|
||||
|
||||
[:li {:on-click go-drafts
|
||||
:class-name (when drafts? "current")}
|
||||
i/file-html
|
||||
[:span.element-title (t locale "dashboard.sidebar.drafts")]]
|
||||
[:span.element-title (t locale "labels.drafts")]]
|
||||
|
||||
|
||||
[:li {:on-click go-libs
|
||||
:class-name (when libs? "current")}
|
||||
i/library
|
||||
[:span.element-title (t locale "dashboard.sidebar.libraries")]]]]
|
||||
[:span.element-title (t locale "labels.shared-libraries")]]]]
|
||||
|
||||
[:hr]
|
||||
|
||||
|
@ -423,7 +420,7 @@
|
|||
:selected? (= (:id item) (:id project))}])]
|
||||
[:div.sidebar-empty-placeholder
|
||||
[: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
|
||||
|
@ -451,15 +448,15 @@
|
|||
[:ul.dropdown
|
||||
[:li {:on-click (partial on-click :settings-profile)}
|
||||
[:span.icon i/user]
|
||||
[:span.text (t locale "dashboard.sidebar.profile")]]
|
||||
[:span.text (t locale "labels.profile")]]
|
||||
[:hr]
|
||||
[:li {:on-click (partial on-click :settings-password)}
|
||||
[:span.icon i/lock]
|
||||
[:span.text (t locale "dashboard.sidebar.password")]]
|
||||
[:span.text (t locale "labels.password")]]
|
||||
[:hr]
|
||||
[:li {:on-click (partial on-click da/logout)}
|
||||
[:span.icon i/exit]
|
||||
[:span.text (t locale "dashboard.logout")]]]]]))
|
||||
[:span.text (t locale "labels.logout")]]]]]))
|
||||
|
||||
(mf/defc sidebar
|
||||
{::mf/wrap-props false
|
||||
|
|
|
@ -56,17 +56,17 @@
|
|||
|
||||
[:header.dashboard-header
|
||||
[:div.dashboard-title
|
||||
[:h1 "Projects"]]
|
||||
[:h1 (t locale "labels.members")]]
|
||||
[:nav
|
||||
[:ul
|
||||
[: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")}
|
||||
[:a {:on-click go-settings} "SETTINGS"]]]]
|
||||
[:a {:on-click go-settings} (t locale "labels.settings")]]]]
|
||||
|
||||
(if members-section?
|
||||
[:a.btn-secondary.btn-small {:on-click invite-member}
|
||||
(t locale "dashboard.header.invite-profile")]
|
||||
(t locale "dashboard.invite-profile")]
|
||||
[:div])]))
|
||||
|
||||
(s/def ::email ::us/email)
|
||||
|
@ -78,10 +78,10 @@
|
|||
{::mf/register modal/components
|
||||
::mf/register-as ::invite-member}
|
||||
[{:keys [team] :as props}]
|
||||
(let [roles [{:value "" :label "Role"}
|
||||
{:value "admin" :label "Admin"}
|
||||
{:value "editor" :label "Editor"}
|
||||
{:value "viewer" :label "Viewer"}]
|
||||
(let [roles [{:value "" :label (tr "labels.role")}
|
||||
{:value "admin" :label (tr "labels.admin")}
|
||||
{:value "editor" :label (tr "labels.editor")}
|
||||
{:value "viewer" :label (tr "labels.viewer")}]
|
||||
|
||||
initial (mf/use-memo (mf/deps team) (constantly {:team-id (:id team)}))
|
||||
form (fm/use-form :spec ::invite-member-form
|
||||
|
@ -99,16 +99,14 @@
|
|||
mdata {:on-success (partial on-success form)}]
|
||||
(st/emit! (dd/invite-team-member (with-meta params mdata))))))]
|
||||
|
||||
(prn "invite-member-modal" @form)
|
||||
|
||||
[:div.modal.dashboard-invite-modal.form-container
|
||||
[:& fm/form {:on-submit on-submit :form form}
|
||||
[:div.title
|
||||
[:span.text "Invite a new team member"]]
|
||||
[:span.text (tr "modals.invite-member.title")]]
|
||||
|
||||
[:div.form-row
|
||||
[:& fm/input {:name :email
|
||||
:label "Introduce an email"}]
|
||||
:label (tr "labels.email")}]
|
||||
[:& fm/select {:name :role
|
||||
:options roles}]]
|
||||
|
||||
|
@ -141,9 +139,9 @@
|
|||
(mf/deps team member)
|
||||
(st/emitf (modal/show
|
||||
{:type :confirm
|
||||
:title "Promoto to owner"
|
||||
:message "Are you sure you wan't to promote this user to owner?"
|
||||
:accept-label "Promote"
|
||||
:title (tr "modals.promote-owner-confirm.title")
|
||||
:message (tr "modals.promote-owner-confirm.message")
|
||||
:accept-label (tr "modals.promote-owner-confirm.accept")
|
||||
:on-accept set-owner-fn})))
|
||||
|
||||
delete-fn
|
||||
|
@ -154,9 +152,9 @@
|
|||
(mf/deps team member)
|
||||
(st/emitf (modal/show
|
||||
{:type :confirm
|
||||
:title "Delete team member"
|
||||
:message "Are you sure wan't to delete this user from team?"
|
||||
:accept-label "Delete"
|
||||
:title (tr "modals.delete-team-member-confirm.title")
|
||||
:message (tr "modals.delete-team-member-confirm.message")
|
||||
:accept-label (tr "modals.delete-team-member-confirm.accept")
|
||||
:on-accept delete-fn})))]
|
||||
|
||||
|
||||
|
@ -167,16 +165,17 @@
|
|||
[:*
|
||||
(cond
|
||||
(:is-owner member)
|
||||
[:span.label "Owner"]
|
||||
[:span.label (tr "labels.owner")]
|
||||
|
||||
(:is-admin member)
|
||||
[:span.label "Admin"]
|
||||
[:span.label (tr "labels.admin")]
|
||||
|
||||
(:can-edit member)
|
||||
[:span.label "Editor"]
|
||||
[:span.label (tr "labels.editor")]
|
||||
|
||||
:else
|
||||
[:span.label "Viewer"])
|
||||
[:span.label (tr "labels.viewer")])
|
||||
|
||||
(when (and (not (:is-owner member))
|
||||
(or (:is-admin team)
|
||||
(:is-owner team)))
|
||||
|
@ -185,19 +184,19 @@
|
|||
[:& dropdown {:show @show?
|
||||
:on-close #(reset! show? false)}
|
||||
[:ul.dropdown.options-dropdown
|
||||
[:li {:on-click set-admin} "Admin"]
|
||||
[:li {:on-click set-editor} "Editor"]
|
||||
[:li {:on-click set-viewer} "Viewer"]
|
||||
[:li {:on-click set-admin} (tr "labels.admin")]
|
||||
[:li {:on-click set-editor} (tr "labels.editor")]
|
||||
[:li {:on-click set-viewer} (tr "labels.viewer")]
|
||||
(when (:is-owner team)
|
||||
[:*
|
||||
[:hr]
|
||||
[:li {:on-click set-owner} "Promote to owner"]])
|
||||
[:li {:on-click set-owner} (tr "dashboard.promote-to-owner")]])
|
||||
[:hr]
|
||||
(when (and (or (:is-owner team)
|
||||
(:is-admin team))
|
||||
(not= (:id profile)
|
||||
(:id member)))
|
||||
[:li {:on-click delete} "Remove"])]]]]))
|
||||
[:li {:on-click delete} (tr "labels.remove")])]]]]))
|
||||
|
||||
|
||||
(mf/defc team-members
|
||||
|
@ -209,9 +208,9 @@
|
|||
(d/seek :is-owner))]
|
||||
[:div.dashboard-table
|
||||
[:div.table-header
|
||||
[:div.table-field.name "Name"]
|
||||
[:div.table-field.email "Email"]
|
||||
[:div.table-field.permissions "Permissions"]]
|
||||
[:div.table-field.name (tr "labels.name")]
|
||||
[:div.table-field.email (tr "labels.email")]
|
||||
[:div.table-field.permissions (tr "labels.permissions")]]
|
||||
[:div.table-rows
|
||||
[:& team-member {:member owner :team team :profile profile}]
|
||||
(for [item members]
|
||||
|
@ -272,7 +271,7 @@
|
|||
[:div.team-settings
|
||||
[:div.horizontal-blocks
|
||||
[:div.block.info-block
|
||||
[:div.label "Team info"]
|
||||
[:div.label (t locale "dashboard.team-info")]
|
||||
[:div.name (:name team)]
|
||||
[:div.icon
|
||||
[:span.update-overlay {:on-click on-image-click} i/exit]
|
||||
|
@ -283,16 +282,16 @@
|
|||
:on-selected on-file-selected}]]]
|
||||
|
||||
[:div.block.owner-block
|
||||
[:div.label "Team members"]
|
||||
[:div.label (t locale "dashboard.team-members")]
|
||||
[:div.owner
|
||||
[:span.icon [:img {:src (cfg/resolve-media-path (:photo-uri profile))}]]
|
||||
[:span.text (:fullname profile)]]
|
||||
[:div.summary
|
||||
[: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.label "Team projects"]
|
||||
[:div.label (t locale "dashboard.team-projects")]
|
||||
[:div.projects
|
||||
[:span.icon i/folder]
|
||||
[:span.text "4 projects"]]
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
[{:keys [locale] :as props}]
|
||||
(let [logout (constantly nil)]
|
||||
[: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}
|
||||
(t locale "dashboard.logout")]]))
|
||||
(t locale "labels.logout")]]))
|
||||
|
||||
(mf/defc settings
|
||||
[{:keys [route] :as props}]
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
(defn- on-success
|
||||
[form data]
|
||||
(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)
|
||||
(modal/hide))))
|
||||
|
||||
|
@ -83,30 +83,30 @@
|
|||
|
||||
[:div.modal-header
|
||||
[:div.modal-header-title
|
||||
[:h2 (t locale "dashboard.settings.change-email-title")]]
|
||||
[:h2 (t locale "modals.change-email.title")]]
|
||||
[:div.modal-close-button
|
||||
{:on-click on-close} i/close]]
|
||||
|
||||
[:div.modal-content
|
||||
[:& msgs/inline-banner
|
||||
{:type :info
|
||||
:content (t locale "dashboard.settings.change-email-info" (:email profile))}]
|
||||
:content (t locale "modals.change-email.info" (:email profile))}]
|
||||
|
||||
[:div.fields-row
|
||||
[:& fm/input {:type "text"
|
||||
:name :email-1
|
||||
:label (t locale "dashboard.settings.new-email-label")
|
||||
:label (t locale "modals.change-email.new-email")
|
||||
:trim true}]]
|
||||
[:div.fields-row
|
||||
[:& fm/input {:type "text"
|
||||
:name :email-2
|
||||
:label (t locale "dashboard.settings.confirm-email-label")
|
||||
:label (t locale "modals.change-email.confirm-email")
|
||||
:trim true}]]]
|
||||
|
||||
[:div.modal-footer
|
||||
[:div.action-buttons
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "dashboard.settings.change-email-submit-label")}]]]]]]))
|
||||
{:label (t locale "modals.change-email.submit")}]]]]]]))
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,23 +9,23 @@
|
|||
|
||||
(ns app.main.ui.settings.delete-account
|
||||
(:require
|
||||
[cljs.spec.alpha :as s]
|
||||
[beicon.core :as rx]
|
||||
[rumext.alpha :as mf]
|
||||
[app.main.data.auth :as da]
|
||||
[app.main.data.messages :as dm]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.data.users :as du]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.icons :as i]
|
||||
[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.i18n :as i18n :refer [tr t]]))
|
||||
[beicon.core :as rx]
|
||||
[cljs.spec.alpha :as s]
|
||||
[rumext.alpha :as mf]))
|
||||
|
||||
(defn on-error
|
||||
[{:keys [code] :as error}]
|
||||
(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/throw error)))
|
||||
|
||||
|
@ -52,19 +52,19 @@
|
|||
[:div.modal-container.change-email-modal
|
||||
[:div.modal-header
|
||||
[:div.modal-header-title
|
||||
[:h2 (t locale "dashboard.settings.delete-account-title")]]
|
||||
[:h2 (t locale "modals.delete-account.title")]]
|
||||
[:div.modal-close-button
|
||||
{:on-click on-close} i/close]]
|
||||
|
||||
[:div.modal-content
|
||||
[:& msgs/inline-banner
|
||||
{:type :warning
|
||||
:content (t locale "dashboard.settings.delete-account-info")}]]
|
||||
:content (t locale "modals.delete-account.info")}]]
|
||||
|
||||
[:div.modal-footer
|
||||
[:div.action-buttons
|
||||
[: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}
|
||||
(t locale "dashboard.settings.cancel-and-keep-my-account")]]]]]))
|
||||
(t locale "modals.delete-account.cancel")]]]]]))
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
(defn- on-success
|
||||
[form]
|
||||
(st/emit! (dm/success (tr "dashboard.notifications.profile-saved"))))
|
||||
(st/emit! (dm/success (tr "notifications.profile-saved"))))
|
||||
|
||||
(defn- on-submit
|
||||
[form event]
|
||||
|
@ -51,25 +51,25 @@
|
|||
:on-submit on-submit
|
||||
:form form}
|
||||
|
||||
[:h2 (t locale "dashboard.settings.language-change-title")]
|
||||
[:h2 (t locale "labels.language")]
|
||||
|
||||
[:div.fields-row
|
||||
[:& fm/select {:options [{:label "English" :value "en"}
|
||||
{:label "Français" :value "fr"}
|
||||
{:label "Español" :value "es"}
|
||||
{:label "Русский" :value "ru"}]
|
||||
:label (t locale "dashboard.settings.language-label")
|
||||
:label (t locale "dashboard.select-ui-language")
|
||||
:default "en"
|
||||
:name :lang}]]
|
||||
|
||||
[:h2 (t locale "dashboard.settings.theme-change-title")]
|
||||
[:h2 (t locale "dashboard.theme-change")]
|
||||
[:div.fields-row
|
||||
[:& fm/select {:label (t locale "dashboard.settings.theme-label")
|
||||
[:& fm/select {:label (t locale "dashboard.select-ui-theme")
|
||||
:name :theme
|
||||
:default "default"
|
||||
:options [{:label "Default" :value "default"}]}]]
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "dashboard.settings.profile-submit-label")}]]))
|
||||
{:label (t locale "dashboard.update-settings")}]]))
|
||||
|
||||
;; --- Password Page
|
||||
|
||||
|
|
|
@ -73,27 +73,27 @@
|
|||
[:& fm/form {:class "password-form"
|
||||
:on-submit on-submit
|
||||
:form form}
|
||||
[:h2 (t locale "dashboard.settings.password-change-title")]
|
||||
[:h2 (t locale "dashboard.password-change")]
|
||||
[:div.fields-row
|
||||
[:& fm/input
|
||||
{:type "password"
|
||||
:name :password-old
|
||||
:label (t locale "dashboard.settings.old-password-label")}]]
|
||||
:label (t locale "labels.old-password")}]]
|
||||
|
||||
[:div.fields-row
|
||||
[:& fm/input
|
||||
{:type "password"
|
||||
:name :password-1
|
||||
:label (t locale "dashboard.settings.new-password-label")}]]
|
||||
:label (t locale "labels.new-password")}]]
|
||||
|
||||
[:div.fields-row
|
||||
[:& fm/input
|
||||
{:type "password"
|
||||
:name :password-2
|
||||
:label (t locale "dashboard.settings.confirm-password-label")}]]
|
||||
:label (t locale "labels.confirm-password")}]]
|
||||
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "dashboard.settings.profile-submit-label")}]]))
|
||||
{:label (t locale "dashboard.update-settings")}]]))
|
||||
|
||||
;; --- Password Page
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
(defn- on-success
|
||||
[form]
|
||||
(st/emit! (dm/success (tr "dashboard.notifications.profile-saved"))))
|
||||
(st/emit! (dm/success (tr "notifications.profile-saved"))))
|
||||
|
||||
(defn- on-error
|
||||
[form error]
|
||||
|
@ -61,7 +61,7 @@
|
|||
[:& fm/input
|
||||
{:type "text"
|
||||
:name :fullname
|
||||
:label (t locale "dashboard.settings.fullname-label")}]]
|
||||
:label (t locale "dashboard.your-name")}]]
|
||||
|
||||
[:div.fields-row
|
||||
[:& fm/input
|
||||
|
@ -69,20 +69,20 @@
|
|||
:name :email
|
||||
:disabled true
|
||||
:help-icon i/at
|
||||
:label (t locale "dashboard.settings.email-label")}]
|
||||
:label (t locale "dashboard.your-email")}]
|
||||
|
||||
[:div.options
|
||||
[:div.change-email
|
||||
[:a {:on-click #(modal/show! :change-email {})}
|
||||
(t locale "dashboard.settings.change-email-label")]]]]
|
||||
(t locale "dashboard.change-email")]]]]
|
||||
|
||||
[:& fm/submit-button
|
||||
{:label (t locale "dashboard.settings.profile-submit-label")}]
|
||||
{:label (t locale "dashboard.update-settings")}]
|
||||
|
||||
[:div.links
|
||||
[:div.link-item
|
||||
[:a {:on-click #(modal/show! :delete-account {})}
|
||||
(t locale "dashboard.settings.remove-account-label")]]]]))
|
||||
(t locale "dashboard.remove-account")]]]]))
|
||||
|
||||
;; --- Profile Photo Form
|
||||
|
||||
|
@ -103,7 +103,7 @@
|
|||
|
||||
[:form.avatar-form
|
||||
[: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}]
|
||||
[:& file-uploader {:accept "image/jpeg,image/png"
|
||||
:multi false
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
[:div.sidebar-content-section
|
||||
[:div.back-to-dashboard {:on-click go-dashboard}
|
||||
[:span.icon i/arrow-down]
|
||||
[:span.text "Dashboard"]]]
|
||||
[:span.text (t locale "labels.dashboard")]]]
|
||||
[:hr]
|
||||
|
||||
[:div.sidebar-content-section
|
||||
|
@ -67,17 +67,17 @@
|
|||
[:li {:class (when profile? "current")
|
||||
:on-click go-settings-profile}
|
||||
i/user
|
||||
[:span.element-title (t locale "dashboard.sidebar.profile")]]
|
||||
[:span.element-title (t locale "labels.profile")]]
|
||||
|
||||
[:li {:class (when password? "current")
|
||||
:on-click go-settings-password}
|
||||
i/lock
|
||||
[:span.element-title (t locale "dashboard.sidebar.password")]]
|
||||
[:span.element-title (t locale "labels.password")]]
|
||||
|
||||
[:li {:class (when options? "current")
|
||||
:on-click go-settings-options}
|
||||
i/tree
|
||||
[:span.element-title (t locale "dashboard.sidebar.settings")]]]]]))
|
||||
[:span.element-title (t locale "labels.settings")]]]]]))
|
||||
|
||||
(mf/defc sidebar
|
||||
{::mf/wrap [mf/memo]}
|
||||
|
|
|
@ -96,23 +96,34 @@
|
|||
|
||||
edit-input-ref (mf/use-ref nil)
|
||||
|
||||
add-shared-fn #(st/emit! nil (dw/set-file-shared (:id file) true))
|
||||
on-add-shared
|
||||
#(modal/show! :confirm-dialog
|
||||
{:message (t locale "dashboard.grid.add-shared-message" (:name file))
|
||||
:hint (t locale "dashboard.grid.add-shared-hint")
|
||||
:accept-text (t locale "dashboard.grid.add-shared-accept")
|
||||
:not-danger? true
|
||||
:on-accept add-shared-fn})
|
||||
add-shared-fn
|
||||
(st/emitf (dw/set-file-shared (:id file) true))
|
||||
|
||||
del-shared-fn
|
||||
(st/emitf (dw/set-file-shared (:id file) false))
|
||||
|
||||
on-add-shared
|
||||
(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
|
||||
#(modal/show! :confirm-dialog
|
||||
{:message (t locale "dashboard.grid.remove-shared-message" (:name file))
|
||||
:hint (t locale "dashboard.grid.remove-shared-hint")
|
||||
:accept-text (t locale "dashboard.grid.remove-shared-accept")
|
||||
:not-danger? false
|
||||
:on-accept remove-shared-fn})
|
||||
(mf/use-fn
|
||||
(mf/deps file)
|
||||
(st/emitf (modal/show
|
||||
{:type :confirm
|
||||
:title (t locale "modals.remove-shared-confirm.title")
|
||||
: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]
|
||||
(let [value (-> edit-input-ref mf/ref-val dom/get-value)]
|
||||
|
@ -132,7 +143,7 @@
|
|||
|
||||
[:div.menu-section
|
||||
[: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
|
||||
{:on-click #(st/emit! (rt/navigate :dashboard-project {:team-id team-id
|
||||
:project-id (:project-id file)}))}
|
||||
|
@ -205,9 +216,9 @@
|
|||
|
||||
(if (:is-shared file)
|
||||
[: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}
|
||||
[:span (t locale "dashboard.grid.add-shared")]])
|
||||
[:span (t locale "dashboard.add-shared")]])
|
||||
]]]))
|
||||
|
||||
;; --- Header Component
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
[:div.item-name (:name library)]
|
||||
[:div.item-contents (contents-str library)]
|
||||
[:input.item-button {:type "button"
|
||||
:value (tr "workspace.libraries.remove")
|
||||
:value (tr "labels.remove")
|
||||
:on-click #(unlink-library (:id library))}]])
|
||||
]]
|
||||
[:div.section
|
||||
|
|
Loading…
Add table
Reference in a new issue