Views and tests for contact disclosure

This commit is contained in:
Andres Keskküla 2014-11-25 16:29:40 +02:00
parent ea2b64bc69
commit c03818968f
9 changed files with 130 additions and 78 deletions

View file

@ -1,15 +1,13 @@
address = @contact.address
xml.tag!('contact:postalInfo', type: 'int') do
xml.tag!('contact:name', @contact.name)# if @contact.disclosure.try(:int_name)
xml.tag!('contact:org', @contact.org_name)# if @contact.disclosure.try(:int_org_name)
#if @contact.disclosure.try(:int_addr)
xml.tag!('contact:addr') do
xml.tag!('contact:street', address.street) if address
#xml.tag!('contact:street', address.street2) if address.street2
#xml.tag!('contact:street', address.street3) if address.street3
xml.tag!('contact:cc', address.try(:country).try(:iso)) unless address.try(:country).nil?
xml.tag!('contact:city', address.city) if address
xml.tag!('contact:name', @contact.name) if @disclosure.try(:name) || @owner
xml.tag!('contact:org', @contact.org_name) if @disclosure.try(:org_name) || @owner
if @disclosure.try(:addr) || @owner
xml.tag!('contact:addr') do
xml.tag!('contact:street', address.street) if address
xml.tag!('contact:cc', address.try(:country).try(:iso)) unless address.try(:country).nil?
xml.tag!('contact:city', address.city) if address
end
end
#end
end

View file

@ -6,22 +6,23 @@ xml.epp_head do
xml.resData do
xml.tag!('contact:chkData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do
xml << render('/epp/contacts/postal_info')
xml.tag!('contact:id', @contact.code)
xml.tag!('contact:voice', @contact.phone) #if @contact.disclosure.try(:phone)
xml.tag!('contact:fax', @contact.fax) #if @contact.disclosure.try(:fax)
xml.tag!('contact:email', @contact.email) #if @contact.disclosure..try(:email)
xml.tag!('contact:clID', @current_epp_user.username) if @current_epp_user
xml.tag!('contact:crID', @contact.cr_id ) if @contact.cr_id
xml << render('/epp/contacts/postal_info')
xml.tag!('contact:voice', @contact.phone) if @disclosure.try(:phone) || @owner
xml.tag!('contact:fax', @contact.fax) if @disclosure.try(:fax) || @owner
xml.tag!('contact:email', @contact.email) if @disclosure.try(:email) || @owner
#xml.tag!('contact:clID', @current_epp_user.username) if @current_epp_user
#xml.tag!('contact:crID', @contact.cr_id ) if @contact.cr_id
xml.tag!('contact:crDate', @contact.created_at)
xml.tag!('contact:upID', @contact.up_id) if @contact.up_id
xml.tag!('contact:upDate', @contact.updated_at) unless @contact.updated_at == @contact.created_at
xml.tag!('contact:trDate', '123') if false
xml.tag!('contact:authInfo') do
xml.tag!('contact:pw', @contact.auth_info) # Doc says we have to return this but is it necessary?
if @owner
xml.tag!('contact:authInfo') do
xml.tag!('contact:pw', @contact.auth_info) # Doc says we have to return this but is it necessary?
end
end
xml.tag!('contact:disclose', '123') if false
end
end