displayGroupDetail=function(groupId,parentBrowseViewModel,restUrl){
var mainContent = $("#main-content");
+ mainContent.find("#browse_artifact_detail").hide();
var browseResult=mainContent.find("#browse_result");
browseResult.show();
mainContent.find("#browse_artifact" ).hide();
}
displayArtifactVersionDetail=function(version){
- $.log("displayArtifactVersionDetail:"+groupId+":"+artifactId+":"+version);
+ var artifactVersionDetailViewModel=new ArtifactVersionDetailViewModel(self.groupId,self.artifactId,version,self);
+ artifactVersionDetailViewModel.display();
}
}
+ ArtifactVersionDetailViewModel=function(groupId,artifactId,version,artifactDetailViewModel){
+ var mainContent = $("#main-content");
+ var self=this;
+ this.groupId=groupId;
+ this.artifactId=artifactId;
+ this.version=version;
+ this.artifactDetailViewModel=artifactDetailViewModel;
+ this.projectVersionMetadata=null;
+ this.display=function(){
+ $.log("displayArtifactVersionDetail:"+self.groupId+":"+self.artifactId+":"+self.version);
+ mainContent.find("#browse_artifact").hide("slide", {}, 300,function(){
+ mainContent.find("#browse_artifact_detail").show();
+ mainContent.find("#browse_artifact_detail").html(mediumSpinnerImg());
+ var metadataUrl="restServices/archivaServices/browseService/projectVersionMetadata/"+encodeURIComponent(groupId)+"/"+encodeURIComponent(artifactId);
+ var selectedRepo=getSelectedBrowsingRepository();
+ if (selectedRepo){
+ metadataUrl+="?repositoryId="+encodeURIComponent(selectedRepo);
+ }
+ if (self.artifactDetailViewModel && self.artifactDetailViewModel.projectVersionMetadata){
+ self.projectVersionMetadata=self.artifactDetailViewModel.projectVersionMetadata;
+ ko.applyBindings(self,mainContent.find("#browse_artifact_detail" ).get(0));
+ } else {
+ $.ajax(metadataUrl, {
+ type: "GET",
+ dataType: 'json',
+ success: function(data) {
+ self.projectVersionMetadata=mapProjectVersionMetadata(data);
+ ko.applyBindings(self,mainContent.find("#browse_artifact_detail" ).get(0));
+ }
+ });
+ }
+ });
+ }
+ }
+
displayArtifactDetail=function(groupId,artifactId,parentBrowseViewModel,restUrl){
var artifactDetailViewModel=new ArtifactDetailViewModel(groupId,artifactId);
var mainContent = $("#main-content");
+ mainContent.find("#browse_artifact_detail" ).hide();
mainContent.find("#browse_result").hide();
mainContent.find("#main_browse_result_content").hide("slide", {}, 300,function(){
mainContent.find("#browse_breadcrumb").html(smallSpinnerImg());
changeBrowseRepository=function(){
var selectedRepository=getSelectedBrowsingRepository();
- //displayBrowse(false,selectedRepository);
displayGroupDetail(null,null,"restServices/archivaServices/browseService/rootGroups?repositoryId="+encodeURIComponent(selectedRepository));
}
var selectedOption=$("#main-content #select_browse_repository option:selected" );
if (selectedOption.length>0){
var repoId=selectedOption.val();
- $.log("getSelectedBrowsingRepository:"+repoId);
return repoId;
}
- $.log("getSelectedBrowsingRepository:none");
+ return null;
}
enableAutocompleBrowse=function(groupId){
<div id="browse_breadcrumb" data-bind='template:{name:"browse-breadcrumb-tmpl"}'></div>
<div id="browse_result" class="well" data-bind='template:{name:"browse-groups-tmpl"}'></div>
<div id="browse_artifact" class="well" data-bind='template:{name:"browse-artifact-tmpl"}'></div>
+ <div id="browse_artifact_detail" class="well" data-bind='template:{name:"browse-artifact-detail-tmpl"}'></div>
</div>
</div>
</script>
<option value="${repository.id}">${repository.name}</option>
{{/each}}
</select>
+</script>
+
+<script id="browse-artifact-detail-tmpl" type="text/html">
+ <ul id="artifact-details-tabs" class="nav nav-tabs">
+ <li class="active">
+ <a data-toggle="tab" href="#artifact-details-info-content">${$.i18n.prop('artifact.detail.tab.header.info')}</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#artifact-details-dependencies-content">${$.i18n.prop('artifact.detail.tab.header.dependencies')}</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#artifact-details-dependency-tree-content">${$.i18n.prop('artifact.detail.tab.header.dependency.tree')}</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#artifact-details-used-by-content">${$.i18n.prop('artifact.detail.tab.header.used.by')}</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#artifact-details-mailing-list-content">${$.i18n.prop('artifact.detail.tab.header.mailing.list')}</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#artifact-details-metadatas-content">${$.i18n.prop('artifact.detail.tab.header.metadatas')}</a>
+ </li>
+ </ul>
+ <div class="tab-content">
+ <div id="artifact-details-info-content" class="tab-pane active">
+ <blockquote>${projectVersionMetadata.description}</blockquote>
+ <div class="row span4">
+ <table class="table">
+ <tbody>
+ <tr>
+ <th>${$.i18n.prop('browse.artifact.groupId')}</th>
+ <td>${groupId}</td>
+ </tr>
+ <tr>
+ <th>${$.i18n.prop('browse.artifact.artifactId')}</th>
+ <td>${artifactId}</td>
+ </tr>
+ <tr>
+ <th>${$.i18n.prop('browse.artifact.version')}</th>
+ <td>${version}</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+
+ <div id="artifact-details-dependencies-content" class="tab-pane">
+ dependencies
+ </div>
+
+ <div id="artifact-details-dependency-tree-content" class="tab-pane">
+ dependency tree
+ </div>
+
+ <div id="artifact-details-used-by-content" class="tab-pane">
+ used by
+ </div>
+
+ <div id="artifact-details-mailing-list-content" class="tab-pane">
+ mailing list
+ </div>
+
+ <div id="artifact-details-metadatas-content" class="tab-pane">
+ metadatas
+ </div>
+
+ </div>
</script>
\ No newline at end of file