google-nomulus/java/google/registry/ui/soy/registrar/Contact.soy
shikhman f76bc70f91 Preserve test logs and test summary output for Kokoro CI runs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135494972
2016-10-14 16:57:43 -04:00

179 lines
6.3 KiB
Text

// Copyright 2016 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
{namespace registry.soy.registrar.contact autoescape="strict"}
/**
* Set view for contacts.
*/
{template .set}
<div class="{css set} {css contact}">
<p>Please enter a query for a single contact in the form "contact/[contact id]".
</div>
{/template}
/**
* Item view for contact.
* @param? item
* @param? readonly passed through to field rendering.
*/
{template .item}
<form name="item" class="{css item} {css contact}">
<h1>
{if isNonnull($item['contact:id'])}
{$item['contact:id']['keyValue']}
{else}
New Contact
{/if}
</h1>
<table>
<tr class="{css section-lead}">
<th colspan="2"><h2>Authentication</h2></th>
</tr>
{if not isNonnull($item['contact:id'])}
{call registry.soy.forms.inputFieldRow data="all"}
{param label: 'Contact ID *' /}
{param name: 'contact:id' /}
{/call}
{/if}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Password *' /}
{param name: 'contact:authInfo.contact:pw' /}
{param value: isNonnull($item['contact:authInfo']) ?
$item['contact:authInfo']['contact:pw'] : '' /}
{/call}
<tr class="{css section-lead}">
<th colspan="2"><h2>Contacts</h2></th>
</tr>
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Email *' /}
{param name: 'contact:email' /}
{param value: $item['contact:email'] /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Phone' /}
{param name: 'contact:voice' /}
{param value: $item['contact:voice'] /}
{param placeholder: 'e.g. +1.6508675309' /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Fax' /}
{param name: 'contact:fax' /}
{param value: $item['contact:fax'] /}
{param placeholder: 'e.g. +1.2125552638' /}
{/call}
<tr class="{css section-lead} {css subsection}">
<th id="contact-postalInfoHeader" colspan="2">
<h3>Postal address(es)</h3>
<button id="domain-contact-postalInfo-add-button" type="button"
class="{css kd-button} {css reg-add}"
{if $readonly}disabled{/if}>
Add Localized Address
</button>
</th>
</tr>
<tr>
<td colspan="2">
<div id="contact-postalInfo">
{if isNonnull($item['contact:postalInfo'])}
{foreach $pi in $item['contact:postalInfo']}
{call .postalInfo data="all"}
{param localized: index($pi) == 1 /}
{param item: $pi/}
{param itemPrefix: 'contact:' /}
{param namePrefix: 'contact:postalInfo[' + index($pi) + '].contact:' /}
{/call}
{/foreach}
{else}
{call .postalInfo data="all"}
{param prefix: 'contact:' /}
{param namePrefix: 'contact:postalInfo[0].contact:' /}
{/call}
{/if}
<table id="domain-contact-postalInfos-footer"/>
</div>
</td>
</tr>
</table>
{if isNonnull($item['contact:id'])}
<input type="hidden" name="contact:id" value="{$item['contact:id']['keyValue']}"/>
{/if}
</form>
{/template}
/**
* Postal info.
* @param item
* @param namePrefix
* @param? localized if true, this is the second, localized postalInfo.
*/
{template .postalInfo}
<table>
<tr><th colspan=2>
{if $localized}
<strong>Localized address</strong><br>
<span class="{css info}">Full UTF-8 charsets allowed</span>
{else}
<strong>Internationalized address</strong><br>
<span class="{css info}">Only 7-bit ASCII allowed</span>
{/if}
</th></tr>
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Name *' /}
{param name: 'name' /}
{param value: $item['contact:name']/}
{/call}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Organization' /}
{param name: 'org' /}
{param value: $item['contact:org'] /}
{/call}
{call registry.soy.forms.textareaFieldRowWithValue data="all"}
{param label: 'Street' /}
{param name: 'street' /}
{param namePrefix: $namePrefix + 'addr.contact:' /}
{param value: isNonnull($item['contact:addr']) ? $item['contact:addr']['contact:street'] : '' /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'City *' /}
{param name: 'city' /}
{param namePrefix: $namePrefix + 'addr.contact:' /}
{param value: isNonnull($item['contact:addr']) ? $item['contact:addr']['contact:city'] : '' /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'State / Region' /}
{param name: 'sp' /}
{param namePrefix: $namePrefix + 'addr.contact:' /}
{param value: isNonnull($item['contact:addr']) ? $item['contact:addr']['contact:sp'] : '' /}
{param placeholder: 'e.g. CA' /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Zip / Postal code' /}
{param name: 'pc' /}
{param namePrefix: $namePrefix + 'addr.contact:' /}
{param value: isNonnull($item['contact:addr']) ? $item['contact:addr']['contact:pc'] : '' /}
{param placeholder: 'e.g. 10282' /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Country code *' /}
{param name: 'cc' /}
{param namePrefix: $namePrefix + 'addr.contact:' /}
{param value: isNonnull($item['contact:addr']) ? $item['contact:addr']['contact:cc'] : '' /}
{param placeholder: 'e.g. US' /}
{/call}
</table>
{/template}