mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Add reserved pw field for registrar domain form #2565
This commit is contained in:
parent
048ab8a475
commit
5f1df12b48
3 changed files with 19 additions and 9 deletions
|
@ -132,7 +132,7 @@ module Depp
|
||||||
|
|
||||||
# rubocop:disable Metrics/MethodLength
|
# rubocop:disable Metrics/MethodLength
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
def construct_params_from_server_data(data)
|
def construct_params_from_server_data(data)
|
||||||
ret = default_params
|
ret = default_params
|
||||||
ret[:name] = data.css('name').text
|
ret[:name] = data.css('name').text
|
||||||
ret[:registrant] = data.css('registrant').text
|
ret[:registrant] = data.css('registrant').text
|
||||||
|
@ -182,16 +182,18 @@ module Depp
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
|
|
||||||
def construct_custom_params_hash(domain_params)
|
def construct_custom_params_hash(domain_params)
|
||||||
custom_params = {}
|
custom_params = { _anonymus: [] }
|
||||||
if domain_params[:legal_document].present?
|
if domain_params[:legal_document].present?
|
||||||
type = domain_params[:legal_document].original_filename.split('.').last.downcase
|
type = domain_params[:legal_document].original_filename.split('.').last.downcase
|
||||||
custom_params = {
|
custom_params[:_anonymus] << {
|
||||||
_anonymus: [
|
legalDocument: { value: Base64.encode64(domain_params[:legal_document].read), attrs: { type: type } }
|
||||||
legalDocument: { value: Base64.encode64(domain_params[:legal_document].read), attrs: { type: type } }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if domain_params[:reserved_pw].present?
|
||||||
|
custom_params[:_anonymus] << { reserved: { pw: { value: domain_params[:reserved_pw] } } }
|
||||||
|
end
|
||||||
|
|
||||||
custom_params
|
custom_params
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
= label_tag :domain_name, t(:name), class: 'required'
|
= 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],
|
= text_field_tag('domain[name]', @domain_params[:name],
|
||||||
class: 'form-control', readonly: readonly, required: true)
|
class: 'form-control', readonly: readonly, required: true)
|
||||||
|
|
||||||
- unless params[:domain_name]
|
- unless params[:domain_name]
|
||||||
|
@ -13,13 +13,20 @@
|
||||||
.col-md-3.control-label
|
.col-md-3.control-label
|
||||||
= label_tag :domain_period, t(:period), class: 'required'
|
= 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
|
||||||
.col-md-3.control-label
|
.col-md-3.control-label
|
||||||
= label_tag :domain_registrant, t(:registrant), class: 'required'
|
= label_tag :domain_registrant, t(:registrant), class: 'required'
|
||||||
.col-md-7
|
.col-md-7
|
||||||
= select_tag "domain[registrant]",
|
= select_tag "domain[registrant]",
|
||||||
options_for_select(@contacts_autocomplete_map, selected: @domain_params[:registrant]),
|
options_for_select(@contacts_autocomplete_map, selected: @domain_params[:registrant]),
|
||||||
include_blank: true, class: 'js-combobox', required: true
|
include_blank: true, class: 'js-combobox', required: true
|
||||||
|
|
||||||
|
- unless params[:domain_name]
|
||||||
|
.form-group
|
||||||
|
.col-md-3.control-label
|
||||||
|
= label_tag :domain_reserved_pw, t(:reserved_pw)
|
||||||
|
.col-md-7
|
||||||
|
= text_field_tag('domain[reserved_pw]', @domain_params[:reserved_pw], class: 'form-control')
|
||||||
|
|
|
@ -865,3 +865,4 @@ en:
|
||||||
export_csv: 'Export CSV'
|
export_csv: 'Export CSV'
|
||||||
reserved_domains: 'Reserved domains'
|
reserved_domains: 'Reserved domains'
|
||||||
invalid_yaml: 'Invalid YAML'
|
invalid_yaml: 'Invalid YAML'
|
||||||
|
reserved_pw: 'Reserved pw'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue