Merge branch 'master' of github.com:domify/registry

Conflicts:
	app/assets/stylesheets/shared/general.sass
This commit is contained in:
Martin Lensment 2015-04-21 13:23:50 +03:00
commit dbbc6b3bff
58 changed files with 552 additions and 322 deletions

View file

@ -30,10 +30,12 @@ gem 'turbolinks', '~> 2.5.3' # faster page load
gem 'jquery-rails', '~> 4.0.3' # jquery gem 'jquery-rails', '~> 4.0.3' # jquery
gem 'selectize-rails', '~> 0.11.2' # include selectize.js for select gem 'selectize-rails', '~> 0.11.2' # include selectize.js for select
gem 'therubyracer', platforms: :ruby gem 'therubyracer', platforms: :ruby
gem 'jquery-validation-rails', '~> 1.13.1' # validate on client side
# view helpers # view helpers
gem 'kaminari', '~> 0.16.3' # pagination gem 'kaminari', '~> 0.16.3' # pagination
gem 'nprogress-rails', '~> 0.1.6.5' # visual loader gem 'nprogress-rails', '~> 0.1.6.5' # visual loader
gem 'html5_validators', '~> 1.1.3' # model requements now automatically on html form
# rights # rights
gem 'devise', '~> 3.4.1' # authenitcation gem 'devise', '~> 3.4.1' # authenitcation

View file

@ -220,6 +220,7 @@ GEM
hike (1.2.3) hike (1.2.3)
hitimes (1.2.2) hitimes (1.2.2)
hpricot (0.8.6) hpricot (0.8.6)
html5_validators (1.1.3)
httpclient (2.6.0.1) httpclient (2.6.0.1)
httpi (2.4.0) httpi (2.4.0)
rack rack
@ -234,6 +235,9 @@ GEM
rails-dom-testing (~> 1.0) rails-dom-testing (~> 1.0)
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-validation-rails (1.13.1)
railties (>= 3.2, < 5.0)
thor (~> 0.14)
json (1.8.2) json (1.8.2)
kaminari (0.16.3) kaminari (0.16.3)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
@ -511,10 +515,12 @@ DEPENDENCIES
haml-rails (~> 0.9.0) haml-rails (~> 0.9.0)
hashie-forbidden_attributes (~> 0.1.1) hashie-forbidden_attributes (~> 0.1.1)
html2haml! html2haml!
html5_validators (~> 1.1.3)
isikukood isikukood
iso8601 (~> 0.8.2) iso8601 (~> 0.8.2)
jbuilder (~> 2.2.6) jbuilder (~> 2.2.6)
jquery-rails (~> 4.0.3) jquery-rails (~> 4.0.3)
jquery-validation-rails (~> 1.13.1)
kaminari (~> 0.16.3) kaminari (~> 0.16.3)
launchy (~> 2.4.3) launchy (~> 2.4.3)
mina (~> 0.3.1) mina (~> 0.3.1)

View file

@ -5,10 +5,12 @@
#= require nprogress #= require nprogress
#= require nprogress-turbolinks #= require nprogress-turbolinks
#= require typeahead.bundle.min #= require typeahead.bundle.min
#= require autocomplete #= require admin/autocomplete
#= require jquery.nested_attributes #= require jquery.nested_attributes
#= require selectize #= require selectize
#= require app #= require shared/jquery.validate.bootstrap
#= require shared/general
#= require admin/application
NProgress.configure NProgress.configure
showSpinner: false showSpinner: false

View file

@ -0,0 +1,12 @@
ready = ->
$('.selectize').selectize({
allowEmptyOption: true
});
# client side validate all forms
$('form').each ->
$(this).validate()
$(document).ready(ready)
$(document).on('page:load', ready)

View file

@ -0,0 +1,10 @@
#= require jquery
#= require jquery_ujs
#= require jquery.validate
#= require jquery.validate.additional-methods
#= require turbolinks
#= require bootstrap-sprockets
#= require jquery.nested_attributes
#= require shared/jquery.validate.bootstrap
#= require shared/general
#= require registrar/application

View file

@ -1,10 +1,8 @@
#= require jquery
#= require jquery_ujs
#= require turbolinks
#= require bootstrap-sprockets
#= require jquery.nested_attributes
$(document).on 'ready page:load', -> $(document).on 'ready page:load', ->
# client side validate all forms
$('form').each ->
$(this).validate()
$('.js-contact-form').on 'restoreDefault', (e) -> $('.js-contact-form').on 'restoreDefault', (e) ->
form = $(e.target) form = $(e.target)
form.find('.js-ident-tip').hide() form.find('.js-ident-tip').hide()

View file

@ -9,11 +9,3 @@
$('#flash').find('div').addClass('bg-danger') $('#flash').find('div').addClass('bg-danger')
$('#flash').find('div').html(msg) $('#flash').find('div').html(msg)
$('#flash').show() $('#flash').show()
ready = ->
$('.selectize').selectize({
allowEmptyOption: true
});
$(document).ready(ready)
$(document).on('page:load', ready)

View file

@ -0,0 +1,20 @@
#= require jquery.validate
#= require jquery.validate.additional-methods
# override jquery validate plugin defaults
$.validator.setDefaults
highlight: (element) ->
$(element).closest('.form-group').addClass 'has-error'
return
unhighlight: (element) ->
$(element).closest('.form-group').removeClass 'has-error'
return
errorElement: 'span'
errorClass: 'help-block'
errorPlacement: (error, element) ->
if element.parent('.input-group').length
error.insertAfter element.parent()
else
error.insertAfter element
return

View file

@ -1,4 +1,4 @@
//= require 'shared/general-bootstrap' //= require 'shared/general-manifest'
//= require 'admin/admin-bootstrap' //= require 'admin/admin-bootstrap'
@import shared/fonts @import shared/fonts
@import shared/general @import shared/general

View file

@ -9,5 +9,10 @@ $container-large-desktop: 860px
$font-size-h1: 26px $font-size-h1: 26px
$navbar-default-link-active-color: #333 $navbar-default-link-active-color: #333
@import "bootstrap-sprockets" @import 'bootstrap-sprockets'
@import "bootstrap" @import 'bootstrap'
@import 'shared/general-bootstrap'
// Support rails error element
.field_with_errors
@extend .has-error

View file

@ -4,6 +4,13 @@ html
-webkit-text-size-adjust: 100% -webkit-text-size-adjust: 100%
-ms-text-size-adjust: 100% -ms-text-size-adjust: 100%
body > .container
background: #fff
padding: 16px 30px 30px 30px
margin-top: 0px
border-radius: 3px
min-height: 600px
h1 h1
font-size: 26px font-size: 26px
margin-bottom: 16px margin-bottom: 16px
@ -98,15 +105,6 @@ sub
padding-right: 20px padding-right: 20px
border-top: 0px border-top: 0px
.container
border-radius: 3px
body > .container
background: #F8F8F8
margin-bottom: 50px
min-height: 600px
padding: 30px 30px 56px 30px
.container.version .container.version
background: transparent background: transparent
margin-top: -116px margin-top: -116px
@ -155,21 +153,6 @@ h4
margin-bottom: 16px margin-bottom: 16px
float: right float: right
.navbar-brand
line-height: 12px
padding-top: 20px
padding-bottom: 5px
.navbar-brand small
display: block
font-size: 10px
.footer
color: #777
padding-top: 70px
padding-bottom: 10px
font-size: 10px
.domify .domify
td td
vertical-align: middle !important vertical-align: middle !important
@ -228,6 +211,9 @@ body.login
display: block display: block
font-size: 10px font-size: 10px
.navbar
margin-bottom: 0
.footer .footer
color: #777 color: #777
padding-top: 15px padding-top: 15px
@ -259,7 +245,9 @@ body.login
input input
margin-bottom: 10px margin-bottom: 10px
// fix label position for medium screen @media (min-width: 860px)
@media (min-width: 768px) and (max-width: 991px) .control-label
.form-horizontal .control-label text-align: right
text-align: left margin-bottom: 0
padding-top: 7px

