mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
Convert HAML to ERB
This commit is contained in:
parent
88f2707fe7
commit
0ad0437dec
2 changed files with 130 additions and 81 deletions
|
@ -1,81 +0,0 @@
|
|||
= render 'shared/title', name: t(:domains)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||
.row
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label :name
|
||||
= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:registrant_ident)
|
||||
= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:contact_ident)
|
||||
= f.search_field :contacts_ident_eq, class: 'form-control', placeholder: t(:contact_ident)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:nameserver_hostname)
|
||||
= f.search_field :nameservers_hostname_eq, class: 'form-control', placeholder: t(:nameserver_hostname)
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= f.label t(:registrar_name)
|
||||
= f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:valid_to_from)
|
||||
= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:valid_to_until)
|
||||
= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until)
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= label_tag t(:status)
|
||||
= select_tag :statuses_contains, options_for_select(DomainStatus::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag t(:results_per_page)
|
||||
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||
.col-md-3{style: 'padding-top: 25px;'}
|
||||
%button.btn.btn-primary
|
||||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
= link_to(t('.reset_btn'), admin_domains_path, class: 'btn btn-default')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrant_name', t('.registrant'))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'valid_to', t(:valid_to))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrar_name', t(:registrar_name))
|
||||
%tbody
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, admin_domain_path(x))
|
||||
%td
|
||||
- if x.registrant
|
||||
= link_to(x.registrant, [:admin, x.registrant])
|
||||
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= link_to(x.registrar, admin_registrar_path(x.registrar)) if x.registrar
|
||||
.row
|
||||
.col-md-6
|
||||
= paginate @domains
|
||||
.col-md-6.text-right
|
||||
.pagination
|
||||
= t(:result_count, count: @domains.total_count)
|
130
app/views/admin/domains/index.html.erb
Normal file
130
app/views/admin/domains/index.html.erb
Normal file
|
@ -0,0 +1,130 @@
|
|||
<%= render 'shared/title', name: t(:domains) %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f| %>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :name %>
|
||||
<%= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:registrant_ident) %>
|
||||
<%= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:contact_ident) %>
|
||||
<%= f.search_field :contacts_ident_eq, class: 'form-control', placeholder: t(:contact_ident) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:nameserver_hostname) %>
|
||||
<%= f.search_field :nameservers_hostname_eq, class: 'form-control', placeholder: t(:nameserver_hostname) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:registrar_name) %>
|
||||
<%= f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:valid_to_from) %>
|
||||
<%= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:valid_to_until) %>
|
||||
<%= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<%= label_tag t(:status) %>
|
||||
<%= select_tag :statuses_contains, options_for_select(DomainStatus::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= label_tag t(:results_per_page) %>
|
||||
<%= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding-top: 25px;">
|
||||
<button class="btn btn-primary">
|
||||
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
|
||||
</button>
|
||||
<%= link_to(t('.reset_btn'), admin_domains_path, class: 'btn btn-default') %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'name') %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'registrant_name', t('.registrant')) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'valid_to', t(:valid_to)) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'registrar_name', t(:registrar_name)) %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @domains.each do |x| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to(x, admin_domain_path(x)) %>
|
||||
</td>
|
||||
<td>
|
||||
<% if x.registrant %>
|
||||
<%= link_to(x.registrant, [:admin, x.registrant]) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= l(x.valid_to, format: :short) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to(x.registrar, admin_registrar_path(x.registrar)) if x.registrar %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= paginate @domains %>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<div class="pagination">
|
||||
<%= t(:result_count, count: @domains.total_count) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue