Roll back changelist 180942763

*** Reason for rollback ***

Breaks the FOSS build.

We'll reincorporate this change once Closure Rules is properly updated to accommodate it.

*** Original change description ***

Change all foreach loops in Soy templates to use the for loop syntax

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 2 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 gramma...

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180961695
This commit is contained in:
mcilwain 2018-01-05 12:37:30 -08:00 committed by Ben McIlwain
parent d52a701f50
commit ffcfa283f6
24 changed files with 103 additions and 109 deletions

View file

@ -48,9 +48,9 @@
{/if}
<contact:addr>
{if $street}
{for $s in $street}
{foreach $s in $street}
<contact:street>{$s}</contact:street>
{/for}
{/foreach}
{/if}
{if $city}
<contact:city>{$city}</contact:city>

View file

@ -39,15 +39,15 @@
<domain:period unit="y">{$period}</domain:period>
{if isNonnull($nameservers) and length($nameservers) > 0}
<domain:ns>
{for $nameserver in $nameservers}
{foreach $nameserver in $nameservers}
<domain:hostObj>{$nameserver}</domain:hostObj>
{/for}
{/foreach}
</domain:ns>
{/if}
<domain:registrant>{$registrant}</domain:registrant>
{for $type in keys($contacts)}
{foreach $type in keys($contacts)}
<domain:contact type="{$type}">{$contacts[$type]}</domain:contact>
{/for}
{/foreach}
<domain:authInfo>
<domain:pw>{$authInfo}</domain:pw>
</domain:authInfo>
@ -70,14 +70,14 @@
</allocate:create>
{if isNonnull($dsRecords) and length($dsRecords) > 0}
<secDNS:create xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
{for $dsRecord in $dsRecords}
{foreach $dsRecord in $dsRecords}
<secDNS:dsData>
<secDNS:keyTag>{$dsRecord['keyTag']}</secDNS:keyTag>
<secDNS:alg>{$dsRecord['algorithm']}</secDNS:alg>
<secDNS:digestType>{$dsRecord['digestType']}</secDNS:digestType>
<secDNS:digest>{$dsRecord['digest']}</secDNS:digest>
</secDNS:dsData>
{/for}
{/foreach}
</secDNS:create>
{/if}
</extension>

View file

@ -24,9 +24,9 @@
<command>
<check>
<domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
{for $d in $domainNames}
{foreach $d in $domainNames}
<domain:name>{$d}</domain:name>
{/for}
{/foreach}
</domain:check>
</check>
<clTRID>RegistryTool</clTRID>

View file

@ -24,9 +24,9 @@
<command>
<check>
<domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
{for $d in $domainNames}
{foreach $d in $domainNames}
<domain:name>{$d}</domain:name>
{/for}
{/foreach}
</domain:check>
</check>
<extension>

View file

@ -24,20 +24,20 @@
<command>
<check>
<domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
{for $d in $domainNames}
{foreach $d in $domainNames}
<domain:name>{$d}</domain:name>
{/for}
{/foreach}
</domain:check>
</check>
<extension>
<fee:check xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
{for $d in $domainNames}
{foreach $d in $domainNames}
<fee:domain>
<fee:name>{$d}</fee:name>
<fee:command>create</fee:command>
<fee:period unit="y">1</fee:period>
</fee:domain>
{/for}
{/foreach}
</fee:check>
</extension>
<clTRID>RegistryTool</clTRID>

View file

@ -36,18 +36,18 @@
{/if}
{if length($nameservers) > 0}
<domain:ns>
{for $s in $nameservers}
{foreach $s in $nameservers}
<domain:hostObj>{$s}</domain:hostObj>
{/for}
{/foreach}
</domain:ns>
{/if}
<domain:registrant>{$registrant}</domain:registrant>
{for $admin in $admins}
{foreach $admin in $admins}
<domain:contact type="admin">{$admin}</domain:contact>
{/for}
{for $tech in $techs}
{/foreach}
{foreach $tech in $techs}
<domain:contact type="tech">{$tech}</domain:contact>
{/for}
{/foreach}
<domain:authInfo>
<domain:pw>{$password}</domain:pw>
</domain:authInfo>

View file

@ -42,40 +42,40 @@
<domain:add>
{if length($addNameservers) > 0}
<domain:ns>
{for $s in $addNameservers}
{foreach $s in $addNameservers}
<domain:hostObj>{$s}</domain:hostObj>
{/for}
{/foreach}
</domain:ns>
{/if}
{for $admin in $addAdmins}
{foreach $admin in $addAdmins}
<domain:contact type="admin">{$admin}</domain:contact>
{/for}
{for $tech in $addTechs}
{/foreach}
{foreach $tech in $addTechs}
<domain:contact type="tech">{$tech}</domain:contact>
{/for}
{for $status in $addStatuses}
{/foreach}
{foreach $status in $addStatuses}
<domain:status s="{$status}"/>
{/for}
{/foreach}
</domain:add>
{/if}
{if $remove}
<domain:rem>
{if length($removeNameservers) > 0}
<domain:ns>
{for $s in $removeNameservers}
{foreach $s in $removeNameservers}
<domain:hostObj>{$s}</domain:hostObj>
{/for}
{/foreach}
</domain:ns>
{/if}
{for $admin in $removeAdmins}
{foreach $admin in $removeAdmins}
<domain:contact type="admin">{$admin}</domain:contact>
{/for}
{for $tech in $removeTechs}
{/foreach}
{foreach $tech in $removeTechs}
<domain:contact type="tech">{$tech}</domain:contact>
{/for}
{for $status in $removeStatuses}
{/foreach}
{foreach $status in $removeStatuses}
<domain:status s="{$status}"/>
{/for}
{/foreach}
</domain:rem>
{/if}
{if $change}

View file

@ -28,14 +28,14 @@
<host:create xmlns:host="urn:ietf:params:xml:ns:host-1.0">
<host:name>{$hostname}</host:name>
{if $ipv4addresses}
{for $ipv4 in $ipv4addresses}
{foreach $ipv4 in $ipv4addresses}
<host:addr ip="v4">{$ipv4}</host:addr>
{/for}
{/foreach}
{/if}
{if $ipv6addresses}
{for $ipv6 in $ipv6addresses}
{foreach $ipv6 in $ipv6addresses}
<host:addr ip="v6">{$ipv6}</host:addr>
{/for}
{/foreach}
{/if}
</host:create>
</create>

View file

@ -28,11 +28,11 @@
<host:update
xmlns:host="urn:ietf:params:xml:ns:host-1.0">
<host:name>{$name}</host:name>
{for $ip in $ipAddresses}
{foreach $ip in $ipAddresses}
<host:rem>
<host:addr ip="{$ip['type']}">{$ip['address']}</host:addr>
</host:rem>
{/for}
{/foreach}
</host:update>
</update>
<extension>

View file

@ -34,26 +34,26 @@
<domain:add>
{if length($hostsToAdd) > 0}
<domain:ns>
{for $ha in $hostsToAdd}
{foreach $ha in $hostsToAdd}
<domain:hostObj>{$ha}</domain:hostObj>
{/for}
{/foreach}
</domain:ns>
{/if}
{for $la in $locksToApply}
{foreach $la in $locksToApply}
<domain:status s="{$la}" />
{/for}
{/foreach}
</domain:add>
<domain:rem>
{if length($hostsToRemove) > 0}
<domain:ns>
{for $hr in $hostsToRemove}
{foreach $hr in $hostsToRemove}
<domain:hostObj>{$hr}</domain:hostObj>
{/for}
{/foreach}
</domain:ns>
{/if}
{for $lr in $locksToRemove}
{foreach $lr in $locksToRemove}
<domain:status s="{$lr}" />
{/for}
{/foreach}
</domain:rem>
</domain:update>
</update>
@ -64,14 +64,14 @@
</secDNS:rem>
{if length($newDsData) > 0}
<secDNS:add>
{for $ds in $newDsData}
{foreach $ds in $newDsData}
<secDNS:dsData>
<secDNS:keyTag>{$ds.keyTag}</secDNS:keyTag>
<secDNS:alg>{$ds.alg}</secDNS:alg>
<secDNS:digestType>{$ds.digestType}</secDNS:digestType>
<secDNS:digest>{$ds.digest}</secDNS:digest>
</secDNS:dsData>
{/for}
{/foreach}
</secDNS:add>
{/if}
</secDNS:update>

View file

@ -31,14 +31,14 @@
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>{$domainName}</domain:name>
<domain:add>
{for $a in $locksToApply}
{foreach $a in $locksToApply}
<domain:status s="{$a}" lang="en"></domain:status>
{/for}
{/foreach}
</domain:add>
<domain:rem>
{for $r in $locksToRemove}
{foreach $r in $locksToRemove}
<domain:status s="{$r}" lang="en"></domain:status>
{/for}
{/foreach}
</domain:rem>
</domain:update>
</update>