View file

@ -1,4 +1,4 @@
//= require 'shared/general-bootstrap' //= require 'shared/general-manifest'
//= require 'registrar/registrar-bootstrap' //= require 'registrar/registrar-bootstrap'
@import shared/fonts @import shared/fonts
@import shared/general @import shared/general

View file

@ -9,5 +9,10 @@ $font-family-serif: 'EtelkaLightProBold', Georgia, "Times New Roman", Times, ser
$font-size-h1: 26px $font-size-h1: 26px
$navbar-default-link-active-color: #333 $navbar-default-link-active-color: #333
@import "bootstrap-sprockets" @import 'bootstrap-sprockets'
@import "bootstrap" @import 'bootstrap'
@import 'shared/general-bootstrap'
// Support rails error element
.field_with_errors
@extend .has-error

View file

@ -13,9 +13,10 @@ body > .container
h1, h2, h3, h4 h1, h2, h3, h4
margin-bottom: 0px !important margin-bottom: 0px !important
hr // Commented out, default 20px is needed on forms
margin-top: 10px !important // hr
margin-bottom: 10px !important // margin-top: 10px !important
// margin-bottom: 10px !important
.navbar li .navbar li
font-weight: bold font-weight: bold

View file

@ -62,3 +62,6 @@
.text-justify-lg .text-justify-lg
text-align: justify text-align: justify
.required:after
content: "*"
margin: 0 0 0 1px

View file

@ -39,3 +39,15 @@
.no-border .no-border
border: 0px !important border: 0px !important
.errors
color: #A94442
// vertical allign with other fields
.typeahead
margin-left: 5px
// fix medium screen size label position
@media (min-width: 768px) and (max-width: 991px)
.control-label
text-align: left !important

View file

@ -10,11 +10,11 @@ class Epp::DomainsController < EppController
case @hosts case @hosts
when 'del' when 'del'
@nameservers = @domain.delegated_nameservers @nameservers = @domain.delegated_nameservers.sort
when 'sub' when 'sub'
@nameservers = @domain.subordinate_nameservers @nameservers = @domain.subordinate_nameservers.sort
when 'all' when 'all'
@nameservers = @domain.nameservers @nameservers = @domain.nameservers.sort
end end
render_epp_response '/epp/domains/info' render_epp_response '/epp/domains/info'

View file

@ -1,14 +1,10 @@
class AdminUser < User class AdminUser < User
# TODO: Foreign user will get email with activation link,email,temp-password. validates :username, :password, :country_code, :roles, presence: true
# After activisation, system should require to change temp password.
# TODO: Estonian id validation
validates :username, :password, :country_code, presence: true
validates :identity_code, uniqueness: true, allow_blank: true validates :identity_code, uniqueness: true, allow_blank: true
validates :identity_code, presence: true, if: -> { country_code == 'EE' } validates :identity_code, presence: true, if: -> { country_code == 'EE' }
validates :email, presence: true, if: -> { country_code != 'EE' } validates :email, presence: true
validate :validate_identity_code validate :validate_identity_code, if: -> { country_code == 'EE' }
belongs_to :country_deprecated, foreign_key: :country_id belongs_to :country_deprecated, foreign_key: :country_id
ROLES = %w(user customer_service admin) ROLES = %w(user customer_service admin)

View file

@ -0,0 +1,9 @@
module DisableHtml5Validation
extend ActiveSupport::Concern
class_methods do
def auto_html5_validation
false
end
end
end

View file

@ -2,6 +2,7 @@ class Deposit
include ActiveModel::Validations include ActiveModel::Validations
include ActiveModel::Conversion include ActiveModel::Conversion
extend ActiveModel::Naming extend ActiveModel::Naming
include DisableHtml5Validation
attr_accessor :amount, :description, :registrar attr_accessor :amount, :description, :registrar

View file

@ -1,6 +1,7 @@
module Depp module Depp
class Contact class Contact
include ActiveModel::Model include ActiveModel::Model
include DisableHtml5Validation
attr_accessor :id, :name, :email, :phone, :org_name, attr_accessor :id, :name, :email, :phone, :org_name,
:ident, :ident_type, :ident_country_code, :ident, :ident_type, :ident_country_code,

View file

@ -2,6 +2,7 @@ module Depp
class Domain class Domain
include ActiveModel::Conversion include ActiveModel::Conversion
extend ActiveModel::Naming extend ActiveModel::Naming
include DisableHtml5Validation
attr_accessor :name, :current_user, :epp_xml attr_accessor :name, :current_user, :epp_xml

View file

@ -1,5 +1,6 @@
module Depp module Depp
class Keyrelay class Keyrelay
include DisableHtml5Validation
attr_accessor :current_user, :epp_xml attr_accessor :current_user, :epp_xml
def initialize(args = {}) def initialize(args = {})

View file

@ -3,6 +3,7 @@ module Depp
include ActiveModel::Validations include ActiveModel::Validations
include ActiveModel::Conversion include ActiveModel::Conversion
extend ActiveModel::Naming extend ActiveModel::Naming
include DisableHtml5Validation
attr_accessor :tag, :password, :pki attr_accessor :tag, :password, :pki

View file

@ -53,7 +53,7 @@ class DomainTransfer < ActiveRecord::Base
def notify_losing_registrar def notify_losing_registrar
transfer_from.messages.create!( transfer_from.messages.create!(
body: I18n.t('domain_transfer_was_approved', contacts: domain.contacts.pluck(:code)), body: I18n.t('domain_transfer_was_approved', contacts: domain.contacts.pluck(:code).sort),
attached_obj_id: id, attached_obj_id: id,
attached_obj_type: self.class.to_s attached_obj_type: self.class.to_s
) )

View file

@ -14,7 +14,7 @@ class Registrar < ActiveRecord::Base
validates :name, :reg_no, :reference_no, uniqueness: true validates :name, :reg_no, :reference_no, uniqueness: true
validate :set_code, if: :new_record? validate :set_code, if: :new_record?
before_create :generate_iso_11649_reference_no before_validation :generate_iso_11649_reference_no
def generate_iso_11649_reference_no def generate_iso_11649_reference_no
return if reference_no.present? return if reference_no.present?

View file

