mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Add Renew button to make renewal a separate action
This commit is contained in:
parent
3edf8a500a
commit
a1b3398e0e
4 changed files with 14 additions and 10 deletions
|
@ -12,16 +12,22 @@ class Registrar
|
|||
authorize! :manage, :repp
|
||||
set_form_data
|
||||
|
||||
if domain_ids_for_bulk_renew.present?
|
||||
if ready_to_renew?
|
||||
domains = Epp::Domain.where(id: domain_ids_for_bulk_renew).to_a
|
||||
task = renew_task(domains)
|
||||
flash[:notice] = flash_message(task)
|
||||
else
|
||||
flash[:notice] = nil
|
||||
end
|
||||
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def ready_to_renew?
|
||||
domain_ids_for_bulk_renew.present? && params[:renew].present?
|
||||
end
|
||||
|
||||
def set_form_data
|
||||
@expire_date = params[:expire_date].to_date
|
||||
@domains = domains_by_date(@expire_date)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue