mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
Test mass actions in admin
This commit is contained in:
parent
d80007d83c
commit
1a0becf785
7 changed files with 40 additions and 9 deletions
|
@ -1,3 +0,0 @@
|
|||
$('input:file').on("change", function() {
|
||||
$('input:submit').prop('disabled', !$(this).val());
|
||||
});
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
module Admin
|
||||
class MassActionsController < BaseController
|
||||
authorize_resource
|
||||
before_action :authorize_admin
|
||||
|
||||
# GET /admin/mass_actions
|
||||
def index; end
|
||||
def index
|
||||
end
|
||||
|
||||
# POST /admin/mass_actions
|
||||
def create
|
||||
|
@ -19,5 +20,9 @@ module Admin
|
|||
|
||||
redirect_to(admin_mass_actions_path, notice: notice)
|
||||
end
|
||||
|
||||
def authorize_admin
|
||||
authorize! :manage, :mass_actions
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -109,7 +109,7 @@ class Ability
|
|||
can :destroy, :pending
|
||||
can :create, :zonefile
|
||||
can :access, :settings_menu
|
||||
can :manage, MassAction
|
||||
can :manage, :mass_actions
|
||||
end
|
||||
|
||||
def static_registrant
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
<div class="panel-body">
|
||||
<p>Triggers <b>soft</b> force delete procedure for uploaded domain list. List must be in <b>CSV</b> format. Each domain entry must be on separate line. Line must include <b>domain_name</b> (puny) followed with <b>delete_reason</b>, separated by comma.</p>
|
||||
<p>Allowed delete reasons: <b>ENTITY_BURIED</b> | <b>PHONE</b> | <b>EMAIL</b></p>
|
||||
<%= form_tag admin_mass_actions_path, multipart: true do %>
|
||||
<%= file_field_tag :entry_list, accept: 'text/csv' %>
|
||||
<%= form_tag admin_mass_actions_path, multipart: true, method: :post do %>
|
||||
<%= label_tag :entry_list %>
|
||||
<%= file_field_tag :entry_list, required: true, accept: 'text/csv' %>
|
||||
<%= hidden_field_tag :mass_action, 'force_delete' %>
|
||||
<%= hidden_field_tag :authenticity_token, form_authenticity_token %>
|
||||
<br>
|
||||
<%= submit_tag "Start force delete process", class: 'btn btn-danger', disabled: true %>
|
||||
<%= submit_tag "Start force delete process", class: 'btn btn-danger', id: 'fd_submit' %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue