New plugin repo cloned using new GitRepo class. Readme and info displayed in wide modal dialog.
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$newRepoModal}}
|
||||
<script>
|
||||
function adminPluginsAddRepo() {
|
||||
var repoURL = $('#id_repoURL').val();
|
||||
@@ -44,16 +44,13 @@
|
||||
function(response) {
|
||||
$('#chat-rotator').spin(false);
|
||||
if (response.success) {
|
||||
$('#new-repo-info').html('<h3>Repo Info</h3><p>' + response.message + '</p>');
|
||||
|
||||
$('#new-repo-info').append('<h4>Branches</h4><p>'+JSON.stringify(response.repo.branches)+'</p>');
|
||||
$('#new-repo-info').append('<h4>URL</h4><p>'+response.repo.url+'</p>');
|
||||
$('#new-repo-info').append('<h4>Objects</h4><ul>');
|
||||
for(var i = 0; i<response.repo.objects.length; i++) {
|
||||
$('#new-repo-info').append('<li>'+response.repo.objects[i]+'</li>');
|
||||
}
|
||||
$('#new-repo-info').append('</ul>');
|
||||
$('#new-repo-info').append('<h4>Readme</h4><p>'+response.repo.readme+'</p>');
|
||||
var modalBody = $('#generic-modal-body-{{$newRepoModalID}}');
|
||||
modalBody.html('<div>'+response.repo.readme+'</div>');
|
||||
modalBody.append('<h2>Repo Info</h2><p>Message: ' + response.message + '</p>');
|
||||
modalBody.append('<h4>Branches</h4><p>'+JSON.stringify(response.repo.branches)+'</p>');
|
||||
modalBody.append('<h4>Remotes</h4><p>'+JSON.stringify(response.repo.remote)+'</p>');
|
||||
$('.modal-dialog').width('80%');
|
||||
$('#generic-modal-{{$newRepoModalID}}').modal();
|
||||
} else {
|
||||
window.console.log('Error adding repo :' + response['message']);
|
||||
}
|
||||
|
||||
15
view/tpl/generic_modal.tpl
Normal file
15
view/tpl/generic_modal.tpl
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="modal" id="generic-modal-{{$id}}" tabindex="-1" role="dialog" aria-labelledby="generic-modal-{{$id}}" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="generic-modal-title-{{$id}}">{{$title}}</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="generic-modal-body-{{$id}}"></div>
|
||||
<div class="modal-footer">
|
||||
<button id="generic-modal-cancel-{{$id}}" type="button" class="btn btn-default" data-dismiss="modal">{{$cancel}}</button>
|
||||
<button id="generic-modal-ok-{{$id}}" type="button" class="btn btn-primary">{{$ok}}</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
Reference in New Issue
Block a user