mirror of
https://github.com/google/nomulus.git
synced 2025-05-06 06:57:50 +02:00
This also updates to a newer version of Closure Rules and fixes a protobuf dep compile issue. Full description of the change: Soy supports 2 kinds of loops: * foreach- for iterating over items in a collection, e.g. {foreach $item in $list}...{/foreach} * for - for indexed iteration, e.g. {for $i in range(0, 10)}...{/for} The reason Soy has two different loops is an accident of history; Soy didn’t use to have a proper grammar for expressions and so the alternate ‘for...range’ syntax was added to make it possible to write indexed loops. As the grammar has improved having the two syntaxes is no longer necessary and so we are eliminating one of them. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=182843207
108 lines
3.3 KiB
Text
108 lines
3.3 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}
|
|
|
|
|
|
/**
|
|
* 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'])}
|
|
{for $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}
|
|
{/for}
|
|
{/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}
|