mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +02:00
Add multiple checkboxes to select domains for bulk renew
This commit is contained in:
parent
9c662471a7
commit
40b22cd433
3 changed files with 28 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -12,6 +12,23 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<% if @domains.present? %>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2 control-label">
|
||||
<%= f.label :domain_ids, t('.domain_ids') %>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<%= f.collection_check_boxes :domain_ids, @domains, :id, :name,
|
||||
checked: @domains.map(&:id) do |b|%>
|
||||
<div class="row">
|
||||
<%= b.check_box %>
|
||||
<%= b.label %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-4 col-md-offset-2 text-right">
|
||||
<button class="btn btn-warning">
|
||||
|
|
|
@ -34,3 +34,4 @@ en:
|
|||
bulk_renew_form:
|
||||
filter_btn: Filter
|
||||
expire_date: Expire date until
|
||||
domain_ids: Domains for bulk renewal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue