fix snippet url

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1233900 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-01-20 13:23:33 +00:00
parent b722a82aec
commit 2d96427bd0
3 changed files with 8 additions and 7 deletions

View File

@ -216,6 +216,7 @@ public class DefaultManagedRepositoriesService
snippet.append( " <" ).append( distRepoName ).append( ">\n" );
snippet.append( " <id>" ).append( repo.getId() ).append( "</id>\n" );
snippet.append( " <url>" );
snippet.append( getBaseUrl( httpServletRequest ) + "repository" );
snippet.append( "/" ).append( repo.getId() ).append( "/" ).append( "</url>\n" );

View File

@ -366,16 +366,14 @@ $(function() {
showPomSnippet=function(managedRepository){
$("#managed-repositories-pom-snippet").html(mediumSpinnerImg());
$('#managed-repositories-pom-snippet').show();
var url = "restServices/archivaServices/managedRepositoriesService/getPomSnippet/"+managedRepository.id();
$.ajax(url,
{
type: "GET",
dataType: 'text',
success: function(data) {
//var snippet='<div class="page-header">';
//snippet +="<h2>POM Snippet</h2></div>";
//$("#managed-repositories-pom-snippet").html(snippet+"<pre>"+data+"</pre>");
$("#managed-repositories-pom-snippet").html($("#pom-snippet-tmpl").tmpl(data));
},
error: function(data) {
@ -383,7 +381,7 @@ $(function() {
displayRestError(res);
},
complete: function(){
}
}
}
);

View File

@ -266,7 +266,9 @@
</div>
</script>
<script id="pom-snippet-tmpl" type='text/x-jquery-tmpl'>
<div class="page-header">
<div class="page-header">
<h2>POM Snippet</h2></div>
<pre>${$data}</pre>
</div>
<div><a href="#" onclick="$('#managed-repositories-pom-snippet').effect('blind')">${$.i18n.prop('hide')}</a></div>
<pre>${$data}</pre>
</script>