mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
added csv download
This commit is contained in:
parent
c7e92452af
commit
7f8eee52f4
41 changed files with 259 additions and 35 deletions
|
@ -8,6 +8,18 @@ module Admin
|
|||
@q = domains.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render 'admin/blocked_domains/index'
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "blocked_domains_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -28,6 +28,17 @@ module Admin
|
|||
@versions = @q.result.page(params[:page])
|
||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render 'admin/contact_versions/index'
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "contact_history_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -24,6 +24,18 @@ module Admin
|
|||
end
|
||||
|
||||
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
@contacts
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.distinct.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "contacts_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def filter_by_flags(contacts)
|
||||
|
|
|
@ -10,6 +10,18 @@ module Admin
|
|||
params[:q] ||= {}
|
||||
@disputes = sortable_dispute_query_for(Dispute.active.all, params[:q])
|
||||
@closed_disputes = sortable_dispute_query_for(Dispute.closed.all, params[:q], closed: true)
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render 'admin/disputes/index'
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "disputes_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# GET /admin/disputes/1
|
||||
|
|
|
@ -44,7 +44,18 @@ module Admin
|
|||
@q = versions.search(params[:q])
|
||||
@versions = @q.result.page(params[:page])
|
||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
render "admin/domain_versions/archive"
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render 'admin/domain_versions/archive'
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "domain_history_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -13,6 +13,18 @@ module Admin
|
|||
@epp_logs = @epp_logs.page(params[:page])
|
||||
@count = @q.result.count
|
||||
@epp_logs = @epp_logs.per(params[:results_per_page]) if paginate?
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render 'admin/epp_logs/index'
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "epp_logs_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -13,6 +13,18 @@ module Admin
|
|||
@repp_logs = @repp_logs.page(params[:page])
|
||||
@count = @q.result.count
|
||||
@repp_logs = @repp_logs.per(params[:results_per_page]) if paginate?
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render 'admin/repp_logs/index'
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "repp_logs_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -9,6 +9,18 @@ module Admin
|
|||
@q = domains.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render 'admin/reserved_domains/index'
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
send_data raw_csv,
|
||||
filename: "reserved_domains_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue