Revert "Registry 663"

This commit is contained in:
Timo Võhmar 2018-02-01 16:15:45 +02:00 committed by GitHub
parent 7ed42b6e82
commit 1690f49575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 165 additions and 308 deletions

View file

@ -1,12 +1,13 @@
class Registrant::DomainsController < RegistrantController
def index
authorize! :view, :registrant_domains
params[:q] ||= {}
normalize_search_parameters do
@q = domains.search(params[:q])
@domains = @q.result.page(params[:page])
end
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
authorize! :view, :registrant_domains
params[:q] ||= {}
normalize_search_parameters do
@q = domains.search(params[:q])
@domains = @q.result.page(params[:page])
end
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
end
def show
@ -14,15 +15,19 @@ class Registrant::DomainsController < RegistrantController
authorize! :read, @domain
end
def set_domain
@domain = domains.find(params[:id])
end
def domain_verification_url
authorize! :view, :registrant_domains
dom = domains.find(params[:id])
if (dom.statuses.include?(DomainStatus::PENDING_UPDATE) || dom.statuses.include?(DomainStatus::PENDING_DELETE_CONFIRMATION)) &&
dom.pending_json.present?
dom.pending_json.present?
@domain = dom
confirm_path = get_confirm_path(dom.statuses)
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
@domain = dom
confirm_path = get_confirm_path(dom.statuses)
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
else
flash[:warning] = I18n.t('available_verification_url_not_found')
@ -47,12 +52,6 @@ class Registrant::DomainsController < RegistrantController
end
end
private
def set_domain
@domain = domains.find(params[:id])
end
def domains
ident_cc, ident = @current_user.registrant_ident.split '-'
begin
@ -83,4 +82,5 @@ class Registrant::DomainsController < RegistrantController
"#{ENV['registrant_url']}/registrant/domain_delete_confirms"
end
end
end
end