diff --git a/app/views/admin/registrars/_form.haml b/app/views/admin/registrars/_form.haml deleted file mode 100644 index 2a80e7357..000000000 --- a/app/views/admin/registrars/_form.haml +++ /dev/null @@ -1,105 +0,0 @@ -= form_for([:admin, @registrar], html: {class: 'form-horizontal'}) do |f| - = render 'shared/full_errors', object: @registrar - - .row - .col-md-8 - .panel.panel-default - .panel-heading.clearfix - .pull-left= t(:general) - .panel-body - .form-group - .col-md-4.control-label - = f.label :name - .col-md-7 - = f.text_field(:name, class: 'form-control') - .form-group - .col-md-4.control-label - = f.label :reg_no - .col-md-7 - = f.text_field(:reg_no, class: 'form-control') - .form-group - .col-md-4.control-label - = f.label :vat_no - .col-md-7 - = f.text_field(:vat_no, class: 'form-control') - .form-group - .col-md-4.control-label - = f.label :phone - .col-md-7 - = f.text_field(:phone, class: 'form-control') - .form-group - .col-md-4.control-label - = f.label :website - .col-md-7 - = f.url_field :website, class: 'form-control' - .form-group - .col-md-4.control-label - = f.label :email - .col-md-7 - = f.email_field :email, class: 'form-control' - .form-group - .col-md-4.control-label - = f.label :billing_email - .col-md-7 - = f.email_field :billing_email, class: 'form-control' - - .form-group - .col-md-4.control-label - = f.label :accounting_customer_code - .col-md-7 - = f.text_field :accounting_customer_code, class: 'form-control', required: true - - .row - .col-md-8 - .panel.panel-default - .panel-heading.clearfix - .pull-left= t(:address) - .panel-body - .form-group - .col-md-4.control-label - = f.label :street - .col-md-7 - = f.text_field(:street, class: 'form-control') - .form-group - .col-md-4.control-label - = f.label :city - .col-md-7 - = f.text_field(:city, class: 'form-control') - .form-group - .col-md-4.control-label - = f.label :state - .col-md-7 - = f.text_field(:state, class: 'form-control') - .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') - - .row - .col-md-8 - .panel.panel-default - .panel-heading.clearfix - .pull-left= t('.misc') - .panel-body - .form-group - .col-md-4.control-label - = f.label :code - .col-md-7 - = f.text_field(:code, class: 'form-control', disabled: !f.object.new_record?) - .form-group - .col-md-4.control-label - = f.label :test_registrar - .col-md-7 - = f.check_box :test_registrar, class: 'form-control' - - %hr - .row - .col-md-8.text-right - = button_tag(t(".#{f.object.new_record? ? 'create' : 'update'}_btn"), class: 'btn btn-success') diff --git a/app/views/admin/registrars/_form.html.erb b/app/views/admin/registrars/_form.html.erb new file mode 100644 index 000000000..7bdddb5d9 --- /dev/null +++ b/app/views/admin/registrars/_form.html.erb @@ -0,0 +1,158 @@ +<%= form_for([:admin, @registrar], html: { class: 'form-horizontal' }) do |f| %> + <%= render 'shared/full_errors', object: @registrar %> +
+
+
+
+
+ <%= t(:general) %> +
+
+
+
+
+ <%= f.label :name %> +
+
+ <%= f.text_field :name, required: true, autofocus: true, class: 'form-control' %> +
+
+ +
+
+ <%= f.label :reg_no %> +
+
+ <%= f.text_field :reg_no, required: true, class: 'form-control' %> +
+
+ +
+
+ <%= f.label :phone %> +
+
+ <%= f.text_field(:phone, class: 'form-control') %> +
+
+ +
+
+ <%= f.label :website %> +
+
+ <%= f.url_field :website, class: 'form-control' %> +
+
+ +
+
+ <%= f.label :email %> +
+
+ <%= f.email_field :email, required: true, class: 'form-control' %> +
+
+
+
+
+
+ +
+
+
+
+
+ <%= t(:address) %> +
+
+
+
+
+ <%= f.label :street %> +
+
+ <%= f.text_field(:street, class: 'form-control') %> +
+
+ +
+
+ <%= f.label :city %> +
+
+ <%= f.text_field(:city, class: 'form-control') %> +
+
+ +
+
+ <%= f.label :state %> +
+
+ <%= f.text_field(:state, class: 'form-control') %> +
+
+ +
+
+ <%= f.label :zip %> +
+
+ <%= f.text_field(:zip, class: 'form-control') %> +
+
+ +
+
+ <%= f.label :country_code, t(:country) %> +
+
+ <%= f.select(:country_code, SortedCountry.all_options(f.object.country_code), {}, class: 'form-control') %> +
+
+
+
+
+
+ + <%= render 'admin/registrars/form/billing', f: f %> + +
+
+
+
+
+ <%= t('.misc') %> +
+
+ +
+
+
+ <%= f.label :code %> +
+
+ <%= f.text_field :code, required: f.object.new_record?, class: 'form-control', disabled: !f.object.new_record? %> +
+
+ +
+
+ <%= f.label :test_registrar %> +
+
+ <%= f.check_box :test_registrar, class: 'form-control' %> +
+
+
+
+
+
+
+
+
+ <%= button_tag(t(".#{f.object.new_record? ? 'create' : 'update'}_btn"), class: 'btn btn-success') %> +
+
+<% end %> diff --git a/app/views/admin/registrars/edit.haml b/app/views/admin/registrars/edit.haml deleted file mode 100644 index 0fb8a88c6..000000000 --- a/app/views/admin/registrars/edit.haml +++ /dev/null @@ -1,5 +0,0 @@ -- content_for :actions do - = link_to(t(:back_to_registrar), [:admin, @registrar], class: 'btn btn-default') -= render 'shared/title', name: "#{t(:edit)}: #{@registrar.name}" - -= render 'form' diff --git a/app/views/admin/registrars/edit.html.erb b/app/views/admin/registrars/edit.html.erb new file mode 100644 index 000000000..71d6bd882 --- /dev/null +++ b/app/views/admin/registrars/edit.html.erb @@ -0,0 +1,5 @@ +<% content_for :actions do %> + <%= link_to(t(:back_to_registrar), [:admin, @registrar], class: 'btn btn-default') %> +<% end %> +<%= render 'shared/title', name: "#{t(:edit)}: #{@registrar.name}" %> +<%= render 'form' %> diff --git a/app/views/admin/registrars/form/_billing.html.erb b/app/views/admin/registrars/form/_billing.html.erb new file mode 100644 index 000000000..a3adf1312 --- /dev/null +++ b/app/views/admin/registrars/form/_billing.html.erb @@ -0,0 +1,40 @@ +
+
+
+
+
+ <%= t '.header' %> +
+
+ +
+
+
+ <%= f.label :vat_no %> +
+
+ <%= f.text_field :vat_no, class: 'form-control' %> +
+
+ +
+
+ <%= f.label :accounting_customer_code %> +
+
+ <%= f.text_field :accounting_customer_code, class: 'form-control', required: true %> +
+
+ +
+
+ <%= f.label :billing_email %> +
+
+ <%= f.email_field :billing_email, class: 'form-control' %> +
+
+
+
+
+
diff --git a/app/views/admin/registrars/index.haml b/app/views/admin/registrars/index.haml deleted file mode 100644 index ea9f7b312..000000000 --- a/app/views/admin/registrars/index.haml +++ /dev/null @@ -1,28 +0,0 @@ -- content_for :actions do - = link_to(t('.new_btn'), new_admin_registrar_path, class: 'btn btn-primary') -= render 'shared/title', name: t(:registrars) - -.row - .col-md-12 - .table-responsive - %table.table.table-hover.table-bordered.table-condensed - %thead - %tr - %th{class: 'col-xs-4'} - = sort_link(@q, 'name') - %th{class: 'col-xs-4'} - = sort_link(@q, 'reg_no', t(:reg_no)) - %th{class: 'col-xs-4'} - = t(:credit_balance) - %th{class: 'col-xs-4'} - = t(:test_registrar) - %tbody - - @registrars.each do |x| - %tr - %td= link_to(x, [:admin, x]) - %td= x.reg_no - %td= "#{x.balance}" - %td= "#{x.test_registrar}" -.row - .col-md-12 - = paginate @registrars diff --git a/app/views/admin/registrars/index.html.erb b/app/views/admin/registrars/index.html.erb new file mode 100644 index 000000000..5533a6f07 --- /dev/null +++ b/app/views/admin/registrars/index.html.erb @@ -0,0 +1,51 @@ +<% content_for :actions do %> + <%= link_to(t('.new_btn'), new_admin_registrar_path, class: 'btn btn-primary') %> +<% end %> +<%= render 'shared/title', name: t(:registrars) %> +
+
+
+ + + + + + + + + + + <% @registrars.each do |x| %> + + + + + + + <% end %> + +
+ <%= sort_link(@q, 'name') %> + + <%= sort_link(@q, 'reg_no', t(:reg_no)) %> + + <%= t(:credit_balance) %> + + <%= t(:test_registrar) %> +
+ <%= link_to(x, [:admin, x]) %> + + <%= x.reg_no %> + + <%= "#{x.balance}" %> + + <%= "#{x.test_registrar}" %> +
+
+
+
+
+
+ <%= paginate @registrars %> +
+
diff --git a/app/views/admin/registrars/new.haml b/app/views/admin/registrars/new.haml deleted file mode 100644 index 5f651835a..000000000 --- a/app/views/admin/registrars/new.haml +++ /dev/null @@ -1,3 +0,0 @@ -= render 'shared/title', name: t(:new_registrar) - -= render 'form' diff --git a/app/views/admin/registrars/new.html.erb b/app/views/admin/registrars/new.html.erb new file mode 100644 index 000000000..70154d217 --- /dev/null +++ b/app/views/admin/registrars/new.html.erb @@ -0,0 +1,2 @@ +<%= render 'shared/title', name: t(:new_registrar) %> +<%= render 'form' %> diff --git a/app/views/admin/registrars/show.haml b/app/views/admin/registrars/show.haml deleted file mode 100644 index 7bd49f058..000000000 --- a/app/views/admin/registrars/show.haml +++ /dev/null @@ -1,118 +0,0 @@ -- content_for :actions do - = link_to(t(:edit), edit_admin_registrar_path(@registrar), class: 'btn btn-primary') - = link_to(t(:delete), admin_registrar_path(@registrar), - method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger') -- content_for :page_name do - = @registrar.name - - if @registrar.test_registrar? - %span{style: "color: #c9302c;"} (test) -= render 'shared/title', name: @registrar.name - -- if @registrar.errors.any? - - @registrar.errors.each do |attr, err| - = err - %br -- if @registrar.errors.any? - %hr -.row - .col-md-6 - .panel.panel-default - .panel-heading - %h3.panel-title= t(:general) - .panel-body - %dl.dl-horizontal - %dt= t(:name) - %dd= @registrar.name - - %dt= t(:reg_no) - %dd= @registrar.reg_no - - %dt= t(:vat_no) - %dd= @registrar.vat_no - - %dt= t(:reference_no) - %dd= @registrar.reference_no - - %dt= t(:id) - %dd= @registrar.code - - %dt= t(:credit_balance) - %dd= @registrar.balance - - %dt= Registrar.human_attribute_name :website - %dd= @registrar.website - - %dt= Registrar.human_attribute_name :accounting_customer_code - %dd= @registrar.accounting_customer_code - - .col-md-6 - .panel.panel-default - .panel-heading - %h3.panel-title= t(:contact) - .panel-body - %dl.dl-horizontal - %dt= t(:country) - %dd= @registrar.country - - %dt= t(:address) - %dd= @registrar.address - - %dt= t(:contact_phone) - %dd= @registrar.phone - - %dt= t(:contact_email) - %dd= @registrar.email - - %dt= t(:billing_address) - %dd= @registrar.billing_address - - %dt= t(:billing_email) - %dd= @registrar.billing_email - -.row - .col-md-12 - #epp-users.panel.panel-default - .panel-heading.clearfix - .pull-left - = t('.api_users') - .pull-right - = link_to(t('.new_api_use_btn'), new_admin_registrar_api_user_path(@registrar), class: 'btn btn-default btn-xs') - - .table-responsive - %table.table.table-hover.table-bordered.table-condensed - %thead - %tr - %th{class: 'col-xs-6'}= t(:username) - %th{class: 'col-xs-6'}= t('.active') - %tbody - - @registrar.api_users.each do |x| - %tr - %td= link_to(x, [:admin, x]) - %td= x.active - -.row - .col-md-12 - #epp-users.panel.panel-default - .panel-heading.clearfix - .pull-left - = t(:white_ips) - .pull-right - = link_to(t(:create_new_white_ip), new_admin_registrar_white_ip_path(@registrar), class: 'btn btn-default btn-xs') - - .table-responsive - %table.table.table-hover.table-bordered.table-condensed - %thead - %tr - %th{class: 'col-xs-4'}= t(:ipv4) - %th{class: 'col-xs-6'}= t(:ipv6) - %th{class: 'col-xs-2'}= t(:interfaces) - %tbody - - @registrar.white_ips.each do |x| - %tr - %td - - if x.ipv4.present? - = link_to(x.ipv4, [:admin, @registrar, x]) - %td - - if x.ipv6.present? - = link_to(x.ipv6, [:admin, @registrar, x]) - %td= x.interfaces.join(', ').upcase diff --git a/app/views/admin/registrars/show.html.erb b/app/views/admin/registrars/show.html.erb new file mode 100644 index 000000000..00a1e4647 --- /dev/null +++ b/app/views/admin/registrars/show.html.erb @@ -0,0 +1,222 @@ +<% content_for :actions do %> + <%= link_to(t(:edit), edit_admin_registrar_path(@registrar), class: 'btn btn-primary') %> + <%= link_to(t(:delete), admin_registrar_path(@registrar), method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger') %> +<% end %> +<% content_for :page_name do %> + <%= @registrar.name %> + <% if @registrar.test_registrar? %> + (test) + <% end %> +<% end %> +<%= render 'shared/title', name: @registrar.name %> +<% if @registrar.errors.any? %> + <% @registrar.errors.each do |attr, err| %> + <%= err %> +
+ <% end %> +<% end %> +<% if @registrar.errors.any? %> +
+<% end %> +
+
+
+
+

