From 5de6a8d06dbc2fe7e34bf8fb531c6588bbc77db8 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 17 Mar 2014 22:30:58 +0400 Subject: [PATCH] [JENKINS-21190] - lib/layout/layout.jelly: Interpret norefresh=="false" as "autorefresh is enabled" The fix allows to explicitly disable automatic page refreshes in the @View extensions. Resolves https://issues.jenkins-ci.org/browse/JENKINS-21190 Signed-off-by: Oleg Nenashev --- core/src/main/java/hudson/model/View.java | 9 +++++++++ core/src/main/resources/hudson/model/View/index.jelly | 2 +- core/src/main/resources/lib/layout/breadcrumbBar.jelly | 2 +- core/src/main/resources/lib/layout/layout.jelly | 5 ++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/model/View.java b/core/src/main/java/hudson/model/View.java index 0a418e1310..fee18dd273 100644 --- a/core/src/main/java/hudson/model/View.java +++ b/core/src/main/java/hudson/model/View.java @@ -373,6 +373,15 @@ public abstract class View extends AbstractModelObject implements AccessControll return true; } + /** + * Enables or disables automatic refreshes of the view. + * By default, automatic refreshes are enabled. + * @since TODO: define a version + */ + public boolean isAutomaticRefreshEnabled() { + return true; + } + /** * If true, only show relevant executors */ diff --git a/core/src/main/resources/hudson/model/View/index.jelly b/core/src/main/resources/hudson/model/View/index.jelly index 464262f320..b74f00dc4d 100644 --- a/core/src/main/resources/hudson/model/View/index.jelly +++ b/core/src/main/resources/hudson/model/View/index.jelly @@ -24,7 +24,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/lib/layout/breadcrumbBar.jelly b/core/src/main/resources/lib/layout/breadcrumbBar.jelly index f00fb45e99..ef1b411328 100644 --- a/core/src/main/resources/lib/layout/breadcrumbBar.jelly +++ b/core/src/main/resources/lib/layout/breadcrumbBar.jelly @@ -40,7 +40,7 @@ THE SOFTWARE.
- +
diff --git a/core/src/main/resources/lib/layout/layout.jelly b/core/src/main/resources/lib/layout/layout.jelly index 95d73c8d01..46acef6e2b 100644 --- a/core/src/main/resources/lib/layout/layout.jelly +++ b/core/src/main/resources/lib/layout/layout.jelly @@ -34,7 +34,7 @@ THE SOFTWARE. Title of the HTML page. Rendered into <title> tag. - If non-null, auto refresh is disabled on this page. + If non-null and not "false", auto refresh is disabled on this page. This is necessary for pages that include forms. @@ -67,8 +67,7 @@ ${h.initPageVariables(context)} which I suspect can end up creating sessions for wrong resource types (such as static resources.) --> - - + ${h.advertiseHeaders(response)}