From 651d134280c17ae61d92f0c8392328ea48201fde Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Thu, 14 Dec 2023 09:55:14 +0100 Subject: [PATCH 1/3] Use icon_button for page folder --- app/assets/javascripts/alchemy/templates/page_folder.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/alchemy/templates/page_folder.hbs b/app/assets/javascripts/alchemy/templates/page_folder.hbs index eb9536b8b5..350b32ea38 100644 --- a/app/assets/javascripts/alchemy/templates/page_folder.hbs +++ b/app/assets/javascripts/alchemy/templates/page_folder.hbs @@ -1,3 +1,3 @@ - - + + From 20b05bcd4929972e4c5f71344e63dd011f82fa1e Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Thu, 14 Dec 2023 09:57:30 +0100 Subject: [PATCH 2/3] Allow to drag locked pages There is no reason to not allow dragndrop locked pages as this does not effect page content. --- app/views/alchemy/admin/pages/_page.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/alchemy/admin/pages/_page.html.erb b/app/views/alchemy/admin/pages/_page.html.erb index 3fa2a5d889..7f927b5d25 100644 --- a/app/views/alchemy/admin/pages/_page.html.erb +++ b/app/views/alchemy/admin/pages/_page.html.erb @@ -6,15 +6,15 @@ <%= page_layout_missing_warning %> {{else}} {{#if permissions.edit_content}} - {{#if locked}} - - {{else}} - + {{#if locked}} + + {{else}} + + {{/if}} - {{/if}} {{else}} " class="like-hint-tooltip" placement="bottom-start"> From 5068b3760e8d36ee726aa9cc2b04de43f5217d56 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Thu, 14 Dec 2023 10:07:27 +0100 Subject: [PATCH 3/3] Show locked notice in page status To make this more accessible and obvious in what state a locked page is, we show this state as well. --- app/serializers/alchemy/page_tree_serializer.rb | 3 ++- app/views/alchemy/admin/pages/_page.html.erb | 6 ++++++ app/views/alchemy/admin/pages/_table_row.html.erb | 8 +++++++- app/views/alchemy/admin/pages/info.html.erb | 13 +++++++------ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/app/serializers/alchemy/page_tree_serializer.rb b/app/serializers/alchemy/page_tree_serializer.rb index 9462e7a8a8..48ab105dc1 100644 --- a/app/serializers/alchemy/page_tree_serializer.rb +++ b/app/serializers/alchemy/page_tree_serializer.rb @@ -105,7 +105,8 @@ def page_permissions(page, ability) def page_status_titles(page) { public: page.status_title(:public), - restricted: page.status_title(:restricted) + restricted: page.status_title(:restricted), + locked: page.status_title(:locked) } end end diff --git a/app/views/alchemy/admin/pages/_page.html.erb b/app/views/alchemy/admin/pages/_page.html.erb index 7f927b5d25..c5ea5553c9 100644 --- a/app/views/alchemy/admin/pages/_page.html.erb +++ b/app/views/alchemy/admin/pages/_page.html.erb @@ -123,6 +123,12 @@ {{/if}}
+ {{#if locked}} + + + {{status_titles.locked}} + + {{/if}} {{#if restricted}} diff --git a/app/views/alchemy/admin/pages/_table_row.html.erb b/app/views/alchemy/admin/pages/_table_row.html.erb index 692dbb4ce4..1d2225d2cb 100644 --- a/app/views/alchemy/admin/pages/_table_row.html.erb +++ b/app/views/alchemy/admin/pages/_table_row.html.erb @@ -3,7 +3,7 @@ <% if can?(:edit_content, page) %> <% if page.locked? %> <% else %> @@ -37,6 +37,12 @@ <%= l(page.updated_at, format: :"alchemy.default") %> + <% if page.locked? %> + + <%= render_icon(:edit, size: "1x") %> + <%= page.status_title(:locked) %> + + <% end %> <% if page.restricted? %> <%= render_icon(:lock, size: "1x") %> diff --git a/app/views/alchemy/admin/pages/info.html.erb b/app/views/alchemy/admin/pages/info.html.erb index 7f90709e17..ff1d708ddd 100644 --- a/app/views/alchemy/admin/pages/info.html.erb +++ b/app/views/alchemy/admin/pages/info.html.erb @@ -20,6 +20,13 @@

+ <% if @page.locked? %> + + <%= render_icon(:edit, size: "1x") %> + <%= Alchemy.t(:currently_edited_by) %> + <%= @page.locker_name %> + + <% end %> <% if @page.public? %> <%= render_icon(:cloud, size: "1x") %> @@ -46,10 +53,4 @@

<%= Alchemy.t(:from_at) % {by: @page.updater_name, at: l(@page.updated_at, format: :'alchemy.page_status')} %>

- <% if @page.locked? %> -
- -

<%= @page.locker_name %>

-
- <% end %>