diff --git a/app/controllers/registrar/bulk_change_controller.rb b/app/controllers/registrar/bulk_change_controller.rb index 1d9d606a4..358a1949c 100644 --- a/app/controllers/registrar/bulk_change_controller.rb +++ b/app/controllers/registrar/bulk_change_controller.rb @@ -11,6 +11,8 @@ class Registrar def bulk_renew authorize! :manage, :repp @expire_date = params[:expire_date].to_date + # binding.pry + @domains = domains_by_date(@expire_date) render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew } end @@ -23,5 +25,13 @@ class Registrar def default_tab :technical_contact end + + def domains_scope + current_registrar_user.registrar.domains + end + + def domains_by_date(date) + domains_scope.where('valid_to <= ?', date) + end end end diff --git a/app/views/registrar/bulk_change/_bulk_renew_form.html.erb b/app/views/registrar/bulk_change/_bulk_renew_form.html.erb index 4b7cd392b..874dc8eaa 100644 --- a/app/views/registrar/bulk_change/_bulk_renew_form.html.erb +++ b/app/views/registrar/bulk_change/_bulk_renew_form.html.erb @@ -12,6 +12,23 @@ + <% if @domains.present? %> +