hubstats 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.markdown +9 -0
- data/app/assets/javascripts/hubstats/bootstrap.js +38 -38
- data/app/assets/javascripts/hubstats/users.js +10 -5
- data/app/controllers/hubstats/application_controller.rb +0 -1
- data/app/controllers/hubstats/base_controller.rb +13 -0
- data/app/controllers/hubstats/deploys_controller.rb +26 -49
- data/app/controllers/hubstats/pull_requests_controller.rb +10 -14
- data/app/controllers/hubstats/repos_controller.rb +46 -24
- data/app/controllers/hubstats/users_controller.rb +24 -12
- data/app/models/hubstats/deploy.rb +36 -0
- data/app/models/hubstats/pull_request.rb +2 -2
- data/app/models/hubstats/repo.rb +63 -1
- data/app/models/hubstats/user.rb +29 -26
- data/app/views/hubstats/partials/_deploy-condensed.html.erb +1 -0
- data/app/views/hubstats/partials/_deploy.html.erb +1 -1
- data/app/views/hubstats/partials/_pull-condensed.html.erb +2 -1
- data/app/views/hubstats/partials/_pull.html.erb +1 -1
- data/app/views/hubstats/partials/_quick_addition_stats.html.erb +14 -2
- data/app/views/hubstats/partials/_quick_stats.html.erb +24 -12
- data/app/views/hubstats/partials/_repo.html.erb +37 -8
- data/app/views/hubstats/partials/_user.html.erb +1 -14
- data/app/views/hubstats/repos/dashboard.html.erb +1 -1
- data/app/views/hubstats/repos/show.html.erb +2 -9
- data/app/views/hubstats/tables/_repos.html.erb +19 -0
- data/app/views/hubstats/tables/_users.html.erb +1 -7
- data/app/views/hubstats/users/show.html.erb +3 -5
- data/config/routes.rb +8 -8
- data/lib/hubstats/github_api.rb +8 -6
- data/lib/hubstats/version.rb +1 -1
- data/spec/controllers/hubstats/deploys_controller_spec.rb +43 -47
- data/spec/controllers/hubstats/pull_requests_controller_spec.rb +41 -2
- data/spec/controllers/hubstats/repos_controller_spec.rb +62 -2
- data/spec/controllers/hubstats/users_controller_spec.rb +30 -2
- metadata +3 -2
@@ -4,12 +4,15 @@ module Hubstats
|
|
4
4
|
class UsersController < ApplicationController
|
5
5
|
|
6
6
|
def index
|
7
|
-
if params[:query] ## For select 2
|
7
|
+
if params[:query] ## For select 2
|
8
8
|
@users = Hubstats::User.where("login LIKE ?", "%#{params[:query]}%").order("login ASC")
|
9
|
-
elsif params[:id]
|
9
|
+
elsif params[:id]
|
10
10
|
@users = Hubstats::User.where(id: params[:id].split(",")).order("login ASC")
|
11
11
|
else
|
12
|
-
@users = Hubstats::User.only_active.with_all_metrics(@timespan)
|
12
|
+
@users = Hubstats::User.only_active.with_all_metrics(@timespan)
|
13
|
+
.with_id(params[:users])
|
14
|
+
.custom_order(params[:order])
|
15
|
+
.paginate(:page => params[:page], :per_page => 15)
|
13
16
|
end
|
14
17
|
|
15
18
|
respond_to do |format|
|
@@ -20,20 +23,29 @@ module Hubstats
|
|
20
23
|
|
21
24
|
def show
|
22
25
|
@user = Hubstats::User.where(login: params[:id]).first
|
23
|
-
@pull_requests = Hubstats::PullRequest.belonging_to_user(@user.id).
|
24
|
-
@
|
25
|
-
@deploys = Hubstats::Deploy.belonging_to_user(@user.id).deployed_since(@timespan).limit(20)
|
26
|
-
@pull_count = Hubstats::PullRequest.belonging_to_user(@user.id).updated_since(@timespan).count(:all)
|
26
|
+
@pull_requests = Hubstats::PullRequest.belonging_to_user(@user.id).merged_since(@timespan).order("updated_at DESC").limit(20)
|
27
|
+
@pull_count = Hubstats::PullRequest.belonging_to_user(@user.id).merged_since(@timespan).count(:all)
|
28
|
+
@deploys = Hubstats::Deploy.belonging_to_user(@user.id).deployed_since(@timespan).order("deployed_at DESC").limit(20)
|
27
29
|
@deploy_count = Hubstats::Deploy.belonging_to_user(@user.id).deployed_since(@timespan).count(:all)
|
28
30
|
@comment_count = Hubstats::Comment.belonging_to_user(@user.id).created_since(@timespan).count(:all)
|
31
|
+
@net_additions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_user(@user.id).sum(:additions).to_i -
|
32
|
+
Hubstats::PullRequest.merged_since(@timespan).belonging_to_user(@user.id).sum(:deletions).to_i
|
33
|
+
@additions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_user(@user.id).average(:additions)
|
34
|
+
@deletions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_user(@user.id).average(:deletions)
|
35
|
+
|
36
|
+
stats
|
37
|
+
end
|
38
|
+
|
39
|
+
def stats
|
40
|
+
@additions ||= 0
|
41
|
+
@deletions ||= 0
|
29
42
|
@stats_basics = {
|
30
|
-
pull_count:
|
43
|
+
pull_count: @pull_count,
|
31
44
|
deploy_count: @deploy_count,
|
32
45
|
comment_count: @comment_count,
|
33
|
-
avg_additions:
|
34
|
-
avg_deletions:
|
35
|
-
net_additions:
|
36
|
-
Hubstats::PullRequest.merged_since(@timespan).belonging_to_user(@user.id).sum(:deletions).to_i
|
46
|
+
avg_additions: @additions.round.to_i,
|
47
|
+
avg_deletions: @deletions.round.to_i,
|
48
|
+
net_additions: @net_additions
|
37
49
|
}
|
38
50
|
end
|
39
51
|
|
@@ -41,5 +41,41 @@ module Hubstats
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
# finds the total number of additions or deletions for all pull requests in this deploy
|
45
|
+
def total_changes(add)
|
46
|
+
pull_requests = self.pull_requests
|
47
|
+
total = 0
|
48
|
+
pull_requests.each do |pull|
|
49
|
+
if add == :additions
|
50
|
+
total += pull.additions.to_i
|
51
|
+
elsif add == :deletions
|
52
|
+
total += pull.deletions.to_i
|
53
|
+
end
|
54
|
+
end
|
55
|
+
return total
|
56
|
+
end
|
57
|
+
|
58
|
+
# finds all of the additions and deletions in all pull requests and then makes the net additions
|
59
|
+
def find_net_additions
|
60
|
+
pull_requests = self.pull_requests
|
61
|
+
total_additions = 0
|
62
|
+
total_deletions = 0
|
63
|
+
pull_requests.each do |pull|
|
64
|
+
total_additions += pull.additions.to_i
|
65
|
+
total_deletions += pull.deletions.to_i
|
66
|
+
end
|
67
|
+
return total_additions - total_deletions
|
68
|
+
end
|
69
|
+
|
70
|
+
# returns the total amount of comments from all pull requests in a deploy
|
71
|
+
def find_comment_count
|
72
|
+
pull_requests = self.pull_requests
|
73
|
+
total_comments = 0
|
74
|
+
pull_requests.each do |pull|
|
75
|
+
total_comments += Hubstats::Comment.belonging_to_pull_request(pull.id).count(:all)
|
76
|
+
end
|
77
|
+
return total_comments
|
78
|
+
end
|
79
|
+
|
44
80
|
end
|
45
81
|
end
|
@@ -3,7 +3,7 @@ module Hubstats
|
|
3
3
|
scope :closed_since, lambda {|time| where("hubstats_pull_requests.closed_at > ?", time) }
|
4
4
|
scope :updated_since, lambda {|time| where("hubstats_pull_requests.updated_at > ?", time) }
|
5
5
|
scope :opened_since, lambda {|time| where("hubstats_pull_requests.created_at > ?", time) }
|
6
|
-
scope :merged_since, lambda {|time| where("hubstats_pull_requests.merged").where("hubstats_pull_requests.
|
6
|
+
scope :merged_since, lambda {|time| where("hubstats_pull_requests.merged").where("hubstats_pull_requests.merged_at > ?", time) }
|
7
7
|
scope :belonging_to_repo, lambda {|repo_id| where(repo_id: repo_id)}
|
8
8
|
scope :belonging_to_user, lambda {|user_id| where(user_id: user_id)}
|
9
9
|
scope :belonging_to_deploy, lambda {|deploy_id| where(deploy_id: deploy_id)}
|
@@ -64,7 +64,7 @@ module Hubstats
|
|
64
64
|
order = ["ASC","DESC"].detect{|order_type| order_type.to_s == order.to_s.upcase } || "DESC"
|
65
65
|
if state == "closed"
|
66
66
|
with_state(state).updated_since(timespan).order("hubstats_pull_requests.closed_at #{order}")
|
67
|
-
else
|
67
|
+
else #state == "open"
|
68
68
|
with_state(state).updated_since(timespan).order("hubstats_pull_requests.created_at #{order}")
|
69
69
|
end
|
70
70
|
end
|
data/app/models/hubstats/repo.rb
CHANGED
@@ -1,7 +1,47 @@
|
|
1
1
|
module Hubstats
|
2
2
|
class Repo < ActiveRecord::Base
|
3
3
|
|
4
|
-
scope :with_recent_activity, lambda {|time| where("updated_at > ?", time).order("updated_at DESC")
|
4
|
+
scope :with_recent_activity, lambda {|time| where("updated_at > ?", time).order("updated_at DESC")}
|
5
|
+
scope :with_id, lambda {|user_id| where(id: user_id.split(',')) if user_id}
|
6
|
+
|
7
|
+
scope :deploys_or_comments_count, lambda {|time, data, began_time, name|
|
8
|
+
select("hubstats_repos.id as repo_id")
|
9
|
+
.select("IFNULL(COUNT(DISTINCT #{data}.id),0) AS #{name}_count")
|
10
|
+
.joins("LEFT JOIN #{data} ON #{data}.repo_id = hubstats_repos.id AND #{data}.#{began_time} > '#{time}'")
|
11
|
+
.group("hubstats_repos.id")
|
12
|
+
}
|
13
|
+
|
14
|
+
scope :deploys_count, lambda {|time|
|
15
|
+
deploys_or_comments_count(time, "hubstats_deploys", "deployed_at", "deploy")
|
16
|
+
}
|
17
|
+
|
18
|
+
scope :comments_count, lambda {|time|
|
19
|
+
deploys_or_comments_count(time, "hubstats_comments", "created_at", "comment")
|
20
|
+
}
|
21
|
+
|
22
|
+
scope :pull_requests_count, lambda {|time|
|
23
|
+
select("hubstats_repos.id as repo_id")
|
24
|
+
.select("IFNULL(COUNT(DISTINCT hubstats_pull_requests.id),0) AS pull_request_count")
|
25
|
+
.joins("LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.repo_id = hubstats_repos.id AND hubstats_pull_requests.created_at > '#{time}' AND hubstats_pull_requests.merged = '1'")
|
26
|
+
.group("hubstats_repos.id")
|
27
|
+
}
|
28
|
+
|
29
|
+
scope :averages, lambda { |time|
|
30
|
+
select("hubstats_repos.id as repo_id")
|
31
|
+
.select("ROUND(IFNULL(AVG(hubstats_pull_requests.additions),0)) AS average_additions")
|
32
|
+
.select("ROUND(IFNULL(AVG(hubstats_pull_requests.deletions),0)) AS average_deletions")
|
33
|
+
.joins("LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.repo_id = hubstats_repos.id AND hubstats_pull_requests.merged = '1'")
|
34
|
+
.group("hubstats_repos.id")
|
35
|
+
}
|
36
|
+
|
37
|
+
scope :with_all_metrics, lambda { |time|
|
38
|
+
select("hubstats_repos.*, deploy_count, pull_request_count, comment_count, average_additions, average_deletions")
|
39
|
+
.joins("LEFT JOIN (#{averages(time).to_sql}) AS averages ON averages.repo_id = hubstats_repos.id")
|
40
|
+
.joins("LEFT JOIN (#{pull_requests_count(time).to_sql}) AS pull_requests ON pull_requests.repo_id = hubstats_repos.id")
|
41
|
+
.joins("LEFT JOIN (#{comments_count(time).to_sql}) AS comments ON comments.repo_id = hubstats_repos.id")
|
42
|
+
.joins("LEFT JOIN (#{deploys_count(time).to_sql}) AS deploys ON deploys.repo_id = hubstats_repos.id")
|
43
|
+
.group("hubstats_repos.id")
|
44
|
+
}
|
5
45
|
|
6
46
|
attr_accessible :id, :name, :full_name, :homepage, :language, :description, :default_branch,
|
7
47
|
:url, :html_url, :clone_url, :git_url, :ssh_url, :svn_url, :mirror_url,
|
@@ -28,6 +68,28 @@ module Hubstats
|
|
28
68
|
return repo if repo.update_attributes(repo_data)
|
29
69
|
Rails.logger.warn repo.errors.inspect
|
30
70
|
end
|
71
|
+
|
72
|
+
def self.custom_order(order_params)
|
73
|
+
if order_params
|
74
|
+
order = order_params.include?('asc') ? "ASC" : "DESC"
|
75
|
+
case order_params.split('-').first
|
76
|
+
when 'deploys'
|
77
|
+
order("deploy_count #{order}")
|
78
|
+
when 'pulls'
|
79
|
+
order("pull_request_count #{order}")
|
80
|
+
when 'comments'
|
81
|
+
order("comment_count #{order}")
|
82
|
+
when 'additions'
|
83
|
+
order("average_additions #{order}")
|
84
|
+
when 'deletions'
|
85
|
+
order("average_deletions #{order}")
|
86
|
+
else
|
87
|
+
order("pull_request_count #{order}")
|
88
|
+
end
|
89
|
+
else
|
90
|
+
order("pull_request_count DESC")
|
91
|
+
end
|
92
|
+
end
|
31
93
|
|
32
94
|
def to_param
|
33
95
|
self.name
|
data/app/models/hubstats/user.rb
CHANGED
@@ -3,36 +3,42 @@ module Hubstats
|
|
3
3
|
|
4
4
|
scope :with_id, lambda {|user_id| where(id: user_id.split(',')) if user_id}
|
5
5
|
|
6
|
-
scope :
|
6
|
+
scope :deploys_or_comments_count, lambda {|time, data, began_time, name|
|
7
|
+
select("hubstats_users.id as user_id")
|
8
|
+
.select("IFNULL(COUNT(DISTINCT #{data}.id),0) AS #{name}_count")
|
9
|
+
.joins("LEFT JOIN #{data} ON #{data}.user_id = hubstats_users.id AND #{data}.#{began_time} > '#{time}'")
|
10
|
+
.group("hubstats_users.id")
|
11
|
+
}
|
12
|
+
|
13
|
+
scope :deploys_count, lambda {|time|
|
14
|
+
deploys_or_comments_count(time, "hubstats_deploys", "deployed_at", "deploy")
|
15
|
+
}
|
16
|
+
|
17
|
+
scope :comments_count, lambda {|time|
|
18
|
+
deploys_or_comments_count(time, "hubstats_comments", "created_at", "comment")
|
19
|
+
}
|
20
|
+
|
21
|
+
scope :pull_requests_count, lambda {|time|
|
7
22
|
select("hubstats_users.id as user_id")
|
8
23
|
.select("IFNULL(COUNT(DISTINCT hubstats_pull_requests.id),0) AS pull_request_count")
|
9
24
|
.joins("LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.user_id = hubstats_users.id AND hubstats_pull_requests.created_at > '#{time}' AND hubstats_pull_requests.merged = '1'")
|
10
25
|
.group("hubstats_users.id")
|
11
26
|
}
|
12
|
-
|
27
|
+
|
28
|
+
scope :pull_requests_count_by_repo, lambda {|time,repo_id|
|
13
29
|
select("hubstats_users.id as user_id")
|
14
30
|
.select("IFNULL(COUNT(DISTINCT hubstats_pull_requests.id),0) AS pull_request_count")
|
15
31
|
.joins("LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.user_id = hubstats_users.id AND hubstats_pull_requests.created_at > '#{time}' AND hubstats_pull_requests.repo_id = '#{repo_id}' AND hubstats_pull_requests.merged = '1'")
|
16
32
|
.group("hubstats_users.id")
|
17
33
|
}
|
18
|
-
|
19
|
-
|
20
|
-
.select("IFNULL(COUNT(DISTINCT hubstats_deploys.id),0) AS deploy_count")
|
21
|
-
.joins("LEFT JOIN hubstats_deploys ON hubstats_deploys.user_id = hubstats_users.id AND hubstats_deploys.deployed_at > '#{time}'")
|
22
|
-
.group("hubstats_users.id")
|
23
|
-
}
|
24
|
-
scope :comments_count, lambda { |time|
|
25
|
-
select("hubstats_users.id as user_id")
|
26
|
-
.select("COUNT(DISTINCT hubstats_comments.id) AS comment_count")
|
27
|
-
.joins("LEFT JOIN hubstats_comments ON hubstats_comments.user_id = hubstats_users.id AND hubstats_comments.created_at > '#{time}'")
|
28
|
-
.group("hubstats_users.id")
|
29
|
-
}
|
30
|
-
scope :comments_count_by_repo, lambda { |time,repo_id|
|
34
|
+
|
35
|
+
scope :comments_count_by_repo, lambda {|time,repo_id|
|
31
36
|
select("hubstats_users.id as user_id")
|
32
37
|
.select("COUNT(DISTINCT hubstats_comments.id) AS comment_count")
|
33
38
|
.joins("LEFT JOIN hubstats_comments ON hubstats_comments.user_id = hubstats_users.id AND hubstats_comments.created_at > '#{time}' AND hubstats_comments.repo_id = '#{repo_id}'")
|
34
39
|
.group("hubstats_users.id")
|
35
40
|
}
|
41
|
+
|
36
42
|
scope :pulls_reviewed_count, lambda { |time|
|
37
43
|
select("hubstats_users.id as user_id")
|
38
44
|
.select("COUNT(DISTINCT hubstats_pull_requests.id) as reviews_count")
|
@@ -41,11 +47,11 @@ module Hubstats
|
|
41
47
|
.where("hubstats_pull_requests.user_id != hubstats_users.id")
|
42
48
|
.group("hubstats_users.id")
|
43
49
|
}
|
44
|
-
|
45
|
-
scope :
|
50
|
+
|
51
|
+
scope :net_additions_count, lambda { |time|
|
46
52
|
select("hubstats_users.id as user_id")
|
47
|
-
.select("
|
48
|
-
.select("
|
53
|
+
.select("SUM(IFNULL(hubstats_pull_requests.additions, 0)) AS additions")
|
54
|
+
.select("SUM(IFNULL(hubstats_pull_requests.deletions, 0)) AS deletions")
|
49
55
|
.joins("LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.user_id = hubstats_users.id AND hubstats_pull_requests.created_at > '#{time}' AND hubstats_pull_requests.merged = '1'")
|
50
56
|
.group("hubstats_users.id")
|
51
57
|
}
|
@@ -63,10 +69,9 @@ module Hubstats
|
|
63
69
|
.joins("LEFT JOIN (#{comments_count_by_repo(time,repo_id).to_sql}) AS comments ON comments.user_id = hubstats_users.id")
|
64
70
|
.group("hubstats_users.id")
|
65
71
|
}
|
66
|
-
|
67
72
|
scope :with_all_metrics, lambda { |time|
|
68
|
-
select("hubstats_users.*, deploy_count, pull_request_count, comment_count,
|
69
|
-
.joins("LEFT JOIN (#{
|
73
|
+
select("hubstats_users.*, deploy_count, pull_request_count, comment_count, additions, deletions")
|
74
|
+
.joins("LEFT JOIN (#{net_additions_count(time).to_sql}) AS net_additions ON net_additions.user_id = hubstats_users.id")
|
70
75
|
.joins("LEFT JOIN (#{pull_requests_count(time).to_sql}) AS pull_requests ON pull_requests.user_id = hubstats_users.id")
|
71
76
|
.joins("LEFT JOIN (#{comments_count(time).to_sql}) AS comments ON comments.user_id = hubstats_users.id")
|
72
77
|
.joins("LEFT JOIN (#{deploys_count(time).to_sql}) AS deploys ON deploys.user_id = hubstats_users.id")
|
@@ -116,10 +121,8 @@ module Hubstats
|
|
116
121
|
order("pull_request_count #{order}")
|
117
122
|
when 'comments'
|
118
123
|
order("comment_count #{order}")
|
119
|
-
when '
|
120
|
-
order("
|
121
|
-
when 'deletions'
|
122
|
-
order("average_deletions #{order}")
|
124
|
+
when 'netadditions'
|
125
|
+
order("additions - deletions #{order}")
|
123
126
|
else
|
124
127
|
order("pull_request_count #{order}")
|
125
128
|
end
|
@@ -8,6 +8,7 @@
|
|
8
8
|
<!-- Show the git revision and when the deploy happened by whom -->
|
9
9
|
<div class="deploy-info col-lg-6 col-md-6 col-sm-6 col-xs-5">
|
10
10
|
<h4>
|
11
|
+
<%= link_to deploy.repo.name, repo_path(deploy.repo.name) %> /
|
11
12
|
<%= link_to deploy.git_revision, deploy_path(deploy) %>
|
12
13
|
</h4>
|
13
14
|
by
|
@@ -6,7 +6,7 @@
|
|
6
6
|
</div>
|
7
7
|
|
8
8
|
<!-- Show the repo name, git revision, and who deployed it when -->
|
9
|
-
<div class="deploy-info col-lg-6 col-md-
|
9
|
+
<div class="deploy-info col-lg-6 col-md-6 col-sm-6">
|
10
10
|
<h4>
|
11
11
|
<%= link_to deploy.repo.name, repo_path(deploy.repo.name) %> /
|
12
12
|
<%= link_to deploy.git_revision, deploy_path(deploy) %>
|
@@ -5,11 +5,12 @@
|
|
5
5
|
|
6
6
|
<div class="pull-info col-lg-9 col-md-9 col-sm-9 col-xs-8">
|
7
7
|
<h4>
|
8
|
+
<%= link_to pull.repo.name, repo_path(pull.repo.name) %> /
|
8
9
|
<%= link_to pull.title, repo_pull_path({:repo => pull.repo.name, :id => pull.id}) %>
|
9
10
|
</h4>
|
10
11
|
by <%= link_to pull.user.login, user_path(pull.user) %>
|
11
12
|
<% if pull.merged == '1'%>
|
12
|
-
<%= "merged #{time_ago_in_words(pull.
|
13
|
+
<%= "merged #{time_ago_in_words(pull.merged_at)} ago "%>
|
13
14
|
<% elsif pull.state == 'closed' %>
|
14
15
|
<%= "closed #{time_ago_in_words(pull.closed_at)} ago "%>
|
15
16
|
<% else %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<br>
|
15
15
|
by <%= link_to pull.user.login, user_path(pull.user) %>
|
16
16
|
<% if pull.merged == '1'%>
|
17
|
-
<%= "merged #{time_ago_in_words(pull.
|
17
|
+
<%= "merged #{time_ago_in_words(pull.merged_at)} ago "%>
|
18
18
|
<% elsif pull.state == 'closed' %>
|
19
19
|
<%= "closed #{time_ago_in_words(pull.closed_at)} ago "%>
|
20
20
|
<% else %>
|
@@ -8,12 +8,24 @@
|
|
8
8
|
<% if @stats_additions.has_key? :avg_additions %>
|
9
9
|
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
10
10
|
<h1> <%= @stats_additions[:avg_additions] %> </h1>
|
11
|
-
<h4> Average Additions </h4>
|
11
|
+
<h4> Average Additions per Pull </h4>
|
12
12
|
</div>
|
13
13
|
<% end %>
|
14
14
|
<% if @stats_additions.has_key? :avg_deletions%>
|
15
15
|
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
16
16
|
<h1><%= @stats_additions[:avg_deletions] %> </h1>
|
17
|
-
<h4> Average Deletions </h4>
|
17
|
+
<h4> Average Deletions per Pull </h4>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
20
|
+
<% if @stats_additions.has_key? :additions %>
|
21
|
+
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
22
|
+
<h1> <%= @stats_additions[:additions] %> </h1>
|
23
|
+
<h4> Additions </h4>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
26
|
+
<% if @stats_additions.has_key? :deletions%>
|
27
|
+
<div class="col col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center">
|
28
|
+
<h1><%= @stats_additions[:deletions] %> </h1>
|
29
|
+
<h4> Deletions </h4>
|
18
30
|
</div>
|
19
31
|
<% end %>
|
@@ -1,50 +1,62 @@
|
|
1
1
|
<div class="col-lg-<%= (12-(@stats_basics.length)*2)/2 %>"></div>
|
2
2
|
|
3
3
|
<% if @stats_basics.has_key? :user_count %>
|
4
|
-
<div class="col col-lg-2 col-md-
|
4
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
5
5
|
<h1> <%= @stats_basics[:user_count] %> </h1>
|
6
6
|
<h4> Active Users </h4>
|
7
7
|
</div>
|
8
8
|
<% end %>
|
9
9
|
<% if @stats_basics.has_key? :deploy_count %>
|
10
|
-
<div class="col col-lg-2 col-md-
|
10
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
11
11
|
<h1> <%= @stats_basics[:deploy_count] %> </h1>
|
12
12
|
<h4> Deploys </h4>
|
13
13
|
</div>
|
14
14
|
<% end %>
|
15
15
|
<% if @stats_basics.has_key? :pull_count %>
|
16
|
-
<div class="col col-lg-2 col-md-
|
16
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
17
17
|
<h1> <%= @stats_basics[:pull_count] %> </h1>
|
18
|
-
<h4> Pull Requests </h4>
|
18
|
+
<h4> Merged Pull Requests </h4>
|
19
19
|
</div>
|
20
20
|
<% end %>
|
21
21
|
<% if @stats_basics.has_key? :comment_count %>
|
22
|
-
<div class="col col-lg-2 col-md-
|
22
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
23
23
|
<h1><%= @stats_basics[:comment_count] %> </h1>
|
24
24
|
<h4> Comments </h4>
|
25
25
|
</div>
|
26
26
|
<% end %>
|
27
27
|
<% if @stats_basics.has_key? :review_count %>
|
28
|
-
<div class="col col-lg-2 col-md-
|
28
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
29
29
|
<h1> <%= @stats_basics[:review_count] %> </h1>
|
30
30
|
<h4> Code Reviews </h4>
|
31
31
|
</div>
|
32
32
|
<% end %>
|
33
33
|
<% if @stats_basics.has_key? :net_additions %>
|
34
|
-
<div class="col col-lg-2 col-md-
|
34
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
35
35
|
<h1> <%= @stats_basics[:net_additions] %> </h1>
|
36
36
|
<h4> Net Additions </h4>
|
37
37
|
</div>
|
38
38
|
<% end %>
|
39
39
|
<% if @stats_basics.has_key? :avg_additions %>
|
40
|
-
<div class="col col-lg-2 col-md-
|
40
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
41
41
|
<h1> <%= @stats_basics[:avg_additions] %> </h1>
|
42
|
-
<h4> Average Additions </h4>
|
42
|
+
<h4> Average Additions per Pull </h4>
|
43
43
|
</div>
|
44
44
|
<% end %>
|
45
45
|
<% if @stats_basics.has_key? :avg_deletions%>
|
46
|
-
<div class="col col-lg-2 col-md-
|
46
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
47
47
|
<h1><%= @stats_basics[:avg_deletions] %> </h1>
|
48
|
-
<h4> Average Deletions </h4>
|
48
|
+
<h4> Average Deletions per Pull </h4>
|
49
49
|
</div>
|
50
|
-
|
50
|
+
<% end %>
|
51
|
+
<% if @stats_basics.has_key? :additions %>
|
52
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
53
|
+
<h1> <%= @stats_basics[:additions] %> </h1>
|
54
|
+
<h4> Additions </h4>
|
55
|
+
</div>
|
56
|
+
<% end %>
|
57
|
+
<% if @stats_basics.has_key? :deletions%>
|
58
|
+
<div class="col col-lg-2 col-md-3 col-sm-3 col-xs-3 text-center">
|
59
|
+
<h1><%= @stats_basics[:deletions] %> </h1>
|
60
|
+
<h4> Deletions </h4>
|
61
|
+
</div>
|
62
|
+
<% end %>
|
@@ -1,21 +1,50 @@
|
|
1
1
|
<div class="row single-repo">
|
2
|
-
|
2
|
+
<!-- <div class="repo-image-small col-lg-1 col-md-1 col-sm-1 col-xs-1" >
|
3
3
|
<span class="repo-octicon-small mega-octicon octicon-repo"></span>
|
4
|
-
</div>
|
4
|
+
</div> -->
|
5
5
|
|
6
|
-
<div class="repo-info col-lg-
|
6
|
+
<div class="repo-info col-lg-2 col-md-2 col-sm-2 col-xs-8">
|
7
7
|
<h4>
|
8
8
|
<%= link_to repo.name, repo_path(repo)%>
|
9
9
|
</h4>
|
10
10
|
updated <%= distance_of_time_in_words(DateTime.now,repo.updated_at) %> ago
|
11
|
-
|
12
|
-
|
13
|
-
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
14
|
-
<div class="pull-right">
|
11
|
+
<br>
|
12
|
+
<h4>
|
15
13
|
<a class="subtle" href=<%= repo.html_url %> >
|
16
14
|
<span class="octicon octicon-mark-github"></span>
|
15
|
+
<span class="octicon octicon-logo-github"></span>
|
17
16
|
</a>
|
18
|
-
|
17
|
+
</h4>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="col-lg-2 col-md-2 col-sm-2">
|
21
|
+
<div class="text-center">
|
22
|
+
<span class="text-large"><%= repo.deploy_count %></span>
|
23
|
+
<span class="mega-octicon octicon-rocket"></span>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<div class="col-lg-2 col-md-2 col-sm-2">
|
27
|
+
<div class="text-center">
|
28
|
+
<span class="text-large"><%= repo.pull_request_count %></span>
|
29
|
+
<span class="mega-octicon octicon-git-pull-request"></span>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
<div class="col-lg-2 col-md-2 col-sm-2">
|
33
|
+
<div class="text-center">
|
34
|
+
<span class="text-large"><%= repo.comment_count %></span>
|
35
|
+
<span class="mega-octicon octicon-comment"></span>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<div class="col-lg-2 col-md-2 col-sm-2">
|
39
|
+
<div class="text-center">
|
40
|
+
<span class="text-large"><%= repo.average_additions %></span>
|
41
|
+
<span class="mega-octicon octicon-plus"></span>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<div class="col-lg-2 col-md-2 col-sm-2">
|
45
|
+
<div class="text-center">
|
46
|
+
<span class="text-large"><%= repo.average_deletions %></span>
|
47
|
+
<span class="mega-octicon octicon-dash"></span>
|
19
48
|
</div>
|
20
49
|
</div>
|
21
50
|
</div>
|