diff --git a/app/assets/stylesheets/alchemy/buttons.scss b/app/assets/stylesheets/alchemy/buttons.scss index df03a5a635..28571d94f3 100644 --- a/app/assets/stylesheets/alchemy/buttons.scss +++ b/app/assets/stylesheets/alchemy/buttons.scss @@ -100,6 +100,11 @@ input.button { &:focus:not(.disabled):not([disabled]) { @include default-focus-style; } + + .spinner { + position: static; + transform: none; + } } button.icon_button { diff --git a/app/assets/stylesheets/alchemy/sitemap.scss b/app/assets/stylesheets/alchemy/sitemap.scss index 778573ce07..3b874f8b3e 100644 --- a/app/assets/stylesheets/alchemy/sitemap.scss +++ b/app/assets/stylesheets/alchemy/sitemap.scss @@ -1,5 +1,6 @@ $sitemap-url-large-width: 250px; $sitemap-url-xlarge-width: 350px; +$sitemap-url-header-offset: 110px; #sort_panel { background: $light-gray; @@ -177,12 +178,20 @@ $sitemap-url-xlarge-width: 350px; background-color: $sitemap-page-background-color; border-left: 1px solid $light-gray; float: right; + display: none; + justify-content: end; + width: 170px; height: $sitemap-line-height; line-height: $sitemap-line-height; - padding: 0 $default-padding; .page_status { + margin: 0 $default-margin; padding: 0 $default-padding; + white-space: nowrap; + } + + @media screen and (min-width: $medium-screen-break-point) { + display: flex; } } @@ -210,22 +219,28 @@ $sitemap-url-xlarge-width: 350px; .page_urlname { display: none; margin-left: auto; + padding-left: $default-padding; @media screen and (min-width: $large-screen-break-point) { display: block; - width: $sitemap-url-large-width; + width: $sitemap-url-large-width + $sitemap-url-header-offset; } @media screen and (min-width: 1440px) { - width: $sitemap-url-xlarge-width; + width: $sitemap-url-xlarge-width + $sitemap-url-header-offset; } } .page_status { + display: none; padding-left: 2 * $default-padding; margin-right: 190px; margin-left: auto; + @media screen and (min-width: $medium-screen-break-point) { + display: block; + } + @media screen and (min-width: $large-screen-break-point) { margin-left: initial; } diff --git a/app/javascript/alchemy_admin/components/char_counter.js b/app/javascript/alchemy_admin/components/char_counter.js index b36b91ec8e..2a8752b43d 100644 --- a/app/javascript/alchemy_admin/components/char_counter.js +++ b/app/javascript/alchemy_admin/components/char_counter.js @@ -1,7 +1,7 @@ /** * Show the character counter below input fields and textareas */ -import { AlchemyHTMLElement } from "./alchemy_html_element" +import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_element" import { translate } from "alchemy_admin/i18n" class CharCounter extends AlchemyHTMLElement { diff --git a/app/javascript/alchemy_admin/components/datepicker.js b/app/javascript/alchemy_admin/components/datepicker.js index ef83f038ab..22d7ca287b 100644 --- a/app/javascript/alchemy_admin/components/datepicker.js +++ b/app/javascript/alchemy_admin/components/datepicker.js @@ -1,4 +1,4 @@ -import { AlchemyHTMLElement } from "./alchemy_html_element" +import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_element" import { translate, currentLocale } from "alchemy_admin/i18n" import flatpickr from "flatpickr" diff --git a/app/javascript/alchemy_admin/components/node_select.js b/app/javascript/alchemy_admin/components/node_select.js index 5e648bb28a..e3d17c1bdd 100644 --- a/app/javascript/alchemy_admin/components/node_select.js +++ b/app/javascript/alchemy_admin/components/node_select.js @@ -1,4 +1,4 @@ -import { RemoteSelect } from "./remote_select" +import { RemoteSelect } from "alchemy_admin/components/remote_select" class NodeSelect extends RemoteSelect { _searchQuery(term, page) { diff --git a/app/javascript/alchemy_admin/components/overlay.js b/app/javascript/alchemy_admin/components/overlay.js index 6db711350f..cbfd58c464 100644 --- a/app/javascript/alchemy_admin/components/overlay.js +++ b/app/javascript/alchemy_admin/components/overlay.js @@ -1,4 +1,4 @@ -import { AlchemyHTMLElement } from "./alchemy_html_element" +import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_element" class Overlay extends AlchemyHTMLElement { static properties = { diff --git a/app/javascript/alchemy_admin/components/page_select.js b/app/javascript/alchemy_admin/components/page_select.js index cac24fe1de..7d2475bf43 100644 --- a/app/javascript/alchemy_admin/components/page_select.js +++ b/app/javascript/alchemy_admin/components/page_select.js @@ -1,4 +1,4 @@ -import { RemoteSelect } from "./remote_select" +import { RemoteSelect } from "alchemy_admin/components/remote_select" class PageSelect extends RemoteSelect { onChange(event) { diff --git a/app/javascript/alchemy_admin/components/remote_select.js b/app/javascript/alchemy_admin/components/remote_select.js index 6ed12036b9..4612473373 100644 --- a/app/javascript/alchemy_admin/components/remote_select.js +++ b/app/javascript/alchemy_admin/components/remote_select.js @@ -1,4 +1,4 @@ -import { AlchemyHTMLElement } from "./alchemy_html_element" +import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_element" export class RemoteSelect extends AlchemyHTMLElement { static properties = { diff --git a/app/javascript/alchemy_admin/components/spinner.js b/app/javascript/alchemy_admin/components/spinner.js index d2fb01104b..8b0cdc88e7 100644 --- a/app/javascript/alchemy_admin/components/spinner.js +++ b/app/javascript/alchemy_admin/components/spinner.js @@ -1,4 +1,4 @@ -import { AlchemyHTMLElement } from "./alchemy_html_element" +import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_element" class Spinner extends AlchemyHTMLElement { static properties = { diff --git a/app/javascript/alchemy_admin/components/tinymce.js b/app/javascript/alchemy_admin/components/tinymce.js index 1548e4d7df..349e4ee52c 100644 --- a/app/javascript/alchemy_admin/components/tinymce.js +++ b/app/javascript/alchemy_admin/components/tinymce.js @@ -1,4 +1,4 @@ -import { AlchemyHTMLElement } from "./alchemy_html_element" +import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_element" import { currentLocale } from "alchemy_admin/i18n" const TOOLBAR_ROW_HEIGHT = 30 diff --git a/app/models/alchemy/page/page_natures.rb b/app/models/alchemy/page/page_natures.rb index 6e1adbde67..79b7802b14 100644 --- a/app/models/alchemy/page/page_natures.rb +++ b/app/models/alchemy/page/page_natures.rb @@ -62,14 +62,22 @@ def status } end - # Returns the translated status for given status type. + # Returns the long translated status message for given status type. # # @param [Symbol] status_type # - def status_title(status_type) + def status_message(status_type) Alchemy.t(status[status_type].to_s, scope: "page_states.#{status_type}") end + # Returns the sort translated status title for given status type. + # + # @param [Symbol] status_type + # + def status_title(status_type) + Alchemy.t(status[status_type].to_s, scope: "page_status_titles.#{status_type}") + end + # Returns the self#page_layout definition from config/alchemy/page_layouts.yml file. def definition definition = PageLayout.get(page_layout) diff --git a/app/views/alchemy/admin/pages/_page.html.erb b/app/views/alchemy/admin/pages/_page.html.erb index 158e788d32..3fa2a5d889 100644 --- a/app/views/alchemy/admin/pages/_page.html.erb +++ b/app/views/alchemy/admin/pages/_page.html.erb @@ -123,16 +123,18 @@ {{/if}}
<% if @page.public? %> - <%= render_icon(:cloud, size: "1x", class: "disabled") %> + <%= render_icon(:cloud, size: "1x") %> <% else %> <%= render_icon("cloud-off", size: "1x") %> <% end %> - <%= @page.status_title(:public) %> + <%= @page.status_message(:public) %> <% if @page.restricted? %> <%= render_icon(:lock, size: "1x") %> <% else %> - <%= render_icon("lock-unlock", size: "1x", class: "disabled") %> + <%= render_icon("lock-unlock", size: "1x") %> <% end %> - <%= @page.status_title(:restricted) %> + <%= @page.status_message(:restricted) %>
diff --git a/config/locales/alchemy.en.yml b/config/locales/alchemy.en.yml index 93bdf075fb..cb8d36b43c 100644 --- a/config/locales/alchemy.en.yml +++ b/config/locales/alchemy.en.yml @@ -527,19 +527,27 @@ en: "Page created": "Page: '%{name}' created." page_infos: "Page info" page_properties: "Page properties" - page_public: "published" page_published: "Published page" - page_restricted: "restricted" page_states: public: - "true": "Page is published." - "false": "Page is unpublished." + "true": "Page is available online." + "false": "Page is unavailable for website visitors." locked: "true": "Page is being edited at the moment." "false": "" restricted: - "true": "Page is restricted." - "false": "Page is not restricted." + "true": "Page is only accessible by members." + "false": "Page is accessible by all visitors." + page_status_titles: + public: + "true": "online" + "false": "offline" + locked: + "true": "locked" + "false": "" + restricted: + "true": "restricted" + "false": "accessible" page_status: "Status" page_title: "Title" page_type: "Type" diff --git a/spec/models/alchemy/page_spec.rb b/spec/models/alchemy/page_spec.rb index cb36a3c6f0..80352b4854 100644 --- a/spec/models/alchemy/page_spec.rb +++ b/spec/models/alchemy/page_spec.rb @@ -1683,7 +1683,7 @@ module Alchemy describe "#status_title" do it "returns a translated status string for public status" do - expect(page.status_title(:public)).to eq("Page is published.") + expect(page.status_title(:public)).to eq("online") end it "returns a translated status string for locked status" do @@ -1691,7 +1691,21 @@ module Alchemy end it "returns a translated status string for restricted status" do - expect(page.status_title(:restricted)).to eq("Page is not restricted.") + expect(page.status_title(:restricted)).to eq("accessible") + end + end + + describe "#status_message" do + it "returns a translated status string for public status" do + expect(page.status_message(:public)).to eq("Page is available online.") + end + + it "returns a translated status string for locked status" do + expect(page.status_message(:locked)).to eq("") + end + + it "returns a translated status string for restricted status" do + expect(page.status_message(:restricted)).to eq("Page is accessible by all visitors.") end end end