Client side validations

This commit is contained in:
Priit Tark 2015-04-21 11:00:03 +03:00
parent e987e201ad
commit b51310062d
53 changed files with 503 additions and 305 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)
@ -510,10 +514,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

@ -36,3 +36,15 @@
box-sizing: border-box box-sizing: border-box
padding: 10px padding: 10px
font-size: 16px font-size: 16px
.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

@ -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

@ -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
= f.label :username .col-md-4.control-label
= f.text_field(:username, class: 'form-control') = f.label :username
.col-md-8
= f.text_field(:username, class: 'form-control')
.form-group .form-group
= f.label :password .col-md-4.control-label
= f.text_field(:password, class: 'form-control') = f.label :password
.col-md-8
= 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' = f.label :identity_code
.col-md-8
= f.text_field(:identity_code, class: 'form-control')
.form-group .form-group
= f.label :identity_code .col-md-4.control-label
= f.text_field(:identity_code, class: 'form-control') = f.label :email
.col-md-8
.col-md-6 = f.text_field(:email, class: 'form-control', email: true)
.form-group .form-group
= f.label :email .col-md-4.control-label
= f.text_field(:email, class: 'form-control') = 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 .form-group
= f.label :role .col-md-4.control-label
= select_tag 'admin_user[roles][]', options_for_select(AdminUser::ROLES.map {|x| [t(x), x] }, @admin_user.roles.try(:first)), class: 'form-control selectize' = 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'
%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
= f.label :username .col-md-4.control-label
= f.text_field(:username, class: 'form-control') = f.label :username
.col-md-7
= f.text_field(:username, class: 'form-control')
.form-group .form-group
= f.label :password .col-md-4.control-label
= f.text_field(:password, class: 'form-control') = f.label :password
.col-md-7
= f.text_field(:password, class: 'form-control')
.form-group .form-group
= f.label :identity_code .col-md-4.control-label
= f.text_field(:identity_code, class: 'form-control') = f.label :identity_code
.col-md-7
= 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'
%span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden .col-md-7
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove = f.text_field(:registrar_typeahead,
= f.hidden_field(:registrar_id, class: 'js-registrar-id') class: 'form-control js-registrar-typeahead typeahead required',
.form-group placeholder: t(:registrar), autocomplete: 'off')
.checkbox %span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
%label{for: 'api_user_active'} %span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
= f.check_box(:active) = f.hidden_field(:registrar_id, class: 'js-registrar-id')
= t('active') .checkbox
%label{for: 'api_user_active'}
= f.check_box(: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
= f.label :th6_file .col-md-4.control-label
= f.file_field :th6_file = f.label :th6_file
.col-md-8
= 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
= f.label :csr, t(:certificate_signing_req) .col-md-4.control-label= f.label :username
= f.file_field :csr = f.label :csr, t(:certificate_signing_req)
.col-md-8
= 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
= f.label :reg_no .col-md-4.control-label
= f.text_field(:reg_no, class: 'form-control') = f.label :reg_no
/ EIS does not want VAT .col-md-7
/ .form-group = f.text_field(:reg_no, class: 'form-control')
/ = f.label :vat_no .form-group
/ = f.text_field(:vat_no, class: 'form-control') .col-md-4.control-label
.form-group = f.label :vat_no
= f.label :email .col-md-7
= f.text_field(:email, class: 'form-control') = f.text_field(:vat_no, class: 'form-control')
.form-group .form-group
= f.label :phone .col-md-4.control-label
= f.text_field(:phone, class: 'form-control') = f.label :phone
.form-group .col-md-7
= f.label :billing_email = f.text_field(:phone, class: 'form-control')
= f.text_field(:billing_email, class: 'form-control') .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
.col-md-7
= f.text_field(:billing_email, class: 'form-control', email: true)
.row .row
.col-md-8 .col-md-8
.form-group .panel.panel-default
= f.label :street .panel-heading.clearfix
= f.text_field(:street, class: 'form-control') .pull-left= t(:address)
.form-group .panel-body
= f.label :city .form-group
= f.text_field(:city, class: 'form-control') .col-md-4.control-label
.form-group = f.label :street
= f.label :state .col-md-7
= f.text_field(:state, class: 'form-control') = f.text_field(:street, class: 'form-control')
.form-group .form-group
= f.label :zip .col-md-4.control-label
= f.text_field(:zip, class: 'form-control') = f.label :city
.form-group .col-md-7
= f.label :country_code = f.text_field(:city, class: 'form-control')
= f.text_field :country_code, class: 'form-control' .form-group
/ EIS does not want Billing Address .col-md-4.control-label
/ .form-group = f.label :state
/ = f.label :billing_address .col-md-7
/ = f.text_field(:billing_address, class: 'form-control') = f.text_field(:state, class: 'form-control')
/ %p.help-block= t('address_help') .form-group
.col-md-4.control-label
= f.label :zip
.col-md-7
= f.text_field(:zip, class: 'form-control')
.form-group
.col-md-4.control-label
= f.label :country_code, t(:country)
.col-md-7
= f.select(:country_code,
SortedCountry.all_options(f.object.country_code), {}, class: 'form-control')
%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

@ -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

@ -1,5 +1,5 @@
= render 'shared/title', name: "#{t(:edit)}: #{@contact.name}" = render 'shared/title', name: "#{t(:edit)}: #{@contact.name}"
= form_for(@contact, url: registrar_contact_path(@contact), = form_for(@contact, url: registrar_contact_path(@contact),
html: {class: 'form-horizontal js-contact-form'}) do |f| html: {class: 'form-horizontal js-contact-form'}) do |f|
- render 'form', f: f - render 'form', f: f

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|
= render 'shared/full_errors', object: @deposit
.row .row
.col-md-4.col-md-offset-4 .col-md-8
= render 'shared/full_errors', object: @deposit
.form-group .form-group
= f.label :amount .col-md-4.control-label
.input-group = f.label :amount, class: 'required'
= f.text_field :amount, class: 'form-control' .col-md-7
.input-group-addon .input-group
EUR = f.text_field :amount, class: 'form-control', required: true
.input-group-addon
EUR
.form-group .form-group
= f.label :description .col-md-4.control-label
= f.text_area :description, class: 'form-control' = f.label :description
.col-md-7
= f.text_area :description, class: 'form-control'
.row %hr
.col-md-12.text-right .row
= button_tag(t(:add), class: 'btn btn-primary') .col-md-8.text-right
= 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,24 @@
class ActionView::Helpers::FormBuilder
alias :orig_label :label
# add a 'required' CSS class to the field label if the field is required
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
self.orig_label(method, content, options || {}, &block)
end
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'