From 5620e3c38627b5a14ee74c02d18713ae4ba65c02 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 14 Feb 2013 17:51:09 +0100 Subject: [PATCH] Fix indentation and get rid of some unnecessary whitespace in the output --- src/root/common.tt | 624 +++++++++++++++++++++++---------------------- 1 file changed, 319 insertions(+), 305 deletions(-) diff --git a/src/root/common.tt b/src/root/common.tt index 5473b2a2..98a37758 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -1,65 +1,67 @@ -[% USE date %] -[% USE String %] -[% USE HTML %] +[% +USE date; +USE String; +USE HTML; -[% inputTypes = - { "svn" = "Subversion export" - , "svn-checkout" = "Subversion checkout" - , "bzr" = "Bazaar export" - , "bzr-checkout" = "Bazaar checkout" - , "git" = "Git checkout" - , "hg" = "Mercurial checkout" - , "string" = "String value" - , "boolean" = "Boolean" - , "path" = "Local path" - , "build" = "Build output" - , "sysbuild" = "Build output (same system)" - } -%] +inputTypes = + { "svn" = "Subversion export" + , "svn-checkout" = "Subversion checkout" + , "bzr" = "Bazaar export" + , "bzr-checkout" = "Bazaar checkout" + , "git" = "Git checkout" + , "hg" = "Mercurial checkout" + , "string" = "String value" + , "boolean" = "Boolean" + , "path" = "Local path" + , "build" = "Build output" + , "sysbuild" = "Build output (same system)" + }; + +BLOCK renderDateTime; +date.format(timestamp, '%Y-%m-%d %H:%M:%S'); +END; -[% BLOCK renderDateTime %] - [% date.format(timestamp, '%Y-%m-%d %H:%M:%S') %] -[% END %] +BLOCK renderProjectName %] +[% project %] +[% END; -[% BLOCK renderProjectName %] -[% project %][% END %] +BLOCK renderJobsetName %] +[% jobset %] +[% END; -[% BLOCK renderJobsetName %] -[% jobset %][% END %] +BLOCK renderJobName %] +[% job %] +[% END; -[% BLOCK renderJobName %] -[% job %][% END %] - - -[% BLOCK renderFullJobsetName %] +BLOCK renderFullJobsetName %] [% INCLUDE renderProjectName %]:[% INCLUDE renderJobsetName %] -[% END %] +[% END; -[% BLOCK renderFullJobName %] +BLOCK renderFullJobName %] [% IF !hideProjectName; INCLUDE renderProjectName %]:[% END; IF !hideJobsetName; INCLUDE renderJobsetName %]:[% END; INCLUDE renderJobName %] -[% END %] +[% END; -[% BLOCK renderFullJobNameOfBuild %] - [% INCLUDE renderFullJobName project=build.get_column("project") jobset = build.get_column("jobset") job = build.get_column("job") %] -[% END %] +BLOCK renderFullJobNameOfBuild; + INCLUDE renderFullJobName project=build.get_column("project") jobset = build.get_column("jobset") job = build.get_column("job"); +END; -[% BLOCK renderDuration %] -[% IF duration >= 24 * 60 * 60 %][% duration div (24 * 60 * 60) %]d[% END %] -[% IF duration >= 60 * 60 %][% duration div (60 * 60) % 24 %]h[% END %] -[% IF duration >= 60 %][% duration div 60 % 60 %]m[% END %] -[% duration % 60 %]s -[% END %] +BLOCK renderDuration; + IF duration >= 24 * 60 * 60; duration div (24 * 60 * 60) %]d[% END; + IF duration >= 60 * 60; duration div (60 * 60) % 24 %]h[% END; + IF duration >= 60; duration div 60 % 60 %]m[% END; + duration % 60 %]s[% +END; -[% BLOCK renderBuildListHeader %] +BLOCK renderBuildListHeader %] @@ -88,70 +90,73 @@ -[% END %] +[% END; -[% BLOCK renderBuildListBody %] - [% odd = 0 %] - [% FOREACH build IN builds %] - - [% IF !hideResultInfo %] - - [% END %] - [% IF showSchedulingInfo %] - - [% END %] - - [% IF showSchedulingInfo %] - - [% END %] - [% IF !hideJobName %] - - [% END %] - - - - [% IF showStatusChange %] - - [% END %] - [% IF showDescription %] - - [% END %] - + +BLOCK renderBuildListBody; + odd = 0; + FOREACH build IN builds; %] + + [% IF !hideResultInfo %] + [% END %] -[% END %] + [% IF showSchedulingInfo %] + + [% END %] + + [% IF showSchedulingInfo %] + + [% END %] + [% IF !hideJobName %] + + [% END %] + + + + [% IF showStatusChange %] + + [% END %] + [% IF showDescription %] + + [% END %] + + [% END; +END; -[% BLOCK renderBuildListFooter %] + +BLOCK renderBuildListFooter %]
- [% INCLUDE renderBuildStatusIcon size=16 busy=(showSchedulingInfo ? 1 : 0) buildstatus=build.buildstatus %] - [% IF build.busy %]Started[% ELSE %]Queued[% END %][% build.id %][% build.priority %][% INCLUDE renderFullJobNameOfBuild %][% !showSchedulingInfo and build.get_column('releasename') ? build.get_column('releasename') : build.nixname %][% build.system %][% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %] - [% IF build.get_column('statusChangeTime') %] - - [% date.format(build.get_column('statusChangeTime'), '%Y-%m-%d %H:%M:%S') %] - - [% ELSE %] - never - [% END %] - [% build.description %]
+ [% INCLUDE renderBuildStatusIcon size=16 busy=(showSchedulingInfo ? 1 : 0) buildstatus=build.buildstatus %] + [% IF build.busy %]Started[% ELSE %]Queued[% END %][% build.id %][% build.priority %][% INCLUDE renderFullJobNameOfBuild %][% !showSchedulingInfo and build.get_column('releasename') ? build.get_column('releasename') : build.nixname %][% build.system %][% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %] + [% IF build.get_column('statusChangeTime') %] + + [% date.format(build.get_column('statusChangeTime'), '%Y-%m-%d %H:%M:%S') %] + + [% ELSE %] + never + [% END %] + [% build.description %]
-[% END %] - -[% BLOCK renderBuildList %] -[% INCLUDE renderBuildListHeader %] -[% INCLUDE renderBuildListBody %] -[% INCLUDE renderBuildListFooter %] -[% END %] +[% END; -[% BLOCK renderLink %][% title %][% END %] +BLOCK renderBuildList; + INCLUDE renderBuildListHeader; + INCLUDE renderBuildListBody; + INCLUDE renderBuildListFooter; +END; -[% BLOCK showBuildStats %] +BLOCK renderLink %][% title %][% END; + + +BLOCK showBuildStats %] @@ -178,26 +183,27 @@
Finished builds:[% busyBuilds %]
- -[% END %] +[% END; -[% BLOCK renderViewJobName %] -[% IF job.description; HTML.escape(job.description); ELSE %][% job.job %] ([% job.attrs %])[% END %] -[% END %] +BLOCK renderViewJobName; + IF job.description; HTML.escape(job.description); ELSE %][% job.job %] ([% job.attrs %])[% END; +END; -[% BLOCK maybeLink %] - [% IF uri %] uri, class => class) %][% IF confirmmsg %]onclick="javascript:return confirm('[% confirmmsg %]')"[% END %]>[% content %][% ELSE; content; END %] -[% END %] +BLOCK maybeLink; + IF uri %] uri, class => class) %][% IF confirmmsg %]onclick="javascript:return confirm('[% confirmmsg %]')"[% END %]>[% content %][% ELSE; content; END; +END; -[% BLOCK maybeButton %] - [% IF uri %] uri) %][% IF confirmmsg %]onclick="javascript:return confirm('[% confirmmsg %]')"[% END %]>[% content %][% ELSE; content; END %] -[% END %] -[% BLOCK renderSelection %] - [% IF edit %] - [% IF radiobuttons %] +BLOCK maybeButton; + IF uri %] uri); IF confirmmsg %]onclick="javascript:return confirm('[% confirmmsg %]')"[% END; content %][% ELSE; content; END; +END; + + +BLOCK renderSelection; + IF edit; + IF radiobuttons; %]
[% FOREACH name IN options.keys.sort %]