From 6c40338f28d031221ee0e28832c67c159633106d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 22 2016 11:30:02 +0000 Subject: Fix styling and show possible PR if authenticated and admin --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index 47fbcf7..099a56a 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -335,17 +335,44 @@ $(document).ready(function() { $(".extra_gits").hide(); }); - $(function() { - $( "#more_gits" ).click( - function() { - if ($( "#more_gits" ).html() == 'more') { - $( "#more_gits" ).html('less'); - } else { - $( "#more_gits" ).html('more'); + $( "#more_gits" ).click(function() { + if ($( "#more_gits" ).html() == 'more') { + $( "#more_gits" ).html('less'); + } else { + $( "#more_gits" ).html('more'); + } + }); + + {% if authenticated and repo_admin %} + $.ajax({ + url: '{{ url_for("internal_ns.get_pull_request_ready_branch") }}' , + type: 'POST', + data: { + repo: "{{ repo.name }}", + repouser: "{{ repo.user.user if repo.is_fork else '' }}", + csrf_token: "{{ form.csrf_token.current_token }}", + }, + dataType: 'json', + success: function(res) { + if (res.code == 'OK'){ + for (branch in res.message){ + html = ''; + $($('.bodycontent').find('.row').children()[0]).before(html) } } - ); + } + }); + {% endif %} });