17 changed files with 160 additions and 89 deletions
@ -1,10 +0,0 @@
|
||||
module Forms |
||||
class FilterForm |
||||
include ActiveModel::Model |
||||
include ActiveModel::Validations |
||||
|
||||
attr_accessor :years, :status, :needstypes, :assigned_to, :user, :owning_organisation_select, :owning_organisation, :managing_organisation_select, :managing_organisation |
||||
|
||||
validates :years, presence: true |
||||
end |
||||
end |
||||
@ -1,14 +1,20 @@
|
||||
<%= form_with model: @filter_form, url: filters_lettings_logs_path(search: @search_term, codes_only: @codes_only) do |f| %> |
||||
<%= form_with html: { method: :get }, url: filters_update_needstype_lettings_logs_path do |f| %> |
||||
<%= render partial: "filters/checkbox_filter", |
||||
locals: { |
||||
f:, |
||||
options: needstype_filters, |
||||
label: "Needs type", |
||||
category: "needstypes", |
||||
size: "l", |
||||
} %> |
||||
|
||||
<% if request.params["search"].present? %> |
||||
<%= f.hidden_field :search, value: request.params["search"] %> |
||||
<% end %> |
||||
<%= f.hidden_field :codes_only, value: request.params["codes_only"] %> |
||||
|
||||
<div class="govuk-button-group"> |
||||
<%= f.govuk_submit "Save changes" %> |
||||
<%= govuk_button_link_to "Cancel", csv_download_lettings_logs_path(search: @search_term, codes_only: @codes_only), secondary: true %> |
||||
<%= govuk_button_link_to "Cancel", csv_download_lettings_logs_path(search: request.params["search"], codes_only: request.params["codes_only"]), secondary: true %> |
||||
</div> |
||||
<% end %> |
||||
|
||||
@ -1,13 +1,20 @@
|
||||
<%= form_with model: @filter_form, url: filters_lettings_logs_path(search: @search_term, codes_only: @codes_only) do |f| %> |
||||
<%= form_with html: { method: :get }, url: filters_update_status_lettings_logs_path do |f| %> |
||||
<%= render partial: "filters/checkbox_filter", |
||||
locals: { |
||||
f:, |
||||
options: status_filters, |
||||
label: "Status", |
||||
category: "status", |
||||
size: "l", |
||||
} %> |
||||
|
||||
<% if request.params["search"].present? %> |
||||
<%= f.hidden_field :search, value: request.params["search"] %> |
||||
<% end %> |
||||
<%= f.hidden_field :codes_only, value: request.params["codes_only"] %> |
||||
|
||||
<div class="govuk-button-group"> |
||||
<%= f.govuk_submit "Save changes" %> |
||||
<%= govuk_button_link_to "Cancel", csv_download_lettings_logs_path(search: @search_term, codes_only: @codes_only), secondary: true %> |
||||
<%= govuk_button_link_to "Cancel", csv_download_lettings_logs_path(search: request.params["search"], codes_only: request.params["codes_only"]), secondary: true %> |
||||
</div> |
||||
<% end %> |
||||
|
||||
@ -1,13 +1,20 @@
|
||||
<%= form_with model: @filter_form, url: filters_sales_logs_path(search: @search_term, codes_only: @codes_only) do |f| %> |
||||
<%= form_with html: { method: :get }, url: filters_update_status_sales_logs_path do |f| %> |
||||
<%= render partial: "filters/checkbox_filter", |
||||
locals: { |
||||
f:, |
||||
options: status_filters, |
||||
label: "Status", |
||||
category: "status", |
||||
size: "l", |
||||
} %> |
||||
|
||||
<% if request.params["search"].present? %> |
||||
<%= f.hidden_field :search, value: request.params["search"] %> |
||||
<% end %> |
||||
<%= f.hidden_field :codes_only, value: request.params["codes_only"] %> |
||||
|
||||
<div class="govuk-button-group"> |
||||
<%= f.govuk_submit "Save changes" %> |
||||
<%= govuk_button_link_to "Cancel", csv_download_sales_logs_path(search: @search_term, codes_only: @codes_only), secondary: true %> |
||||
<%= govuk_button_link_to "Cancel", csv_download_sales_logs_path(search: request.params["search"], codes_only: request.params["codes_only"]), secondary: true %> |
||||
</div> |
||||
<% end %> |
||||
|
||||
Loading…
Reference in new issue