mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
108869472-template_changes
This commit is contained in:
parent
8867644f16
commit
a42049e170
6 changed files with 134 additions and 11 deletions
|
@ -6,12 +6,18 @@ class Admin::ContactVersionsController < AdminController
|
|||
|
||||
@q = ContactVersion.search(params[:q])
|
||||
@versions = @q.result.page(params[:page])
|
||||
search_params = params[:q].deep_dup
|
||||
|
||||
whereS = "1=1"
|
||||
|
||||
params[:q].each do |key, value|
|
||||
search_params.each do |key, value|
|
||||
next if value.empty?
|
||||
whereS += create_where_string(key, value)
|
||||
case key
|
||||
when 'event'
|
||||
whereS += " AND event = '#{value}'"
|
||||
else
|
||||
whereS += create_where_string(key, value)
|
||||
end
|
||||
end
|
||||
|
||||
versions = ContactVersion.includes(:item).where(whereS)
|
||||
|
@ -21,6 +27,14 @@ class Admin::ContactVersionsController < AdminController
|
|||
|
||||
end
|
||||
|
||||
def show
|
||||
per_page = 7
|
||||
@version = ContactVersion.find(params[:id])
|
||||
@q = ContactVersion.where(item_id: @version.item_id).search
|
||||
@versions = @q.result.page(params[:page])
|
||||
@versions = @versions.per(per_page)
|
||||
end
|
||||
|
||||
def search
|
||||
render json: ContactVersion.search_by_query(params[:q])
|
||||
end
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
.row
|
||||
.col-md-3
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag :action
|
||||
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy']], params[:q][:event]), { include_blank:true, multiple: false, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag t(:results_per_page)
|
||||
|
@ -60,7 +63,7 @@
|
|||
%tbody
|
||||
- @versions.each do |version|
|
||||
%tr
|
||||
%td= version.reify.name
|
||||
%td= link_to(version.reify.name, admin_contact_version_path(version.id))
|
||||
%td= version.reify.code
|
||||
%td= ident_for(version.reify)
|
||||
%td= version.reify.phone
|
||||
|
|
96
app/views/admin/contact_versions/show.haml
Normal file
96
app/views/admin/contact_versions/show.haml
Normal file
|
@ -0,0 +1,96 @@
|
|||
= render 'shared/title', name: @version.reify.name
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
.panel.panel-default{:style => "min-height:420px;"}
|
||||
.panel-heading
|
||||
%h3.panel-title
|
||||
= l(@version.reify.updated_at, format: :short)
|
||||
= @version.event
|
||||
= plain_username(@version.terminator)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:id)
|
||||
%dd= @version.reify.code
|
||||
|
||||
%dt= t(:ident)
|
||||
%dd= ident_for(@version.reify)
|
||||
|
||||
%dt= t(:email)
|
||||
%dd= @version.reify.email
|
||||
|
||||
%dt= t(:phone)
|
||||
%dd= @version.reify.phone
|
||||
|
||||
- if @version.reify.fax
|
||||
%dt= t(:fax)
|
||||
%dd= @version.reify.fax
|
||||
|
||||
%br
|
||||
|
||||
%dt= t(:created)
|
||||
%dd
|
||||
= l(@version.reify.created_at, format: :short)
|
||||
|
||||
%dt= t(:updated)
|
||||
%dd
|
||||
= l(@version.reify.updated_at, format: :short)
|
||||
|
||||
%dt= t(:registrar)
|
||||
%dd
|
||||
- if @version.reify.registrar.present?
|
||||
= link_to(@version.reify.registrar, admin_registrar_path(@version.reify.registrar))
|
||||
|
||||
%dl.dl-horizontal
|
||||
- if @version.reify.org_name.present?
|
||||
%dt= t(:org_name)
|
||||
%dd= @version.reify.org_name
|
||||
|
||||
%dt= t(:street)
|
||||
%dd= @version.reify.street.to_s.gsub("\n", '<br>').html_safe
|
||||
|
||||
%dt= t(:city)
|
||||
%dd= @version.reify.city
|
||||
|
||||
%dt= t(:zip)
|
||||
%dd= @version.reify.zip
|
||||
|
||||
%dt= t(:state)
|
||||
%dd= @version.reify.state
|
||||
|
||||
%dt= t(:country)
|
||||
%dd= @version.reify.country
|
||||
|
||||
|
||||
%span{:style => "padding-right:10px; float: right;"}
|
||||
- if @version.previous
|
||||
= link_to(t(:previous),
|
||||
admin_contact_version_path(@version.previous.id),
|
||||
class: 'btn btn-primary')
|
||||
- else
|
||||
%a.btn.btn-primary.disabled{:href => "#"}
|
||||
%span= t(:previous)
|
||||
- if @version.next
|
||||
= link_to(t(:next),
|
||||
admin_contact_version_path(@version.next.id),
|
||||
class: 'btn btn-default')
|
||||
- else
|
||||
%a.btn.btn-default.disabled{:href => "#"}
|
||||
%span= t(:next)
|
||||
|
||||
.col-md-4
|
||||
.panel.panel-default{:style => "min-height:420px;"}
|
||||
%ul.nav.nav-pills.nav-stacked
|
||||
- @versions.each do |vs|
|
||||
- if vs.id == @version.id
|
||||
%li.active
|
||||
= link_to admin_contact_version_path(vs.id) do
|
||||
= l(vs.reify.updated_at, format: :short)
|
||||
= vs.event
|
||||
- else
|
||||
%li
|
||||
= link_to admin_contact_version_path(vs.id) do
|
||||
= l(vs.reify.updated_at, format: :short)
|
||||
= vs.event
|
||||
%span{:style => "padding-left:10px; position: absolute; bottom: 10px;"}
|
||||
= paginate @versions
|
|
@ -19,7 +19,7 @@
|
|||
.col-md-3
|
||||
.form-group
|
||||
= label_tag :action
|
||||
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy']], params[:q][:event]), { multiple: false, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy']], params[:q][:event]), { include_blank:true, multiple: false, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||
.row
|
||||
.col-md-3
|
||||
.col-md-3
|
||||
|
|
|
@ -60,13 +60,21 @@
|
|||
%br
|
||||
%dt= t(:registrar)
|
||||
%dd= @version.reify.registrar.name
|
||||
%span{:style => "padding-right:10px; float: right; bottom: 10px;"}
|
||||
= link_to(t(:previous),
|
||||
admin_domain_path(@version.item_id),
|
||||
class: 'btn btn-primary')
|
||||
= link_to(t(:next),
|
||||
admin_domain_path(@version.item_id),
|
||||
class: 'btn btn-default')
|
||||
%span{:style => "padding-right:10px; padding-top:40px; float: right; bottom: 10px;"}
|
||||
- if @version.previous
|
||||
= link_to(t(:previous),
|
||||
admin_domain_version_path(@version.previous.id),
|
||||
class: 'btn btn-primary')
|
||||
- else
|
||||
%a.btn.btn-primary.disabled{:href => "#"}
|
||||
%span= t(:previous)
|
||||
- if @version.next
|
||||
= link_to(t(:next),
|
||||
admin_domain_version_path(@version.next.id),
|
||||
class: 'btn btn-default')
|
||||
- else
|
||||
%a.btn.btn-default.disabled{:href => "#"}
|
||||
%span= t(:next)
|
||||
|
||||
.col-md-4
|
||||
.panel.panel-default{:style => "min-height:400px;"}
|
||||
|
|
|
@ -926,3 +926,5 @@ en:
|
|||
if_auth_info_is_left_empty_it_will_be_auto_generated: 'If auth info is left empty, it will be auto generated.'
|
||||
each_domain_name_must_end_with_colon_sign: 'Each domain name must end with colon (:) sign.'
|
||||
expiration_remind_subject: 'The %{name} domain has expired'
|
||||
next: 'Next'
|
||||
previous: 'Previous'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue