diff --git a/app/assets/stylesheets/alchemy/_variables.scss b/app/assets/stylesheets/alchemy/_variables.scss index b9bd448133..da5dde5403 100644 --- a/app/assets/stylesheets/alchemy/_variables.scss +++ b/app/assets/stylesheets/alchemy/_variables.scss @@ -108,7 +108,7 @@ $error_text_color: #a23434 !default; $error_background_color: #efd3d3 !default; $hint-background-color: $light_yellow !default; -$hint-text-color: $very-dark-gray !default; +$hint-text-color: #59543e !default; $form-left-width: 35% !default; $form-right-width: 65% !default; diff --git a/app/assets/stylesheets/alchemy/buttons.scss b/app/assets/stylesheets/alchemy/buttons.scss index d9f6bbff3e..1eedee1ed6 100644 --- a/app/assets/stylesheets/alchemy/buttons.scss +++ b/app/assets/stylesheets/alchemy/buttons.scss @@ -48,6 +48,7 @@ input.button { } .icon_button { + position: relative; display: inline-flex; align-items: center; justify-content: center; @@ -55,7 +56,6 @@ input.button { height: 30px; margin: 0; padding: 0; - overflow: hidden; text-shadow: none; border-radius: $default-border-radius; @@ -66,7 +66,9 @@ input.button { border: none; } - &:hover { + &.active, + &:active, + &:hover:not([disabled]):not(.disabled):not(.linked) { text-decoration: none; background-color: $default-border-color; cursor: pointer; @@ -79,17 +81,15 @@ input.button { &.disabled, &[disabled] { - span { - opacity: 0.3; - cursor: not-allowed; - } + pointer-events: none; i { opacity: 0.3; } &:hover { - cursor: not-allowed; + text-decoration: none; + cursor: default; } } @@ -97,7 +97,7 @@ input.button { @include linked-button; } - &:focus { + &:focus:not(.disabled):not([disabled]) { @include default-focus-style; } } @@ -125,15 +125,6 @@ button.icon_button { justify-content: center; text-align: center; - &.active, - &:active, - &:hover { - .icon_button:not([disabled]) { - background-color: $default-border-color; - cursor: pointer; - } - } - .select2-container, select { margin: 0; diff --git a/app/assets/stylesheets/alchemy/elements.scss b/app/assets/stylesheets/alchemy/elements.scss index c6ef4858e5..2f75ac169a 100644 --- a/app/assets/stylesheets/alchemy/elements.scss +++ b/app/assets/stylesheets/alchemy/elements.scss @@ -85,9 +85,8 @@ alchemy-tinymce { .element-handle { display: inline-flex; - align-items: center; - justify-content: center; cursor: move; + padding-right: $default-padding; } .element-toggle { @@ -217,6 +216,7 @@ alchemy-tinymce { .element-body, .element-footer, .nestable-elements, + .message, .nested-elements { display: none; } @@ -532,18 +532,11 @@ alchemy-tinymce { bottom: 0; z-index: 0; width: 100%; - padding: $default-padding/2; - - a { - &.linked { - border-radius: $default-border-radius; - background-color: $linked-color; - } + padding: $default-padding; - &.disabled { - opacity: 0.3; - cursor: default; - } + .icon_button { + width: 26px; + height: 26px; } } diff --git a/app/assets/stylesheets/alchemy/flash.scss b/app/assets/stylesheets/alchemy/flash.scss index 1f46f0eb57..09c98ba49f 100644 --- a/app/assets/stylesheets/alchemy/flash.scss +++ b/app/assets/stylesheets/alchemy/flash.scss @@ -35,7 +35,7 @@ div.flash { margin: $default-margin $default-margin 2 * $default-margin; position: relative; min-height: 2.6em; - word-break: break-all; + word-break: break-word; transition-property: opacity, transform; transition-duration: 0.4s; line-height: 1.5; diff --git a/app/assets/stylesheets/alchemy/frame.scss b/app/assets/stylesheets/alchemy/frame.scss index 33515c98a3..4c2cb50c74 100644 --- a/app/assets/stylesheets/alchemy/frame.scss +++ b/app/assets/stylesheets/alchemy/frame.scss @@ -53,8 +53,7 @@ div#overlay_text_box { } .page_status_and_name { - display: flex; - align-items: center; + align-items: end; padding: $default-padding 2 * $default-padding; background-color: $medium-gray; text-shadow: $text-shadow-light; diff --git a/app/assets/stylesheets/alchemy/notices.scss b/app/assets/stylesheets/alchemy/notices.scss index 7e823842fa..851904ff5e 100644 --- a/app/assets/stylesheets/alchemy/notices.scss +++ b/app/assets/stylesheets/alchemy/notices.scss @@ -46,6 +46,12 @@ div.message { } } + &.hint { + background-color: $hint-background-color; + border-color: $hint-background-color; + color: $hint-text-color; + } + &.info { background-color: $info_background_color; border-color: $info_border_color; diff --git a/app/assets/stylesheets/alchemy/selects.scss b/app/assets/stylesheets/alchemy/selects.scss index aec9c832c3..f578a068a1 100644 --- a/app/assets/stylesheets/alchemy/selects.scss +++ b/app/assets/stylesheets/alchemy/selects.scss @@ -269,13 +269,11 @@ select { } .select_with_label { + display: inline-flex; + align-items: center; margin: 0 3 * $default-margin; - display: inline-block; - vertical-align: middle; label { - display: inline-block; - vertical-align: middle; margin-right: 2 * $default-margin; } } diff --git a/app/assets/stylesheets/alchemy/sitemap.scss b/app/assets/stylesheets/alchemy/sitemap.scss index 5b0aa325d5..778573ce07 100644 --- a/app/assets/stylesheets/alchemy/sitemap.scss +++ b/app/assets/stylesheets/alchemy/sitemap.scss @@ -104,7 +104,6 @@ $sitemap-url-xlarge-width: 350px; width: 32px; line-height: $sitemap-line-height; float: left; - padding: 0 2 * $default-padding; text-align: center; } @@ -146,9 +145,9 @@ $sitemap-url-xlarge-width: 350px; .page_folder { position: absolute; - left: -23px; + left: -$sitemap-line-height; top: 0; - width: 16px; + width: $sitemap-line-height; height: $sitemap-line-height; } diff --git a/app/assets/stylesheets/alchemy/tables.scss b/app/assets/stylesheets/alchemy/tables.scss index 41434ab886..13a67ca701 100644 --- a/app/assets/stylesheets/alchemy/tables.scss +++ b/app/assets/stylesheets/alchemy/tables.scss @@ -13,7 +13,7 @@ table { .list td, .list th { - padding: 3 * $default-padding; + padding: 2 * $default-padding 3 * $default-padding; vertical-align: top; line-height: 22px; border-right: 1px solid $medium-gray; @@ -60,6 +60,7 @@ tr.odd td { .list tr .tools { width: 40px; + padding: $default-padding 2 * $default-padding; white-space: nowrap; @extend .disable-user-select; diff --git a/app/helpers/alchemy/base_helper.rb b/app/helpers/alchemy/base_helper.rb index 7a352c5000..85474418ff 100644 --- a/app/helpers/alchemy/base_helper.rb +++ b/app/helpers/alchemy/base_helper.rb @@ -96,6 +96,7 @@ def message_icon_class(message_type) when "warning", "warn", "alert" then "exclamation" when "notice" then "check" when "error" then "bug" + when "hint" then "info" else message_type end diff --git a/app/views/alchemy/admin/elements/_element.html.erb b/app/views/alchemy/admin/elements/_element.html.erb index 3ded7286d2..f288be3537 100644 --- a/app/views/alchemy/admin/elements/_element.html.erb +++ b/app/views/alchemy/admin/elements/_element.html.erb @@ -12,6 +12,10 @@ <%= render 'alchemy/admin/elements/toolbar', element: element %> + <% if element.has_hint? %> + <%= render_message(:hint, sanitize(element.hint)) %> + <% end %> + <% element.definition[:message].tap do |message| %> <%= render_message(:info, sanitize(message)) if message %> <% end %> diff --git a/app/views/alchemy/admin/elements/_header.html.erb b/app/views/alchemy/admin/elements/_header.html.erb index 4f6dc80cfb..42a2f6e1f2 100644 --- a/app/views/alchemy/admin/elements/_header.html.erb +++ b/app/views/alchemy/admin/elements/_header.html.erb @@ -5,7 +5,7 @@ <% elsif element.deprecated? %> <%= hint_with_tooltip element.deprecation_notice %> <% else %> - <%= render_icon('draggable', style: nil, class: 'element') %> + <%= render_icon('draggable', style: nil, class: 'element', fixed_width: false) %> <% end %> @@ -14,7 +14,6 @@ <%= sanitize(element.preview_text.presence || ' ') %> - <%= render_hint_for(element) %> <%= button_tag({ title: Alchemy.t(element.folded? ? :show_element_content : :hide_element_content), class: "element-toggle" diff --git a/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb b/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb index ea5bf73d68..04ea8f6615 100644 --- a/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +++ b/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb @@ -3,8 +3,15 @@
<% if layoutpage.definition.blank? %> <%= page_layout_missing_warning %> + <% elsif layoutpage.locked? %> + + + + <%= Alchemy.t("This page is locked", name: layoutpage.locker_name) %> + + <% else %> - + <% end %>
diff --git a/app/views/alchemy/admin/pages/_current_page.html.erb b/app/views/alchemy/admin/pages/_current_page.html.erb index a4d3530ff3..0d408e6d66 100644 --- a/app/views/alchemy/admin/pages/_current_page.html.erb +++ b/app/views/alchemy/admin/pages/_current_page.html.erb @@ -1,4 +1,4 @@
+ <%= render 'alchemy/admin/pages/page_infos', page: current_page %> <%= render 'alchemy/admin/pages/page_status', page: current_page %> - <%= render 'alchemy/admin/pages/page_infos', page: current_page, icon_size: "1x" %>
diff --git a/app/views/alchemy/admin/pages/_locked_page.html.erb b/app/views/alchemy/admin/pages/_locked_page.html.erb index 0e46c402ee..20bbcab306 100644 --- a/app/views/alchemy/admin/pages/_locked_page.html.erb +++ b/app/views/alchemy/admin/pages/_locked_page.html.erb @@ -3,7 +3,7 @@ <% else %>
<%= link_to alchemy.edit_admin_page_path(locked_page) do %> - <%= render 'alchemy/admin/pages/page_status', page: locked_page, truncate: true %> + <%= render 'alchemy/admin/pages/page_infos', page: locked_page, truncate: true %> <% end %> <%= form_tag(alchemy.unlock_admin_page_path(locked_page), remote: true) do %>
<% end %> - <% if @page.has_hint? %> -
- <%= render_hint_for(@page) %> - <% end %>
diff --git a/app/views/alchemy/admin/pages/info.html.erb b/app/views/alchemy/admin/pages/info.html.erb index d4e2d1164b..1fdfe6b1cd 100644 --- a/app/views/alchemy/admin/pages/info.html.erb +++ b/app/views/alchemy/admin/pages/info.html.erb @@ -1,6 +1,6 @@
<% if @page.has_hint? %> - <%= render_message do %> + <%= render_message(:hint) do %> <%= @page.hint %> <% end %> <% end %> diff --git a/spec/helpers/alchemy/base_helper_spec.rb b/spec/helpers/alchemy/base_helper_spec.rb index 2032dbac00..12f2622be4 100644 --- a/spec/helpers/alchemy/base_helper_spec.rb +++ b/spec/helpers/alchemy/base_helper_spec.rb @@ -114,6 +114,12 @@ module Alchemy it { is_expected.to eq "check" } end + context "when `hint` message type is given" do + let(:message_type) { "hint" } + + it { is_expected.to eq "info" } + end + context "when `error` message type is given" do let(:message_type) { "error" }