+ <%= t(:general) %> +

+
+
+
+
+ <%= t(:name) %> +
+
+ <%= @registrar.name %> +
+
+ <%= t(:reg_no) %> +
+
+ <%= @registrar.reg_no %> +
+
+ <%= t(:vat_no) %> +
+
+ <%= @registrar.vat_no %> +
+
+ <%= t(:reference_no) %> +
+
+ <%= @registrar.reference_no %> +
+
+ <%= t(:id) %> +
+
+ <%= @registrar.code %> +
+
+ <%= t(:credit_balance) %> +
+
+ <%= @registrar.balance %> +
+
+ <%= Registrar.human_attribute_name :website %> +
+
+ <%= @registrar.website %> +
+
+ <%= Registrar.human_attribute_name :accounting_customer_code %> +
+
+ <%= @registrar.accounting_customer_code %> +
+
+
+
+
+
+
+
+

+ <%= t(:contact) %> +

+
+
+
+
+ <%= t(:country) %> +
+
+ <%= @registrar.country %> +
+
+ <%= t(:address) %> +
+
+ <%= @registrar.address %> +
+
+ <%= t(:contact_phone) %> +
+
+ <%= @registrar.phone %> +
+
+ <%= t(:contact_email) %> +
+
+ <%= @registrar.email %> +
+
+ <%= t(:billing_address) %> +
+
+ <%= @registrar.billing_address %> +
+
+ <%= t(:billing_email) %> +
+
+ <%= @registrar.billing_email %> +
+
+
+
+
+
+
+
+
+
+
+ <%= t('.api_users') %> +
+
+ <%= link_to(t('.new_api_use_btn'), new_admin_registrar_api_user_path(@registrar), class: 'btn btn-default btn-xs') %> +
+
+
+ + + + + + + + + <% @registrar.api_users.each do |x| %> + + + + + <% end %> + +
+ <%= t(:username) %> + + <%= t('.active') %> +
+ <%= link_to(x, [:admin, x]) %> + + <%= x.active %> +
+
+
+
+
+
+
+
+
+
+ <%= t(:white_ips) %> +
+
+ <%= link_to(t(:create_new_white_ip), new_admin_registrar_white_ip_path(@registrar), class: 'btn btn-default btn-xs') %> +
+
+
+ + + + + + + + + + <% @registrar.white_ips.each do |x| %> + + + + + + <% end %> + +
+ <%= t(:ipv4) %> + + <%= t(:ipv6) %> + + <%= t(:interfaces) %> +
+ <% if x.ipv4.present? %> + <%= link_to(x.ipv4, [:admin, @registrar, x]) %> + <% end %> + + <% if x.ipv6.present? %> + <%= link_to(x.ipv6, [:admin, @registrar, x]) %> + <% end %> + + <%= x.interfaces.join(', ').upcase %> +
+
+
+
+
diff --git a/config/locales/admin/registrars.en.yml b/config/locales/admin/registrars.en.yml index b30ad456e..7d1846e05 100644 --- a/config/locales/admin/registrars.en.yml +++ b/config/locales/admin/registrars.en.yml @@ -21,3 +21,6 @@ en: misc: Miscellaneous create_btn: Create registrar update_btn: Update registrar + + billing: + header: Billing diff --git a/spec/views/admin/registrars/_form.haml_spec.rb b/spec/views/admin/registrars/_form.html.erb_spec.rb similarity index 100% rename from spec/views/admin/registrars/_form.haml_spec.rb rename to spec/views/admin/registrars/_form.html.erb_spec.rb