提交 c4847d1b 编写于 作者: V Vincent Latombe

Deprecated jobBaseUrl from projectView.jelly.

The reason is that we always determine the job url using
Functions#getRelativeLinkTo, which keeps the view navigation info if it
exists, and can produce an absolute url if required by the context. So
it is no longer needed for the caller to worry about jobBaseUrl.

By default, names are interpreted in relatively to the current item
group, so Label and Computer views no longer need to set useFullName to
true to have correct behaviour.
上级 71997559
......@@ -344,6 +344,7 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
* Nested ItemGroups are separated by / character.
*/
public String getRelativeNameFrom(ItemGroup p) {
if (p == null) return getFullName();
// first list up all the parents
Map<ItemGroup,Integer> parents = new HashMap<ItemGroup,Integer>();
int depth=0;
......
......@@ -111,7 +111,7 @@ THE SOFTWARE.
</p>
</j:when>
<j:otherwise>
<t:projectView jobs="${jobs}" jobBaseUrl="${rootURL}/" useFullName="true"/>
<t:projectView jobs="${jobs}"/>
</j:otherwise>
</j:choose>
......
......@@ -53,7 +53,7 @@ THE SOFTWARE.
</p>
</j:when>
<j:otherwise>
<t:projectView jobs="${jobs}" jobBaseUrl="${rootURL}/" useFullName="true"/>
<t:projectView jobs="${jobs}"/>
</j:otherwise>
</j:choose>
......
......@@ -11,7 +11,7 @@ if (items.isEmpty()) {
}
include(my,"noJob.jelly");
} else {
t.projectView(jobs: items, jobBaseUrl: "", showViewTabs: true, columnExtensions: my.columns, indenter: my.indenter) {
t.projectView(jobs: items, showViewTabs: true, columnExtensions: my.columns, indenter: my.indenter) {
set("views",my.owner.views);
set("currentView",my);
if (my.owner.class == hudson.model.MyViewsProperty.class) {
......
......@@ -25,6 +25,6 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<td style="${indenter.getCss(job)}">
<a href="${jobBaseUrl}${job.shortUrl}" class='model-link'> ${useFullName ? job.fullDisplayName : h.getRelativeDisplayNameFrom(job,currentView.owner.itemGroup)}</a>
<a href="${jobBaseUrl}${job.shortUrl}" class='model-link'> ${h.getRelativeDisplayNameFrom(job,currentView.owner.itemGroup)}</a>
</td>
</j:jelly>
\ No newline at end of file
......@@ -33,10 +33,9 @@ THE SOFTWARE.
</st:attribute>
<st:attribute name="useFullName" use="optional" type="boolean">
May be interpreted by columns to display the full name of a job.
Will also append a parent URL to jobBaseUrl if needed.
</st:attribute>
<st:attribute name="jobBaseUrl" type="String">
The base URL of all job links. Normally ${rootURL}/
Deprecated. Using this attribute has no effect.
</st:attribute>
<st:attribute name="showViewTabs" use="optional" type="boolean">
If the caller rendered a view tabes, set this attribute so that CSS is adjusted accordingly.
......@@ -79,7 +78,7 @@ THE SOFTWARE.
</j:forEach>
<j:forEach var="job" items="${jobs}">
<t:projectViewRow jobBaseUrl="${h.getRelativeLinkTo(job).substring(0, h.getRelativeLinkTo(job).length() - job.shortUrl.length())}${jobBaseUrl}"/>
<t:projectViewRow jobBaseUrl="${h.getRelativeLinkTo(job).substring(0, h.getRelativeLinkTo(job).length() - job.shortUrl.length())}"/>
</j:forEach>
</table>
<t:iconSize><t:rssBar/></t:iconSize>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册