// 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.contacts autoescape="strict"} /** Registrar contacts listing for view only. */ {template .set} {@param contactsByType: map} {let $possibleTypesLookup: [ ['admin', 'Primary', 'Primary contact for general issues.'], ['billing', 'Billing', 'Contact for financial communications & invoices.'], ['tech', 'Technical', 'Contact for technical communications about the registry.'], ['legal', 'Legal', 'Contact for all legal communications.'], ['marketing', 'Marketing', 'Contact for registry promotions and campaigns.'], ['abuse', 'Abuse', 'Contact for abuse complaints.'], ['whois', 'WHOIS-Inquiry', 'Contact for inquiries about WHOIS accuracy.']] /}

Contact settings

{foreach $type in $possibleTypesLookup} {if isNonnull($contactsByType[$type[0]])} {/if} {/foreach}
{$type[2]} {foreach $c in $contactsByType[$type[0]]} {call .contactInfoCompact} {param namePrefix: 'contacts[' + index($c) + '].' /} {param name: $c['name'] /} {param emailAddress: $c['emailAddress'] /} {param visibleInWhois: ($c['visibleInWhoisAsAdmin'] or $c['visibleInWhoisAsTech']) /} {param phoneNumber: $c['phoneNumber'] /} {param faxNumber: $c['faxNumber'] /} {/call} {if (index($c) + 1) % 3 == 0}
{/if} {/foreach}
{/template} /** Compact readonly contact info view. */ {template .contactInfoCompact} {@param namePrefix: string} {@param name: string} {@param emailAddress: string} {@param visibleInWhois: bool} {@param? phoneNumber: string} {@param? faxNumber: string}
{$name} {if $visibleInWhois}
Visible in WHOIS
{/if}
{if isNonnull($phoneNumber)}
{$phoneNumber}
{/if} {if isNonnull($faxNumber)}
{$faxNumber} (Fax)
{/if}
{$emailAddress}
View/Edit
{/template} /** Registrar contact item page. */ {template .contact} {@param namePrefix: string} {@param item: map} {@param actualTypesLookup: map} {@param readonly: bool}

Contact Details

{call .contactInfo data="all"} {param namePrefix: $namePrefix /} {param item: $item /} {param actualTypesLookup: $actualTypesLookup /} {param readonly: $readonly /} {/call}
{/template} /** Contact info for view and edit. */ {template .contactInfo} {@param namePrefix: string} {@param item: map} {@param actualTypesLookup: map} {@param? readonly: bool} {let $possibleTypesLookup: [ ['admin', 'Primary', 'Primary contact for general issues.'], ['billing', 'Billing', 'Contact for financial communications & invoices.'], ['tech', 'Technical', 'Contact for technical communications about the registry.'], ['legal', 'Legal', 'Contact for all legal communications.'], ['marketing', 'Marketing', 'Contact for registry promotions and campaigns.'], ['abuse', 'Abuse', 'Contact for abuse complaints.'], ['whois', 'WHOIS-Inquiry', 'Contact for inquiries about WHOIS accuracy.']] /}
{call registry.soy.forms.inputFieldRow data="all"} {param label: 'Name' /} {param namePrefix: $namePrefix /} {param name: 'name' /} {/call} {call registry.soy.forms.inputFieldRow data="all"} {param label: 'Email' /} {param namePrefix: $namePrefix /} {param name: 'emailAddress' /} {/call} {call registry.soy.forms.inputFieldRow data="all"} {param label: 'Phone' /} {param namePrefix: $namePrefix /} {param name: 'phoneNumber' /} {/call} {call registry.soy.forms.inputFieldRow data="all"} {param label: 'Fax' /} {param namePrefix: $namePrefix /} {param name: 'faxNumber' /} {/call} {if $readonly} {call .contactTypeSettingsView_} {param item: $item /} {param possibleTypesLookup: $possibleTypesLookup /} {param actualTypesLookup: $actualTypesLookup /} {/call} {else} {call .contactTypeSettingsEdit_} {param item: $item /} {param namePrefix: $namePrefix /} {param possibleTypesLookup: $possibleTypesLookup /} {param actualTypesLookup: $actualTypesLookup /} {/call} {/if}
{if isNonnull($item['gaeUserId'])} {/if}
{/template} /** @private */ {template .contactTypeSettingsView_ private="true"} {@param item: map} {@param possibleTypesLookup: list>} {@param actualTypesLookup: map}
{foreach $type in $possibleTypesLookup} {if $actualTypesLookup[$type[0]]}
{$type[1]} contact
{/if} {/foreach}

{let $visibleAsAdmin: $item['visibleInWhoisAsAdmin'] == true /} {let $visibleAsTech: $item['visibleInWhoisAsTech'] == true /} {if (not $visibleAsAdmin) and (not $visibleAsTech)} Not visible in WHOIS {else} {if $visibleAsAdmin}Admin{/if} {if $visibleAsAdmin and $visibleAsTech},{sp}{/if} {if $visibleAsTech}Technical{/if} {/if} {/template} /** @private */ {template .contactTypeSettingsEdit_ private="true"} {@param item: map} {@param namePrefix: string} {@param possibleTypesLookup: list>} {@param actualTypesLookup: map} Subscribe this contact to the checked mailing lists. {call .contactCheckboxes_} {param namePrefix: $namePrefix /} {param possibleTypesLookup: $possibleTypesLookup /} {param actualTypesLookup: $actualTypesLookup /} {/call}


{call .whoisVisibleRadios_} {param description: 'Show in WHOIS as Admin contact' /} {param fieldName: $namePrefix + 'visibleInWhoisAsAdmin' /} {param visible: $item['visibleInWhoisAsAdmin'] == true /} {/call} {call .whoisVisibleRadios_} {param description: 'Show in WHOIS as Technical contact' /} {param fieldName: $namePrefix + 'visibleInWhoisAsTech' /} {param visible: $item['visibleInWhoisAsTech'] == true /} {/call} {/template} /** @private */ {template .whoisVisibleRadios_ private="true"} {@param description: string} {@param fieldName: string} {@param visible: bool} {/template} /** @private */ {template .contactCheckboxes_ private="true"} {@param namePrefix: string} {@param actualTypesLookup: map} {@param possibleTypesLookup: list>} {foreach $type in $possibleTypesLookup} {let $name: $namePrefix + 'type.' + $type[0] /} {let $checked: $actualTypesLookup[$type[0]] /}
{/foreach} {/template} /** IP address form input. */ {template .ip} {@param name: string} {@param ip: string}
{/template}