Merge pull request #486 from internetee/remove-registrar-nameservers-controller

Remove unused registrar name servers controller
This commit is contained in:
Georg 2017-04-28 14:34:01 +03:00 committed by GitHub
commit aa7b29f5a1
5 changed files with 0 additions and 164 deletions

View file

@ -1,48 +0,0 @@
class Registrar::NameserversController < RegistrarController
# turned off requested by client
# load_and_authorize_resource
# def index
# if can_replace_hostnames?
# prc = Nameserver.replace_hostname_ends(
# current_user.registrar.domains.includes(
# :registrant, :nameservers, :admin_domain_contacts, :tech_domain_contacts, :domain_statuses,
# :versions, :admin_contacts, :tech_contacts, :whois_record, :dnskeys
# ),
# params[:q][:hostname_end],
# params[:hostname_end_replacement]
# )
# if prc == 'replaced_none'
# flash.now[:alert] = t(:no_hostnames_replaced)
# elsif prc == 'replaced_all'
# params[:q][:hostname_end] = params[:hostname_end_replacement]
# params[:hostname_end_replacement] = nil
# flash.now[:notice] = t(:all_hostnames_replaced)
# else
# flash.now[:warning] = t(:hostnames_partially_replaced)
# end
# end
# nameservers = current_user.registrar.nameservers.includes(:domain)
# @q = nameservers.search(params[:q])
# @q.sorts = 'id desc' if @q.sorts.empty?
# @nameservers = @q.result.page(params[:page])
# end
# def replace_all
# @domain_params = { nameservers_attributes: { 0 => {} } }
# end
# private
# def can_replace_hostnames?
# if params[:replace] && params[:q]
# flash.now[:alert] = t('hostname_end_replacement_is_required') unless params[:hostname_end_replacement].present?
# flash.now[:alert] = t('hostname_end_is_required') unless params[:q][:hostname_end].present?
# return true if flash[:alert].blank?
# end
# false
# end
end

View file

@ -1,61 +0,0 @@
- content_for :actions do
= link_to(t(:back_to_domains), registrar_domains_path, class: 'btn btn-default')
= render 'shared/title', name: t(:nameservers)
.row
.col-md-12
= search_form_for @q, url: [:registrar, :nameservers], html: { style: 'margin-bottom: 0;' } do |f|
.row
.col-md-3
.form-group
= f.label t(:hostname_end)
= f.search_field :hostname_end, class: 'form-control', placeholder: t(:hostname_end), autocomplete: 'off'
.col-md-3
.form-group
= label_tag t(:hostname_end_replacement)
= text_field_tag :hostname_end_replacement, params[:hostname_end_replacement], class: 'form-control', placeholder: t(:hostname_end_replacement), autocomplete: 'off'
.col-md-4{style: 'padding-top: 25px;'}
%button.btn.btn-default
&nbsp;
%span.glyphicon.glyphicon-search
&nbsp;
%button.btn.btn-default.js-reset-form
= t(:clear_fields)
%button.btn.btn-warning{name: 'replace'}
= t(:replace)
.row
.col-md-12
%p.help-block= t(:hostnames_will_be_replaced_only_if_domain_validates_with_the_new_nameserver)
%hr
.row
.col-md-12
.table-responsive
%table.table.table-hover.table-condensed
%thead
%tr
%th{class: 'col-xs-3'}= t(:hostname)
%th{class: 'col-xs-3'}= t(:ipv4)
%th{class: 'col-xs-3'}= t(:ipv6)
%th{class: 'col-xs-3'}= t(:domain)
%tbody
- @nameservers.each do |x|
%tr
- if params[:q] && params[:q][:hostname_end]
- hn = x.hostname.chomp(params[:q][:hostname_end])
%td
= precede hn do
%strong= params[:q][:hostname_end]
- else
%td= x.hostname
%td= x.ipv4
%td= x.ipv4
%td= link_to(x.domain, info_registrar_domains_url(domain_name: x.domain.name))
.row
.col-md-12
= paginate @nameservers
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
window.location = "#{registrar_nameservers_path}"

