From 4f0351c48c8d081de8c4c1b1165ba4a917311d45 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 8 Mar 2024 17:07:50 +0100 Subject: [PATCH 1/4] Fix layoutpages layout for flexy sitemap We rebuilt the sitemap with flexbox but forgot to update the layoutpages as well. --- .../admin/layoutpages/_layoutpage.html.erb | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb b/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb index a697e995e7..6ef330061b 100644 --- a/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +++ b/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb @@ -11,6 +11,22 @@ <% end %> +
+ <%= link_to( + layoutpage.name, + alchemy.edit_admin_page_path(layoutpage), + title: Alchemy.t(:edit_page), + class: "sitemap_pagename_link #{cycle('even', 'odd')}" + ) -%> +
+
+ <% if layoutpage.locked? %> + + + <%= layoutpage.status_title(:locked) %> + + <% end %> +
<%- if can?(:configure, layoutpage) -%> @@ -54,21 +70,5 @@ <%- end -%>
-
- <% if layoutpage.locked? %> - - - <%= layoutpage.status_title(:locked) %> - - <% end %> -
-
- <%= link_to( - layoutpage.name, - alchemy.edit_admin_page_path(layoutpage), - title: Alchemy.t(:edit_page), - class: "sitemap_pagename_link #{cycle('even', 'odd')}" - ) -%> -
From e8949c039dc25fd6dba60cb238e0281ca026e296 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 8 Mar 2024 17:10:21 +0100 Subject: [PATCH 2/4] Add thicker underline for text links --- app/assets/stylesheets/alchemy/base.scss | 49 +++++++++++++++------ app/assets/stylesheets/alchemy/sitemap.scss | 1 - 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/app/assets/stylesheets/alchemy/base.scss b/app/assets/stylesheets/alchemy/base.scss index a86af4c56a..eb3e1ee34e 100644 --- a/app/assets/stylesheets/alchemy/base.scss +++ b/app/assets/stylesheets/alchemy/base.scss @@ -28,7 +28,8 @@ noscript { color: $warning_text_color; background-color: $warning_background_color; - h1, p { + h1, + p { margin: 16px 0; } } @@ -43,7 +44,9 @@ body { cursor: default; // Fix for strange element window offset - &.pages.edit { overflow: hidden } + &.pages.edit { + overflow: hidden; + } &.prevent-scrolling { overflow: hidden; @@ -57,6 +60,7 @@ a { &:hover { text-decoration: underline; + text-decoration-thickness: 1px; } img { @@ -64,7 +68,8 @@ a { } } -a:focus, [tabindex]:focus { +a:focus, +[tabindex]:focus { @include default-focus-style; } @@ -82,14 +87,18 @@ hr { width: 80%; max-width: 500px; margin: 2em auto; - padding: 4*$default-padding; + padding: 4 * $default-padding; background: $medium-gray; border-radius: $default-border-radius; } -.float_right { float: right } +.float_right { + float: right; +} -.float_left { float: left } +.float_left { + float: left; +} .center { text-align: center; @@ -124,11 +133,11 @@ hr { } .with_padding { - padding: 2*$default-padding; + padding: 2 * $default-padding; } .with_margin { - margin: 2*$default-margin; + margin: 2 * $default-margin; } a img { @@ -144,16 +153,28 @@ a img { } @-moz-keyframes spin { - from { -moz-transform: rotate(0deg); } - to { -moz-transform: rotate(360deg); } + from { + -moz-transform: rotate(0deg); + } + to { + -moz-transform: rotate(360deg); + } } @-webkit-keyframes spin { - from { -webkit-transform: rotate(0deg); } - to { -webkit-transform: rotate(360deg); } + from { + -webkit-transform: rotate(0deg); + } + to { + -webkit-transform: rotate(360deg); + } } @keyframes spin { - from {transform:rotate(0deg);} - to {transform:rotate(360deg);} + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } diff --git a/app/assets/stylesheets/alchemy/sitemap.scss b/app/assets/stylesheets/alchemy/sitemap.scss index 1f98d4f328..d1c3ff1457 100644 --- a/app/assets/stylesheets/alchemy/sitemap.scss +++ b/app/assets/stylesheets/alchemy/sitemap.scss @@ -149,7 +149,6 @@ display: block; padding: 0 10px; margin: 2px; - text-decoration: none; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; From cf4fd96bafc51d72715c1f94efce9e083fe5d2ac Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 8 Mar 2024 17:16:54 +0100 Subject: [PATCH 3/4] Rebuilt nodes tree with flexbox --- app/assets/stylesheets/alchemy/nodes.scss | 14 ++++---- app/views/alchemy/admin/nodes/_node.html.erb | 38 ++++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/assets/stylesheets/alchemy/nodes.scss b/app/assets/stylesheets/alchemy/nodes.scss index 00855eccdf..f8db982a6f 100644 --- a/app/assets/stylesheets/alchemy/nodes.scss +++ b/app/assets/stylesheets/alchemy/nodes.scss @@ -84,6 +84,8 @@ } .sitemap_node { + display: flex; + align-items: center; height: $sitemap-line-height; margin: 3 * $default-margin 0; transition: background-color $transition-duration; @@ -102,8 +104,9 @@ } .node_name { - height: $sitemap-line-height; display: flex; + height: $sitemap-line-height; + flex: 1; justify-content: space-between; @include border-left-radius($default-border-radius); padding: 0 0 0 10px; @@ -126,8 +129,7 @@ .nodes_tree-left_images { position: relative; width: 32px; - line-height: $sitemap-line-height; - float: left; + height: $sitemap-line-height; padding: 0 2 * $default-padding; text-align: center; } @@ -136,15 +138,13 @@ display: flex; height: $sitemap-line-height; padding: 0 2 * $default-padding; - float: right; align-items: center; > a { - float: left; + display: inline-flex; width: $sitemap-line-height; height: $sitemap-line-height; - line-height: $sitemap-line-height; - text-align: center; + align-items: center; text-decoration: none; margin: 0; diff --git a/app/views/alchemy/admin/nodes/_node.html.erb b/app/views/alchemy/admin/nodes/_node.html.erb index 5423545cdf..46bde42a6b 100644 --- a/app/views/alchemy/admin/nodes/_node.html.erb +++ b/app/views/alchemy/admin/nodes/_node.html.erb @@ -7,6 +7,25 @@   +
+ <%= node.name || ' '.html_safe %> + + <% if node.page %> + + <%= link_to [:edit, :admin, node.page], title: Alchemy.t(:edit_page) do %> + <%= node.page.name %> + <% end %> + <% end %> + + <% if node.url %> + + <%= link_to node.url, node.url, target: '_blank', title: node.url %> + <% if node.external? %> + + <% end %> + + <% end %> +
<% if can?(:edit, node) %> @@ -52,25 +71,6 @@ <% end %> -
- <%= node.name || ' '.html_safe %> - - <% if node.page %> - - <%= link_to [:edit, :admin, node.page], title: Alchemy.t(:edit_page) do %> - <%= node.page.name %> - <% end %> - <% end %> - - <% if node.url %> - - <%= link_to node.url, node.url, target: '_blank', title: node.url %> - <% if node.external? %> - - <% end %> - - <% end %> -
<% end %> <%= content_tag :ul, class: "children #{' folded' if node.folded?}", data: { record_id: node.id } do %> <%= render partial: 'node', collection: node.children.includes(:page, :children) %> From 38e15d477fb10e1f77fad74e22ee217b955d17d2 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 8 Mar 2024 20:41:39 +0100 Subject: [PATCH 4/4] Remove unused animations --- app/assets/stylesheets/alchemy/base.scss | 27 ------------------------ 1 file changed, 27 deletions(-) diff --git a/app/assets/stylesheets/alchemy/base.scss b/app/assets/stylesheets/alchemy/base.scss index eb3e1ee34e..430524d55c 100644 --- a/app/assets/stylesheets/alchemy/base.scss +++ b/app/assets/stylesheets/alchemy/base.scss @@ -151,30 +151,3 @@ a img { .hidden { display: none; } - -@-moz-keyframes spin { - from { - -moz-transform: rotate(0deg); - } - to { - -moz-transform: rotate(360deg); - } -} - -@-webkit-keyframes spin { - from { - -webkit-transform: rotate(0deg); - } - to { - -webkit-transform: rotate(360deg); - } -} - -@keyframes spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -}