Merge "Revert "Soy: bump version and use new "??" operator""
diff --git a/WORKSPACE b/WORKSPACE
index b1bedac..0c55d21 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -140,8 +140,8 @@
maven_jar(
name = "soy",
- artifact = "com.google.template:soy:2023-09-13",
- sha1 = "b88a029df7408c58452f80d6518723f1386d69b5",
+ artifact = "com.google.template:soy:2022-07-20",
+ sha1 = "f64eb90da6d91beddf11653865c90f26d26710cf",
)
FLOGGER_VERS = "0.7.4"
diff --git a/resources/com/google/gitiles/templates/Common.soy b/resources/com/google/gitiles/templates/Common.soy
index b47eb2c..5e6bf11 100644
--- a/resources/com/google/gitiles/templates/Common.soy
+++ b/resources/com/google/gitiles/templates/Common.soy
@@ -49,13 +49,13 @@
<link rel="stylesheet" type="text/css" href="{$url}">
{/for}
{/if}
- {call customHeadTagPart variant="'' + ($customVariant ?? '')" /}
+ {delcall gitiles.customHeadTagPart variant="$customVariant ?: ''" /}
</head>
<body class="Site">
<header class="Site-header">
<div class="Header">
- {call customHeader variant="'' + ($customVariant ?? '')" /}
+ {delcall gitiles.customHeader variant="$customVariant ?: ''" /}
{if $menuEntries and length($menuEntries)}
<div class="Header-menu">
@@ -95,14 +95,14 @@
* This can be used to include per-project CSS/JS by
* providing custom variants.
*/
-{template customHeadTagPart modifiable="true" legacydeltemplatenamespace="gitiles.customHeadTagPart" usevarianttype="string"}
+{deltemplate gitiles.customHeadTagPart}
<!-- default customHeadTagPart -->
-{/template}
+{/deltemplate}
/**
* Default custom header implementation for Gitiles.
*/
-{template customHeader modifiable="true" legacydeltemplatenamespace="gitiles.customHeader" usevarianttype="string"}
+{deltemplate gitiles.customHeader}
{@inject SITE_TITLE: string}
<!-- default customHeader -->
<div class="Header-title">
@@ -110,44 +110,44 @@
{$SITE_TITLE}
{/msg}
</div>
-{/template}
+{/deltemplate}
/**
* Footer 'powered by' element
*
* Please call this in custom variants as well.
*/
-{template footerPoweredBy modifiable="true" legacydeltemplatenamespace="gitiles.footerPoweredBy"}
+{deltemplate gitiles.footerPoweredBy}
<span class="Footer-poweredBy">
Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a>
</span>
-{/template}
+{/deltemplate}
/**
* Footer format badge
*
* You can use this in custom footers as well.
*/
-{template footerFormatBadge modifiable="true" legacydeltemplatenamespace="gitiles.footerFormatBadge"}
+{deltemplate gitiles.footerFormatBadge}
<span class="Footer-formats">
<a class="u-monospace Footer-formatsItem" href="?format=TEXT">{msg desc="text format"}txt{/msg}</a>
{sp}
<a class="u-monospace Footer-formatsItem" href="?format=JSON">{msg desc="JSON format"}json{/msg}</a>
</span>
-{/template}
+{/deltemplate}
/**
* Default Footer
*/
-{template customFooter modifiable="true" legacydeltemplatenamespace="gitiles.customFooter" usevarianttype="string"}
+{deltemplate gitiles.customFooter}
<!-- default customFooter -->
<footer class="Site-footer">
<div class="Footer">
- {call footerPoweredBy /}
- {call footerFormatBadge /}
+ {delcall gitiles.footerPoweredBy /}
+ {delcall gitiles.footerFormatBadge /}
</div>
</footer>
-{/template}
+{/deltemplate}
/**
* Main footer.
@@ -159,7 +159,7 @@
{@param? customVariant: ?} /** variant name for custom styling. */
</div> <!-- Container -->
</div> <!-- Site-content -->
- {call customFooter variant="'' + ($customVariant ?? '')" /}
+ {delcall gitiles.customFooter variant="$customVariant ?: ''" /}
</body>
</html>
{/template}
diff --git a/resources/com/google/gitiles/templates/Doc.soy b/resources/com/google/gitiles/templates/Doc.soy
index ac32006..db46994 100644
--- a/resources/com/google/gitiles/templates/Doc.soy
+++ b/resources/com/google/gitiles/templates/Doc.soy
@@ -18,14 +18,14 @@
/**
* Default Doc Footer
*/
-{template customDocFooter modifiable="true" legacydeltemplatenamespace="gitiles.customDocFooter" usevarianttype="string"}
+{deltemplate gitiles.customDocFooter}
{@param? sourceUrl: ?} /** url for source view of the page. */
{@param? logUrl: ?} /** url for log history of page. */
{@param? blameUrl: ?} /** url for blame of page source. */
<!-- default customDocFooter -->
<footer class="Site-footer">
<div class="Footer">
- {call common.footerPoweredBy /}
+ {delcall gitiles.footerPoweredBy /}
<div class="Footer-links">
{if $sourceUrl}<a class="Footer-link" href="{$sourceUrl}">{msg desc="text for the source link"}source{/msg}</a>{/if}
{if $logUrl}<a class="Footer-link" href="{$logUrl}">{msg desc="text for the log link"}log{/msg}</a>{/if}
@@ -33,7 +33,7 @@
</div>
</div>
</footer>
-{/template}
+{/deltemplate}
/**
* Documentation page rendered from markdown.
@@ -59,7 +59,7 @@
<link rel="stylesheet" type="text/css" href="{$staticUrls.BASE_CSS_URL}" />
<link rel="stylesheet" type="text/css" href="{$staticUrls.DOC_CSS_URL}" />
<link rel="stylesheet" type="text/css" href="{$staticUrls.PRETTIFY_CSS_URL}" />
- {call common.customHeadTagPart variant="'' + ($customVariant ?? '')" /}
+ {delcall gitiles.customHeadTagPart variant="$customVariant ?: ''" /}
</head>
<body class="Site">
<header class="Site-header {if $navbarHtml}Site-header--withNavbar{/if}">
@@ -84,7 +84,7 @@
</div>
</div>
</div>
- {call customDocFooter variant="'' + ($customVariant ?? '')" /}
+ {delcall gitiles.customDocFooter variant="$customVariant ?: ''" /}
{if $analyticsId}
/* From https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
<script>
diff --git a/resources/com/google/gitiles/templates/LogDetail.soy b/resources/com/google/gitiles/templates/LogDetail.soy
index d262364..23ae8eb 100644
--- a/resources/com/google/gitiles/templates/LogDetail.soy
+++ b/resources/com/google/gitiles/templates/LogDetail.soy
@@ -62,10 +62,10 @@
* Wrapper for a single log entry with pretty format and variant.
*/
{template logEntryWrapper}
- {@param variant: string} /** variant name for log entry template. */
+ {@param variant: ?} /** variant name for log entry template. */
{@param entry: ?} /** log entry; see .logEntry. */
<li class="CommitLog-item CommitLog-item--{$variant}">
- {call logEntry variant="$variant" data="$entry" /}
+ {delcall gitiles.logEntry variant="$variant ?: 'default'" data="$entry" /}
</li>
{/template}
@@ -84,6 +84,7 @@
{/if}
{/template}
+
/**
* Single log entry indicating the full log is empty.
*/
@@ -91,10 +92,11 @@
<li class="CommitLog-item CommitLog-item--empty">{msg desc="informational text for when the log is empty"}No commits.{/msg}</li>
{/template}
+
/**
* Single pretty log entry, similar to --pretty=oneline.
*/
-{template oneLineLogEntry visibility="private" modifies="logEntry" variant="'oneline'"}
+{deltemplate gitiles.logEntry variant="'oneline'"}
{@param abbrevSha: ?} /** abbreviated SHA-1. */
{@param sha: ?} /** commit SHA-1. */
{@param url: ?} /** URL to commit detail page. */
@@ -145,13 +147,13 @@
</span>
{/if}
-{/template}
+{/deltemplate}
/**
* Default single log entry (oneline format).
*/
-{template logEntry modifiable="true" usevarianttype="string"}
+{deltemplate gitiles.logEntry variant="'default'"}
{@param abbrevSha: ?} /** abbreviated SHA-1. */
{@param sha: ?} /** commit SHA-1. */
{@param url: ?} /** URL to commit detail page. */
@@ -171,14 +173,14 @@
newPath: the new path after the rename or copy.
score: the similarity score of the rename or copy.
*/
- {call logEntry variant="'oneline'" data="all" /}
-{/template}
+{delcall gitiles.logEntry variant="'oneline'" data="all" /}
+{/deltemplate}
/**
* Single pretty log entry, similar to --pretty=full.
*/
-{template fullLogEntry visibility="private" modifies="logEntry" variant="'full'"}
+{deltemplate gitiles.logEntry variant="'full'"}
{@param abbrevSha: ?} /** abbreviated SHA-1. */
{@param sha: ?} /** commit SHA-1. */
{@param url: ?} /** URL to commit detail page. */
@@ -260,4 +262,4 @@
<pre class="u-pre u-monospace MetadataMessage">
{$message}
</pre>
-{/template}
+{/deltemplate}