@@ -26,50 +26,59 @@ <h3 class="sidebar-section__title">Project links</h3>
26
26
</ div >
27
27
{% endif %}
28
28
29
- {% macro statistic_item (title, json_data_key, json_base_url_key=None, url_ending=None, icon=None) %}
29
+ {% macro repo_item (title, json_data_key, json_base_url_key=None, url_ending=None, icon=None) %}
30
30
{% if not icon %}
31
31
{% if title == 'Stars' %}
32
32
{% set icon = 'fa-star' %}
33
33
{% elif title == 'Forks' %}
34
34
{% set icon = 'fa-code-branch' %}
35
- {% elif title == 'Open issues/ PRs' %}
35
+ {% elif title == 'Open issues / PRs' %}
36
36
{% set icon = 'fa-exclamation-circle' %}
37
37
{% endif %}
38
38
{% endif %}
39
39
{% if json_base_url_key %}
40
- < a class ="statistic-item repo-info__item "
41
- data-key ="{{ json_base_url_key }} " data-attr =" href " data-supplement =" {{ url_ending }} "
42
- rel =" noopener " target =" _blank " >
43
- {% else %}
44
- < span class =" statistic-item " >
45
- {% endif %}
40
+ < a class ="repo-info__item js- repo-data "
41
+ data-key ="{{ json_base_url_key }} "
42
+ data-attr =" href "
43
+ data-supplement =" {{ url_ending }} "
44
+ rel =" noopener "
45
+ target =" _blank " >
46
46
< i class ="fa {{ icon }} " aria-hidden ="true "> </ i >
47
47
< strong > {{ title }}: </ strong >
48
- < span class ="repo-info__item " data-key ="{{ json_data_key }} "> </ span >
49
- {% if json_base_url_key %}
48
+ < span class ="js-repo-data " data-key ="{{ json_data_key }} "> </ span >
50
49
</ a >
51
50
{% else %}
51
+ < span class ="repo-info__item ">
52
+ < i class ="fa {{ icon }} " aria-hidden ="true "> </ i >
53
+ < strong > {{ title }}: </ strong >
54
+ < span class ="js-repo-data " data-key ="{{ json_data_key }} "> </ span >
52
55
</ span >
53
56
{% endif %}
54
57
{% endmacro %}
55
58
56
59
< div class ="sidebar-section ">
57
- < h3 class ="sidebar-section__title "> Statistics</ h3 >
58
60
{% if release.github_repo_info_url %}
61
+ < h3 class ="sidebar-section__title ">
62
+ < i class ="fab fa-github " aria-hidden ="true "> </ i >
63
+ GitHub statistics
64
+ </ h3 >
59
65
< div class ="repo-info hidden " data-url ="{{release.github_repo_info_url}} ">
60
- < em > GitHub statistics:</ em >
61
- {{ statistic_item('Stars', 'stargazers_count', 'html_url', '/stargazers') }}
62
- {{ statistic_item('Forks', 'forks_count', 'html_url', '/network') }}
63
- {{ statistic_item('Open issues/PRs', 'open_issues_count', 'html_url', '/issues') }}
66
+ {{ repo_item('Stars', 'stargazers_count', 'html_url', '/stargazers') }}
67
+ {{ repo_item('Forks', 'forks_count', 'html_url', '/network') }}
68
+ {{ repo_item('Open issues / PRs', 'open_issues_count', 'html_url', '/issues') }}
64
69
</ div >
65
70
{% elif release.gitlab_repo_info_url %}
71
+ < h3 class ="sidebar-section__title ">
72
+ < i class ="fab fa-gitlab " aria-hidden ="true "> </ i >
73
+ GitLab statistics
74
+ </ h3 >
66
75
< div class ="repo-info hidden " data-url ="{{release.gitlab_repo_info_url}} ">
67
- < em > GitLab statistics:</ em >
68
- {{ statistic_item('Stars', 'star_count') }}
69
- {{ statistic_item('Forks', 'forks_count', 'web_url', '/forks') }}
76
+ {{ repo_item('Stars', 'star_count') }}
77
+ {{ repo_item('Forks', 'forks_count', 'web_url', '/forks') }}
70
78
</ div >
71
79
{% endif %}
72
- < p > View statistics for this project via < a
80
+ < br />
81
+ < p > View other statistics for this project via < a
73
82
href ="https://libraries.io/pypi/{{ release.project.name }} "> Libraries.io</ a > , or by using
74
83
< a href ="https://packaging.python.org/guides/analyzing-pypi-package-downloads/ "> Google
75
84
BigQuery</ a > </ p >
0 commit comments