mirror of https://github.com/apache/archiva.git
[MRM-1573] breadcrumbs in repository browsing.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6d0d073824
commit
f113456cc5
|
@ -41,9 +41,22 @@ $(function() {
|
|||
browseRoot();
|
||||
}
|
||||
}
|
||||
|
||||
breadCrumbEntries=function(){
|
||||
var curBrowseViewModel=self;
|
||||
var entries=[];
|
||||
do{
|
||||
entries.push(curBrowseViewModel.groupId);
|
||||
curBrowseViewModel=curBrowseViewModel.parentBrowseViewModel;
|
||||
if (!curBrowseViewModel) return entries.reverse();
|
||||
}while(curBrowseViewModel.parentBrowseViewModel)
|
||||
return entries.reverse();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
findParentGroupId=function(browseViewModel){
|
||||
return browseViewModel.groupId;
|
||||
}
|
||||
|
||||
displayGroupDetail=function(groupId,parentBrowseViewModel,restUrl){
|
||||
var mainContent = $("#main-content");
|
||||
|
|
|
@ -42,11 +42,13 @@
|
|||
<ul>
|
||||
<!-- if null we are on root level -->
|
||||
{{if $root.parentBrowseViewModel}}
|
||||
<li class="browse-list"><a href="#" data-bind="click:function(){displayParentGroupId()}">..</a></li>
|
||||
<li class="browse-list" data-bind="click:function(){displayParentGroupId()}">
|
||||
<a href="#">..</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{each(i,browseResultEntry) browseResultEntries}}
|
||||
<li class="browse-list">
|
||||
<a href="#" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">
|
||||
<li class="browse-list" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">
|
||||
<a href="#">
|
||||
${browseResultEntry.name} (project: ${browseResultEntry.project})
|
||||
</a>
|
||||
</li>
|
||||
|
@ -58,6 +60,8 @@
|
|||
<script id="browse-breadcrumb-tmpl" type="text/html">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#" data-bind="click: function(){ browseRoot()}"><i class="icon-home"/> </a> <span class="divider">/</span></li>
|
||||
<li><a href="#">org</a> <span class="divider">/</span></li>
|
||||
{{each(i,breadCrumbEntry) breadCrumbEntries}}
|
||||
<li><a href="#">${breadCrumbEntry}</a> <span class="divider">/</span></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</script>
|
Loading…
Reference in New Issue