mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 06:26:15 +02:00
Merge branch 'master' into 499-admin-wildcard-search
This commit is contained in:
parent
f93286c2e6
commit
fd6e625d25
49 changed files with 382 additions and 160 deletions
|
@ -35,7 +35,8 @@ module Admin
|
|||
respond_to do |format|
|
||||
format.html
|
||||
format.csv do
|
||||
send_data @q.result.to_csv, filename: "account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv"
|
||||
raw_csv = CsvGenerator.generate_csv(@q.result)
|
||||
send_data raw_csv, filename: "account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ module Admin
|
|||
respond_to do |format|
|
||||
format.html { render page }
|
||||
format.csv do
|
||||
raw_csv = @q.result.to_csv
|
||||
raw_csv = CsvGenerator.generate_csv(@q.result)
|
||||
send_data raw_csv,
|
||||
filename: "#{filename}_#{Time.zone.now.to_formatted_s(:number)}.csv",
|
||||
type: "#{Mime[:csv]}; charset=utf-8"
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
module Admin
|
||||
class ContactVersionsController < BaseController
|
||||
include ObjectVersionsHelper
|
||||
include ApplicationHelper
|
||||
|
||||
load_and_authorize_resource class: Version::ContactVersion
|
||||
|
||||
def index
|
||||
params[:q] ||= {}
|
||||
|
||||
search_params = PartialSearchFormatter.format(params[:q])
|
||||
search_params = PartialSearchFormatter.format(fix_date_params)
|
||||
versions = Version::ContactVersion.includes(:item).order(created_at: :desc, id: :desc)
|
||||
@q = versions.ransack(polymorphic_association(search_params))
|
||||
|
||||
|
@ -48,5 +48,14 @@ module Admin
|
|||
|
||||
record_type
|
||||
end
|
||||
|
||||
def fix_date_params
|
||||
params_copy = params[:q].deep_dup
|
||||
if params_copy['created_at_lteq'].present?
|
||||
params_copy['created_at_lteq'] = Date.parse(params_copy['created_at_lteq']) + 1.day
|
||||
end
|
||||
|
||||
params_copy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
module Admin
|
||||
class DomainVersionsController < BaseController
|
||||
include ObjectVersionsHelper
|
||||
|
||||
load_and_authorize_resource class: Version::DomainVersion
|
||||
|
||||
def index
|
||||
|
@ -82,9 +80,8 @@ module Admin
|
|||
|
||||
def fix_date_params
|
||||
params_copy = params[:q].deep_dup
|
||||
if params_copy['created_at_lteq'].present?
|
||||
params_copy['created_at_lteq'] = Date.parse(params_copy['created_at_lteq']) + 1.day
|
||||
end
|
||||
created_at = params_copy['created_at_lteq']
|
||||
params_copy['created_at_lteq'] = Date.parse(created_at) + 1.day if created_at.present?
|
||||
|
||||
params_copy
|
||||
end
|
||||
|
|
|
@ -34,6 +34,17 @@ module Api
|
|||
end
|
||||
end
|
||||
|
||||
def do_need_update_contact
|
||||
result = current_registrant_user.do_need_update_contact?
|
||||
render json: { update_contacts: result[:result], counter: result[:counter] }
|
||||
end
|
||||
|
||||
def update_company_contacts
|
||||
companies = current_registrant_user.update_company_contacts
|
||||
|
||||
render json: { message: 'get it', companies: companies }
|
||||
end
|
||||
|
||||
def update
|
||||
logger.debug 'Received update request'
|
||||
logger.debug params
|
||||
|
|
|
@ -20,7 +20,8 @@ class Registrar
|
|||
respond_to do |format|
|
||||
format.html { @account_activities = @q.result.page(params[:page]) }
|
||||
format.csv do
|
||||
send_data @q.result.to_csv, filename: "account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv"
|
||||
raw_csv = CsvGenerator.generate_csv(@q.result)
|
||||
send_data raw_csv, filename: "account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class Registrar
|
|||
@contacts = @contacts.per(contacts_per_page) if contacts_per_page.positive?
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = contacts.to_csv
|
||||
raw_csv = CsvGenerator.generate_csv(contacts)
|
||||
send_data raw_csv, filename: 'contacts.csv', type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
format.pdf do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue