提交 ecda4930 编写于 作者: K kohsuke

Allowing job classes to specify the pronoun used to refer to it. This allows...

Allowing job classes to specify the pronoun used to refer to it. This allows us to say "delete module", not "delete project", and so on in the UI.
See #502.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3191 71c3de6d-444a-0410-be80-ed276b4c234a
上级 9c45a0ef
......@@ -160,6 +160,11 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
return displayName;
}
@Override
public String getPronoun() {
return "Module";
}
public MavenModuleSet getParent() {
return (MavenModuleSet)super.getParent();
}
......
......@@ -151,6 +151,15 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return Hudson.getInstance().getSlave(assignedNode);
}
/**
* Get the term used in the UI to represent this kind of {@link AbstractProject}.
* Must start with a capital letter.
*/
@Override
public String getPronoun() {
return "Project";
}
/**
* Gets the directory where the module is checked out.
*/
......
......@@ -73,6 +73,11 @@ public class ExternalJob extends ViewJob<ExternalJob,ExternalRun> implements Top
public static final TopLevelItemDescriptor DESCRIPTOR = new DescriptorImpl();
@Override
public String getPronoun() {
return "Job";
}
public static final class DescriptorImpl extends TopLevelItemDescriptor {
private DescriptorImpl() {
super(ExternalJob.class);
......
......@@ -130,6 +130,14 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
return null;
}
/**
* Get the term used in the UI to represent this kind of {@link AbstractProject}.
* Must start with a capital letter.
*/
public String getPronoun() {
return "Project";
}
/**
* If true, it will keep all the build logs of dependency components.
*/
......
......@@ -18,7 +18,7 @@
<j:if test="${!it.disabled}">
<l:task icon="images/24x24/clock.gif" href="${url}/build" title="Build Now" />
</j:if>
<l:task icon="images/24x24/edit-delete.gif" href="${url}/delete" title="Delete Project" />
<l:task icon="images/24x24/edit-delete.gif" href="${url}/delete" title="Delete ${it.pronoun}" />
<l:task icon="images/24x24/setting.gif" href="${url}/configure" title="Configure" />
</l:isAdmin>
<st:include page="actions.jelly" />
......
......@@ -2,7 +2,7 @@
<l:layout title="${it.displayName}">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>Project ${it.displayName}</h1>
<h1>${it.pronoun} ${it.displayName}</h1>
<t:editableDescription adminOnly="true"/>
<!-- inject main part here -->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册