This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
aggregate_template.html
225 lines (213 loc) · 9.83 KB
/
aggregate_template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{ settings.TITLE }} - gitstat</title>
<style>
.fixed { font-family: "Monospace" };
dd { clear: both; float: left; }
dt { float: left; left-margin: 2em };
</style>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawImpact);
google.setOnLoadCallback(drawRate);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawImpact() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Author');
data.addColumn('number', 'Commit Impact');
data.addRows([
{%- for author in authors[:size] %}
['({{ author.commits|length }}) {{ author.name }}', {{ author.commit_impact }}]{% if not loop.last %},{% endif %}
{%- endfor %}
{% if others.authors|length > 0 %}
,['({{ others.commits|length }}) Other {{ others.names|length }} users', {{ others.commit_impact }}]
{% endif %}
{% for group in [actives, newfaces] + groups %}
{% if loop.first %}
,['-- groups --', 0]
{% endif %}
{% if group.authors|length > 0 %}
,['({{ group.commits|length }}) {{ group.groupname }} group {{ group.authors|length }} users', {{ group.commit_impact }}]
{% endif %}
{% endfor %}
]);
// Set chart options
var options = {'title':'Commit Impact (Natural log of Commits)',
'width':600,
'height':200 + {{ size }} * 25};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.BarChart(document.getElementById('chart_impact'));
chart.draw(data, options);
}
function drawRate() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Author');
data.addColumn('number', 'Commit Count');
data.addRows([
{%- for author in authors[:size] %}
['({{ author.commits|length }}) {{ author.name }}', {{ author.commits|length }}]{% if not loop.last %},{% endif %}
{%- endfor %}
{% if others.authors|length > 0 %}
,['({{ others.commits|length }}) Other {{ others.names|length }} users', {{ others.commits|length }}]
{% endif %}
]);
// Set chart options
var options = {'title':'Commit Rate',
'width':600,
'height':400};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_rate'));
chart.draw(data, options);
}
</script>
</head>
<body>
{% if settings.GITHUB_RIBBON %}
<a href="{{ settings.GITHUB_RIBBON }}"><img class="ribbon" style="display: inline; position: absolute; top:0; right:0; border:0" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
{% endif %}
<div style="width:1000px;">
<div id="chart" style="float:right; width: 600px;">
<menu id="toc" style="border:1px"><h1>Index</h1>
<ol>
<li><a href="#summary">Summary</a></li>
<li><a href="#group">Authors by Group</a></li>
<li><a href="#index">Author Index</a></li>
<li><a href="#author">Authors</a></li>
</ol>
</menu>
<div id="chart_rate"></div>
<div id="chart_impact"></div>
</div>
<header id="top">
<h1>{{ settings.TITLE }}</h1>
<p>These stats are built nightly on TravisCI. Graphs may take a few
seconds to render. Pull requests to the <a
href="https://github.com/edunham/orglog">orglog</a> and <a
href="https://github.com/youknowone/gitstat/">gitstat</a> tools are
welcome!</p>
<p>Configuration, including a blacklist of repositories to ignore
contributions from, is available in the <a
href="https://github.com/edunham/servo-org-stats">servo-org-stats</a>
repo.</p>
</header>
{% set TOP = '<aside style="float:right">[<a href="#top">#Top</a>]</aside>' %}
<div style="width:400px;">
<section id="summary">{{ TOP }}<h1>Summary</h1>
<ul>
<li>These stats were gathered from the commit histories of every
non-fork repo in the servo github organization</li>
<li>Statistics from {{ total.commits[-1].date.short }} to {{ total.commits[0].date.short }}</li>
<li>{{ numformat(authors|length) }} contributors</li>
<li>{{ numformat(total.commits|length) }} commits</li>
<li>{{ actives.authors|length }} active contributors in {{ settings.ACTIVE_DAYS }} days</li>
<li>And they contributed {{ active_commits.commits|length }} commits</li>
<li>{{ newfaces.authors|length }} new contributors in {{ settings.ACTIVE_DAYS }} days</li>
<li>And they contributed {{ newfaces.commits|length }} commits</li>
<li>{{ mauthors|length }} mergers merged {{ mcommits|length }} commits</li>
</ul>
</section>
<section id="group">{{ TOP }}<h1>Author by Group</h1>
{% for group in [newfaces, actives] + groups %}
{% if group.authors|length %}
<section id="group-{{ group.groupname }}">{{ TOP }}<h1>{{ group.groupname }}</h1>
{% if group.url %}
<p><a href="{{ group.url }}">{{ group.url }}</a>
{% endif %}
{% if group.description %}
<p>{{ group.description }}</p>
{% endif %}
<ul>
<li>{{ group.authors|length }} users contributed {{ numformat(group.commits|length) }} commits</li>
<li>{{ (group.authors|length * 100 / authors|length)|round(1) }}% of users</li>
<li>{{ (group.commits|length * 100 / total.commits|length)|round(1) }}% of commits, impacts {{ group.commit_impact }} of {{ total.commit_impact }}</li>
</ul>
<p>Members are:</p>
<ul>
{% for author in group.authors %}
<li><a href="#author-{{ author.safe_email }}">{{ author.name }}</a></li>
{% endfor %}
</ul>
</section>
{% endif %}
{% endfor %}
<section id="group-merge">{{ TOP }}<h1>Mergers</h1>
<ul>
<li>{{ mauthors|length }} users merged {{ mcommits|length }} commits</li>
<li>{{ (mcommits|length * 100 / total.commits|length)|round(1) }}% of commits, but not counted in total</li>
</ul>
<p>Members are:</p>
<ul>
{% for author in mauthors %}
<li><a href="#author-{{ author.safe_email }}">{{ author.name }}</a> merged {{ mcommitd[author.email]|length }} commits</li>
{% endfor %}
</ul>
</section>
</section>
<section id="index">{{ TOP }}<h1>Author Index</h1>
<ul>
{%- for author in authors %}
<li>#{{ author.rank }} <a href="#author-{{ author.tag }}">{{ author.name }}</a>({{ author.commits|length }} commits
{%- if author in newfaces.authors %}, <span style="color:red">New!</span>{% elif author in actives.authors %}, <span style="color:blue">Active!</span>{% endif -%}
)</li>
{%- endfor %}
</ul>
</section>
</div>
<section id="author">{{ TOP }}<h1>Authors</h1>
{% for author in authors %}
<section id="author-{{ author.tag }}" class="fixed">{{ TOP }}<h1 id="{{ author.names[0] }}">{{ author.names[0] }}</h1>
<section>
<dl>
{% if author.names|length > 1 %}
<dt>Other names:</dt>
<dd>{% for name in author.names[1:] %}{{ name }} {% endfor %}</dd>
{% endif %}
</dl>
</section>
</section>
{% endfor %}
</section>
<footer>
<p>Generated by <a href="https://github.com/youknowone/gitstat">gitstat</a></p>
<p>Generated at {{ gentime }}</p>
{% if settings.GOOGLE_ANALYTICS %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ settings.GOOGLE_ANALYTICS[0] }}', '{{ settings.GOOGLE_ANALYTICS[1] }}');
ga('send', 'pageview');
</script>
{% endif %}
{% if settings.PIWIK%}
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
_paq.push(['setTrackerUrl', PIWIK['tracker']]);
_paq.push(['setSiteId', 1]);
_paq.push(['setApiToken', PIWIK['token']]);
var d=document, g=d.createElement('script'),
s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true;
g.src=PIWIK['source'];
s.parentNode.insertBefore(g,s);
})();
</script>
{% endif %}
</footer>
</div>
</body>
</html>