mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
expanded the URL space so that jobs can be displayed under views. This puts the view into the breadcrumb, allowing users to get back to the view more easily.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1687 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
77b52aaabb
commit
c4e0a8df91
6 files changed
+36
-12
No files matched your search
@@ -270,4 +270,19 @@ public class Functions {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the given object in the ancestor list and returns its URL.
|
||||
* This is used to determine the "current" URL assigned to the given object,
|
||||
* so that one can compute relative URLs from it.
|
||||
*/
|
||||
public static String getNearestAncestorUrl(StaplerRequest req,Object it) {
|
||||
List list = req.getAncestors();
|
||||
for( int i=list.size()-1; i>=0; i-- ) {
|
||||
Ancestor anc = (Ancestor) list.get(i);
|
||||
if(anc.getObject()==it)
|
||||
return anc.getUrl();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user