diff --git a/app/components/create_log_actions_component.html.erb b/app/components/create_log_actions_component.html.erb index 2e88034d7..53e2bb57b 100644 --- a/app/components/create_log_actions_component.html.erb +++ b/app/components/create_log_actions_component.html.erb @@ -1,5 +1,5 @@ +
"> <% if display_actions? %> -
<%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %> <% unless user.support? %> <%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %> @@ -7,5 +7,5 @@ <% if user.support? %> <%= govuk_button_link_to view_uploads_button_copy, view_uploads_button_href, secondary: true %> <% end %> -
<% end %> +
diff --git a/app/views/organisations/schemes.html.erb b/app/views/organisations/schemes.html.erb index 0fda1d359..a6f225bd8 100644 --- a/app/views/organisations/schemes.html.erb +++ b/app/views/organisations/schemes.html.erb @@ -22,11 +22,12 @@ <% end %>
- <% if SchemePolicy.new(current_user, nil).create? %> -
- <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> -
- <% end %> + <% display_actions = SchemePolicy.new(current_user, nil).create? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> + <% end %> +
<%= govuk_details( classes: "govuk-!-width-two-thirds", diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index 73a460276..109d8c24a 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -13,8 +13,9 @@ <% end %>
-
- <% if current_user.data_coordinator? || current_user.support? %> + <% display_actions = current_user.data_coordinator? || current_user.support? %> +
"> + <% if display_actions %> <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> <% end %>
diff --git a/app/views/schemes/index.html.erb b/app/views/schemes/index.html.erb index 9cbc95fdb..1ca69691e 100644 --- a/app/views/schemes/index.html.erb +++ b/app/views/schemes/index.html.erb @@ -6,11 +6,12 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing schemes", sub: nil } : { main: "Supported housing schemes", sub: current_user.organisation.name } %>
- <% if SchemePolicy.new(current_user, nil).create? %> -
- <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> -
- <% end %> + <% display_actions = SchemePolicy.new(current_user, nil).create? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> + <% end %> +
<%= render partial: "schemes/scheme_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by postcode, scheme name, scheme code or location name", value: @searched) %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index dd454464d..47d714dbc 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -6,11 +6,12 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Users", sub: nil } : { main: "Users", sub: current_user.organisation.name } %>
-<% if current_user.data_coordinator? || current_user.support? %> -
- <%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> + <% display_actions = current_user.data_coordinator? || current_user.support? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> + <% end %>
-<% end %> <%= render partial: "users/user_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by name or email address", value: @searched) %>