#36 Show the heads of the branches on the commit list
Merged 7 years ago by pingou. Opened 7 years ago by pingou.

file modified
+30
@@ -188,6 +188,36 @@ 

      $('#diff_commits_link').click(function(){

        $('#diff_commits').toggle();

      });

+     $.ajax({

+         url: '{{ url_for("internal_ns.get_branches_head") }}' ,

+         type: 'POST',

+         data: {

+           repo: "{{ repo.name }}",

+           repouser: "{{ repo.user.user if repo.is_fork else '' }}",

+           namespace: "{{ repo.namespace if repo.namespace else '' }}",

+           csrf_token: "{{ form.csrf_token.current_token }}",

+         },

+         dataType: 'json',

+         success: function(res) {

+           for (var _c in res.heads) {

+             for (var i=0; i < res.heads[_c].length; i++){

+               var _url = '{{ url_for('.view_commits',

+                 repo=repo.name,

+                 branchname='---',

+                 username=username,

+                 namespace=repo.namespace) }}';

+               var _b = res.heads[_c][i];

+               var html = '<a href="' + _url.replace('---', _b) + '">'

+                 +'<span class="label label-info"'

+                 +'title="Head of branch(es): ' + _b + '">'

+                 + '<span class="oi" data-glyph="fork"></span> '

+                 + _b + '</span></a> ';

+               var el = $('#c_' + _c);

+               el.parent().before(html);

+             }

+           }

+         },

+     });

    });

    {% if config.get('RESULTSDB_URL') %}

      var _base_url = '{{ config.get("RESULTSDB_URL").rstrip("/") }}/api/v2.0/';

This backports to pagure-dist-git a change that has been made to pagure
itself on: https://pagure.io/pagure/pull-request/2675

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

rebased onto bb7cccd

7 years ago

Probably you should also bump requirement for pagure... in spec? in setup.py?

Worst case the ajax query gets a 404 :)

apart from one concern looks good =)

Pull-Request has been merged by pingou

7 years ago
Metadata