ENHANCEMENT: refactoring template "control" loops into "loop" and "with" to fit with the new template syntax

This commit is contained in:
Julian Seidenberg 2012-05-18 16:32:44 +12:00
parent fb64cad34e
commit aa7bc23992
10 changed files with 41 additions and 41 deletions

View File

@ -1,5 +1,5 @@
<% if Pages %> <% if Pages %>
<% control Pages %> <% loop Pages %>
<% if Last %>$Title.XML<% else %><a href="$Link">$MenuTitle.XML</a> &raquo;<% end_if %> <% if Last %>$Title.XML<% else %><a href="$Link">$MenuTitle.XML</a> &raquo;<% end_if %>
<% end_control %> <% end_loop %>
<% end_if %> <% end_if %>

View File

@ -9,15 +9,15 @@
</thead> </thead>
<tbody> <tbody>
<% control Versions %> <% loop Versions %>
<tr id="page-$RecordID-version-$Version" class="$EvenOdd $PublishedClass<% if not WasPublished %><% if not Active %> ui-helper-hidden<% end_if %><% end_if %><% if Active %> active<% end_if %>" data-published="<% if WasPublished %>true<% else %>false<% end_if %>"> <tr id="page-$RecordID-version-$Version" class="$EvenOdd $PublishedClass<% if not WasPublished %><% if not Active %> ui-helper-hidden<% end_if %><% end_if %><% if Active %> active<% end_if %>" data-published="<% if WasPublished %>true<% else %>false<% end_if %>">
<td class="ui-helper-hidden"><input type="checkbox" name="Versions[]" id="cms-version-{$Version}" value="$Version"<% if Active %> checked="checked"<% end_if %> /></td> <td class="ui-helper-hidden"><input type="checkbox" name="Versions[]" id="cms-version-{$Version}" value="$Version"<% if Active %> checked="checked"<% end_if %> /></td>
<% control LastEdited %> <% with LastEdited %>
<td class="last-edited first-column" title="$Ago - $Nice">$Nice</td> <td class="last-edited first-column" title="$Ago - $Nice">$Nice</td>
<% end_control %> <% end_with %>
<td><% if Author %>$Author.FirstName $Author.Surname.Initial<% else %><% _t('UNKNOWN','Unknown') %><% end_if %></td> <td><% if Author %>$Author.FirstName $Author.Surname.Initial<% else %><% _t('UNKNOWN','Unknown') %><% end_if %></td>
<td class="last-column"><% if Published %><% if Publisher %>$Publisher.FirstName $Publisher.Surname.Initial<% else %><% _t('UNKNOWN','Unknown') %><% end_if %><% else %><% _t('NOTPUBLISHED','Not published') %><% end_if %></td> <td class="last-column"><% if Published %><% if Publisher %>$Publisher.FirstName $Publisher.Surname.Initial<% else %><% _t('UNKNOWN','Unknown') %><% end_if %><% else %><% _t('NOTPUBLISHED','Not published') %><% end_if %></td>
</tr> </tr>
<% end_control %> <% end_loop %>
</tbody> </tbody>
</table> </table>

View File

@ -2,27 +2,27 @@
<div class="cms-content-header north"> <div class="cms-content-header north">
<div> <div>
<% control EditForm %> <% with EditForm %>
<% include BackLink_Button %> <% include BackLink_Button %>
<h2 id="page-title-heading"> <h2 id="page-title-heading">
<% control Controller %> <% with Controller %>
<% include CMSSectionIcon %> <% include CMSSectionIcon %>
<% include CMSBreadcrumbs %> <% include CMSBreadcrumbs %>
<% end_control %> <% end_with %>
</h2> </h2>
<% if Fields.hasTabset %> <% if Fields.hasTabset %>
<% with Fields.fieldByName('Root') %> <% with Fields.fieldByName('Root') %>
<div class="cms-content-header-tabs"> <div class="cms-content-header-tabs">
<ul> <ul>
<% control Tabs %> <% loop Tabs %>
<li<% if extraClass %> class="$extraClass"<% end_if %>><a href="#$id">$Title</a></li> <li<% if extraClass %> class="$extraClass"<% end_if %>><a href="#$id">$Title</a></li>
<% end_control %> <% end_loop %>
</ul> </ul>
</div> </div>
<% end_with %> <% end_with %>
<% end_if %> <% end_if %>
<% end_control %> <% end_with %>
</div> </div>
</div> </div>

View File

@ -8,17 +8,17 @@
<fieldset> <fieldset>
<% if Legend %><legend>$Legend</legend><% end_if %> <% if Legend %><legend>$Legend</legend><% end_if %>
<% control Fields %> <% loop Fields %>
$FieldHolder $FieldHolder
<% end_control %> <% end_loop %>
<div class="clear"><!-- --></div> <div class="clear"><!-- --></div>
</fieldset> </fieldset>
<% if Actions %> <% if Actions %>
<div class="Actions"> <div class="Actions">
<% control Actions %> <% loop Actions %>
$Field $Field
<% end_control %> <% end_loop %>
<% if CurrentPage.LinkPreview %> <% if CurrentPage.LinkPreview %>
<a href="$CurrentPage.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview"> <a href="$CurrentPage.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
<% _t('LeftAndMain.PreviewButton', 'Preview') %> &raquo; <% _t('LeftAndMain.PreviewButton', 'Preview') %> &raquo;

