From: Andy Allan Date: Wed, 21 Jul 2021 10:45:37 +0000 (+0100) Subject: Refactor to use a heading class for height when using header-illustrations X-Git-Tag: live~2059^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2443e7dd650a3d3aaae9ab14d14d2fde6a582755?ds=inline Refactor to use a heading class for height when using header-illustrations This fixes a glitch highlighted in #3259, where the css class stopped applying when the view was moved to a different controller. We're moving to having each view responsible for their layout, and commonly having override classes explicitly in the relevant views. So we can follow that pattern here. --- diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 3bec5fe36..3e4b30a70 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1035,13 +1035,8 @@ tr.turn:hover { /* Overrides for pages that use new layout conventions */ -.users-new, -.users-create, -.users-terms, -.users-confirm { - .content-heading .content-inner { - height: 200px; - } +.header-illustration-heading { + height: 200px; } .header-illustration { diff --git a/app/views/confirmations/confirm.html.erb b/app/views/confirmations/confirm.html.erb index fde545546..75d72487c 100644 --- a/app/views/confirmations/confirm.html.erb +++ b/app/views/confirmations/confirm.html.erb @@ -1,3 +1,4 @@ +<% content_for :heading_class, "header-illustration-heading" %> <% content_for :heading do %>

<%= t ".heading" %>

diff --git a/app/views/users/blocked.html.erb b/app/views/users/blocked.html.erb index ed00a8fcc..b49990705 100644 --- a/app/views/users/blocked.html.erb +++ b/app/views/users/blocked.html.erb @@ -1,3 +1,4 @@ +<% content_for :heading_class, "header-illustration-heading" %> <% content_for :heading do %>

<%= t "users.new.title" %>

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 264fc8e02..165c9486b 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -2,6 +2,7 @@ <%= javascript_include_tag "user" %> <% end %> +<% content_for :heading_class, "header-illustration-heading" %> <% content_for :heading do %>

<%= t ".title" %>

diff --git a/app/views/users/terms.html.erb b/app/views/users/terms.html.erb index 99af8b841..f32cc17bd 100644 --- a/app/views/users/terms.html.erb +++ b/app/views/users/terms.html.erb @@ -2,6 +2,7 @@ <%= javascript_include_tag "user" %> <% end %> +<% content_for :heading_class, "header-illustration-heading" %> <% content_for :heading do %>

<%= t ".heading" %>