View file

@ -1,38 +0,0 @@
- content_for :actions do
= link_to(t(:back_to_domains), registrar_domains_path, class: 'btn btn-default')
= render 'shared/title', name: t(:nameservers)
= form_tag url: [:registrar, :replace_all], html: { style: 'margin-bottom: 0;' } do
#nameservers
- @domain_params[:nameservers_attributes].each do |k, v|
.panel.panel-default
.panel-heading.clearfix
.pull-left= t(:nameserver)
.pull-right
= link_to(t(:add_another), '#', class: 'btn btn-default btn-xs add-nameserver')
= link_to(t(:delete), '#', class: 'btn btn-default btn-xs destroy')
.panel-body
.form-group
.col-md-3.control-label
= label_tag "domain_nameservers_attributes_#{k}_hostname", t(:hostname), class: 'required'
.col-md-7
= text_field_tag "domain[nameservers_attributes][#{k}][hostname]", v['hostname'],
class: 'form-control', required: true
.form-group
.col-md-3.control-label
= label_tag "domain_nameservers_attributes_#{k}_ipv4", t(:ipv4)
.col-md-7
= text_field_tag "domain[nameservers_attributes][#{k}][ipv4]", v['ipv4'],
class: 'form-control', ipv4: true
.form-group
.col-md-3.control-label
= label_tag "domain_nameservers_attributes_#{k}_ipv6", t(:ipv6)
.col-md-7
= text_field_tag "domain[nameservers_attributes][#{k}][ipv6]", v['ipv6'],
class: 'form-control', ipv6: true
.row
.col-md-8.text-right
= button_tag(t('shared.save'), class: 'btn btn-warning')
:coffee
$("#nameservers").nestedAttributes
bindAddTo: $(".add-nameserver")

View file

@ -756,16 +756,6 @@ en:
due_date_until: 'Due date until' due_date_until: 'Due date until'
minimum_total: 'Minimum total' minimum_total: 'Minimum total'
maximum_total: 'Maximum total' maximum_total: 'Maximum total'
hostname_end: 'Hostname end'
hostname_end_replacement: 'Hostname end replacement'
hostname_end_is_required: 'Hostname end is required'
hostname_end_replacement_is_required: 'Hostname end replacement is required'
hostnames_replaced: 'Hostnames replaced'
all_hostnames_replaced: 'All hostnames replaced'
hostnames_partially_replaced: 'Hostnames partially replaced'
hostnames_will_be_replaced_only_if_domain_validates_with_the_new_nameserver: 'Hostnames will be replaced only if domain validates with the new nameserver'
back_to_domains: 'Back to domains'
no_hostnames_replaced: 'No hostnames replaced'
forbidden_code: 'is forbidden to use' forbidden_code: 'is forbidden to use'
unimplemented_object_service: 'Unimplemented object service' unimplemented_object_service: 'Unimplemented object service'
contact_email_update_subject: 'Teie domeenide kontakt epostiaadress on muutunud / Contact e-mail addresses of your domains have changed' contact_email_update_subject: 'Teie domeenide kontakt epostiaadress on muutunud / Contact e-mail addresses of your domains have changed'

View file

@ -61,13 +61,6 @@ Rails.application.routes.draw do
end end
end end
# turned off requested by client
# resources :nameservers do
# collection do
# match 'replace_all', via: [:post, :get]
# end
# end
resources :contacts, constraints: {:id => /[^\/]+(?=#{ ActionController::Renderers::RENDERERS.map{|e| "\\.#{e}\\z"}.join("|") })|[^\/]+/} do resources :contacts, constraints: {:id => /[^\/]+(?=#{ ActionController::Renderers::RENDERERS.map{|e| "\\.#{e}\\z"}.join("|") })|[^\/]+/} do
member do member do
get 'delete' get 'delete'