Skip to content

Commit

Permalink
community/: Display contributor statistics
Browse files Browse the repository at this point in the history
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
  • Loading branch information
KVGarg committed Jul 30, 2019
1 parent cbae07d commit 982791f
Show file tree
Hide file tree
Showing 6 changed files with 921 additions and 0 deletions.
43 changes: 43 additions & 0 deletions data/migrations/0007_auto_20190727_1348.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 2.1.7 on 2019-07-27 13:48

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('data', '0006_auto_20190615_1331'),
]

operations = [
migrations.AddField(
model_name='contributor',
name='is_gci_participant',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='contributor',
name='oauth_completed',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='contributor',
name='statistics',
field=models.TextField(default=None, null=True),
),
migrations.AddField(
model_name='contributor',
name='type_of_issues_worked_on',
field=models.TextField(default=None, null=True),
),
migrations.AddField(
model_name='contributor',
name='updated_at',
field=models.TextField(default=None, null=True),
),
migrations.AddField(
model_name='contributor',
name='working_on_issues_count',
field=models.TextField(default=None, null=True),
),
]
6 changes: 6 additions & 0 deletions data/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ class Contributor(models.Model):
issues_opened = models.IntegerField(default=None, null=True)
location = models.TextField(default=None, null=True)
teams = models.ManyToManyField(Team, related_name='contributors')
statistics = models.TextField(default=None, null=True)
type_of_issues_worked_on = models.TextField(default=None, null=True)
is_gci_participant = models.BooleanField(default=False)
working_on_issues_count = models.TextField(default=None, null=True)
updated_at = models.TextField(default=None, null=True)
oauth_completed = models.BooleanField(default=False)

def __str__(self):
return self.login
Expand Down
17 changes: 17 additions & 0 deletions static/contributors-data.json

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions static/css/contributors.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
min-width: 300px;
}

.repository-canvas {
position: relative;
margin: auto;
width: 60vw;
height: 70vh;
}

.search-results {
width: 100%;
background-color: transparent;
Expand All @@ -62,3 +69,57 @@
border-color: darkgray;
border-style: solid;
}

.some-important-information, .issues-labels,
.github-issue-labels, .issues-count, .user-updated-datetime,
.gitlab-issue-labels{
padding: 0 10px;
}

.stats-canvas {
position: relative;
margin: auto;
width: 35vw;
height: 50vh;
}

.user-statistics {
display: none;
position: relative;
margin-top: -380px;
left: 10%;
width: 80%;
height: 70vh;
background-color: white;
z-index: 1002;
overflow: auto;
border-radius: 10px;
box-shadow: 0 0 25px 2px black;
}

.user-statistics-option {
position: absolute;
float: right;
margin-left: 180px;
margin-top: 10px;
background: black;
color: white;
font-size: 1.5rem;
border-radius: 50px;
width: 20px;
text-align: center;
cursor: pointer;
}

@media only screen and (max-width: 600px) {
.stats-canvas {
width: 50vw;
height: 50vh;
}
}

/*@media only screen and (max-width: 991px) {*/
/* .user-statistics {*/
/* margin-top: -40%;*/
/* }*/
/*}*/
Loading

0 comments on commit 982791f

Please sign in to comment.