mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 23:54:44 +02:00
Convert HAML to ERB
This commit is contained in:
parent
a3f2c0cdd5
commit
eeeb806564
12 changed files with 223 additions and 139 deletions
|
@ -1,23 +0,0 @@
|
||||||
.panel.panel-default
|
|
||||||
.panel-heading
|
|
||||||
%h3.panel-title= t(:address)
|
|
||||||
.panel-body
|
|
||||||
%dl.dl-horizontal
|
|
||||||
- if @contact.org_name.present?
|
|
||||||
%dt= t(:org_name)
|
|
||||||
%dd= @contact.org_name
|
|
||||||
|
|
||||||
%dt= t(:street)
|
|
||||||
%dd= @contact.street
|
|
||||||
|
|
||||||
%dt= t(:city)
|
|
||||||
%dd= @contact.city
|
|
||||||
|
|
||||||
%dt= t(:zip)
|
|
||||||
%dd= @contact.zip
|
|
||||||
|
|
||||||
%dt= t(:state)
|
|
||||||
%dd= @contact.state
|
|
||||||
|
|
||||||
%dt= t(:country)
|
|
||||||
%dd= @contact.country
|
|
35
app/views/registrant/contacts/partials/_address.html.erb
Normal file
35
app/views/registrant/contacts/partials/_address.html.erb
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<%= t(:address) %>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<% if @contact.org_name.present? %>
|
||||||
|
<dt>
|
||||||
|
<%= t(:org_name) %>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<%= @contact.org_name %>
|
||||||
|
</dd>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<dt><%= t(:street) %></dt>
|
||||||
|
<dd><%= @contact.street %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:city) %></dt>
|
||||||
|
<dd><%= @contact.city %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:zip) %></dt>
|
||||||
|
<dd><%= @contact.zip %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:state) %></dt>
|
||||||
|
<dd><%= @contact.state %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:country) %></dt>
|
||||||
|
<dd><%= @contact.country %></dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,30 +0,0 @@
|
||||||
- domains = contact.all_domains(page: params[:domain_page], per: 20, params: params.merge(leave_domains: domain_ids))
|
|
||||||
#contacts.panel.panel-default
|
|
||||||
.panel-heading
|
|
||||||
.pull-left
|
|
||||||
= t(:domains)
|
|
||||||
.pull-right
|
|
||||||
= form_tag request.path, method: :get do
|
|
||||||
= select_tag :domain_filter, options_for_select(%w(Registrant AdminDomainContact TechDomainContact), selected: params[:domain_filter]),
|
|
||||||
include_blank: true, class: 'form-control2 selectize2'
|
|
||||||
%button.btn.btn-primary
|
|
||||||
%span.glyphicon.glyphicon-search
|
|
||||||
.clearfix
|
|
||||||
|
|
||||||
.table-responsive
|
|
||||||
%table.table.table-hover.table-bordered.table-condensed
|
|
||||||
%thead
|
|
||||||
%tr
|
|
||||||
%th{class: 'col-xs-3'}=custom_sort_link t(:domain_name), :name
|
|
||||||
%th{class: 'col-xs-3'}=custom_sort_link t(:registrar_name), :registrar_name
|
|
||||||
%th{class: 'col-xs-3'}=custom_sort_link t(:valid_to), :valid_to
|
|
||||||
%th{class: 'col-xs-3'}=custom_sort_link Domain.human_attribute_name(:roles), :roles
|
|
||||||
%tbody
|
|
||||||
- domains.each do |x|
|
|
||||||
%tr
|
|
||||||
%td= link_to(x.name, [:registrant, x])
|
|
||||||
%td= link_to(x.registrar, [:registrant, x.registrar])
|
|
||||||
%td= l(x.valid_to, format: :short)
|
|
||||||
%td= x.roles.join(", ")
|
|
||||||
|
|
||||||
= paginate domains, param_name: :domain_page
|
|
60
app/views/registrant/contacts/partials/_domains.html.erb
Normal file
60
app/views/registrant/contacts/partials/_domains.html.erb
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<% domains = contact.all_domains(page: params[:domain_page], per: 20, params:
|
||||||
|
params.merge(leave_domains: domain_ids)) %>
|
||||||
|
|
||||||
|
<div class="panel panel-default" id="contacts">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="pull-left">
|
||||||
|
<%= t(:domains) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pull-right">
|
||||||
|
<%= form_tag request.path, method: :get do %>
|
||||||
|
<%= select_tag :domain_filter,
|
||||||
|
options_for_select(%w(Registrant AdminDomainContact TechDomainContact),
|
||||||
|
selected: params[:domain_filter]),
|
||||||
|
include_blank: true,
|
||||||
|
class: 'form-control2 selectize2' %>
|
||||||
|
<button class="btn btn-primary">
|
||||||
|
<span class="glyphicon glyphicon-search"></span>
|
||||||
|
</button>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover table-bordered table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="col-xs-3"><%= custom_sort_link t(:domain_name), :name %></th>
|
||||||
|
<th class="col-xs-3">
|
||||||
|
<%= custom_sort_link t(:registrar_name), :registrar_name %>
|
||||||
|
</th>
|
||||||
|
<th class="col-xs-3"><%= custom_sort_link t(:valid_to), :valid_to %></th>
|
||||||
|
<th class="col-xs-3">
|
||||||
|
<%= custom_sort_link Domain.human_attribute_name(:roles), :roles %>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% domains.each do |x| %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= link_to(x.name, [:registrant, x]) %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= link_to(x.registrar, [:registrant, x.registrar]) %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= l(x.valid_to, format: :short) %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= x.roles.join(", ") %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%= paginate domains, param_name: :domain_page %>
|
|
@ -1,48 +0,0 @@
|
||||||
.panel.panel-default
|
|
||||||
.panel-heading
|
|
||||||
%h3.panel-title= t(:general)
|
|
||||||
.panel-body
|
|
||||||
%dl.dl-horizontal
|
|
||||||
%dt= t(:id)
|
|
||||||
%dd= @contact.code
|
|
||||||
|
|
||||||
%dt= t(:name)
|
|
||||||
%dd= @contact.name
|
|
||||||
|
|
||||||
%dt= t(:password)
|
|
||||||
%dd
|
|
||||||
= text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden'
|
|
||||||
|
|
||||||
%br
|
|
||||||
|
|
||||||
%dt= t(:ident)
|
|
||||||
%dd= ident_for(@contact)
|
|
||||||
|
|
||||||
%dt= t(:email)
|
|
||||||
%dd= @contact.email
|
|
||||||
|
|
||||||
%dt= t(:phone)
|
|
||||||
%dd= @contact.phone
|
|
||||||
|
|
||||||
- if @contact.fax
|
|
||||||
%dt= t(:fax)
|
|
||||||
%dd= @contact.fax
|
|
||||||
|
|
||||||
%br
|
|
||||||
|
|
||||||
%dt= Contact.human_attribute_name :created_at
|
|
||||||
%dd
|
|
||||||
= l(@contact.created_at, format: :short)
|
|
||||||
by
|
|
||||||
= @contact.name
|
|
||||||
|
|
||||||
%dt= Contact.human_attribute_name :updated_at
|
|
||||||
%dd
|
|
||||||
= l(@contact.updated_at, format: :short)
|
|
||||||
by
|
|
||||||
= @contact.name
|
|
||||||
|
|
||||||
%dt= t(:registrar_name)
|
|
||||||
%dd
|
|
||||||
- if @contact.registrar.present?
|
|
||||||
= link_to(@contact.registrar, registrant_registrar_path(@contact.registrar))
|
|
63
app/views/registrant/contacts/partials/_general.html.erb
Normal file
63
app/views/registrant/contacts/partials/_general.html.erb
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
<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(:id) %></dt>
|
||||||
|
<dd><%= @contact.code %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:name) %></dt>
|
||||||
|
<dd><%= @contact.name %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:password) %></dt>
|
||||||
|
<dd><%= text_field_tag :auth_info, @contact.auth_info, readonly: true,
|
||||||
|
class: 'partially-hidden' %></dd>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<dt><%= t(:ident) %></dt>
|
||||||
|
<dd><%= ident_for(@contact) %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:email) %></dt>
|
||||||
|
<dd><%= @contact.email %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:phone) %></dt>
|
||||||
|
<dd><%= @contact.phone %></dd>
|
||||||
|
|
||||||
|
<% if @contact.fax %>
|
||||||
|
<dt>
|
||||||
|
<%= t(:fax) %>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<%= @contact.fax %>
|
||||||
|
</dd>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<dt><%= Contact.human_attribute_name :created_at %></dt>
|
||||||
|
<dd>
|
||||||
|
<%= l(@contact.created_at, format: :short) %>
|
||||||
|
by
|
||||||
|
<%= @contact.name %>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt><%= Contact.human_attribute_name :updated_at %></dt>
|
||||||
|
<dd>
|
||||||
|
<%= l(@contact.updated_at, format: :short) %>
|
||||||
|
by
|
||||||
|
<%= @contact.name %>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt><%= t(:registrar_name) %></dt>
|
||||||
|
<dd>
|
||||||
|
<% if @contact.registrar.present? %>
|
||||||
|
<%= link_to @contact.registrar, registrant_registrar_path(@contact.registrar) %>
|
||||||
|
<% end %>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,6 +0,0 @@
|
||||||
= search_form_for [:registrant, @q] do |f|
|
|
||||||
= f.search_field :name_cont
|
|
||||||
= f.submit do
|
|
||||||
%span.glyphicon.glyphicon-search
|
|
||||||
|
|
||||||
|
|
6
app/views/registrant/contacts/partials/_search.html.erb
Normal file
6
app/views/registrant/contacts/partials/_search.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<%= search_form_for [:registrant, @q] do |f| %>
|
||||||
|
<%= f.search_field :name_cont %>
|
||||||
|
<%= f.submit do %>
|
||||||
|
<span class="glyphicon glyphicon-search"></span>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
|
@ -1,21 +0,0 @@
|
||||||
- panel_class = contact.errors.messages[:statuses] ? 'panel-danger' : 'panel-default'
|
|
||||||
#contact_statuses.panel{class: panel_class}
|
|
||||||
.panel-heading.clearfix
|
|
||||||
= t(:statuses)
|
|
||||||
.table-responsive
|
|
||||||
%table.table.table-hover.table-bordered.table-condensed
|
|
||||||
%thead
|
|
||||||
%tr
|
|
||||||
%th{class: 'col-xs-6'}= t(:status)
|
|
||||||
%th{class: 'col-xs-6'}= t(:notes)
|
|
||||||
%tbody
|
|
||||||
- contact.statuses.each do |status|
|
|
||||||
%tr
|
|
||||||
%td= status
|
|
||||||
%td= contact.status_notes[status]
|
|
||||||
|
|
||||||
- if contact.errors.messages[:statuses]
|
|
||||||
%tfoot
|
|
||||||
- @domain.errors.messages[:statuses].each do |s|
|
|
||||||
%tr
|
|
||||||
%td{colspan: 4}= s
|
|
36
app/views/registrant/contacts/partials/_statuses.html.erb
Normal file
36
app/views/registrant/contacts/partials/_statuses.html.erb
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
<% panel_class = contact.errors.messages[:statuses] ? 'panel-danger' : 'panel-default' %>
|
||||||
|
<div class="<%= panel_class %> panel" id="contact_statuses">
|
||||||
|
<div class="panel-heading clearfix">
|
||||||
|
<%= t(:statuses) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover table-bordered table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="col-xs-6"><%= t(:status) %></th>
|
||||||
|
<th class="col-xs-6"><%= t(:notes) %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<% contact.statuses.each do |status| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= status %></td>
|
||||||
|
<td><%= contact.status_notes[status] %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<% if contact.errors.messages[:statuses] %>
|
||||||
|
<tfoot>
|
||||||
|
<% @domain.errors.messages[:statuses].each do |s| %>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4"><%= s %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tfoot>
|
||||||
|
<% end %>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,11 +0,0 @@
|
||||||
= render 'shared/title', name: @contact.name
|
|
||||||
|
|
||||||
.row
|
|
||||||
.col-md-6= render 'registrant/contacts/partials/general'
|
|
||||||
.col-md-6= render 'registrant/contacts/partials/address'
|
|
||||||
.row
|
|
||||||
.col-md-12= render 'registrant/contacts/partials/statuses', contact: @contact
|
|
||||||
.row
|
|
||||||
.col-md-12= render 'registrant/contacts/partials/domains', contact: @contact
|
|
||||||
|
|
||||||
|
|
23
app/views/registrant/contacts/show.html.erb
Normal file
23
app/views/registrant/contacts/show.html.erb
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<%= render 'shared/title', name: @contact.name %>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<%= render 'registrant/contacts/partials/general' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<%= render 'registrant/contacts/partials/address' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<%= render 'registrant/contacts/partials/statuses', contact: @contact %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<%= render 'registrant/contacts/partials/domains', contact: @contact %>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Add table
Add a link
Reference in a new issue