google-nomulus/java/google/registry/ui/soy/registrar/Host.soy
lukes 4de8d3eae1 Migrate {css} and {xid} tags to new builtinfunctions css() and xid()
Output should be identical in either syntax, and migration will bring css and xid into consistency with other soy functions, plus it'll allow us to simplify the soy parser.

LSC: https://docs.google.com/document/d/1evNu02pVXGm1QIcN0dTmNi-GnhbCKOWdrZwBJmcNaU0/edit#

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

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164887843
2017-08-29 15:56:43 -04:00

108 lines
3.4 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.host autoescape="strict"}
/**
* Set view for hosts.
*/
{template .set}
<div class="{css('set')} {css('host')}">
<p>Please enter a query for a single host in the form "host/[hostname]".
</div>
{/template}
/**
* Item view for host.
* @param? item
* @param? readonly passed through to field rendering.
*/
{template .item}
<form name="item" class="{css('item')} {css('host')}">
<h1>
{if isNonnull($item['host:name'])}
{$item['host:name']['keyValue']}
{else}
New Host
{/if}
</h1>
<table>
<tr class="{css('section-lead')}">
<th colspan="2"><h2>Host</h2></th>
</tr>
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Name *' /}
{param name: isNonnull($item['host:name']) ? 'host:chgName' : 'host:name' /}
{param value: $item['host:name'] /}
{/call}
<tr class="{css('section-lead')}">
<th colspan="2">
<h3>Addresses</h3>
<button id="domain-host-addr-add-button" type="button"
class="{css('kd-button')} {css('reg-add')}"
{if $readonly}disabled{/if}>
Add Address
</button>
</th>
</tr>
{if isNonnull($item['host:addr'])}
{foreach $addr in $item['host:addr']}
{if not $readonly}
<input type="hidden"
name="host:oldAddr[{index($addr)}].value"
value="{$item['host:addr'][index($addr)]['keyValue']}">
{/if}
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Address No. ' + (index($addr) + 1) /}
{param name: 'host:addr[' + index($addr) + '].value' /}
{param value: $item['host:addr'][index($addr)] /}
{/call}
{/foreach}
{/if}
<tr id="domain-host-addrs-footer"></tr>
</table>
{if isNonnull($item['host:name'])}
<input type="hidden"
name="host:name"
value="{$item['host:name']['keyValue']}">
{/if}
</form>
{/template}
/**
* Item view for host.
* @param? item
* @param? readonly passed through to field rendering.
*/
{template .update}
<form name="item" class="{css('item')} {css('host')}">
<h1>{$item['host:name']['keyValue']}</h1>
<table>
<tr class="{css('section-lead')}">
<th colspan="2"><h2>Host</h2></th>
</tr>
{call registry.soy.forms.inputFieldRowWithValue data="all"}
{param label: 'Name' /}
{param name: 'host:chgName' /}
{param value: $item['host:name'] /}
{/call}
</table>
{if isNonnull($item['host:name'])}
<input type="hidden" name="host:name" value="{$item['host:name']['keyValue']}">
{/if}
</form>
{/template}