google-nomulus/java/google/registry/ui/soy/registrar/WhoisSettings.soy
lukes e94ba8d2af Delete private="true" from .soy files
private="true" has never done very much unfortunately. There is an alternate
way to mark templates as private by setting 'visibility="private"' which does
get enforced both by the soy compiler and by custom per-language strategies in
the various backends.

Unfortunately, it isn't possible to safely migrate from one to the other since
users may be calling these templates from server side soy which enforces
visibility via a runtime exception.  So they are just being deleted.

LSC: https://docs.google.com/document/d/1aOM_tBmanDQolF8mAuB0y29yB76cmYS5qOVYBAzFzyw/edit#

Tested:
    TAP --sample for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159565458
2017-06-21 10:00:53 -04:00

230 lines
7.5 KiB
Text

// Copyright 2017 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.whois autoescape="strict"}
/** Registrar whois settings page for view and edit. */
{template .settings}
{@param clientIdentifier: string}
{@param ianaIdentifier: int}
{@param icannReferralEmail: string}
{@param readonly: bool}
{@param? whoisServer: string}
{@param? referralUrl: string}
// Passed to .contactInfo_
{@param emailAddress: string}
{@param? localizedAddress: ?}
{@param? phoneNumber: string}
{@param? faxNumber: string}
{let $whoisServerNonNull: $whoisServer ?: 'None' /}
{let $referralUrlNonNull: $referralUrl ?: 'None' /}
<form name="item" class="{css item} {css registrar} {css kd-settings-pane}">
<h1>WHOIS Settings</h1>
{if $readonly}
<p>General registrar information for your WHOIS record. This
information is always visible in WHOIS.
{/if}
<table>
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Name' /}
{param name: 'clientIdentifier' /}
{param value: $clientIdentifier /}
{param readonly: true /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'IANA ID' /}
{param name: 'ianaIdentifier' /}
{param value: $ianaIdentifier /}
{param readonly: true /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'ICANN referral email' /}
{param name: 'icannReferralEmail' /}
{param value: $icannReferralEmail /}
{param readonly: true /}
{/call}
{call .contactInfo_ data="all" /}
<tr><td colspan="2"><hr>
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'WHOIS server' /}
{param name: 'whoisServer' /}
{param value: $whoisServerNonNull /}
{param readonly: $readonly /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Referral URL' /}
{param name: 'referralUrl' /}
{param value: $referralUrlNonNull /}
{param readonly: $readonly /}
{/call}
</table>
</form>
{/template}
/**
* Contact info.
*/
{template .contactInfo_ visibility="private"}
{@param emailAddress: string}
{@param readonly: bool}
{@param? localizedAddress: ?}
{@param? phoneNumber: string}
{@param? faxNumber: string}
{if $readonly}
<tr class="{css kd-settings-pane-section}">
<td><label class="{css setting-label}">Contact info</label></td>
<td class="{css setting-group-compact}">
{if isNonnull($localizedAddress)}
{call .viewAddress_ data="$localizedAddress"}
{param id: 'localizedAddress' /}
{/call}
{/if}
{if isNonnull($phoneNumber)}
<input type="hidden"
name="phoneNumber"
id="phoneNumber"
value="{$phoneNumber}">
<div class="{css contact-phone-number}">{$phoneNumber}</div>
{/if}
{if isNonnull($faxNumber)}
<input type="hidden"
name="faxNumber"
id="faxNumber"
value="{$faxNumber}">
<div class="{css contact-fax-number}">{$faxNumber} (Fax)</div>
{/if}
<input type="hidden"
name="emailAddress"
id="emailAddress"
value="{$emailAddress}">
<div class="{css contact-fax-number}">{$emailAddress}</div>
</td>
{else}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Email' /}
{param name: 'emailAddress' /}
{param value: $emailAddress /}
{param readonly: false /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Phone' /}
{param name: 'phoneNumber' /}
{param value: $phoneNumber /}
{param readonly: false /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Fax' /}
{param name: 'faxNumber' /}
{param value: $faxNumber /}
{param readonly: false /}
{/call}
{call .editAddress_ data="$localizedAddress"}
{param id: 'localizedAddress' /}
{/call}
{/if}
{/template}
/**
* Read-only view of address.
*/
{template .viewAddress_ visibility="private"}
{@param id: string}
{@param street: list<string>}
{@param city: string}
{@param? state: string}
{@param? zip: string}
{@param countryCode: string}
{foreach $line in $street}
<input type="hidden"
name="{$id}.street[{index($line)}]"
id="{$id}.street[{index($line)}]"
value="{$street[index($line)]}">
<div class="{css contact-address-street}">{$street[index($line)]}</div>
{/foreach}
<input type="hidden" name="{$id}.city" id="{$id}.city" value="{$city}">
<input type="hidden" name="{$id}.state" id="{$id}.state" value="{$state}">
<input type="hidden" name="{$id}.zip" id="{$id}.zip" value="{$zip}">
<input type="hidden"
name="{$id}.countryCode"
id="{$id}.countryCode"
value="{$countryCode}">
<div class="{css contact-address-city}">{$city},</div>
{if isNonnull($state)}
{sp}<div class="{css contact-address-state}">{$state}</div>
{/if}
{if isNonnull($zip)}
{sp}<div class="{css contact-address-zip}">{$zip}</div>
{/if}
{sp}<div class="{css contact-address-cc}">{$countryCode}</div>
{/template}
/**
* Editor of address.
*/
{template .editAddress_ visibility="private"}
{@param id: string}
{@param? street: list<string>}
{@param? city: string}
{@param? state: string}
{@param? zip: string}
{@param? countryCode: string}
{let $street2: $street ?: [] /}
{let $city2: $city ?: '' /}
{let $state2: $state ?: '' /}
{let $zip2: $zip ?: '' /}
{let $countryCode2: $countryCode ?: '' /}
<tr class="{css kd-settings-pane-section}">
<td>
<label for="{$id}.street[0]"
class="{css setting-label}">Street Address</label>
<td class="{css setting}">
<input id="{$id}.street[0]"
name="{$id}.street[0]"
value="{if isNonnull($street2[0])}{$street2[0]}{/if}">
<input id="{$id}.street[1]"
name="{$id}.street[1]"
value="{if isNonnull($street2[1])}{$street2[1]}{/if}">
<input id="{$id}.street[2]"
name="{$id}.street[2]"
value="{if isNonnull($street2[2])}{$street2[2]}{/if}">
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'City' /}
{param name: $id + '.city' /}
{param value: $city2 /}
{param readonly: false /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'State/Region' /}
{param name: $id + '.state' /}
{param value: $state2 /}
{param readonly: false /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Zip/Postal Code' /}
{param name: $id + '.zip' /}
{param value: $zip2 /}
{param readonly: false /}
{/call}
{call registry.soy.forms.inputFieldRowWithValue}
{param label: 'Country Code' /}
{param name: $id + '.countryCode' /}
{param value: $countryCode2 /}
{param readonly: false /}
{/call}
{/template}