@ -1,35 +1,43 @@
= form_for([:admin, @admin_user]) do |f| = form_for([:admin, @admin_user], html: { class: 'form-horizontal' }) do |f|
- if @admin_user.errors.any? = render 'shared/full_errors', object: @admin_user
- @admin_user.errors.each do |attr, err|
= err
%br
- if @admin_user.errors.any?
%hr
.row .row
.col-md-6 .col-md-8
.form-group .form-group
.col-md-4.control-label
= f.label :username = f.label :username
.col-md-8
= f.text_field(:username, class: 'form-control') = f.text_field(:username, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :password = f.label :password
.col-md-8
= f.text_field(:password, class: 'form-control') = f.text_field(:password, class: 'form-control')
%hr
.form-group .form-group
= f.label :country_code .col-md-4.control-label
= f.text_field :country_code, class: 'form-control'
.form-group
= f.label :identity_code = f.label :identity_code
.col-md-8
= f.text_field(:identity_code, class: 'form-control') = f.text_field(:identity_code, class: 'form-control')
.col-md-6
.form-group .form-group
.col-md-4.control-label
= f.label :email = f.label :email
= f.text_field(:email, class: 'form-control') .col-md-8
= f.text_field(:email, class: 'form-control', email: true)
.form-group .form-group
.col-md-4.control-label
= f.label :country_code, t(:country)
.col-md-8
= f.select(:country_code,
SortedCountry.all_options(f.object.country_code), {}, class: 'form-control')
%hr
.form-group
.col-md-4.control-label
= f.label :role = f.label :role
.col-md-8
= select_tag 'admin_user[roles][]', options_for_select(AdminUser::ROLES.map {|x| [t(x), x] }, @admin_user.roles.try(:first)), class: 'form-control selectize' = select_tag 'admin_user[roles][]', options_for_select(AdminUser::ROLES.map {|x| [t(x), x] }, @admin_user.roles.try(:first)), class: 'form-control selectize'
%hr %hr
.row .row
.col-md-12.text-right .col-md-8.text-right
= button_tag(t('save'), class: 'btn btn-primary') = button_tag(t(:save), class: 'btn btn-primary')

View file

@ -1,38 +1,42 @@
= form_for([:admin, @api_user], multipart: true) do |f| = form_for([:admin, @api_user], multipart: true, html: {class: 'form-horizontal'}) do |f|
- if @api_user.errors.any? = render 'shared/full_errors', object: @api_user
- @api_user.errors.each do |attr, err|
= err
%br
- if @api_user.errors.any?
%hr
.row .row
.col-md-12 .col-md-8
.form-group .form-group
.col-md-4.control-label
= f.label :username = f.label :username
.col-md-7
= f.text_field(:username, class: 'form-control') = f.text_field(:username, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :password = f.label :password
.col-md-7
= f.text_field(:password, class: 'form-control') = f.text_field(:password, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :identity_code = f.label :identity_code
.col-md-7
= f.text_field(:identity_code, class: 'form-control') = f.text_field(:identity_code, class: 'form-control')
.form-group .form-group
.form-group.has-feedback.js-typeahead-container .form-group.has-feedback.js-typeahead-container
= f.label :registrar_typeahead, t('registrar') .col-md-4.control-label
= f.text_field(:registrar_typeahead, class: 'form-control js-registrar-typeahead', placeholder: t('registrar'), autocomplete: 'off') = f.label :registrar_typeahead, t(:registrar), class: 'required'
.col-md-7
= f.text_field(:registrar_typeahead,
class: 'form-control js-registrar-typeahead typeahead required',
placeholder: t(:registrar), autocomplete: 'off')
%span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden %span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove %span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
= f.hidden_field(:registrar_id, class: 'js-registrar-id') = f.hidden_field(:registrar_id, class: 'js-registrar-id')
.form-group
.checkbox .checkbox
%label{for: 'api_user_active'} %label{for: 'api_user_active'}
= f.check_box(:active) = f.check_box(:active)
= t('active') = t(:active)
%hr %hr
.row .row
.col-md-12.text-right .col-md-8.text-right
= button_tag(t('save'), class: 'btn btn-primary') = button_tag(t(:save), class: 'btn btn-primary')
:coffee :coffee
Autocomplete.bindAdminRegistrarSearch(); Autocomplete.bindAdminRegistrarSearch();

View file

@ -6,11 +6,13 @@
= render 'shared/full_errors', object: @bank_statement = render 'shared/full_errors', object: @bank_statement
.row .row
.col-md-12.text-left .col-md-8
.form-group .form-group
.col-md-4.control-label
= f.label :th6_file = f.label :th6_file
.col-md-8
= f.file_field :th6_file = f.file_field :th6_file
%hr %hr
.row .row
.col-md-12.text-right .col-md-8.text-right
= button_tag(t(:save), class: 'btn btn-primary') = button_tag(t(:save), class: 'btn btn-primary')

View file

@ -1,20 +1,17 @@
= render 'shared/title', name: t(:upload_csr) = render 'shared/title', name: t(:upload_csr)
= form_for([:admin, @api_user, @certificate], multipart: true) do |f| = form_for([:admin, @api_user, @certificate], multipart: true) do |f|
- if @certificate.errors.any? = render 'shared/full_errors', object: f.object
- @certificate.errors.each do |attr, err|
= err
%br
- if @certificate.errors.any?
%hr
.row .row
.col-md-12.text-left .col-md-8
.form-group .form-group
.col-md-4.control-label= f.label :username
= f.label :csr, t(:certificate_signing_req) = f.label :csr, t(:certificate_signing_req)
.col-md-8
= f.file_field :csr = f.file_field :csr
%hr %hr
.row .row
.col-md-12.text-right .col-md-8.text-right
= button_tag(t(:save), class: 'btn btn-primary') = button_tag(t(:save), class: 'btn btn-primary')

View file

@ -1,10 +1,5 @@
= form_for([:admin, @registrar]) do |f| = form_for([:admin, @registrar], html: {class: 'form-horizontal'}) do |f|
- if @registrar.errors.any? = render 'shared/full_errors', object: @registrar
- @registrar.errors.full_messages.each do |err|
= err
%br
- if @registrar.errors.any?
%hr
.row .row
.col-md-8 .col-md-8
@ -13,48 +8,68 @@
.pull-left= t(:general) .pull-left= t(:general)
.panel-body .panel-body
.form-group .form-group
.col-md-3.control-label .col-md-4.control-label
= f.label :name = f.label :name
.col-md-7 .col-md-7
= f.text_field(:name, class: 'form-control') = f.text_field(:name, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :reg_no = f.label :reg_no
.col-md-7
= f.text_field(:reg_no, class: 'form-control') = f.text_field(:reg_no, class: 'form-control')
/ EIS does not want VAT
/ .form-group
/ = f.label :vat_no
/ = f.text_field(:vat_no, class: 'form-control')
.form-group .form-group
= f.label :email .col-md-4.control-label
= f.text_field(:email, class: 'form-control') = f.label :vat_no
.col-md-7
= f.text_field(:vat_no, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :phone = f.label :phone
.col-md-7
= f.text_field(:phone, class: 'form-control') = f.text_field(:phone, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :email
.col-md-7
= f.text_field(:email, class: 'form-control', email: true)
.form-group
.col-md-4.control-label
= f.label :billing_email = f.label :billing_email
= f.text_field(:billing_email, class: 'form-control') .col-md-7
= f.text_field(:billing_email, class: 'form-control', email: true)
.row .row
.col-md-8 .col-md-8
.panel.panel-default
.panel-heading.clearfix
.pull-left= t(:address)
.panel-body
.form-group .form-group
.col-md-4.control-label
= f.label :street = f.label :street
.col-md-7
= f.text_field(:street, class: 'form-control') = f.text_field(:street, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :city = f.label :city
.col-md-7
= f.text_field(:city, class: 'form-control') = f.text_field(:city, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :state = f.label :state
.col-md-7
= f.text_field(:state, class: 'form-control') = f.text_field(:state, class: 'form-control')
.form-group .form-group
.col-md-4.control-label
= f.label :zip = f.label :zip
.col-md-7
= f.text_field(:zip, class: 'form-control') = f.text_field(:zip, class: 'form-control')
.form-group .form-group
= f.label :country_code .col-md-4.control-label
= f.text_field :country_code, class: 'form-control' = f.label :country_code, t(:country)
/ EIS does not want Billing Address .col-md-7
/ .form-group = f.select(:country_code,
/ = f.label :billing_address SortedCountry.all_options(f.object.country_code), {}, class: 'form-control')
/ = f.text_field(:billing_address, class: 'form-control')
/ %p.help-block= t('address_help')
%hr %hr
.row .row
.col-md-8.text-right .col-md-8.text-right

View file

@ -2,12 +2,12 @@
= form_tag [:admin, :settings] do = form_tag [:admin, :settings] do
.row .row
.col-md-12 .col-md-8
.table-responsive .table-responsive
%table.table.table-hover.table-bordered.table-condensed %table.table.table-hover.table-bordered.table-condensed
%thead %thead
%tr %tr
%th{class: 'col-xs-9'} %th{class: 'col-xs-4'}
= t(:setting) = t(:setting)
%th{class: 'col-xs-2'} %th{class: 'col-xs-2'}
= t(:value) = t(:value)
@ -21,6 +21,7 @@
= check_box_tag("[settings][#{x.var}]", true, x.value) = check_box_tag("[settings][#{x.var}]", true, x.value)
- else - else
%td= text_field_tag("[settings][#{x.var}]", x.value) %td= text_field_tag("[settings][#{x.var}]", x.value)
%hr
.row .row
.col-md-12.text-right .col-md-8.text-right
%button.btn.btn-primary=t(:save) %button.btn.btn-primary=t(:save)

View file

@ -2,49 +2,52 @@
= form_for [:admin, @zonefile_setting], html: { class: 'form-horizontal' } do |f| = form_for [:admin, @zonefile_setting], html: { class: 'form-horizontal' } do |f|
.row .row
.col-md-12 .col-md-8
#domain-statuses #domain-statuses
.errors = render 'shared/full_errors', object: f.object
- if f.object.errors.any?
- f.object.errors.full_messages.each do |x|
= x
%br
- if f.object.errors.any?
%hr
.form-group .form-group
= f.label :origin, class: 'col-md-2 control-label' .col-md-4.control-label
.col-md-10 = f.label :origin
.col-md-8
= f.text_field :origin, class: 'form-control', disabled: true = f.text_field :origin, class: 'form-control', disabled: true
.form-group .form-group
= f.label :ttl, class: 'col-md-2 control-label' .col-md-4.control-label
.col-md-10 = f.label :ttl
.col-md-8
= f.text_field :ttl, class: 'form-control' = f.text_field :ttl, class: 'form-control'
.form-group .form-group
= f.label :refresh, class: 'col-md-2 control-label' .col-md-4.control-label
.col-md-10 = f.label :refresh
.col-md-8
= f.text_field :refresh, class: 'form-control' = f.text_field :refresh, class: 'form-control'
.form-group .form-group
= f.label :retry, class: 'col-md-2 control-label' .col-md-4.control-label
.col-md-10 = f.label :retry
.col-md-8
= f.text_field :retry, class: 'form-control' = f.text_field :retry, class: 'form-control'
.form-group .form-group
= f.label :expire, class: 'col-md-2 control-label' .col-md-4.control-label
.col-md-10 = f.label :expire
.col-md-8
= f.text_field :expire, class: 'form-control' = f.text_field :expire, class: 'form-control'
.form-group .form-group
= f.label :minimum_ttl, class: 'col-md-2 control-label' .col-md-4.control-label
.col-md-10 = f.label :minimum_ttl
.col-md-8
= f.text_field :minimum_ttl, class: 'form-control' = f.text_field :minimum_ttl, class: 'form-control'
.form-group .form-group
= f.label :email, class: 'col-md-2 control-label' .col-md-4.control-label
.col-md-10 = f.label :email
= f.text_field :email, class: 'form-control' .col-md-8
= f.text_field :email, class: 'form-control', email: true
%hr
.row .row
.col-md-12.text-right .col-md-8.text-right
%button.btn.btn-primary= t(:save) %button.btn.btn-primary= t(:save)

View file

@ -63,7 +63,7 @@ xml.epp_head do
xml.extension do xml.extension do
xml.tag!('secDNS:infData', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do xml.tag!('secDNS:infData', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
@domain.dnskeys.each do |key| @domain.dnskeys.sort.each do |key|
xml.tag!('secDNS:dsData') do xml.tag!('secDNS:dsData') do
xml.tag!('secDNS:keyTag', key.ds_key_tag) xml.tag!('secDNS:keyTag', key.ds_key_tag)
xml.tag!('secDNS:alg', key.ds_alg) xml.tag!('secDNS:alg', key.ds_alg)

View file

@ -11,7 +11,7 @@
%title= t(:admin_head_title) %title= t(:admin_head_title)
= csrf_meta_tags = csrf_meta_tags
= stylesheet_link_tag 'admin-manifest', media: 'all', 'data-turbolinks-track' => true = stylesheet_link_tag 'admin-manifest', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true = javascript_include_tag 'admin-manifest', 'data-turbolinks-track' => true
= favicon_link_tag 'favicon.ico' = favicon_link_tag 'favicon.ico'
%body{:style => env_style} %body{:style => env_style}
/ Static navbar / Static navbar

View file

@ -12,7 +12,7 @@
%title= t(:registrar_head_title) %title= t(:registrar_head_title)
= csrf_meta_tags = csrf_meta_tags
= stylesheet_link_tag 'registrar-manifest', media: 'all', 'data-turbolinks-track' => true = stylesheet_link_tag 'registrar-manifest', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true = javascript_include_tag 'registrar-manifest', 'data-turbolinks-track' => true
= favicon_link_tag 'favicon.ico' = favicon_link_tag 'favicon.ico'
%body %body
/ Fixed navbar / Fixed navbar

View file

@ -18,6 +18,6 @@
.row .row
.col-md-8.text-right .col-md-8.text-right
- if @contact.persisted? - if @contact.persisted?
= button_tag(t(:save), class: 'btn btn-primary') = button_tag t(:save), class: 'btn btn-primary'
- else - else
= button_tag(t(:create), class: 'btn btn-primary') = button_tag t(:create), class: 'btn btn-primary'

View file

@ -6,19 +6,19 @@
.col-md-3.control-label .col-md-3.control-label
= f.label :street, t(:street) + '*' = f.label :street, t(:street) + '*'
.col-md-7 .col-md-7
= f.text_field :street, class: 'form-control' = f.text_field :street, class: 'form-control', required: true
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :city, t(:city) + '*' = f.label :city, t(:city) + '*'
.col-md-7 .col-md-7
= f.text_field :city, class: 'form-control' = f.text_field :city, class: 'form-control', required: true
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :zip, t(:zip) + '*' = f.label :zip, t(:zip) + '*'
.col-md-7 .col-md-7
= f.text_field :zip, class: 'form-control' = f.text_field :zip, class: 'form-control', required: true
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
@ -30,4 +30,5 @@
.col-md-3.control-label .col-md-3.control-label
= f.label :country_code, t(:country) + '*' = f.label :country_code, t(:country) + '*'
.col-md-7 .col-md-7
= f.select(:country_code, SortedCountry.all_options(f.object.country_code)) = f.select :country_code,
SortedCountry.all_options(f.object.country_code)

View file

@ -7,20 +7,20 @@
= f.label :ident_country_code, t(:country) + '*' = f.label :ident_country_code, t(:country) + '*'
.col-md-7 .col-md-7
= f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {}, = f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {},
class: 'js-ident-country-code') class: 'js-ident-country-code', required: true)
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :ident_type, t(:type) + '*' = f.label :ident_type, t(:type) + '*'
.col-md-7 .col-md-7
= f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type }, = f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type },
class: 'js-ident-type') class: 'js-ident-type', required: true)
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :ident, t(:ident) + '*' = f.label :ident, t(:ident) + '*'
.col-md-7 .col-md-7
= f.text_field :ident, class: 'form-control' = f.text_field :ident, class: 'form-control', required: true
- tip_visibility = f.object.ident_type == 'birthday' ? '' : 'display: none' - tip_visibility = f.object.ident_type == 'birthday' ? '' : 'display: none'
.js-ident-tip{ style: tip_visibility } .js-ident-tip{ style: tip_visibility }
= t(:birthday_format) = t(:birthday_format)
@ -33,18 +33,19 @@
.col-md-3.control-label .col-md-3.control-label
= f.label :name, t(:name) + '*' = f.label :name, t(:name) + '*'
.col-md-7 .col-md-7
= f.text_field :name, class: 'form-control' = f.text_field :name, class: 'form-control', required: true
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :email, t(:email) + '*' = f.label :email, t(:email) + '*'
.col-md-7 .col-md-7
= f.text_field :email, class: 'form-control' = f.text_field :email, class: 'form-control', required: true, email: true
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :phone, t(:phone) + '*' = f.label :phone, t(:phone) + '*'
.col-md-7 .col-md-7
= f.text_field(:phone, class: 'form-control', placeholder: '+372.12323344') = f.text_field :phone, class: 'form-control',
placeholder: '+372.12323344', required: true

View file

@ -2,21 +2,27 @@
= link_to(t(:back_to_billing), registrar_invoices_path, class: 'btn btn-default') = link_to(t(:back_to_billing), registrar_invoices_path, class: 'btn btn-default')
= render 'shared/title', name: t(:add_deposit) = render 'shared/title', name: t(:add_deposit)
= form_for([:registrar, @deposit], method: :post) do |f| = form_for([:registrar, @deposit], method: :post, html: { class: 'form-horizontal' }) do |f|
.row
.col-md-4.col-md-offset-4
= render 'shared/full_errors', object: @deposit = render 'shared/full_errors', object: @deposit
.row
.col-md-8
.form-group .form-group
= f.label :amount .col-md-4.control-label
= f.label :amount, class: 'required'
.col-md-7
.input-group .input-group
= f.text_field :amount, class: 'form-control' = f.text_field :amount, class: 'form-control', required: true
.input-group-addon .input-group-addon
EUR EUR
.form-group .form-group
.col-md-4.control-label
= f.label :description = f.label :description
.col-md-7
= f.text_area :description, class: 'form-control' = f.text_area :description, class: 'form-control'
%hr
.row .row
.col-md-12.text-right .col-md-8.text-right
= button_tag(t(:add), class: 'btn btn-primary') = button_tag(t(:add), class: 'btn btn-primary')

View file

@ -13,9 +13,10 @@
.pull-left= t(:legal_document) .pull-left= t(:legal_document)
.panel-body .panel-body
.form-group .form-group
= label_tag 'domain[legal_document]', t('legal_document'),class: 'col-md-3 control-label' .col-md-3.control-label
.col-md-9 = label_tag 'domain[legal_document]', t('legal_document'), class: 'required'
= file_field_tag 'domain[legal_document]' .col-md-7
= file_field_tag 'domain[legal_document]', required: true
.col-md-4 .col-md-4
%p.domain-general-help= t(:domain_general_help).html_safe %p.domain-general-help= t(:domain_general_help).html_safe
%p.domain-admin-contact-help= t(:domain_admin_contact_help).html_safe %p.domain-admin-contact-help= t(:domain_admin_contact_help).html_safe

View file

@ -7,10 +7,10 @@
= t(:legal_document) = t(:legal_document)
.panel-body .panel-body
.form-group .form-group
.col-md-3.control-label .col-md-4.control-label
= label_tag 'domain[legal_document]', t('legal_document') = label_tag 'domain[legal_document]', t('legal_document'), class: 'required'
.col-md-7 .col-md-6
= file_field_tag 'domain[legal_document]' = file_field_tag 'domain[legal_document]', required: true
= hidden_field_tag 'domain[name]', params[:domain_name] = hidden_field_tag 'domain[name]', params[:domain_name]
%hr %hr
.row .row

View file

@ -2,20 +2,23 @@
- @domain_params['contacts_attributes'].each do |k, v| - @domain_params['contacts_attributes'].each do |k, v|
.panel.panel-default .panel.panel-default
.panel-heading.clearfix .panel-heading.clearfix
.pull-left= t('contact') .pull-left= t(:contact)
.pull-right .pull-right
= link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-domain-contact') = link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-domain-contact')
= link_to(t('delete'), '#', class: 'btn btn-danger btn-xs destroy') = link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy')
.panel-body .panel-body
.form-group .form-group
= label_tag "domain_contacts_attributes_#{k}_type", t('contact_type'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_contacts_attributes_#{k}_type", t(:contact_type), class: 'required'
.col-md-7 .col-md-7
= select_tag "domain[contacts_attributes][#{k}][type]", options_for_select(['admin', 'tech'], v['type']), {class: 'form-control'} = select_tag "domain[contacts_attributes][#{k}][type]", options_for_select(['admin', 'tech'], v['type']), {class: 'form-control'}
.form-group .form-group
= label_tag "domain_contacts_attributes_#{k}_code", t('contact_code'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_contacts_attributes_#{k}_code", t(:contact_code), class: 'required'
.col-md-7.has-feedback .col-md-7.has-feedback
= text_field_tag("domain[contacts_attributes][#{k}][code]", v['code'], class: 'form-control', placeholder: t('contact_code'), autocomplete: 'off') = text_field_tag("domain[contacts_attributes][#{k}][code]", v['code'],
class: 'form-control', placeholder: t(:contact_code), autocomplete: 'off', required: true)
:coffee :coffee
$("#domain-contacts").nestedAttributes $("#domain-contacts").nestedAttributes
bindAddTo: $(".add-domain-contact") bindAddTo: $(".add-domain-contact")

View file

@ -2,51 +2,71 @@
- @domain_params['dnskeys_attributes'].each do |k, v| - @domain_params['dnskeys_attributes'].each do |k, v|
.panel.panel-default .panel.panel-default
.panel-heading.clearfix .panel-heading.clearfix
.pull-left= t('dnskey') .pull-left= t(:dnskey)
.pull-right .pull-right
= link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-dnskey') = link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-dnskey')
= link_to(t('delete'), '#', class: 'btn btn-danger btn-xs destroy') = link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy')
.panel-body .panel-body
- if ENV['show_ds_data_fields'] == 'true' - if ENV['show_ds_data_fields'] == 'true'
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_ds_key_tag", t('ds_key_tag'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_ds_key_tag", t(:ds_key_tag)
.col-md-7 .col-md-7
= text_field_tag "domain[dnskeys_attributes][#{k}][ds_key_tag]", v['ds_key_tag'], {class: 'form-control'} = text_field_tag "domain[dnskeys_attributes][#{k}][ds_key_tag]", v['ds_key_tag'],
{class: 'form-control'}
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_ds_alg", t('ds_algorithm'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_ds_alg", t(:ds_algorithm)
.col-md-7 .col-md-7
= select_tag "domain[dnskeys_attributes][#{k}][ds_alg]", options_for_select(Depp::Dnskey::ALGORITHMS, v['ds_alg']), {class: 'form-control'} = select_tag "domain[dnskeys_attributes][#{k}][ds_alg]",
options_for_select(Depp::Dnskey::ALGORITHMS, v['ds_alg']), {class: 'form-control'}
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_ds_digest_type", t('ds_digest_type'), class: 'col-md-2 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_ds_digest_type", t(:ds_digest_type)
.col-md-7 .col-md-7
= select_tag "domain[dnskeys_attributes][#{k}][ds_digest_type]", options_for_select(Depp::Dnskey::DS_DIGEST_TYPES, v['ds_digest_type']), {class: 'form-control'} = select_tag "domain[dnskeys_attributes][#{k}][ds_digest_type]",
options_for_select(Depp::Dnskey::DS_DIGEST_TYPES, v['ds_digest_type']),
{class: 'form-control'}
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_ds_digest", t('ds_digest'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_ds_digest", t(:ds_digest)
.col-md-7 .col-md-7
= text_field_tag "domain[dnskeys_attributes][#{k}][ds_digest]", v['ds_digest'], {class: 'form-control'} = text_field_tag "domain[dnskeys_attributes][#{k}][ds_digest]", v['ds_digest'],
{class: 'form-control'}
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_flags", t('flags'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_flags", t(:flags)
.col-md-7 .col-md-7
= select_tag "domain[dnskeys_attributes][#{k}][flags]", options_for_select(Depp::Dnskey::FLAGS, v['flags']), {class: 'form-control'} = select_tag "domain[dnskeys_attributes][#{k}][flags]",
options_for_select(Depp::Dnskey::FLAGS, v['flags']),
{ class: 'form-control' }
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_protocol", t('protocol'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_protocol", t(:protocol)
.col-md-7 .col-md-7
= select_tag "domain[dnskeys_attributes][#{k}][protocol]", options_for_select(Depp::Dnskey::PROTOCOLS, v['protocol']), {class: 'form-control'} = select_tag "domain[dnskeys_attributes][#{k}][protocol]",
options_for_select(Depp::Dnskey::PROTOCOLS, v['protocol']),
{ class: 'form-control' }
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_alg", t('alg'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_alg", t(:alg)
.col-md-7 .col-md-7
= select_tag "domain[dnskeys_attributes][#{k}][alg]", options_for_select(Depp::Dnskey::ALGORITHMS, v['alg']), {class: 'form-control'} = select_tag "domain[dnskeys_attributes][#{k}][alg]",
options_for_select(Depp::Dnskey::ALGORITHMS, v['alg']), { class: 'form-control' }
.form-group .form-group
= label_tag "domain_dnskeys_attributes_#{k}_public_key", t('public_key'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_dnskeys_attributes_#{k}_public_key", t(:public_key)
.col-md-7 .col-md-7
= text_field_tag "domain[dnskeys_attributes][#{k}][public_key]", v['public_key'], class: 'form-control' = text_field_tag "domain[dnskeys_attributes][#{k}][public_key]", v['public_key'],
class: 'form-control'
:coffee :coffee
$("#dnskeys").nestedAttributes $("#dnskeys").nestedAttributes
bindAddTo: $(".add-dnskey") bindAddTo: $(".add-dnskey")

View file

@ -1,19 +1,24 @@
.general-tab.panel.panel-default .general-tab.panel.panel-default
.panel-body .panel-body
.form-group .form-group
= label_tag :domain_name, t('name'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :domain_name, t(:name), class: 'required'
.col-md-7 .col-md-7
- readonly = params[:domain_name] ? true : false - readonly = params[:domain_name] ? true : false
= text_field_tag('domain[name]', @domain_params[:name], class: 'form-control', readonly: readonly) = text_field_tag('domain[name]', @domain_params[:name],
class: 'form-control', readonly: readonly, required: true)
- unless params[:domain_name] - unless params[:domain_name]
.form-group .form-group
= label_tag :domain_period, t('period'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :domain_period, t(:period), class: 'required'
.col-md-7 .col-md-7
= select_tag 'domain[period]', = select_tag 'domain[period]',
options_for_select(Depp::Domain::PERIODS, @domain_params[:period]), { class: 'form-control' } options_for_select(Depp::Domain::PERIODS, @domain_params[:period]), { class: 'form-control' }
.form-group .form-group
= label_tag :domain_registrant, t('registrant'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :domain_registrant, t(:registrant), class: 'required'
.col-md-7 .col-md-7
= text_field_tag('domain[registrant]', @domain_params[:registrant], class: 'form-control', placeholder: t('contact_code'), autocomplete: 'off') = text_field_tag('domain[registrant]', @domain_params[:registrant],
class: 'form-control', placeholder: t(:contact_code), autocomplete: 'off', required: true)

View file

@ -2,23 +2,29 @@
- @domain_params['nameservers_attributes'].each do |k, v| - @domain_params['nameservers_attributes'].each do |k, v|
.panel.panel-default .panel.panel-default
.panel-heading.clearfix .panel-heading.clearfix
.pull-left= t('nameserver') .pull-left= t(:nameserver)
.pull-right .pull-right
= link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-nameserver') = link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-nameserver')
= link_to(t('delete'), '#', class: 'btn btn-danger btn-xs destroy') = link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy')
.panel-body .panel-body
.form-group .form-group
= label_tag "domain_nameservers_attributes_#{k}_hostname", t('hostname'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_nameservers_attributes_#{k}_hostname", t(:hostname), class: 'required'
.col-md-7 .col-md-7
= text_field_tag "domain[nameservers_attributes][#{k}][hostname]", v['hostname'], class: 'form-control' = text_field_tag "domain[nameservers_attributes][#{k}][hostname]", v['hostname'],
class: 'form-control', required: true
.form-group .form-group
= label_tag "domain_nameservers_attributes_#{k}_ipv4", t('ipv4'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_nameservers_attributes_#{k}_ipv4", t(:ipv4)
.col-md-7 .col-md-7
= text_field_tag "domain[nameservers_attributes][#{k}][ipv4]", v['ipv4'], class: 'form-control' = text_field_tag "domain[nameservers_attributes][#{k}][ipv4]", v['ipv4'],
class: 'form-control', ipv4: true
.form-group .form-group
= label_tag "domain_nameservers_attributes_#{k}_ipv6", t('ipv6'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag "domain_nameservers_attributes_#{k}_ipv6", t(:ipv6)
.col-md-7 .col-md-7
= text_field_tag "domain[nameservers_attributes][#{k}][ipv6]", v['ipv6'], class: 'form-control' = text_field_tag "domain[nameservers_attributes][#{k}][ipv6]", v['ipv6'],
class: 'form-control', ipv6: true
:coffee :coffee
$("#nameservers").nestedAttributes $("#nameservers").nestedAttributes
bindAddTo: $(".add-nameserver") bindAddTo: $(".add-nameserver")

View file

@ -4,18 +4,27 @@
.col-md-8 .col-md-8
= form_tag renew_registrar_domains_path, class: 'form-horizontal', method: :get do = form_tag renew_registrar_domains_path, class: 'form-horizontal', method: :get do
.form-group .form-group
= label_tag :domain_name, t(:name), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :domain_name, t(:name), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t('domain_name'), autocomplete: 'off' = text_field_tag :domain_name, params[:domain_name],
class: 'form-control', placeholder: t('domain_name'), autocomplete: 'off', required: true
.form-group .form-group
= label_tag :cur_exp_date, t(:cur_exp_date), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :cur_exp_date, t(:cur_exp_date), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :cur_exp_date, params[:cur_exp_date], class: 'form-control', placeholder: 'yyyy-mm-dd', autocomplete: 'off' = text_field_tag :cur_exp_date, params[:cur_exp_date],
class: 'form-control', placeholder: 'yyyy-mm-dd', autocomplete: 'off', required: true
.form-group .form-group
= label_tag :domain_period, t(:period), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :domain_period, t(:period), class: 'required'
.col-md-7 .col-md-7
= select_tag :period, = select_tag :period,
options_for_select(Depp::Domain::PERIODS, params[:period]), { class: 'form-control' } options_for_select(Depp::Domain::PERIODS, params[:period]), { class: 'form-control' }
%hr
.form-group .form-group
.col-md-10.text-right .col-md-10.text-right
%button.btn.btn-primary= t(:renew) %button.btn.btn-primary= t(:renew)

View file

@ -4,19 +4,24 @@
.col-md-8 .col-md-8
= form_tag transfer_registrar_domains_path, class: 'form-horizontal', method: :post, multipart: true do = form_tag transfer_registrar_domains_path, class: 'form-horizontal', method: :post, multipart: true do
.form-group .form-group
= label_tag :domain_name, t('name'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :domain_name, t(:name), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t('domain_name'), autocomplete: 'off', autofocus: true = text_field_tag :domain_name, params[:domain_name], class: 'form-control',
placeholder: t(:domain_name), autocomplete: 'off', autofocus: true, required: true
.form-group .form-group
= label_tag :password, t('password'), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :password, t(:password), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :password, params[:password], class: 'form-control', autocomplete: 'off' = text_field_tag :password, params[:password],
class: 'form-control', autocomplete: 'off', required: true
.form-group .form-group
= label_tag 'legal_document', t('legal_document'),class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag 'legal_document', t(:legal_document), class: 'required'
.col-md-7 .col-md-7
= file_field_tag 'legal_document' = file_field_tag 'legal_document', required: true
.form-group .form-group
.col-md-10.text-right .col-md-10.text-right
%button.btn.btn-primary{ name: 'query' }= t('query') %button.btn.btn-primary{ name: 'query' }= t(:query)
%button.btn.btn-primary{ name: 'approve' }= t('approve') %button.btn.btn-primary{ name: 'approve' }= t(:approve)
%button.btn.btn-primary{ name: 'reject' }= t('reject') %button.btn.btn-primary{ name: 'reject' }= t(:reject)

View file

@ -4,47 +4,65 @@
.col-md-8 .col-md-8
= form_tag registrar_keyrelay_path, class: 'form-horizontal', method: :post, multipart: true do = form_tag registrar_keyrelay_path, class: 'form-horizontal', method: :post, multipart: true do
.form-group .form-group
= label_tag :domain_name, t(:domain_name), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :domain_name, t(:domain_name), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :domain_name, params[:domain_name], class: 'form-control', autocomplete: 'off' = text_field_tag :domain_name, params[:domain_name],
class: 'form-control', autocomplete: 'off', required: true
.form-group .form-group
= label_tag :password, t(:password), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :password, t(:password), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :password, params[:password], class: 'form-control', autocomplete: 'off' = text_field_tag :password, params[:password],
class: 'form-control', autocomplete: 'off', required: true
.form-group .form-group
= label_tag :expiry_relative, t(:expiry_relative), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :expiry_relative, t(:expiry_relative), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :expiry_relative, params[:expiry_relative], class: 'form-control', autocomplete: 'off' = text_field_tag :expiry_relative, params[:expiry_relative],
class: 'form-control', autocomplete: 'off', required: true
.form-group .form-group
= label_tag :expiry_absolute, t(:expiry_absolute), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :expiry_absolute, t(:expiry_absolute), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :expiry_absolute, params[:expiry_absolute], class: 'form-control', autocomplete: 'off' = text_field_tag :expiry_absolute, params[:expiry_absolute],
class: 'form-control', autocomplete: 'off', required: true
.form-group .form-group
= label_tag :key_data_flags, t(:flag), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :key_data_flags, t(:flag), class: 'required'
.col-md-7 .col-md-7
= select_tag :key_data_flags, options_for_select(Depp::Dnskey::FLAGS, params['key_data_flags']), {class: 'form-control'} = select_tag :key_data_flags,
options_for_select(Depp::Dnskey::FLAGS, params['key_data_flags']), {class: 'form-control'}
.form-group .form-group
= label_tag :key_data_protocol, t(:protocol), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :key_data_protocol, t(:protocol), class: 'required'
.col-md-7 .col-md-7
= select_tag :key_data_protocol, options_for_select(Depp::Dnskey::PROTOCOLS, params['key_data_protocol']), {class: 'form-control'} = select_tag :key_data_protocol,
options_for_select(Depp::Dnskey::PROTOCOLS, params['key_data_protocol']),
{class: 'form-control'}
.form-group .form-group
= label_tag :key_data_alg, t(:algorithm), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :key_data_alg, t(:algorithm), class: 'required'
.col-md-7 .col-md-7
= select_tag :key_data_alg, options_for_select(Depp::Dnskey::ALGORITHMS, params['key_data_alg']), {class: 'form-control'} = select_tag :key_data_alg,
options_for_select(Depp::Dnskey::ALGORITHMS, params['key_data_alg']), {class: 'form-control'}
.form-group .form-group
= label_tag :key_data_public_key, t(:public_key), class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :key_data_public_key, t(:public_key), class: 'required'
.col-md-7 .col-md-7
= text_field_tag :key_data_public_key, params['key_data_public_key'], class: 'form-control' = text_field_tag :key_data_public_key, params['key_data_public_key'],
class: 'form-control', required: true
.form-group .form-group
= label_tag :legal_document, t(:legal_document),class: 'col-md-3 control-label' .col-md-3.control-label
= label_tag :legal_document, t(:legal_document)
.col-md-7 .col-md-7
= file_field_tag :legal_document = file_field_tag :legal_document

View file

@ -2,8 +2,10 @@
.form-signin.col-md-4.center-block.text-center .form-signin.col-md-4.center-block.text-center
%h2.form-signin-heading.text-center= t(:log_in_with_mid) %h2.form-signin-heading.text-center= t(:log_in_with_mid)
%hr %hr
= form_for @user, url: registrar_mid_path, html: {class: 'form-signin'} do |f| = form_for @user, url: registrar_mid_path, auto_html5_validation: false,
= f.text_field :phone, class: 'form-control', placeholder: t(:phone_no), autocomplete: 'off' html: {class: 'form-signin'} do |f|
= f.text_field :phone, class: 'form-control',
placeholder: t(:phone_no), autocomplete: 'off', required: true
%button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t(:log_in) %button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t(:log_in)
- if ['development', 'alpha'].include?(Rails.env) - if ['development', 'alpha'].include?(Rails.env)

View file

@ -39,7 +39,8 @@ module Registry
# Precompile additional assets # Precompile additional assets
config.assets.precompile += %w(*.svg *.eot *.woff *.ttf) config.assets.precompile += %w(*.svg *.eot *.woff *.ttf)
config.assets.precompile += %w(admin-manifest.css) config.assets.precompile += %w(admin-manifest.css admin-manifest.js)
config.assets.precompile += %w(registrar-manifest.css registrar-manifest.js)
# Active Record used to suppresses errors raised within # Active Record used to suppresses errors raised within
# `after_rollback`/`after_commit` callbacks and only printed them to the logs. # `after_rollback`/`after_commit` callbacks and only printed them to the logs.

View file

@ -0,0 +1,28 @@
class ActionView::Helpers::FormBuilder
alias_method :orig_label, :label
# add a 'required' CSS class to the field label if the field is required
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def label(method, content_or_options = nil, options = nil, &block)
if content_or_options && content_or_options.class == Hash
options = content_or_options
else
content = content_or_options
end
if object.class.respond_to?(:validators_on) &&
object.class.validators_on(method).map(&:class).include?(ActiveRecord::Validations::PresenceValidator)
if options.class != Hash
options = { class: 'required' }
else
options[:class] = ((options[:class] || "") + ' required').split(' ').uniq.join(' ')
end
end
orig_label(method, content, options || {}, &block)
end
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Metrics/CyclomaticComplexity
end

View file

@ -641,7 +641,7 @@ en:
m_id: 'M-ID' m_id: 'M-ID'
destroyed: It was successfully deleted. destroyed: It was successfully deleted.
not_found: Not found not_found: Not found
no_connection_to_registry: Connection issue to the registry server! Please try again later. no_connection_to_registry: Connection issue to the registry EPP or REPP server! Please try again later.
domain_not_found: 'Domain was not found' domain_not_found: 'Domain was not found'
new_contact: 'New contact' new_contact: 'New contact'
add_deposit: 'Add deposit' add_deposit: 'Add deposit'

View file

@ -741,7 +741,7 @@ describe 'EPP Domain', epp: true do
response[:msg].should == 'Command completed successfully; ack to dequeue' response[:msg].should == 'Command completed successfully; ack to dequeue'
msg_q = response[:parsed].css('msgQ') msg_q = response[:parsed].css('msgQ')
msg_q.css('qDate').text.should_not be_blank msg_q.css('qDate').text.should_not be_blank
contacts = domain.contacts.pluck(:code) contacts = domain.contacts.pluck(:code).sort
msg_q.css('msg').text.should == "Domain transfer was approved, associated contacts are: #{contacts}" msg_q.css('msg').text.should == "Domain transfer was approved, associated contacts are: #{contacts}"
msg_q.first['id'].should_not be_blank msg_q.first['id'].should_not be_blank
msg_q.first['count'].should == '1' msg_q.first['count'].should == '1'
@ -1146,8 +1146,7 @@ describe 'EPP Domain', epp: true do
domain.registrant.code.should == original_oc_code domain.registrant.code.should == original_oc_code
domain.registrant.registrar_id.should == @registrar2.id domain.registrant.registrar_id.should == @registrar2.id
original_contacts_codes.should == domain.contacts.pluck(:code) original_contacts_codes.sort.should == domain.contacts.pluck(:code).sort
end end
it 'should not creates transfer without password' do it 'should not creates transfer without password' do
@ -1446,27 +1445,55 @@ describe 'EPP Domain', epp: true do
response[:results][0][:result_code].should == '2302' response[:results][0][:result_code].should == '2302'
response[:results][0][:msg].should == 'Nameserver already exists on this domain [hostname]' response[:results][0][:msg].should == 'Nameserver already exists on this domain [hostname]'
if response[:results][0][:value] == 'ns1.example.com'
response[:results][0][:value].should == 'ns1.example.com' response[:results][0][:value].should == 'ns1.example.com'
else
response[:results][0][:value].should == 'ns2.example.com'
end
response[:results][1][:result_code].should == '2302' response[:results][1][:result_code].should == '2302'
response[:results][1][:msg].should == 'Nameserver already exists on this domain [hostname]' response[:results][1][:msg].should == 'Nameserver already exists on this domain [hostname]'
if response[:results][1][:value] == 'ns1.example.com'
response[:results][1][:value].should == 'ns1.example.com'
else
response[:results][1][:value].should == 'ns2.example.com' response[:results][1][:value].should == 'ns2.example.com'
end
response[:results][2][:result_code].should == '2302' response[:results][2][:result_code].should == '2302'
response[:results][2][:msg].should == 'Contact already exists on this domain [contact_code_cache]' response[:results][2][:msg].should == 'Contact already exists on this domain [contact_code_cache]'
response[:results][2][:value].should == 'mak21' response[:results][2][:value].should == 'mak21'
response[:results][3][:msg].should == 'Status already exists on this domain [value]' response[:results][3][:msg].should == 'Status already exists on this domain [value]'
if response[:results][3][:value] == 'clientHold'
response[:results][3][:value].should == 'clientHold' response[:results][3][:value].should == 'clientHold'
else
response[:results][3][:value].should == 'clientUpdateProhibited'
end
response[:results][4][:msg].should == 'Status already exists on this domain [value]' response[:results][4][:msg].should == 'Status already exists on this domain [value]'
if response[:results][4][:value] == 'clientHold'
response[:results][4][:value].should == 'clientHold'
else
response[:results][4][:value].should == 'clientUpdateProhibited' response[:results][4][:value].should == 'clientUpdateProhibited'
end
response[:results][5][:msg].should == 'Public key already exists [public_key]' response[:results][5][:msg].should == 'Public key already exists [public_key]'
response[:results][5][:value].should == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f' if response[:results][5][:value] == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
response[:results][5][:value].should ==
'700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
else
response[:results][5][:value].should ==
'841936717ae427ace63c28d04918569a841936717ae427ace63c28d0'
end
response[:results][6][:msg].should == 'Public key already exists [public_key]' response[:results][6][:msg].should == 'Public key already exists [public_key]'
response[:results][6][:value].should == '841936717ae427ace63c28d04918569a841936717ae427ace63c28d0' if response[:results][6][:value] == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
response[:results][6][:value].should ==
'700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
else
response[:results][6][:value].should ==
'841936717ae427ace63c28d04918569a841936717ae427ace63c28d0'
end
d.domain_statuses.count.should == 2 d.domain_statuses.count.should == 2
end end
@ -1773,9 +1800,9 @@ describe 'EPP Domain', epp: true do
admin_contacts_from_request.should == admin_contacts_existing admin_contacts_from_request.should == admin_contacts_existing
hosts_from_request = inf_data.css('hostName').map(&:text) hosts_from_request = inf_data.css('hostName').map(&:text)
hosts_existing = domain.nameservers.pluck(:hostname) hosts_existing = domain.nameservers.pluck(:hostname).sort
hosts_from_request.should == hosts_existing hosts_from_request.sort.should == hosts_existing
ns1 = inf_data.css('hostAttr').last ns1 = inf_data.css('hostAttr').last

View file

@ -13,7 +13,8 @@ describe AdminUser do
"Country code is missing", "Country code is missing",
"Email Email is missing", "Email Email is missing",
"Password Password is missing", "Password Password is missing",
"Username Username is missing" "Username Username is missing",
"Roles is missing"
]) ])
end end