diff --git a/frontend/resources/styles/main/partials/sidebar.scss b/frontend/resources/styles/main/partials/sidebar.scss index b94fa06e9..1f83627db 100644 --- a/frontend/resources/styles/main/partials/sidebar.scss +++ b/frontend/resources/styles/main/partials/sidebar.scss @@ -119,6 +119,17 @@ } } } + + & .view-only-mode { + color: $color-primary; + border: 1px solid $color-primary; + border-radius: 3px; + font-size: 10px; + text-transform: uppercase; + padding: 0px 4px; + display: flex; + align-items: center; + } } & .focus-title { diff --git a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs index b5e93f97d..e05fdba67 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs @@ -540,6 +540,8 @@ observer-var (mf/use-var nil) lazy-load-ref (mf/use-ref nil) + workspace-read-only? (mf/use-ctx ctx/workspace-read-only?) + [filtered-objects show-more filter-component] (use-search page objects) intersection-callback @@ -576,14 +578,17 @@ (dom/add-class! last-hidden-frame "sticky"))))] [:div#layers.tool-window - (if (d/not-empty? focus) + (if workspace-read-only? [:div.tool-window-bar - [:div.focus-title {:on-click #(st/emit! (dw/toggle-focus-mode))} - [:button.back-button i/arrow-slide] - [:div.focus-name (or title (tr "workspace.focus.selection"))] - [:div.focus-mode (tr "workspace.focus.focus-mode")]]] - - filter-component) + [:span (:name page)] + [:span.view-only-mode (tr "labels.view-only")]] + (if (d/not-empty? focus) + [:div.tool-window-bar + [:div.focus-title {:on-click #(st/emit! (dw/toggle-focus-mode))} + [:button.back-button i/arrow-slide] + [:div.focus-name (or title (tr "workspace.focus.selection"))] + [:div.focus-mode (tr "workspace.focus.focus-mode")]]] + filter-component)) (if (some? filtered-objects) [:* @@ -599,8 +604,8 @@ :key (dm/str (:id page)) :filtered? true}]]] - [:div.tool-window-content {:on-scroll on-scroll - :style {:display (when (some? filtered-objects) "none")}} - [:& layers-tree {:objects objects - :key (dm/str (:id page)) - :filtered? false}]])])) + [:div.tool-window-content {:on-scroll on-scroll + :style {:display (when (some? filtered-objects) "none")}} + [:& layers-tree {:objects objects + :key (dm/str (:id page)) + :filtered? false}]])])) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index ddc9b3743..ddf122ca9 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -1549,6 +1549,9 @@ msgstr "Active" msgid "labels.inactive" msgstr "Inactive" +msgid "labels.view-only" +msgstr "VIEW ONLY" + #: src/app/main/data/workspace/persistence.cljs, src/app/main/data/workspace/persistence.cljs, src/app/main/data/media.cljs msgid "media.loading" msgstr "Loading image…" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 049f79aa8..6edd78b81 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -1742,6 +1742,9 @@ msgstr "Activo" msgid "labels.inactive" msgstr "Inactivo" +msgid "labels.view-only" +msgstr "SOLO LECTURA" + #: src/app/main/data/workspace/persistence.cljs, src/app/main/data/media.cljs msgid "media.loading" msgstr "Cargando imagen…"