mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Convert HAML to ERB
This commit is contained in:
parent
ddaf9c9cbf
commit
8bcdeb25ee
2 changed files with 193 additions and 120 deletions
|
@ -1,120 +0,0 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:new), new_registrar_contact_path, class: 'btn btn-primary')
|
||||
= render 'shared/title', name: t(:contacts)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
= search_form_for [:registrar, @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(:id)
|
||||
= f.search_field :code_eq, class: 'form-control', placeholder: t(:id)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:ident)
|
||||
= f.search_field :ident_matches, class: 'form-control', placeholder: t(:ident)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag t(:ident_type)
|
||||
= select_tag '[q][ident_type_eq]', options_for_select(ident_types, params[:q][:ident_type_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' }
|
||||
.row
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:email)
|
||||
= f.search_field :email_matches, class: 'form-control', placeholder: t(:email)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag t(:country)
|
||||
= select_tag '[q][country_code_eq]', SortedCountry.all_options(params[:q][:country_code_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' }
|
||||
.col-md-6
|
||||
.form-group
|
||||
= label_tag t(:contact_type)
|
||||
= select_tag '[q][domain_contacts_type_in]', options_for_select([['admin', 'AdminDomainContact'], ['tech', 'TechDomainContact'], ['registrant', 'registrant']], params[:q][:domain_contacts_type_in]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||
.row
|
||||
.col-md-3
|
||||
.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(:created_at_from)
|
||||
= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:created_at_from)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:created_at_until)
|
||||
= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:created_at_until)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:updated_at)
|
||||
= f.search_field :updated_at_gteq, value: params[:q][:updated_at_gteq], class: 'form-control js-datepicker', placeholder: t(:updated_at)
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= label_tag t(:status)
|
||||
= select_tag :statuses_contains, options_for_select(Contact::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'), registrar_contacts_path, class: 'btn btn-default')
|
||||
.row
|
||||
.col-md-3
|
||||
.btn-group{:role => "group"}
|
||||
%button.btn.btn-default.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"}
|
||||
Download
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to 'PDF', download_list_registrar_contacts_path(q: params[:q], format: "pdf")
|
||||
%li= link_to 'CSV', download_list_registrar_contacts_path(q: params[:q], format: "csv")
|
||||
.col-md-3
|
||||
.col-md-3
|
||||
.col-md-3
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed.contacts
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name', t(:name))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'code', t(:id))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'ident', t(:ident))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'email', t(:created_at))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrar_name', t(:registrar_name))
|
||||
%th{class: 'col-xs-2'}= t(:actions)
|
||||
%tbody
|
||||
- @contacts.each do |contact|
|
||||
%tr
|
||||
%td= link_to(contact.name, registrar_contact_path(id: contact.code))
|
||||
%td= contact.code
|
||||
%td= ident_for(contact)
|
||||
%td= l(contact.created_at, format: :short)
|
||||
%td
|
||||
- if contact.registrar
|
||||
= contact.registrar
|
||||
%td
|
||||
= link_to(t(:edit), edit_registrar_contact_path(contact.code), class: 'btn btn-primary btn-xs')
|
||||
= link_to(t(:delete), delete_registrar_contact_path(contact.code), class: 'btn btn-default btn-xs')
|
||||
|
||||
.row
|
||||
.col-md-6
|
||||
= paginate @contacts
|
||||
.col-md-6.text-right
|
||||
.pagination
|
||||
= t(:result_count, count: @contacts.total_count)
|
193
app/views/registrar/contacts/index.html.erb
Normal file
193
app/views/registrar/contacts/index.html.erb
Normal file
|
@ -0,0 +1,193 @@
|
|||
<% content_for :actions do %>
|
||||
<%= link_to(t(:new), new_registrar_contact_path, class: 'btn btn-primary') %>
|
||||
<% end %>
|
||||
<%= render 'shared/title', name: t(:contacts) %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= search_form_for [:registrar, @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(:id) %>
|
||||
<%= f.search_field :code_eq, class: 'form-control', placeholder: t(:id) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:ident) %>
|
||||
<%= f.search_field :ident_matches, class: 'form-control', placeholder: t(:ident) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= label_tag t(:ident_type) %>
|
||||
<%= select_tag '[q][ident_type_eq]', options_for_select(ident_types, params[:q][:ident_type_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:email) %>
|
||||
<%= f.search_field :email_matches, class: 'form-control', placeholder: t(:email) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= label_tag t(:country) %>
|
||||
<%= select_tag '[q][country_code_eq]', SortedCountry.all_options(params[:q][:country_code_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<%= label_tag t(:contact_type) %>
|
||||
<%= select_tag '[q][domain_contacts_type_in]', options_for_select([['admin', 'AdminDomainContact'], ['tech', 'TechDomainContact'], ['registrant', 'registrant']], params[:q][:domain_contacts_type_in]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<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(:created_at_from) %>
|
||||
<%= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control js-datepicker', placeholder: t(:created_at_from) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:created_at_until) %>
|
||||
<%= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control js-datepicker', placeholder: t(:created_at_until) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:updated_at) %>
|
||||
<%= f.search_field :updated_at_gteq, value: params[:q][:updated_at_gteq], class: 'form-control js-datepicker', placeholder: t(:updated_at) %>
|
||||
</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(Contact::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'), registrar_contacts_path, class: 'btn btn-default') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="btn-group" role="group">
|
||||
<button aria-expanded="false" aria-haspopup="true" class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">
|
||||
Download
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%= link_to 'PDF', download_list_registrar_contacts_path(q: params[:q], format: "pdf") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to 'CSV', download_list_registrar_contacts_path(q: params[:q], format: "csv") %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-3"></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 contacts">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'name', t(:name)) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'code', t(:id)) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'ident', t(:ident)) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'email', t(:created_at)) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'registrar_name', t(:registrar_name)) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= t(:actions) %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @contacts.each do |contact| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to(contact.name, registrar_contact_path(id: contact.code)) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= contact.code %>
|
||||
</td>
|
||||
<td>
|
||||
<%= ident_for(contact) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= l(contact.created_at, format: :short) %>
|
||||
</td>
|
||||
<td>
|
||||
<% if contact.registrar %>
|
||||
<%= contact.registrar %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to(t(:edit), edit_registrar_contact_path(contact.code), class: 'btn btn-primary btn-xs') %>
|
||||
<%= link_to(t(:delete), delete_registrar_contact_path(contact.code), class: 'btn btn-default btn-xs') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= paginate @contacts %>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<div class="pagination">
|
||||
<%= t(:result_count, count: @contacts.total_count) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue