From f3bf47f0a9001cdb3db23e9bc1aa77ae4ce7f1ec Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 29 Dec 2023 13:36:24 +0100 Subject: [PATCH 1/4] Use icon_button for disabled picture link button Otherwise it will not have the expected style. --- app/views/alchemy/ingredients/shared/_picture_tools.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/alchemy/ingredients/shared/_picture_tools.html.erb b/app/views/alchemy/ingredients/shared/_picture_tools.html.erb index db42d06ad5..2e7f3871be 100644 --- a/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +++ b/app/views/alchemy/ingredients/shared/_picture_tools.html.erb @@ -35,8 +35,8 @@ <% if linkable %> <%= render "alchemy/ingredients/shared/link_tools", ingredient_editor: picture_editor %> <% else %> - <%= render_icon("link", style: "m") %> - <%= render_icon("link-unlink", style: "m") %> + <%= render_icon("link", style: "m") %> + <%= render_icon("link-unlink", style: "m") %> <% end %> <%= content_tag "sl-tooltip", content: Alchemy.t(:edit_image_properties), placement: "top-end" do %> From 3e32ceecd649cbf915c87d4187404889eebbb7af Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 29 Dec 2023 17:56:57 +0100 Subject: [PATCH 2/4] Fix missing image style The svg was old and using an light color. Also the svg selector needs to make sure the missing image is not too large. --- app/assets/images/alchemy/missing-image.svg | 2 +- app/assets/stylesheets/alchemy/archive.scss | 7 +++++-- app/views/alchemy/admin/pictures/_picture.html.erb | 8 +++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/assets/images/alchemy/missing-image.svg b/app/assets/images/alchemy/missing-image.svg index 57897792ab..e4a379493f 100644 --- a/app/assets/images/alchemy/missing-image.svg +++ b/app/assets/images/alchemy/missing-image.svg @@ -1 +1 @@ - + diff --git a/app/assets/stylesheets/alchemy/archive.scss b/app/assets/stylesheets/alchemy/archive.scss index ef9039a052..ea406d9667 100644 --- a/app/assets/stylesheets/alchemy/archive.scss +++ b/app/assets/stylesheets/alchemy/archive.scss @@ -69,9 +69,12 @@ img { max-width: 100%; max-height: 100%; - background: $thumbnail-background; - &[src*=".svg"] { + &:not([src*="alchemy/missing-image"]) { + background: $thumbnail-background; + } + + &[src$=".svg"]:not([src*="alchemy/missing-image"]) { width: var(--picture-width); max-height: var(--picture-height); } diff --git a/app/views/alchemy/admin/pictures/_picture.html.erb b/app/views/alchemy/admin/pictures/_picture.html.erb index 87c3b3c186..474f302453 100644 --- a/app/views/alchemy/admin/pictures/_picture.html.erb +++ b/app/views/alchemy/admin/pictures/_picture.html.erb @@ -20,11 +20,9 @@ <% end %> - <% image = image_tag( - picture.url(size: preview_size(@size), flatten: true) || "alchemy/missing-image.svg", - alt: picture.name - ) %> - <% if can?(:edit, picture) %> + <% picture_url = picture.url(size: preview_size(@size), flatten: true) %> + <% image = image_tag(picture_url || "alchemy/missing-image.svg", alt: picture.name) %> + <% if can?(:edit, picture) && picture_url %> <%= link_to( image, alchemy.admin_picture_path( From 43acb905e388603e9be4983e2fe9388330fd5b1c Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 29 Dec 2023 18:05:18 +0100 Subject: [PATCH 3/4] Fix default empty thumbnail image style More contrast for the color and a bit smaller --- app/assets/stylesheets/alchemy/elements.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/alchemy/elements.scss b/app/assets/stylesheets/alchemy/elements.scss index 84316949d8..858360865d 100644 --- a/app/assets/stylesheets/alchemy/elements.scss +++ b/app/assets/stylesheets/alchemy/elements.scss @@ -604,9 +604,8 @@ alchemy-publish-element-button { height: 120px; .icon { - font-size: 4em; - color: $medium-gray; - vertical-align: top; + font-size: 3em; + color: var(--color-grey_dark); &.error { font-size: 1.2em; From f1a524dfe3fab0a9afa4ecedb813a70f2f178c89 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 29 Dec 2023 20:57:56 +0100 Subject: [PATCH 4/4] Fix small button.icon_button padding `button.small` has padding, so we need to remove it here. --- app/assets/stylesheets/alchemy/buttons.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/alchemy/buttons.scss b/app/assets/stylesheets/alchemy/buttons.scss index 28571d94f3..219a05c412 100644 --- a/app/assets/stylesheets/alchemy/buttons.scss +++ b/app/assets/stylesheets/alchemy/buttons.scss @@ -64,6 +64,7 @@ input.button { height: 15px; background: none; border: none; + padding: 0; // button.small has padding } &.active,