Browse Source

lint

pull/624/head
Kat 3 years ago
parent
commit
8aa38d28cd
  1. 4
      app/controllers/users_controller.rb
  2. 6
      app/views/users/toggle_active.html.erb

4
app/controllers/users_controller.rb

@ -88,7 +88,7 @@ class UsersController < ApplicationController
def deactivate def deactivate
if current_user.can_toggle_active?(@user) if current_user.can_toggle_active?(@user)
render "toggle-active", locals: { action: "deactivate" } render "toggle_active", locals: { action: "deactivate" }
else else
redirect_to user_path(@user) redirect_to user_path(@user)
end end
@ -96,7 +96,7 @@ class UsersController < ApplicationController
def reactivate def reactivate
if current_user.can_toggle_active?(@user) if current_user.can_toggle_active?(@user)
render "toggle-active", locals: { action: "reactivate" } render "toggle_active", locals: { action: "reactivate" }
else else
redirect_to user_path(@user) redirect_to user_path(@user)
end end

6
app/views/users/toggle-active.html.erb → app/views/users/toggle_active.html.erb

@ -2,7 +2,7 @@
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<%= form_for(@user, as: :user, html: { method: :patch }) do |f| %> <%= form_for(@user, as: :user, html: { method: :patch }) do |f| %>
<div class="govuk-grid-column-two-thirds-from-desktop"> <div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="govuk-heading-l"> <h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= @user.name %></span> <span class="govuk-caption-l"><%= @user.name %></span>
Are you sure you want to <%= action %> this user? Are you sure you want to <%= action %> this user?
@ -11,8 +11,8 @@
<p>Deactivating this user will mean they can no longer access this service to submit CORE data.</p> <p>Deactivating this user will mean they can no longer access this service to submit CORE data.</p>
<p>Any logs this user has already submitted will not be affected.</p> <p>Any logs this user has already submitted will not be affected.</p>
<% end %> <% end %>
<% active_value = action == "deactivate" ? false : true %> <% active_value = action != "deactivate" %>
<div hidden> <div hidden>
<%= f.govuk_text_field :active, <%= f.govuk_text_field :active,
value: active_value %> value: active_value %>
</div> </div>
Loading…
Cancel
Save