Merge branch 'fix-registrar-area-login-page-layout' into registry-475

This commit is contained in:
Artur Beljajev 2017-04-28 18:53:21 +03:00
commit ccf08ded60
7 changed files with 53 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

@ -0,0 +1,45 @@
!!! 5
%html{lang: I18n.locale.to_s}
%head
%meta{charset: "utf-8"}/
%meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
- if content_for? :head_title
= yield :head_title
- else
%title= t(:registrar_head_title)
= csrf_meta_tags
= stylesheet_link_tag 'registrar-manifest', media: 'all'
= javascript_include_tag 'registrar-manifest'
= favicon_link_tag 'favicon.ico'
%body
%nav.navbar.navbar-default.navbar-fixed-top
.container
.navbar-header
%button.navbar-toggle.collapsed{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
= link_to registrar_root_path, class: 'navbar-brand', id: 'registrar-home-btn' do
= t(:registrar_head_title)
- if unstable_env.present?
.text-center
%small{style: 'color: #0074B3;'}= unstable_env
- if current_user
= render 'navbar'
.container
= render 'shared/flash'
- if depp_controller?
= render 'registrar/shared/epp_results'
= yield
%footer.footer
.container
%row
.col-md-6
= image_tag 'eis-logo-et.png'
.col-md-6.text-right
Version
= CURRENT_COMMIT_HASH

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'

View file

@ -0,0 +1,8 @@
require 'rails_helper'
RSpec.feature 'Registrar area home link', db: true do
scenario 'is visible' do
visit registrar_login_url
expect(page).to have_link('registrar-home-btn', href: registrar_root_path)
end
end