Nameserver hostname replacing

This commit is contained in:
Martin Lensment 2015-04-28 18:36:59 +03:00
parent 23098add74
commit 1f2ba55acb
7 changed files with 135 additions and 0 deletions

View file

@ -0,0 +1,57 @@
/ - content_for :actions do
/ = link_to(t(:add_deposit), new_registrar_deposit_path, class: 'btn btn-primary')
/ = link_to(t(:account_activity), registrar_account_activities_path, class: 'btn btn-default')
= render 'shared/title', name: t(:nameservers)
.row
.col-md-12
= search_form_for @q, url: [:registrar, :nameservers], html: { style: 'margin-bottom: 0;' } do |f|
.row
.col-md-3
.form-group
= f.label t(:hostname_end)
= f.search_field :hostname_end, class: 'form-control', placeholder: t(:hostname_end), autocomplete: 'off'
.col-md-3
.form-group
= label_tag t(:hostname_end_replacement)
= text_field_tag :hostname_end_replacement, params[:hostname_end_replacement], class: 'form-control', placeholder: t(:hostname_end_replacement), autocomplete: 'off'
.col-md-4{style: 'padding-top: 25px;'}
%button.btn.btn-default
 
%span.glyphicon.glyphicon-search
 
%button.btn.btn-default{name: 'replace'}
= t(:replace)
%button.btn.btn-default.js-reset-form
= t(:clear_fields)
%hr
.row
.col-md-12
.table-responsive
%table.table.table-hover.table-condensed
%thead
%tr
%th{class: 'col-xs-4'}= t(:hostname)
%th{class: 'col-xs-4'}= t(:ipv4)
%th{class: 'col-xs-4'}= t(:ipv6)
%tbody
- @nameservers.each do |x|
%tr
- if params[:q] && params[:q][:hostname_end]
- hn = x.hostname.chomp(params[:q][:hostname_end])
%td
= precede hn do
%strong= params[:q][:hostname_end]
- else
%td= x.hostname
%td= x.ipv4
%td= x.ipv4
.row
.col-md-12
/ = paginate @nameservers
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
window.location = "#{registrar_nameservers_path}"