added the shortUrl() method.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1874 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-01-22 06:07:33 +00:00
1 parent 8a7575fdc0
commit 277fa849ff
3 files changed
+16 -6

No files matched your search

@@ -107,7 +107,11 @@ public abstract class AbstractItem extends Actionable implements Item {
}
public final String getUrl() {
return getParent().getUrl()+getParent().getUrlChildPrefix()+'/'+getName()+'/';
return getParent().getUrl()+getShortUrl();
}
public String getShortUrl() {
return getParent().getUrlChildPrefix()+'/'+getName()+'/';
}
/**
+7 -1
View File
@@ -69,12 +69,18 @@ public interface Item extends PersistenceRoot {
String getFullName();
/**
* Returns the URL of this project relative to the context root of the application.
* Returns the URL of this item relative to the context root of the application.
*
* @see AbstractItem#getUrl() for how to implement this.
*/
String getUrl();
/**
* Returns the URL of this item relative to the parent {@link ItemGroup}.
* @see AbstractItem#getShortUrl() for how to implement this.
*/
String getShortUrl();
/**
* Called right after when a {@link Item} is loaded from disk.
* This is an opporunity to do a post load processing.
@@ -47,7 +47,7 @@
<img src="${rootURL}/images/${iconSize}/${job.buildStatusUrl}" />
</td>
<td>
<a href="${jobBaseUrl}${job.url}">
<a href="${jobBaseUrl}${job.shortUrl}">
${job.displayName}
</a>
</td>
@@ -55,7 +55,7 @@
<j:choose>
<j:when test="${lsBuild!=null}">
${lsBuild.timestampString}
(<a href="${jobBaseUrl}${job.url}lastSuccessfulBuild/">#${lsBuild.number}</a>)
(<a href="${jobBaseUrl}${job.shortUrl}lastSuccessfulBuild/">#${lsBuild.number}</a>)
</j:when>
<j:otherwise>
N/A
@@ -66,7 +66,7 @@
<j:choose>
<j:when test="${lfBuild!=null}">
${lfBuild.timestampString}
(<a href="${jobBaseUrl}${job.url}lastFailedBuild/">#${lfBuild.number}</a>)
(<a href="${jobBaseUrl}${job.shortUrl}lastFailedBuild/">#${lfBuild.number}</a>)
</j:when>
<j:otherwise>
N/A
@@ -92,7 +92,7 @@
<l:isAdmin>
<td>
<j:if test="${job.buildable}">
<a href="${jobBaseUrl}${job.url}build">
<a href="${jobBaseUrl}${job.shortUrl}build">
<img src="${rootURL}/images/${subIconSize}/clock.gif" title="Schedule a build" border="0" /></a>
</j:if>
</td>