Skip to content

Commit b3413fe

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 dae9c66 commit b3413fe

File tree

5 files changed

+899
-1
lines changed

5 files changed

+899
-1
lines changed
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Generated by Django 2.1.7 on 2019-08-02 20:15
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('data', '0006_auto_20190801_1752'),
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+
]

data/models.py

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class Contributor(models.Model):
2020
issues_opened = models.IntegerField(default=None, null=True)
2121
location = models.TextField(default=None, null=True)
2222
teams = models.ManyToManyField(Team, related_name='contributors')
23+
statistics = models.TextField(default=None, null=True)
24+
type_of_issues_worked_on = models.TextField(default=None, null=True)
25+
is_gci_participant = models.BooleanField(default=False)
26+
working_on_issues_count = models.TextField(default=None, null=True)
27+
updated_at = models.TextField(default=None, null=True)
28+
oauth_completed = models.BooleanField(default=False)
2329

2430
def __str__(self):
2531
return self.login

static/css/contributors.css

+55
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,51 @@
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: fixed;
89+
top: 15%;
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+
}

0 commit comments

Comments
 (0)