Browse Source

Use current_user helper method

pull/1809/head
Jack S 3 years ago
parent
commit
002a8bdbb2
  1. 10
      app/views/logs/_log_filters.html.erb
  2. 4
      app/views/schemes/_scheme_filters.html.erb

10
app/views/logs/_log_filters.html.erb

@ -55,7 +55,7 @@
type: "select",
label: "User",
category: "user",
options: assigned_to_filter_options(@current_user),
options: assigned_to_filter_options(current_user),
},
},
},
@ -63,7 +63,7 @@
category: "assigned_to",
} %>
<% if @current_user.support? || @current_user.organisation.stock_owners.count > 1 && request.path == "/lettings-logs" %>
<% if current_user.support? || current_user.organisation.stock_owners.count > 1 && request.path == "/lettings-logs" %>
<%= render partial: "filters/radio_filter", locals: {
f:,
options: {
@ -74,7 +74,7 @@
type: "select",
label: "Owning Organisation",
category: "owning_organisation",
options: owning_organisation_filter_options(@current_user),
options: owning_organisation_filter_options(current_user),
},
},
},
@ -83,7 +83,7 @@
} %>
<% end %>
<% if (@current_user.support? || @current_user.organisation.managing_agents.count > 1) && request.path == "/lettings-logs" %>
<% if (current_user.support? || current_user.organisation.managing_agents.count > 1) && request.path == "/lettings-logs" %>
<%= render partial: "filters/radio_filter", locals: {
f:,
options: {
@ -94,7 +94,7 @@
type: "select",
label: "Managed by",
category: "managing_organisation",
options: managing_organisation_filter_options(@current_user),
options: managing_organisation_filter_options(current_user),
},
},
},

4
app/views/schemes/_scheme_filters.html.erb

@ -23,7 +23,7 @@
category: "status",
} %>
<% if @current_user.support? || @current_user.organisation.stock_owners.count > 1 %>
<% if current_user.support? || current_user.organisation.stock_owners.count > 1 %>
<%= render partial: "filters/radio_filter", locals: {
f:,
options: {
@ -34,7 +34,7 @@
type: "select",
label: "Owning Organisation",
category: "owning_organisation",
options: owning_organisation_filter_options(@current_user),
options: owning_organisation_filter_options(current_user),
},
},
},

Loading…
Cancel
Save