Skip to content

Commit 982791f

Browse files
committed
community/: Display contributor statistics
Show the contributor statistics in the form of charts. The charts will be shown for issues, commits, reviews and for merge requests. And, an overall chart, which will display stats repository wise. Apart from all these charts, the type of issues the contrib has worked on will be shown, with the count of issues the user is working on and the last updated datetime the user data was updated. All this will be shown, only if there is some statistics, otherwise the popup option willn't be shown. Closes coala#268
1 parent cbae07d commit 982791f

File tree

6 files changed

+921
-0
lines changed

6 files changed

+921
-0
lines changed

Diff for: data/migrations/0007_auto_20190727_1348.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Generated by Django 2.1.7 on 2019-07-27 13:48
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('data', '0006_auto_20190615_1331'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='contributor',
15+
name='is_gci_participant',
16+
field=models.BooleanField(default=False),
17+
),
18+
migrations.AddField(
19+
model_name='contributor',
20+
name='oauth_completed',
21+
field=models.BooleanField(default=False),
22+
),
23+
migrations.AddField(
24+
model_name='contributor',
25+
name='statistics',
26+
field=models.TextField(default=None, null=True),
27+
),
28+
migrations.AddField(
29+
model_name='contributor',
30+
name='type_of_issues_worked_on',
31+
field=models.TextField(default=None, null=True),
32+
),
33+
migrations.AddField(
34+
model_name='contributor',
35+
name='updated_at',
36+
field=models.TextField(default=None, null=True),
37+
),
38+
migrations.AddField(
39+
model_name='contributor',
40+
name='working_on_issues_count',
41+
field=models.TextField(default=None, null=True),
42+
),
43+
]

Diff for: data/models.py

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ class Contributor(models.Model):
1717
issues_opened = models.IntegerField(default=None, null=True)
1818
location = models.TextField(default=None, null=True)
1919
teams = models.ManyToManyField(Team, related_name='contributors')
20+
statistics = models.TextField(default=None, null=True)
21+
type_of_issues_worked_on = models.TextField(default=None, null=True)
22+
is_gci_participant = models.BooleanField(default=False)
23+
working_on_issues_count = models.TextField(default=None, null=True)
24+
updated_at = models.TextField(default=None, null=True)
25+
oauth_completed = models.BooleanField(default=False)
2026

2127
def __str__(self):
2228
return self.login

Diff for: static/contributors-data.json

+17
Large diffs are not rendered by default.

Diff for: static/css/contributors.css

+61
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
min-width: 300px;
4848
}
4949

50+
.repository-canvas {
51+
position: relative;
52+
margin: auto;
53+
width: 60vw;
54+
height: 70vh;
55+
}
56+
5057
.search-results {
5158
width: 100%;
5259
background-color: transparent;
@@ -62,3 +69,57 @@
6269
border-color: darkgray;
6370
border-style: solid;
6471
}
72+
73+
.some-important-information, .issues-labels,
74+
.github-issue-labels, .issues-count, .user-updated-datetime,
75+
.gitlab-issue-labels{
76+
padding: 0 10px;
77+
}
78+
79+
.stats-canvas {
80+
position: relative;
81+
margin: auto;
82+
width: 35vw;
83+
height: 50vh;
84+
}
85+
86+
.user-statistics {
87+
display: none;
88+
position: relative;
89+
margin-top: -380px;
90+
left: 10%;
91+
width: 80%;
92+
height: 70vh;
93+
background-color: white;
94+
z-index: 1002;
95+
overflow: auto;
96+
border-radius: 10px;
97+
box-shadow: 0 0 25px 2px black;
98+
}
99+
100+
.user-statistics-option {
101+
position: absolute;
102+
float: right;
103+
margin-left: 180px;
104+
margin-top: 10px;
105+
background: black;
106+
color: white;
107+
font-size: 1.5rem;
108+
border-radius: 50px;
109+
width: 20px;
110+
text-align: center;
111+
cursor: pointer;
112+
}
113+
114+
@media only screen and (max-width: 600px) {
115+
.stats-canvas {
116+
width: 50vw;
117+
height: 50vh;
118+
}
119+
}
120+
121+
/*@media only screen and (max-width: 991px) {*/
122+
/* .user-statistics {*/
123+
/* margin-top: -40%;*/
124+
/* }*/
125+
/*}*/

0 commit comments

Comments
 (0)