Render custom templates using deltemplate with variants This new feature in Soy[1] allows dynamically choosing a variant template at runtime. Use this in conjunction with reading the config for a particular request to allow per-request (e.g. per-repo) templates. Currently only supports the customHeader template, which uses template.customHeader to specify the variant name. (Unfortunately like most stuff that is common to all pages, we need to pass this around manually.) Since we no longer need to exclude the default custom templates, we can delete DefaultCustomTemplates.soy. [1] https://developers.google.com/closure/templates/docs/commands#delegates-with-variant Change-Id: I4f5d33e6e49b5c6af640f4ed6138b018a11745ae
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/DefaultRenderer.java b/gitiles-servlet/src/main/java/com/google/gitiles/DefaultRenderer.java index e2eef7c..0741fc2 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/DefaultRenderer.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/DefaultRenderer.java
@@ -31,12 +31,12 @@ this("", null, ""); } - public DefaultRenderer(String staticPrefix, URL customTemplates, String siteTitle) { + public DefaultRenderer(String staticPrefix, Iterable<URL> customTemplates, String siteTitle) { this(ImmutableMap.<String, String> of(), staticPrefix, customTemplates, siteTitle); } - public DefaultRenderer(Map<String, String> globals, String staticPrefix, URL customTemplates, - String siteTitle) { + public DefaultRenderer(Map<String, String> globals, String staticPrefix, + Iterable<URL> customTemplates, String siteTitle) { super( new Function<String, URL>() { @Override