mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
parent
cee51e1ac5
commit
0f6a47d73d
47 changed files with 644 additions and 640 deletions
|
@ -19,17 +19,15 @@ module Admin
|
|||
def create
|
||||
@registrar = Registrar.new(registrar_params)
|
||||
|
||||
begin
|
||||
if @registrar.valid?
|
||||
@registrar.transaction do
|
||||
@registrar.save!
|
||||
@registrar.accounts.create!(account_type: Account::CASH, currency: 'EUR')
|
||||
end
|
||||
|
||||
flash[:notice] = t('.created')
|
||||
redirect_to [:admin, @registrar]
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
flash.now[:alert] = t('.not_created')
|
||||
render 'new'
|
||||
redirect_to [:admin, @registrar], notice: t('.created')
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -38,21 +36,19 @@ module Admin
|
|||
|
||||
def update
|
||||
if @registrar.update(registrar_params)
|
||||
flash[:notice] = t('.updated')
|
||||
redirect_to [:admin, @registrar]
|
||||
redirect_to [:admin, @registrar], notice: t('.updated')
|
||||
else
|
||||
flash.now[:alert] = t('.not_updated')
|
||||
render 'edit'
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @registrar.destroy
|
||||
flash[:notice] = I18n.t('registrar_deleted')
|
||||
redirect_to admin_registrars_path
|
||||
flash[:notice] = t('.deleted')
|
||||
redirect_to admin_registrars_url
|
||||
else
|
||||
flash.now[:alert] = I18n.t('failed_to_delete_registrar')
|
||||
render 'show'
|
||||
flash[:alert] = @registrar.errors.full_messages.first
|
||||
redirect_to admin_registrar_url(@registrar)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ class Registrar < ActiveRecord::Base
|
|||
has_many :api_users, dependent: :restrict_with_error
|
||||
has_many :messages
|
||||
has_many :invoices, foreign_key: 'buyer_id'
|
||||
has_many :accounts
|
||||
has_many :accounts, dependent: :destroy
|
||||
has_many :nameservers, through: :domains
|
||||
has_many :whois_records
|
||||
has_many :white_ips, dependent: :destroy
|
||||
|
@ -17,37 +17,10 @@ class Registrar < ActiveRecord::Base
|
|||
validates :name, :reference_no, :code, uniqueness: true
|
||||
validates :accounting_customer_code, presence: true
|
||||
validates :language, presence: true
|
||||
validate :forbidden_codes
|
||||
validate :forbid_special_code
|
||||
|
||||
after_initialize :set_defaults
|
||||
|
||||
def forbidden_codes
|
||||
return true unless ['CID'].include? code
|
||||
errors.add(:code, I18n.t(:forbidden_code))
|
||||
false
|
||||
end
|
||||
|
||||
before_validation :generate_iso_11649_reference_no
|
||||
def generate_iso_11649_reference_no
|
||||
return if reference_no.present?
|
||||
|
||||
loop do
|
||||
base = nil
|
||||
loop do
|
||||
base = SecureRandom.random_number.to_s.last(8)
|
||||
break if base.to_i != 0 && base.length == 8
|
||||
end
|
||||
|
||||
control_base = (base + '2715' + '00').to_i
|
||||
reminder = control_base % 97
|
||||
check_digits = 98 - reminder
|
||||
|
||||
check_digits = check_digits < 10 ? "0#{check_digits}" : check_digits.to_s
|
||||
|
||||
self.reference_no = "RF#{check_digits}#{base}"
|
||||
break unless self.class.exists?(reference_no: reference_no)
|
||||
end
|
||||
end
|
||||
|
||||
validates :email, :billing_email,
|
||||
email_format: { message: :invalid },
|
||||
|
@ -177,4 +150,29 @@ class Registrar < ActiveRecord::Base
|
|||
def set_defaults
|
||||
self.language = Setting.default_language unless language
|
||||
end
|
||||
|
||||
def forbid_special_code
|
||||
errors.add(:code, :forbidden) if code == 'CID'
|
||||
end
|
||||
|
||||
def generate_iso_11649_reference_no
|
||||
return if reference_no.present?
|
||||
|
||||
loop do
|
||||
base = nil
|
||||
loop do
|
||||
base = SecureRandom.random_number.to_s.last(8)
|
||||
break if base.to_i != 0 && base.length == 8
|
||||
end
|
||||
|
||||
control_base = (base + '2715' + '00').to_i
|
||||
reminder = control_base % 97
|
||||
check_digits = 98 - reminder
|
||||
|
||||
check_digits = check_digits < 10 ? "0#{check_digits}" : check_digits.to_s
|
||||
|
||||
self.reference_no = "RF#{check_digits}#{base}"
|
||||
break unless self.class.exists?(reference_no: reference_no)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
%dt= t(:currency)
|
||||
%dd= @bank_transaction.currency
|
||||
|
||||
%dt= t(:reference_no)
|
||||
%dt= BankTransaction.human_attribute_name :reference_no
|
||||
%dd= @bank_transaction.reference_no
|
||||
|
||||
%dt= t(:paid_at)
|
||||
|
|
17
app/views/admin/registrars/_billing.html.erb
Normal file
17
app/views/admin/registrars/_billing.html.erb
Normal file
|
@ -0,0 +1,17 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<%= t '.header' %>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><%= Registrar.human_attribute_name :vat_no %></dt>
|
||||
<dd><%= registrar.vat_no %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :accounting_customer_code %></dt>
|
||||
<dd><%= registrar.accounting_customer_code %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :billing_email %></dt>
|
||||
<dd><%= registrar.billing_email %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
24
app/views/admin/registrars/_contacts.html.erb
Normal file
24
app/views/admin/registrars/_contacts.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<%= t '.header' %>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><%= t(:country) %></dt>
|
||||
<dd><%= @registrar.country %></dd>
|
||||
|
||||
<dt><%= t(:address) %></dt>
|
||||
<dd><%= @registrar.address %></dd>
|
||||
|
||||
<dt><%= t(:contact_phone) %></dt>
|
||||
<dd><%= @registrar.phone %></dd>
|
||||
|
||||
<dt><%= t(:contact_email) %></dt>
|
||||
<dd><%= @registrar.email %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :billing_email %></dt>
|
||||
<dd><%= @registrar.billing_email %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
27
app/views/admin/registrars/_details.html.erb
Normal file
27
app/views/admin/registrars/_details.html.erb
Normal file
|
@ -0,0 +1,27 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<%= t '.header' %>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><%= Registrar.human_attribute_name :name %></dt>
|
||||
<dd><%= registrar.name %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :reg_no %></dt>
|
||||
<dd><%= registrar.reg_no %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :reference_no %></dt>
|
||||
<dd><%= registrar.reference_no %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :code %></dt>
|
||||
<dd><%= registrar.code %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :balance %></dt>
|
||||
<dd><%= registrar.balance %></dd>
|
||||
|
||||
<dt><%= Registrar.human_attribute_name :website %></dt>
|
||||
<dd><%= registrar.website %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
|
@ -1,5 +1,6 @@
|
|||
<%= form_for([:admin, @registrar], html: { class: 'form-horizontal' }) do |f| %>
|
||||
<%= render 'shared/full_errors', object: @registrar %>
|
||||
<%= render 'form_errors', target: @registrar %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="panel panel-default">
|
||||
|
@ -133,7 +134,9 @@
|
|||
<%= f.label :code %>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<%= f.text_field :code, required: f.object.new_record?, class: 'form-control', disabled: !f.object.new_record? %>
|
||||
<%= f.text_field :code, required: f.object.new_record?,
|
||||
disabled: f.object.persisted?,
|
||||
class: 'form-control' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
28
app/views/admin/registrars/_users.html.erb
Normal file
28
app/views/admin/registrars/_users.html.erb
Normal file
|
@ -0,0 +1,28 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<%= t '.header' %>
|
||||
</div>
|
||||
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-6"><%= ApiUser.human_attribute_name :username %></th>
|
||||
<th class="col-xs-6"><%= ApiUser.human_attribute_name :active %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% registrar.api_users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to(user, [:admin, user]) %></td>
|
||||
<td><%= user.active %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="panel-footer text-right">
|
||||
<%= link_to t('.new_btn'), new_admin_registrar_api_user_path(registrar),
|
||||
class: 'btn btn-default btn-xs' %>
|
||||
</div>
|
||||
</div>
|
38
app/views/admin/registrars/_white_ips.html.erb
Normal file
38
app/views/admin/registrars/_white_ips.html.erb
Normal file
|
@ -0,0 +1,38 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<%= t '.header' %>
|
||||
</div>
|
||||
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-4"><%= WhiteIp.human_attribute_name :ipv4 %></th>
|
||||
<th class="col-xs-6"><%= WhiteIp.human_attribute_name :ipv6 %></th>
|
||||
<th class="col-xs-2"><%= WhiteIp.human_attribute_name :interfaces %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% registrar.white_ips.each do |white_ip| %>
|
||||
<tr>
|
||||
<td>
|
||||
<% if white_ip.ipv4.present? %>
|
||||
<%= link_to(white_ip.ipv4, [:admin, registrar, white_ip]) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if white_ip.ipv6.present? %>
|
||||
<%= link_to(white_ip.ipv6, [:admin, registrar, white_ip]) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= white_ip.interfaces.join(', ').upcase %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="panel-footer text-right">
|
||||
<%= link_to t('.new_btn'), new_admin_registrar_white_ip_path(registrar),
|
||||
class: 'btn btn-default btn-xs' %>
|
||||
</div>
|
||||
</div>
|
|
@ -1,5 +1,10 @@
|
|||
<% 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}" %>
|
||||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('admin.registrars.index.header'), admin_registrars_path %></li>
|
||||
<li><%= link_to @registrar.name, admin_registrar_path(@registrar) %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
<% content_for :actions do %>
|
||||
<%= link_to(t('.new_btn'), new_admin_registrar_path, class: 'btn btn-primary') %>
|
||||
<% end %>
|
||||
<%= render 'shared/title', name: t(:registrars) %>
|
||||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 text-right">
|
||||
<%= link_to t('.new_btn'), new_admin_registrar_path, class: 'btn btn-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
|
@ -12,10 +20,10 @@
|
|||
<%= sort_link(@q, 'name') %>
|
||||
</th>
|
||||
<th class="col-xs-4">
|
||||
<%= sort_link(@q, 'reg_no', t(:reg_no)) %>
|
||||
<%= sort_link(@q, 'reg_no', Registrar.human_attribute_name(:reg_no)) %>
|
||||
</th>
|
||||
<th class="col-xs-4">
|
||||
<%= t(:credit_balance) %>
|
||||
<%= Registrar.human_attribute_name :balance %>
|
||||
</th>
|
||||
<th class="col-xs-4">
|
||||
<%= t(:test_registrar) %>
|
||||
|
|
|
@ -1,2 +1,9 @@
|
|||
<%= render 'shared/title', name: t(:new_registrar) %>
|
||||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('admin.registrars.index.header'), admin_registrars_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
|
|
@ -1,218 +1,50 @@
|
|||
<% registrar = RegistrarPresenter.new(registrar: @registrar, view: self) %>
|
||||
<% 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? %>
|
||||
<span style="color: #c9302c;">(test)</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render 'shared/title', name: @registrar.name %>
|
||||
<% if @registrar.errors.any? %>
|
||||
<% @registrar.errors.each do |attr, err| %>
|
||||
<%= err %>
|
||||
<br/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @registrar.errors.any? %>
|
||||
<hr/>
|
||||
<% end %>
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('admin.registrars.index.header'), admin_registrars_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h1>
|
||||
<%= @registrar.name %>
|
||||
<% if @registrar.test_registrar? %>
|
||||
<span class="text-danger"> (test)</span>
|
||||
<% end %>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-right">
|
||||
<%= link_to t('.edit_btn'), edit_admin_registrar_path(@registrar),
|
||||
class: 'btn btn-primary' %>
|
||||
<%= link_to t('.delete_btn'), admin_registrar_path(@registrar),
|
||||
method: :delete,
|
||||
data: { confirm: t('.delete_btn_confirm') },
|
||||
class: 'btn btn-default' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<%= t(:general) %>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
<%= t(:name) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.name %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:reg_no) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.reg_no %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:vat_no) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.vat_no %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:reference_no) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.reference_no %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:id) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.code %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:credit_balance) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.balance %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= Registrar.human_attribute_name :website %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.website %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= Registrar.human_attribute_name :accounting_customer_code %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.accounting_customer_code %>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'details', registrar: @registrar %>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<%= t(:contact) %>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
<%= t(:country) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.country %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:address) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.address %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:contact_phone) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.phone %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:contact_email) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.email %>
|
||||
</dd>
|
||||
<dt>
|
||||
<%= t(:billing_email) %>
|
||||
</dt>
|
||||
<dd>
|
||||
<%= @registrar.billing_email %>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'admin/registrars/show/preferences', registrar: registrar %>
|
||||
<%= render 'contacts', registrar: @registrar %>
|
||||
<%= render 'billing', registrar: @registrar %>
|
||||
<%= render 'preferences', registrar: registrar %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default" id="epp-users">
|
||||
<div class="panel-heading clearfix">
|
||||
<div class="pull-left">
|
||||
<%= t('.api_users') %>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<%= link_to(t('.new_api_use_btn'), new_admin_registrar_api_user_path(@registrar), class: 'btn btn-default btn-xs') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-6">
|
||||
<%= t(:username) %>
|
||||
</th>
|
||||
<th class="col-xs-6">
|
||||
<%= t('.active') %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @registrar.api_users.each do |x| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to(x, [:admin, x]) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= x.active %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'users', registrar: @registrar %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default" id="epp-users">
|
||||
<div class="panel-heading clearfix">
|
||||
<div class="pull-left">
|
||||
<%= t(:white_ips) %>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<%= link_to(t(:create_new_white_ip), new_admin_registrar_white_ip_path(@registrar), class: 'btn btn-default btn-xs') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-4">
|
||||
<%= t(:ipv4) %>
|
||||
</th>
|
||||
<th class="col-xs-6">
|
||||
<%= t(:ipv6) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= t(:interfaces) %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @registrar.white_ips.each do |x| %>
|
||||
<tr>
|
||||
<td>
|
||||
<% if x.ipv4.present? %>
|
||||
<%= link_to(x.ipv4, [:admin, @registrar, x]) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if x.ipv6.present? %>
|
||||
<%= link_to(x.ipv6, [:admin, @registrar, x]) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= x.interfaces.join(', ').upcase %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'white_ips', registrar: @registrar %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:back_to_registrar), admin_registrar_path(@registrar), class: 'btn btn-default')
|
||||
|
||||
= render 'shared/title', name: t(:create_new_white_ip)
|
||||
= render 'shared/title', name: t('.header')
|
||||
= render 'form'
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
%dt= t(:registrar_name)
|
||||
%dd= link_to(@registrar, [:admin, @registrar])
|
||||
|
||||
%dt= t(:ipv4)
|
||||
%dt= WhiteIp.human_attribute_name :ipv4
|
||||
%dd= @white_ip.ipv4
|
||||
|
||||
%dt= t(:ipv6)
|
||||
%dt= WhiteIp.human_attribute_name :ipv6
|
||||
%dd= @white_ip.ipv6
|
||||
|
||||
%dt= t(:interfaces)
|
||||
%dt= WhiteIp.human_attribute_name :interfaces
|
||||
%dd= @white_ip.interfaces.join(', ').upcase
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
%th{class: 'col-xs-6'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-6'}
|
||||
= sort_link(@q, 'reg_no', t(:reg_no))
|
||||
= sort_link(@q, 'reg_no', Registrar.human_attribute_name(:reg_no))
|
||||
%tbody
|
||||
- @registrars.each do |x|
|
||||
%tr
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
%dt= t(:name)
|
||||
%dd= @registrar.name
|
||||
|
||||
%dt= t(:reg_no)
|
||||
%dt= Registrar.human_attribute_name :reg_no
|
||||
%dd= @registrar.reg_no
|
||||
|
||||
%dt= t(:vat_no)
|
||||
%dt= Registrar.human_attribute_name :vat_no
|
||||
%dd= @registrar.vat_no
|
||||
|
||||
%dt= t(:id)
|
||||
|
|
|
@ -32,5 +32,5 @@
|
|||
%dt= t(:description)
|
||||
%dd=@invoice.description
|
||||
|
||||
%dt= t(:reference_no)
|
||||
%dt= Invoice.human_attribute_name :reference_no
|
||||
%dd= @invoice.reference_no
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%dt= t(:name)
|
||||
%dd= @invoice.seller_name
|
||||
|
||||
%dt= t(:reg_no)
|
||||
%dt= Registrar.human_attribute_name :reg_no
|
||||
%dd= @invoice.seller_reg_no
|
||||
|
||||
%dt= t(:iban)
|
||||
|
@ -16,7 +16,7 @@
|
|||
%dt= t(:swift)
|
||||
%dd= @invoice.seller_swift
|
||||
|
||||
%dt= t(:vat_no)
|
||||
%dt= Registrar.human_attribute_name :vat_no
|
||||
%dd= @invoice.seller_vat_no
|
||||
|
||||
%dt= t(:address)
|
||||
|
|
|
@ -182,7 +182,7 @@
|
|||
%dt= t(:description)
|
||||
%dd=@invoice.description
|
||||
|
||||
%dt= t(:reference_no)
|
||||
%dt= Invoice.human_attribute_name :reference_no
|
||||
%dd= @invoice.reference_no
|
||||
|
||||
.col-md-6.right
|
||||
|
@ -261,7 +261,7 @@
|
|||
%br
|
||||
= "#{t('reg_no')} #{@invoice.seller_reg_no}"
|
||||
%br
|
||||
= "#{t('vat_no')} #{@invoice.seller_vat_no}"
|
||||
= "#{Registrar.human_attribute_name :vat_no} #{@invoice.seller_vat_no}"
|
||||
|
||||
.col-md-3.left
|
||||
= @invoice.seller_phone
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue