Merge pull request #159 from internetee/117806281-clickable_actions

117806281 clickable actions
This commit is contained in:
Timo Võhmar 2016-07-28 16:01:58 +03:00 committed by GitHub
commit 08db5bd547
3 changed files with 25 additions and 8 deletions

View file

@ -5,6 +5,7 @@
- if domain.present? - if domain.present?
- if version # normal history - if version # normal history
- epp_req = ApiLog::EppLog.find_by(uuid: version.uuid).try(:request) if version.uuid
- children = HashWithIndifferentAccess.new(version.children) - children = HashWithIndifferentAccess.new(version.children)
- nameservers = Nameserver.all_versions_for(children[:nameservers], version.created_at) - nameservers = Nameserver.all_versions_for(children[:nameservers], version.created_at)
- dnskeys = Dnskey.all_versions_for(children[:dnskeys], version.created_at) - dnskeys = Dnskey.all_versions_for(children[:dnskeys], version.created_at)
@ -13,7 +14,9 @@
- registrant = Contact.all_versions_for(children[:registrant], version.created_at) - registrant = Contact.all_versions_for(children[:registrant], version.created_at)
- event = version.event - event = version.event
- creator = plain_username(version.terminator) - creator = plain_username(version.terminator)
- whodunnit = version.try(:whodunnit)
- else # pending history - else # pending history
- epp_req = false
- nameservers = domain.nameservers - nameservers = domain.nameservers
- dnskeys = domain.dnskeys - dnskeys = domain.dnskeys
- tech_contacts = domain.tech_contacts - tech_contacts = domain.tech_contacts
@ -26,6 +29,7 @@
- registrant = [registrant] - registrant = [registrant]
- creator = pending_user.try(:username) - creator = pending_user.try(:username)
- event = 'pending' - event = 'pending'
- whodunnit = false
%td %td
%p.nowrap %p.nowrap
@ -34,8 +38,14 @@
%br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id]) %br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id])
%p.text-right %p.text-right
- if (event == 'update' || event == 'create') && epp_req
= link_to event, '#', class: 'js-event'
- else
= event = event
%br %br
- if whodunnit
= whodunnit
- else
= creator = creator
- if version - if version
%p.text-right %p.text-right
@ -54,7 +64,7 @@
%br %br
- if domain.pending_json.present? - if domain.pending_json.present?
%p %p
= link_to t(:pending_epp), '#', class: 'js-pending-toggle' = link_to t(:pending_epp), '#', class: 'js-pending'
%td{class: changing_css_class(version, "period", "period_unit", "valid_from", "valid_to")} %td{class: changing_css_class(version, "period", "period_unit", "valid_from", "valid_to")}
%p %p
@ -120,9 +130,15 @@
= link_to admin_registrar_path(domain.registrar), target: "registrar_#{domain.registrar.id}" do = link_to admin_registrar_path(domain.registrar), target: "registrar_#{domain.registrar.id}" do
= domain.registrar.name = domain.registrar.name
- if (event == 'create' || event == 'update') && epp_req
%tr.js-event{ style: 'display: none;' }
%td{colspan: 9}
%pre
= Nokogiri::XML(epp_req)
- if domain.pending_json.present? - if domain.pending_json.present?
%tr.js-pending{ style: 'display: none;' } %tr.js-pending{ style: 'display: none;' }
%td{colspan: 8} %td{colspan: 9}
= preserve do = preserve do
%pre %pre
- formatted_req = Nokogiri::XML(domain.pending_json['frame']) - formatted_req = Nokogiri::XML(domain.pending_json['frame'])

View file

@ -37,9 +37,9 @@
domain: version.reify, version: version.previous domain: version.reify, version: version.previous
:coffee :coffee
$(document).on 'click', '.js-pending-toggle', (e) -> $(document).on 'click', '.js-pending, .js-event', (e) ->
e.preventDefault() e.preventDefault()
$(document).on 'mousedown', '.js-pending-toggle', (e) -> $(document).on 'mousedown', '.js-pending, .js-event', (e) ->
target = $(e.target) target = $(e.target)
target.parents('tr').next('tr.js-pending').toggle() target.parents('tr').nextUntil('tr.small' ,'tr.' + this.className).toggle()

View file

@ -959,3 +959,4 @@ en:
verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?' verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?'
verified: 'Verified' verified: 'Verified'
only_estonian_residets_can_signin: "Access currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID." only_estonian_residets_can_signin: "Access currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID."
cant_match_version: 'Impossible match version with request'