mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 14:14:49 +02:00
Add both types of delete procedure to the view/controller
This commit is contained in:
parent
0e1542609e
commit
b9575661eb
3 changed files with 22 additions and 1 deletions
|
@ -5,7 +5,7 @@ module Admin
|
||||||
authorize! :manage, domain
|
authorize! :manage, domain
|
||||||
|
|
||||||
domain.transaction do
|
domain.transaction do
|
||||||
domain.schedule_force_delete
|
domain.schedule_force_delete(type: force_delete_type)
|
||||||
domain.registrar.notifications.create!(text: t('force_delete_set_on_domain',
|
domain.registrar.notifications.create!(text: t('force_delete_set_on_domain',
|
||||||
domain_name: domain.name))
|
domain_name: domain.name))
|
||||||
|
|
||||||
|
@ -35,6 +35,14 @@ module Admin
|
||||||
def notify_by_email?
|
def notify_by_email?
|
||||||
ActiveRecord::Type::Boolean.new.cast(params[:notify_by_email])
|
ActiveRecord::Type::Boolean.new.cast(params[:notify_by_email])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def force_delete_type
|
||||||
|
soft_delete? ? :soft : :fast_track
|
||||||
|
end
|
||||||
|
|
||||||
|
def soft_delete?
|
||||||
|
ActiveRecord::Type::Boolean.new.cast(params[:soft_delete])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,6 +10,18 @@
|
||||||
|
|
||||||
<%= form_tag admin_domain_force_delete_path(domain), id: 'domain-force-delete-form',
|
<%= form_tag admin_domain_force_delete_path(domain), id: 'domain-force-delete-form',
|
||||||
class: 'modal-body form-horizontal' do %>
|
class: 'modal-body form-horizontal' do %>
|
||||||
|
<div class="form-group force-delete-type">
|
||||||
|
<div class="col-md-9">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<%= check_box_tag 'soft_delete', 1, true,
|
||||||
|
data: { dependent_content_toggle: true } %>
|
||||||
|
<%= t '.use_soft_delete' %>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
|
|
@ -31,6 +31,7 @@ en:
|
||||||
force_delete_dialog:
|
force_delete_dialog:
|
||||||
title: Force delete
|
title: Force delete
|
||||||
notify_by_email: Notify registrant and administrative contacts by email
|
notify_by_email: Notify registrant and administrative contacts by email
|
||||||
|
use_soft_delete: Use soft delete procedure
|
||||||
email_template: Email template
|
email_template: Email template
|
||||||
close_btn: Close dialog
|
close_btn: Close dialog
|
||||||
submit_btn: Force delete domain
|
submit_btn: Force delete domain
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue