mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Fix styling issues
This commit is contained in:
parent
2c8f1081c9
commit
39791f5755
5 changed files with 42 additions and 46 deletions
|
@ -8,20 +8,8 @@ module Admin
|
||||||
# GET /admin/disputes
|
# GET /admin/disputes
|
||||||
def index
|
def index
|
||||||
params[:q] ||= {}
|
params[:q] ||= {}
|
||||||
disputes = Dispute.active.all.order(:domain_name)
|
@disputes = sortable_dispute_query_for(Dispute.active.all, params[:q])
|
||||||
|
@closed_disputes = sortable_dispute_query_for(Dispute.closed.all, params[:q])
|
||||||
@q = disputes.search(params[:q])
|
|
||||||
@disputes = @q.result.page(params[:page])
|
|
||||||
if params[:results_per_page].to_i.positive?
|
|
||||||
@disputes = @disputes.per(params[:results_per_page])
|
|
||||||
end
|
|
||||||
|
|
||||||
closed_disputes = Dispute.closed.order(:domain_name)
|
|
||||||
@closed_q = closed_disputes.search(params[:closed_q])
|
|
||||||
@closed_disputes = @closed_q.result.page(params[:closed_page])
|
|
||||||
return unless params[:results_per_page].to_i.positive?
|
|
||||||
|
|
||||||
@closed_disputes = @closed_disputes.per(params[:results_per_page])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /admin/disputes/1
|
# GET /admin/disputes/1
|
||||||
|
@ -62,6 +50,14 @@ module Admin
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def sortable_dispute_query_for(disputes, query)
|
||||||
|
@q = disputes.order(:domain_name).search(query)
|
||||||
|
disputes = @q.result.page(params[:page])
|
||||||
|
return disputes.per(params[:results_per_page]) if params[:results_per_page].present?
|
||||||
|
|
||||||
|
disputes
|
||||||
|
end
|
||||||
|
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_dispute
|
def set_dispute
|
||||||
@dispute = Dispute.find(params[:id])
|
@dispute = Dispute.find(params[:id])
|
||||||
|
|
|
@ -103,25 +103,18 @@ module Epp
|
||||||
def update
|
def update
|
||||||
authorize! :update, @domain, @password
|
authorize! :update, @domain, @password
|
||||||
|
|
||||||
if @domain.update(params[:parsed_frame], current_user)
|
updated = @domain.update(params[:parsed_frame], current_user)
|
||||||
if @domain.disputed?
|
(handle_errors(@domain) && return) unless updated
|
||||||
dispute = Dispute.active.find_by(domain_name: @domain.name)
|
|
||||||
dispute.close
|
Dispute.active.close_by_domain(@domain.name) if @domain.disputed?
|
||||||
end
|
pending = @domain.epp_pending_update.present?
|
||||||
if @domain.epp_pending_update.present?
|
render_epp_response "/epp/domains/success#{'_pending' if pending}"
|
||||||
render_epp_response '/epp/domains/success_pending'
|
|
||||||
else
|
|
||||||
render_epp_response '/epp/domains/success'
|
|
||||||
end
|
|
||||||
else
|
|
||||||
handle_errors(@domain)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete
|
def delete
|
||||||
authorize! :delete, @domain, @password
|
authorize! :delete, @domain, @password
|
||||||
|
|
||||||
handle_errors(@domain) and return unless @domain.can_be_deleted?
|
(handle_errors(@domain) && return) unless @domain.can_be_deleted?
|
||||||
|
|
||||||
if @domain.epp_destroy(params[:parsed_frame], current_user.id)
|
if @domain.epp_destroy(params[:parsed_frame], current_user.id)
|
||||||
if @domain.epp_pending_delete.present?
|
if @domain.epp_pending_delete.present?
|
||||||
|
|
|
@ -4,6 +4,7 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
return if params[:confirmed] || params[:rejected]
|
return if params[:confirmed] || params[:rejected]
|
||||||
|
|
||||||
@domain = Domain.find(params[:id])
|
@domain = Domain.find(params[:id])
|
||||||
@domain = nil unless @domain.registrant_delete_confirmable?(params[:token])
|
@domain = nil unless @domain.registrant_delete_confirmable?(params[:token])
|
||||||
end
|
end
|
||||||
|
@ -21,22 +22,23 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
|
||||||
initiator = current_registrant_user ? current_registrant_user.username :
|
initiator = current_registrant_user ? current_registrant_user.username :
|
||||||
t(:user_not_authenticated)
|
t(:user_not_authenticated)
|
||||||
|
|
||||||
if params[:rejected]
|
confirmed = params[:confirmed] ? true : false
|
||||||
if @registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
|
action = if confirmed
|
||||||
flash[:notice] = t(:registrant_domain_verification_rejected)
|
@registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
|
||||||
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true)
|
else
|
||||||
else
|
@registrant_verification.domain_registrant_delete_confirm!("email link #{initiator}")
|
||||||
flash[:alert] = t(:registrant_domain_delete_rejected_failed)
|
end
|
||||||
return render 'show'
|
|
||||||
end
|
fail_msg = t("registrant_domain_delete_#{confirmed ? 'confirmed' : 'rejected'}_failed".to_sym)
|
||||||
elsif params[:confirmed]
|
success_msg = t("registrant_domain_verification_#{confirmed ? 'confirmed' : 'rejected'}".to_sym)
|
||||||
if @registrant_verification.domain_registrant_delete_confirm!("email link #{initiator}")
|
|
||||||
flash[:notice] = t(:registrant_domain_verification_confirmed)
|
flash[:alert] = action ? success_msg : fail_msg
|
||||||
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true)
|
(render 'show' && return) unless action
|
||||||
else
|
|
||||||
flash[:alert] = t(:registrant_domain_delete_confirmed_failed)
|
if confirmed
|
||||||
return render 'show'
|
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true) && return
|
||||||
end
|
else
|
||||||
|
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true) unless confirmed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,6 +20,11 @@ class Dispute < ApplicationRecord
|
||||||
|
|
||||||
alias_attribute :name, :domain_name
|
alias_attribute :name, :domain_name
|
||||||
|
|
||||||
|
def self.close_by_domain(domain_name)
|
||||||
|
dispute = Dispute.active.find_by(domain_name: domain_name)
|
||||||
|
dispute.update(closed: true) if dispute.present?
|
||||||
|
end
|
||||||
|
|
||||||
def set_expiry_date
|
def set_expiry_date
|
||||||
return if starts_at.blank?
|
return if starts_at.blank?
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Epp::Domain < Domain
|
||||||
def epp_code_map
|
def epp_code_map
|
||||||
{
|
{
|
||||||
'2002' => [ # Command use error
|
'2002' => [ # Command use error
|
||||||
%i[base domain_already_belongs_to_the_querying_registrar]
|
%i[base domain_already_belongs_to_the_querying_registrar],
|
||||||
],
|
],
|
||||||
'2003' => [ # Required parameter missing
|
'2003' => [ # Required parameter missing
|
||||||
%i[registrant blank],
|
%i[registrant blank],
|
||||||
|
@ -86,7 +86,7 @@ class Epp::Domain < Domain
|
||||||
[:puny_label, :too_long, { obj: 'name', val: name_puny }]
|
[:puny_label, :too_long, { obj: 'name', val: name_puny }]
|
||||||
],
|
],
|
||||||
'2201' => [ # Authorisation error
|
'2201' => [ # Authorisation error
|
||||||
%i[transfer_code wrong_pw]
|
%i[transfer_code wrong_pw],
|
||||||
],
|
],
|
||||||
'2202' => [
|
'2202' => [
|
||||||
%i[base invalid_auth_information_reserved],
|
%i[base invalid_auth_information_reserved],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue