From abf47117a2d66be66a2b2fd2a6a9361d783b653a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 08 2018 10:32:46 +0000 Subject: List the tags of the project in the list of commits Fixes https://pagure.io/pagure/issue/3012 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/commits.html b/pagure/templates/commits.html index 9a4d6a7..68cc836 100644 --- a/pagure/templates/commits.html +++ b/pagure/templates/commits.html @@ -178,6 +178,8 @@ $('#diff_commits_link').click(function(){ $('#diff_commits').toggle(); }); + + {# Show branch labels in commit list #} $.ajax({ url: '{{ url_for("internal_ns.get_branches_head") }}' , type: 'POST', @@ -208,6 +210,28 @@ } }, }); + + {# Show tags in commit list #} + $.ajax({ + url: '{{ url_for("api_ns.api_git_tags", + repo=repo.name, + username=repo.user.user if repo.is_fork else none, + namespace=repo.namespace) }}' + '?with_commits=1' , + type: 'GET', + dataType: 'json', + success: function(res) { + for (var _t in res.tags) { + var _c = res.tags[_t]; + var html = '' + + ' ' + + _t + ' '; + var el = $('#c_' + _c); + el.parent().before(html); + } + }, + }); + }); {% endblock %}