From b29ac454fee567e9b149c3147e94d539b0dc5b2f Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Jul 20 2018 13:12:00 +0000 Subject: fix broken watchers dropdown in repo_info There was some old, unused JS in repo_info that was broken, and was causing the watch dropdown to not work anymore. This removes that JS, and the watch dropdown should work again. fixes #3444 --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index e2db52e..c9b5114 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -342,84 +342,5 @@ $(document).ready(function() { }); }); - -$(function() { - $( "#more_gits" ).click(function() { - if ($( "#more_gits" ).html() == 'more') { - $( "#more_gits" ).html('less'); - } else { - $( "#more_gits" ).html('more'); - } - }); - - {% if g.authenticated and g.repo_committer %} - $.ajax({ - url: '{{ url_for("internal_ns.get_pull_request_ready_branch") }}' , - type: 'POST', - data: { - namespace: "{{ repo.namespace if repo.namespace }}", - repo: "{{ repo.name }}", - repouser: "{{ repo.user.user if repo.is_fork else '' }}", - csrf_token: "{{ g.confirmationform.csrf_token.current_token }}", - }, - dataType: 'json', - success: function(res) { - if (res.code == 'OK'){ - for (branch in res.message.new_branch){ - var nb_commits = res.message.new_branch[branch]['commits'] - var nb_target = res.message.new_branch[branch]['target_branch'] - var url = "{{ url_for( - 'ui_ns.new_request_pull', - repo=repo.name, - username=repo.user.user if repo.is_fork else None, - namespace=repo.namespace, - branch_to='', - branch_from='') }}"; - url = url.slice(0, -2) + nb_target + '..' + branch - html = ''; - /*$($('.bodycontent').find('.row').children()[0]).before(html);*/ - {% if repo.is_fork %} - html2 = ' \ - New PR \ - '; - {% else %} - html2 = ' \ - New PR \ - '; - {%endif%} - var _b = branch.replace(/\./g, '\\.').replace('/', '__').replace('\+', '\\+'); - $('#branch-' + _b + ' .branch_del').prepend(html2); - $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); - } - for (branch in res.message.branch_w_pr){ - var html = ' \ - ' - + 'PR#' + res.message.branch_w_pr[branch].split('/').slice(-1)[0] + ' \ - '; - $('#branch-' + branch.replace(/\./g, '\\.').replace('/', '__') - + ' .branch_del').prepend(html); - $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); - } - } - } - }); - {% endif %} -}); {% endblock %}