From f02b6a7a085eaed9a706774bf6f235a137660c09 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 2 Aug 2019 12:24:04 +0100 Subject: [PATCH 1/8] Fix indentation --- app/views/request/_sidebar.html.erb | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/views/request/_sidebar.html.erb b/app/views/request/_sidebar.html.erb index 8cf060b858..f592640ef1 100644 --- a/app/views/request/_sidebar.html.erb +++ b/app/views/request/_sidebar.html.erb @@ -10,30 +10,30 @@ <% end %>
- <% if @info_request.attention_requested %> - <% if @info_request.prominence(:decorate => true).is_hidden? %> -

<%= _('Request hidden') %>

-

- <%= _("This request has prominence 'hidden'. You can only see it " \ - "because you are logged in as a super user.") %> -

- <% elsif @info_request.prominence(:decorate => true).is_requester_only? %> -

<%= _('Request hidden') %>

- <%# The eccentric formatting of the following string is in order that it be identical - to the corresponding string in request/show.html.erb %> -

<%= _('This request is hidden, so that only you the requester ' \ - 'can see it. Please contact us ' \ - 'if you are not sure why.', - :url => help_requesting_path.html_safe) %>

- <% elsif @info_request.described_state != "attention_requested" %> -

<%= _('Offensive? Unsuitable?') %>

-

<%= _('This request has been marked for review by the site ' \ - 'administrators, who have not hidden it at this time. ' \ - 'If you believe it should be hidden, please ' \ - 'contact us.', - :url => help_requesting_path.html_safe) %>

+ <% if @info_request.attention_requested %> + <% if @info_request.prominence(:decorate => true).is_hidden? %> +

<%= _('Request hidden') %>

+

+ <%= _("This request has prominence 'hidden'. You can only see it " \ + "because you are logged in as a super user.") %> +

+ <% elsif @info_request.prominence(:decorate => true).is_requester_only? %> +

<%= _('Request hidden') %>

+ <%# The eccentric formatting of the following string is in order that it + be identical to the corresponding string in request/show.html.erb %> +

<%= _('This request is hidden, so that only you the requester ' \ + 'can see it. Please contact us ' \ + 'if you are not sure why.', + :url => help_requesting_path.html_safe) %>

+ <% elsif @info_request.described_state != "attention_requested" %> +

<%= _('Offensive? Unsuitable?') %>

+

<%= _('This request has been marked for review by the site ' \ + 'administrators, who have not hidden it at this time. ' \ + 'If you believe it should be hidden, please ' \ + 'contact us.', + :url => help_requesting_path.html_safe) %>

+ <% end %> <% end %> - <% end %>
<%= render :partial => 'request/act' %> From c0d76e669fae04f4dcae947a7d103a140d7f165d Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 7 Aug 2019 17:37:32 +0100 Subject: [PATCH 2/8] Nest div inside conditional Only render the `request__special-status` div if there is actually a special status, otherwise we end up rendering an empty div. --- app/views/request/_sidebar.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/request/_sidebar.html.erb b/app/views/request/_sidebar.html.erb index f592640ef1..c02b109d13 100644 --- a/app/views/request/_sidebar.html.erb +++ b/app/views/request/_sidebar.html.erb @@ -9,8 +9,8 @@ locals: { info_request: @info_request } %> <% end %> -
- <% if @info_request.attention_requested %> + <% if @info_request.attention_requested %> +
<% if @info_request.prominence(:decorate => true).is_hidden? %>

<%= _('Request hidden') %>

@@ -33,8 +33,8 @@ 'contact us.', :url => help_requesting_path.html_safe) %>

<% end %> - <% end %> -
+
+ <% end %> <%= render :partial => 'request/act' %> <%= render :partial => 'request/next_actions' %> From a982f6b4ac8e527e5ca807d7c9597ad83f9111b6 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 2 Aug 2019 13:06:54 +0100 Subject: [PATCH 3/8] Add TODO comments Don't want to deal with these TODOs right now, so flagging them up for next time these are worked on. --- app/assets/stylesheets/responsive/_sidebar_layout.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/responsive/_sidebar_layout.scss b/app/assets/stylesheets/responsive/_sidebar_layout.scss index bfb06fbba9..b5385658b9 100644 --- a/app/assets/stylesheets/responsive/_sidebar_layout.scss +++ b/app/assets/stylesheets/responsive/_sidebar_layout.scss @@ -12,6 +12,8 @@ } } +/* TODO: Not sure this is still used – we use the request header action bar for + tracks */ /* #track-request .feed_link is here to override specificity in the request sidebar, normally .feed_link should be enough */ #track-request .feed_link, @@ -28,6 +30,7 @@ } } +/* TODO: Why is this in the layout file for the request page sidebar? */ .authority__body__sidebar { .feed_link_sidebar { .track-request-action { @@ -36,6 +39,8 @@ } } +/* TODO: I think this is only used in _request_listing_short_via_event, which is + only used in search_ahead */ .request_short_listing { time { display: block; From e2df0688b75845e64cf7e04392fac599c0c3bb15 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 2 Aug 2019 13:14:58 +0100 Subject: [PATCH 4/8] Move request page sidebar items above TODOs Reorganise the file so that its clear which are the most important rules --- .../responsive/_sidebar_layout.scss | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/responsive/_sidebar_layout.scss b/app/assets/stylesheets/responsive/_sidebar_layout.scss index b5385658b9..82f6ccfdd3 100644 --- a/app/assets/stylesheets/responsive/_sidebar_layout.scss +++ b/app/assets/stylesheets/responsive/_sidebar_layout.scss @@ -12,6 +12,16 @@ } } +.new-request-cta { + .new-request__title { + margin-top: 0; + } +} + +.act_link { + margin-bottom: 0.5em; +} + /* TODO: Not sure this is still used – we use the request header action bar for tracks */ /* #track-request .feed_link is here to override specificity in the request sidebar, @@ -24,12 +34,6 @@ } } -.new-request-cta { - .new-request__title { - margin-top: 0; - } -} - /* TODO: Why is this in the layout file for the request page sidebar? */ .authority__body__sidebar { .feed_link_sidebar { @@ -46,7 +50,3 @@ display: block; } } - -.act_link { - margin-bottom: 0.5em; -} From 1faa834f2130987c304f1848daefd5390e9a9c18 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 2 Aug 2019 13:23:12 +0100 Subject: [PATCH 5/8] Ensure all sidebar groups have sidebar__section Makes it easier to group and style a sidebar__section. --- app/views/request/_batch.html.erb | 2 +- app/views/request/_sidebar.html.erb | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/views/request/_batch.html.erb b/app/views/request/_batch.html.erb index 4582fbe3fb..2ee1c03d41 100644 --- a/app/views/request/_batch.html.erb +++ b/app/views/request/_batch.html.erb @@ -1,5 +1,5 @@ <% if @info_request.info_request_batch %> -