From d413e9beb5856e1a882705e691d0e0b6d215b799 Mon Sep 17 00:00:00 2001 From: Sundeep Anand Date: May 11 2021 16:44:25 +0000 Subject: Add Translation status link on repo_info page at src.fp.o Signed-off-by: Sundeep Anand --- diff --git a/pagure/themes/srcfpo/static/icons/transtats.png b/pagure/themes/srcfpo/static/icons/transtats.png new file mode 100644 index 0000000..a96495e Binary files /dev/null and b/pagure/themes/srcfpo/static/icons/transtats.png differ diff --git a/pagure/themes/srcfpo/templates/repo_info.html b/pagure/themes/srcfpo/templates/repo_info.html index 05afe2b..d6aed5b 100644 --- a/pagure/themes/srcfpo/templates/repo_info.html +++ b/pagure/themes/srcfpo/templates/repo_info.html @@ -41,6 +41,10 @@ padding-left: 33px; background: url({{ url_for('theme.static', filename='icons/koschei.png')}}?version={{ g.version}}) 0 50% no-repeat; } + a.transtats button { + padding-left: 20px; + background: url({{ url_for('theme.static', filename='icons/transtats.png')}}?version={{ g.version}}) 0 50% no-repeat; + } .projectinfo { white-space: pre-wrap; white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ @@ -377,6 +381,9 @@ + {% if repo.namespace == 'rpms' %} + + {% endif %} {% endif %} @@ -531,6 +538,18 @@ $(document).ready(function() { $("#bodhi_updates").html("

Failed to retrieve updates from bodhi

"); } }); + + $.ajax({ + url: 'https://transtats.fedoraproject.org/api/package/{{ repo.name }}/exist?format=json', + type: 'GET', + dataType: 'json', + success: function(res){ + console.log(res); + if (res[{{ repo.name }}]) { + $("#transtats").html(""); + } + } + }); {% endif %} });