From 1778a7563b1606cdc079397d2522832831f5961c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 30 Jan 2023 15:05:29 +0100 Subject: [PATCH] Use CSS to define alignment in translations message That way it's possible to override the style without changing the HTML, which is the hardest code to customize and maintain. --- app/assets/stylesheets/layout/remote_translations_button.scss | 1 + .../layout/remote_translations_button_component.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/layout/remote_translations_button.scss b/app/assets/stylesheets/layout/remote_translations_button.scss index f4a6db706..0c1eafe41 100644 --- a/app/assets/stylesheets/layout/remote_translations_button.scss +++ b/app/assets/stylesheets/layout/remote_translations_button.scss @@ -1,4 +1,5 @@ .remote-translations-button { + text-align: center; &.callout { margin: 0; diff --git a/app/components/layout/remote_translations_button_component.html.erb b/app/components/layout/remote_translations_button_component.html.erb index 478f61459..9447e6d5a 100644 --- a/app/components/layout/remote_translations_button_component.html.erb +++ b/app/components/layout/remote_translations_button_component.html.erb @@ -1,4 +1,4 @@ -
+
<% if display_remote_translation_button? %> <%= form_tag remote_translations_path do %> <%= hidden_field_tag :remote_translations, remote_translations.to_json %>