Skip to content
Permalink
Browse files

[FIXED JENKINS-18633] Simplified distinction between Jenkins.descript…

…ion and View.description.

Both are shown if defined. The edit description link only applies to View.description.
Properly handle a ViewGroup other than Jenkins itself, such as a folder.
(cherry picked from commit 04c8a1e)

Conflicts:
	changelog.html
  • Loading branch information...
jglick authored and olivergondza committed Oct 7, 2013
1 parent 3695e61 commit 624395829bfda6a87b3c0210e0a691af90037358
@@ -23,7 +23,6 @@
*/
package hudson.model;

import jenkins.model.Jenkins;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
@@ -53,11 +52,6 @@ public AllView(String name, ViewGroup owner) {
this.owner = owner;
}

@Override
public String getDescription() {
return Jenkins.getInstance().getDescription();
}

@Override
public boolean isEditable() {
return false;
@@ -82,14 +76,6 @@ public Item doCreateItem(StaplerRequest req, StaplerResponse rsp)
return (Collection)getOwnerItemGroup().getItems();
}

@Override
public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
checkPermission(Jenkins.ADMINISTER);

Jenkins.getInstance().setSystemMessage(req.getParameter("description"));
rsp.sendRedirect(".");
}

@Override
public String getPostConstructLandingPage() {
return ""; // there's no configuration page
@@ -27,7 +27,7 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:f="/lib/form" xmlns:l="/lib/layout">
<j:if test="${it.class.name=='hudson.model.Hudson'}">
<j:if test="${it.primaryView != null}">
<j:set var="it" value="${it.primaryView}"/>
</j:if>
<l:ajax>
@@ -31,12 +31,10 @@ THE SOFTWARE.
<st:include page="view-index-top.jelly" it="${it.owner}" optional="true">
<!-- allow the owner to take over the top section, but we also need the default to be backward compatible -->
<div id="view-message">
<j:if test="${it.class.name!='hudson.model.AllView'}">
<div id="systemmessage">
<j:out value="${app.systemMessage!=null ? app.markupFormatter.translate(app.systemMessage) : ''}" />
</div>
</j:if>
<t:editableDescription permission="${app.ADMINISTER}"/>
<t:editableDescription permission="${it.CONFIGURE}"/>
</div>
</st:include>

1 comment on commit 6243958

@jglick

This comment has been minimized.

Copy link
Member Author

commented on 6243958 Nov 2, 2013

Note that this commit is a behavioral change as well as a security bug fix, so it needs to be reviewed.

Please sign in to comment.
You can’t perform that action at this time.