View File

@ -9,9 +9,9 @@
<fieldset> <fieldset>
<% if Legend %><legend>$Legend</legend><% end_if %> <% if Legend %><legend>$Legend</legend><% end_if %>
<% control Fields %> <% loop Fields %>
$FieldHolder $FieldHolder
<% end_control %> <% end_loop %>
<div class="clear"><!-- --></div> <div class="clear"><!-- --></div>
</fieldset> </fieldset>
</div> </div>
@ -19,9 +19,9 @@
<div class="cms-content-actions south"> <div class="cms-content-actions south">
<% if Actions %> <% if Actions %>
<div class="Actions"> <div class="Actions">
<% control Actions %> <% loop Actions %>
$Field $Field
<% end_control %> <% end_loop %>
<% if Controller.LinkPreview %> <% if Controller.LinkPreview %>
<a href="$Controller.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview"> <a href="$Controller.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
<% _t('LeftAndMain.PreviewButton', 'Preview') %> &raquo; <% _t('LeftAndMain.PreviewButton', 'Preview') %> &raquo;

View File

@ -17,18 +17,18 @@
<fieldset> <fieldset>
<% if Legend %><legend>$Legend</legend><% end_if %> <% if Legend %><legend>$Legend</legend><% end_if %>
<% control Fields %> <% loop Fields %>
$FieldHolder $FieldHolder
<% end_control %> <% end_loop %>
</fieldset> </fieldset>
</div> </div>
<div class="cms-content-actions south"> <div class="cms-content-actions south">
<% if Actions %> <% if Actions %>
<div class="Actions"> <div class="Actions">
<% control Actions %> <% loop Actions %>
$Field $Field
<% end_control %> <% end_loop %>
</div> </div>
<% end_if %> <% end_if %>
</div> </div>

View File

@ -4,9 +4,9 @@
</p> </p>
<ul> <ul>
<% control UnsuccessfulFiles %> <% loop UnsuccessfulFiles %>
<li>$File</li> <li>$File</li>
<% end_control %> <% end_loop %>
</ul> </ul>
<% else %> <% else %>
<p style="margin: 1em 0"> <p style="margin: 1em 0">

View File

@ -2,16 +2,16 @@
<div class="cms-content-header north"> <div class="cms-content-header north">
<div> <div>
<% control EditForm %> <% with EditForm %>
<% include BackLink_Button %> <% include BackLink_Button %>
<h2 id="page-title-heading"> <h2 id="page-title-heading">
<% control Controller %> <% with Controller %>
<% include CMSSectionIcon %> <% include CMSSectionIcon %>
<% include CMSBreadcrumbs %> <% include CMSBreadcrumbs %>
<% end_control %> <% end_with %>
</h2> </h2>
<% end_control %> <% end_with %>
</div> </div>
</div> </div>

View File

@ -13,11 +13,11 @@
<h4><% _t('ReportAdminForm.FILTERBY', 'Filter by') %></h4> <h4><% _t('ReportAdminForm.FILTERBY', 'Filter by') %></h4>
<div class="filters"> <div class="filters">
<% control FieldMap.Filters %> <% loop FieldMap.Filters %>
<% control Children %> <% loop Children %>
$FieldHolder $FieldHolder
<% end_control %> <% end_loop %>
<% end_control %> <% end_loop %>
</div> </div>
<div id="action_updatereport"> <div id="action_updatereport">
@ -31,7 +31,7 @@
$FieldMap.ReportContent.FieldHolder $FieldMap.ReportContent.FieldHolder
<% control HiddenFields %>$Field<% end_control %> <% loop HiddenFields %>$Field<% end_loop %>
</fieldset> </fieldset>
</div> </div>

View File

@ -8,19 +8,19 @@
<%-- <body onload="window.print();"> --%> <%-- <body onload="window.print();"> --%>
<body> <body>
<% control Form.Controller %> <% with Form.Controller %>
<h1 style="margin-bottom: 0">$CurrentReport.Title</h1> <h1 style="margin-bottom: 0">$CurrentReport.Title</h1>
<% control CurrentReport.getCmsFields %> <% with CurrentReport.getCmsFields %>
<% if Name == Filters %> <% if Name == Filters %>
<h2 style="margin-bottom: 0; margin-top: 0;">Filters</h2> <h2 style="margin-bottom: 0; margin-top: 0;">Filters</h2>
<ul style="margin-top: 0"> <ul style="margin-top: 0">
<% control FieldSet %> <% loop FieldSet %>
<li>$Title = $performReadonlyTransformation.Field</li> <li>$Title = $performReadonlyTransformation.Field</li>
<% end_control %> <% end_loop %>
</ul> </ul>
<% end_if %> <% end_if %>
<% end_control %> <% end_with %>
<% end_control %> <% end_with %>
<% include TableListField %> <% include TableListField %>
</body> </body>
</html> </html>