From 06c6bd1b7b00fad27fe57f41a15d0b5b700f138d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Sat, 2 Aug 2025 16:56:04 +0200 Subject: [PATCH] templates: Use HTML.attributes for all links --- src/root/build.tt | 30 +++++++++++------------ src/root/channel-contents.tt | 2 +- src/root/common.tt | 42 ++++++++++++++++----------------- src/root/dashboard.tt | 2 +- src/root/deps.tt | 2 +- src/root/job.tt | 12 +++++----- src/root/jobset-channels-tab.tt | 6 ++--- src/root/jobset-eval.tt | 20 ++++++++-------- src/root/jobset-jobs-tab.tt | 4 ++-- src/root/jobset.tt | 2 +- src/root/layout.tt | 2 +- src/root/log.tt | 8 +++---- src/root/machine-status.tt | 4 ++-- src/root/overview.tt | 2 +- src/root/runcommand-log.tt | 4 ++-- src/root/steps.tt | 4 ++-- src/root/style.tt | 10 ++++---- src/root/users.tt | 4 ++-- 18 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/root/build.tt b/src/root/build.tt index cf8e454d..818763bd 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -112,16 +112,16 @@ END; [% IF c.user_exists %] [% IF available %] [% IF build.keep %] - Unkeep + c.uri_for('/build' build.id 'keep' 0)) %]>Unkeep [% ELSE %] - Keep + c.uri_for('/build' build.id 'keep' 1)) %]>Keep [% END %] [% END %] [% IF build.finished %] - Restart + c.uri_for('/build' build.id 'restart')) %]>Restart [% ELSE %] - Cancel - Bump up + c.uri_for('/build' build.id 'cancel')) %]>Cancel + c.uri_for('/build' build.id 'bump')) %]>Bump up [% END %] [% END %] @@ -197,8 +197,8 @@ END; Part of: - evaluation [% HTML.escape(eval.id) %] - [% IF nrEvals > 1 +%] (and [% nrEvals - 1 %] others)[% END %] + c.uri_for(c.controller('JobsetEval').action_for('view'), [eval.id])) %]>evaluation [% HTML.escape(eval.id) %] + [% IF nrEvals > 1 +%] (and c.uri_for('/build' build.id 'evals')) %]>[% nrEvals - 1 %] others)[% END %] [% END %] @@ -226,9 +226,9 @@ END; Logfile: [% actualLog = cachedBuildStep ? c.uri_for('/build' cachedBuild.id 'nixlog' cachedBuildStep.stepnr) : c.uri_for('/build' build.id 'log') %] - pretty - raw - tail + actualLog) %]>pretty + actualLog _ "/raw") %]>raw + actualLog _ "/tail") %]>tail [% END %] @@ -376,14 +376,14 @@ END; Closure size: [% mibs(build.closuresize / (1024 * 1024)) %] MiB - (history) + ( chartsURL) %]>history) [% END %] [% IF build.finished && build.closuresize %] Output size: [% mibs(build.size / (1024 * 1024)) %] MiB - (history) + ( chartsURL) %]>history) [% END %] [% IF build.finished && build.buildproducts %] @@ -532,9 +532,9 @@ END; [% IF runcommandlog.uuid != undef %] [% runLog = c.uri_for('/build', build.id, 'runcommandlog', runcommandlog.uuid) %]
- pretty - raw - tail + runLog) %]>pretty + runLog) %]/raw">raw + runLog) %]/tail">tail
[% END %] diff --git a/src/root/channel-contents.tt b/src/root/channel-contents.tt index 083d6ae5..ff79dd0f 100644 --- a/src/root/channel-contents.tt +++ b/src/root/channel-contents.tt @@ -49,7 +49,7 @@ installed, you can subscribe to this channel by once executing

[% b = pkg.build %] - [% b.id %] + c.uri_for('/build' b.id)) %]>[% b.id %] [% b.get_column('releasename') || b.nixname %] [% b.system %] diff --git a/src/root/common.tt b/src/root/common.tt index 7a93cc95..beee86ca 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -55,17 +55,17 @@ BLOCK renderRelativeDate %] [% END; BLOCK renderProjectName %] -[% project %] + c.uri_for('/project' project)) %]>[% project %] [% END; BLOCK renderJobsetName %] -[% jobset %] + c.uri_for('/jobset' project jobset)) %]>[% jobset %] [% END; BLOCK renderJobName %] -[% job %] + c.uri_for('/job' project jobset job)) %]>[% job %] [% END; @@ -140,10 +140,10 @@ BLOCK renderBuildListBody; [% IF showSchedulingInfo %] [% IF busy %]Started[% ELSE %]Queued[% END %] [% END %] - [% build.id %] + link) %]>[% build.id %] [% IF !hideJobName %] - [% IF !hideJobsetName %][%build.jobset.get_column("project")%]:[%build.jobset.get_column("name")%]:[% END %][%build.get_column("job")%] + link) %]>[% IF !hideJobsetName %][%build.jobset.get_column("project")%]:[%build.jobset.get_column("name")%]:[% END %][%build.get_column("job")%] [% IF showStepName %] [% INCLUDE renderDrvInfo step=build.buildsteps releasename=build.nixname %] [% END %] @@ -158,7 +158,7 @@ BLOCK renderBuildListBody; [% END; IF linkToAll %] - More... + linkToAll) %]>More... [% END; END; @@ -176,7 +176,7 @@ BLOCK renderBuildList; END; -BLOCK renderLink %][% title %][% END; +BLOCK renderLink %] uri) %]>[% title %][% END; BLOCK maybeLink; @@ -216,12 +216,12 @@ BLOCK editString; %] BLOCK renderFullBuildLink; - INCLUDE renderFullJobNameOfBuild build=build %] build [% build.id %][% + INCLUDE renderFullJobNameOfBuild build=build %] c.uri_for('/build' build.id)) %]>build [% build.id %][% END; BLOCK renderBuildIdLink; %] -build [% id %] + c.uri_for('/build' id)) %]>build [% id %] [% END; @@ -320,7 +320,7 @@ END; BLOCK renderShortInputValue; IF input.type == "build" || input.type == "sysbuild" %] - [% input.dependency.id %] + c.uri_for('/build' input.dependency.id)) %]>[% input.dependency.id %] [% ELSIF input.type == "string" %] "[% HTML.escape(input.value) %]" [% ELSIF input.type == "nix" || input.type == "boolean" %] @@ -338,7 +338,7 @@ BLOCK renderDiffUri; url = bi1.uri; path = url.replace(base, ''); IF url.match(base) %] - [% contents %] + m.uri.replace('_path_', path).replace('_1_', bi1.revision).replace('_2_', bi2.revision)) %]>[% contents %] [% nouri = 0; END; END; @@ -347,13 +347,13 @@ BLOCK renderDiffUri; url = res.0; branch = res.1; IF bi1.type == "hg" || bi1.type == "git" %] - c.uri_for('/api/scmdiff', { uri = url, rev1 = bi1.revision, rev2 = bi2.revision, type = bi1.type, branch = branch - })) %]">[% contents %] + })) %]>[% contents %] [% ELSE; contents; END; @@ -443,10 +443,10 @@ BLOCK renderInputDiff; %] BLOCK renderPager %]