hubstats 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/fonts/hubstats/octicons.ttf +0 -0
  3. data/app/assets/fonts/hubstats/octicons.woff +0 -0
  4. data/app/assets/javascripts/hubstats/users.js +17 -0
  5. data/app/assets/stylesheets/hubstats/application.css +26 -7
  6. data/app/assets/stylesheets/hubstats/label.css +2 -1
  7. data/app/assets/stylesheets/hubstats/octicons.css.erb +247 -0
  8. data/app/controllers/hubstats/users_controller.rb +3 -3
  9. data/app/models/hubstats/user.rb +33 -1
  10. data/app/views/hubstats/partials/_header.html.erb +2 -1
  11. data/app/views/hubstats/partials/_user.html.erb +42 -0
  12. data/app/views/hubstats/users/index.html.erb +32 -5
  13. data/lib/hubstats/engine.rb +4 -0
  14. data/lib/hubstats/version.rb +1 -1
  15. data/test/dummy/log/development.log +0 -0
  16. data/test/dummy/tmp/cache/assets/C86/E00/sprockets%2F652cdc396e5788a9241b9355e4c10640 +0 -0
  17. data/test/dummy/tmp/cache/assets/CAD/3D0/sprockets%2F781852b612e12270af6602bdb8f985a4 +0 -0
  18. data/test/dummy/tmp/cache/assets/CBC/4C0/sprockets%2F43796510bea9e088167ff07f3d0a8484 +0 -0
  19. data/test/dummy/tmp/cache/assets/CE1/620/sprockets%2F2eaf40f9364d1a5fc929f615681430e2 +0 -0
  20. data/test/dummy/tmp/cache/assets/D07/C60/sprockets%2Fad1ce92f0e63a75c63272177af6c0542 +0 -0
  21. data/test/dummy/tmp/cache/assets/D1B/C20/sprockets%2F7246ab80e3a902497a99edde782139bd +0 -0
  22. data/test/dummy/tmp/cache/assets/D1E/690/sprockets%2F87b902b589445ed855fa47700d19ddcd +0 -0
  23. data/test/dummy/tmp/cache/assets/D20/FF0/sprockets%2F941bab9382328e98fd569386d1ec0af5 +0 -0
  24. data/test/dummy/tmp/cache/assets/D36/A00/sprockets%2F75301ef3d29df5cff0d6594be00a2117 +0 -0
  25. data/test/dummy/tmp/cache/assets/D3D/470/sprockets%2Ff6740e85131eb3c5c3836792c5db0ccd +0 -0
  26. data/test/dummy/tmp/cache/assets/D81/B70/sprockets%2F7b0f8c0b8a0e320eaaa66e350144e3bb +0 -0
  27. data/test/dummy/tmp/cache/assets/D85/310/sprockets%2F5bfbaf42e04878ffee659890736e5ac4 +0 -0
  28. data/test/dummy/tmp/cache/assets/DC7/950/sprockets%2Fb2e4de5539bdbb6b902390acad4f384d +0 -0
  29. data/test/dummy/tmp/cache/assets/DDE/160/sprockets%2Fad7ae04f67dc2e97b7956ea219e4bc8f +0 -0
  30. data/test/dummy/tmp/cache/assets/E06/450/sprockets%2Ffcd574cdf1957cd4acd029f0de961dd5 +0 -0
  31. data/test/dummy/tmp/cache/assets/E4E/EF0/sprockets%2F5783afe3d038c6cdce49c1cbdaa12acb +0 -0
  32. metadata +18 -4
  33. data/app/assets/images/hubstats/car.png +0 -0
  34. data/app/assets/images/hubstats/green.png +0 -0
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGJkYzE4MWNlZmJjOWQwNDk3Y2UwZWI5ZThmM2NmMzQ3YjdjZWIzNA==
4
+ OWZlN2VmYTljZDQ1NjkyOWU2OWU0ZTFiZThlZGI1ZmY4Y2I0MDYwYw==
5
5
  data.tar.gz: !binary |-
6
- ZWI0NWZmNTU0N2NlNTQ3MWU1MzEwNzc3ZWQwOTllNmNjMGYzYTI0NA==
6
+ YjE3NjRiZmVlMDQ1ODEwMGI3ZmFiZDJkOWYwOGE1YzZlMmE4OGU1Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2RlOGE4NGM0YWI3NDIxNDdkMDhjMzU3ZGFlZDBlMGFjYWEzMGRmZWY5NGJl
10
- ZjI4Y2FkNDk5MzRkNGEyMGUzNTY4MTNkZjFkZTBlNDk2OGVjOTNjZjY0ZDg2
11
- NDgxYmE3NDBhMWI5NjI1NmI4NDk4NWYzNGFiOTMyNTkwNmJiZjY=
9
+ NzQyZmVhMzhhM2VmYTMzMTEwZTE1MWVmOTVhNDczMjc5MGM5OTkwMmQxZDZl
10
+ MjIyOTY1MjgzOTM4OTViZTA1OGE4ZjIxY2M1MmM0Yzk1NmQ3MGJiYzc5NjA5
11
+ MGZlYmQwNzc5ZDM2YTRlZTQyNzk5NGFkNTM4OTkwY2YwMDYwYzA=
12
12
  data.tar.gz: !binary |-
13
- MDdkMmUxNTU2ZDUxOTFhZGM2MzVkNzRlNmZlZjc4MmRmYWE3NDQxMTJkZjQy
14
- NjZmYmM4YjFhOWQ4NDQ4NTYyNjE0Nzc5YWY1OTJhNmE0YTJkMjc4ZDQ4Mzcw
15
- OWRiZWVlM2JjYTc1NTVmOGY3MWYxMTIwZDJmYmUzYzc3NjUyMDM=
13
+ NGUyODU2YjZhMGFmYWZjNTdjZTIwZTkwM2I3MjM2YWNkNGE4NGMxYTFkYmQ3
14
+ ODI5ODI4Y2VjZTI3NjZhZTRlZjNlNTZmMjA2MGFkZDI3ODExYjkyNjc1NDUx
15
+ ZGIxYTVkOTIwYTBhZTNhNzUzMGI3NmUyY2E1MWEyMGE4ZjNjZGE=
@@ -1,2 +1,19 @@
1
1
  // Place all the behaviors and hooks related to the matching controller here.
2
2
  // All this logic will automatically be available in application.js.
3
+
4
+ $(document).ready(function() {
5
+ queryParameters = getUrlVars();
6
+ setUserDefaults(queryParameters);
7
+
8
+ $("#user-sort-group > .btn").on("click", function(){
9
+ updateQueryStringParameter(queryParameters,"order",$(this).attr('id'));
10
+ });
11
+
12
+ });
13
+
14
+ function setUserDefaults(queryParameters) {
15
+ if (queryParameters["order"])
16
+ $('#' + queryParameters["order"]).addClass('active');
17
+ else
18
+ $('#smallest-pulls').addClass('active');
19
+ }
@@ -28,7 +28,17 @@
28
28
  font-size: 28px;
29
29
  }
30
30
 
31
- .single-comment > .user-image, .single-pull > .user-image {
31
+ .text-large {
32
+ font-size: 32px;
33
+ }
34
+ .stat-label {
35
+ display: inline-block;
36
+ }
37
+
38
+ .single-comment > .user-image,
39
+ .single-pull > .user-image,
40
+ .single-user > .user-image,
41
+ .single-user > .user-image-small {
32
42
  padding: 5px;
33
43
  }
34
44
 
@@ -37,17 +47,22 @@
37
47
  height: 55px;
38
48
  }
39
49
 
40
- .pulls, .comments {
50
+ .user-image-small > img{
51
+ width: 45px;
52
+ height: 45px;
53
+ }
54
+
55
+ .pulls, .comments, .users {
41
56
  margin: 15px 0px 15px 0px;
42
57
  border: 1px solid #ccc;
43
58
  border-radius: 5px;
44
59
  }
45
60
 
46
- .pulls > .col, .comments > .col {
61
+ .pulls > .col, .comments > .col, .users > .col{
47
62
  padding: 0px 5px 0px 5px;
48
63
  }
49
64
 
50
- .row .single-pull, .row .single-comment {
65
+ .row .single-pull, .row .single-comment, .row .single-user{
51
66
  padding:5px;
52
67
  margin: 0px;
53
68
  border-bottom: 1px solid #ccc;
@@ -58,10 +73,11 @@
58
73
  margin-bottom: 5px;
59
74
  }
60
75
 
61
- .single-pull > .pull-info {
76
+ .single-pull > .pull-info, .single-user > .user-info {
62
77
  padding: 0px;
63
78
  }
64
- .pull-info > h4 {
79
+
80
+ .pull-info > h4, .user-info > h4 {
65
81
  margin: 0px;
66
82
  }
67
83
 
@@ -71,4 +87,7 @@
71
87
 
72
88
  .push-down-farther {
73
89
  margin-top: 15px;
74
- }
90
+ }
91
+
92
+ .subtle:hover {
93
+ text-decoration: none;
@@ -5,7 +5,7 @@
5
5
  margin-bottom: 2px;
6
6
  }
7
7
 
8
- .btn-label:hover {
8
+ .btn-label:hover{
9
9
  color: #000000;
10
10
  background-color: #EEEEEE;
11
11
  }
@@ -14,6 +14,7 @@
14
14
  box-shadow: none;
15
15
  }
16
16
 
17
+
17
18
  .circle-label {
18
19
  width: 5px;
19
20
  height: 14px;
@@ -0,0 +1,247 @@
1
+ @font-face {
2
+ font-family: 'octicons';
3
+ src: url('<%= asset_path("hubstats/octicons.eot") + "?#iefix" %>') format('embedded-opentype'),
4
+ url('<%= asset_path("hubstats/octicons.woff") %>') format('woff'),
5
+ url('<%= asset_path("hubstats/octicons.ttf") %>') format('truetype'),
6
+ url('octicons.svg#octicons') format('svg');
7
+ font-weight: normal;
8
+ font-style: normal;
9
+ }
10
+
11
+ /*
12
+
13
+ .octicon is optimized for 16px.
14
+ .mega-octicon is optimized for 32px but can be used larger.
15
+
16
+ */
17
+ .octicon {
18
+ font: normal normal 16px octicons;
19
+ line-height: 1;
20
+ display: inline-block;
21
+ text-decoration: none;
22
+ -webkit-font-smoothing: antialiased;
23
+ -moz-osx-font-smoothing: grayscale;
24
+ -webkit-user-select: none;
25
+ -moz-user-select: none;
26
+ -ms-user-select: none;
27
+ user-select: none;
28
+ cursor: default;
29
+ }
30
+ .mega-octicon {
31
+ font: normal normal 32px octicons;
32
+ line-height: 1;
33
+ display: inline-block;
34
+ text-decoration: none;
35
+ -webkit-font-smoothing: antialiased;
36
+ -moz-osx-font-smoothing: grayscale;
37
+ -webkit-user-select: none;
38
+ -moz-user-select: none;
39
+ -ms-user-select: none;
40
+ user-select: none;
41
+ cursor: default;
42
+ }
43
+
44
+ .octicon-alert:before { content: '\f02d'} /*  */
45
+ .octicon-alignment-align:before { content: '\f08a'} /*  */
46
+ .octicon-alignment-aligned-to:before { content: '\f08e'} /*  */
47
+ .octicon-alignment-unalign:before { content: '\f08b'} /*  */
48
+ .octicon-arrow-down:before { content: '\f03f'} /*  */
49
+ .octicon-arrow-left:before { content: '\f040'} /*  */
50
+ .octicon-arrow-right:before { content: '\f03e'} /*  */
51
+ .octicon-arrow-small-down:before { content: '\f0a0'} /*  */
52
+ .octicon-arrow-small-left:before { content: '\f0a1'} /*  */
53
+ .octicon-arrow-small-right:before { content: '\f071'} /*  */
54
+ .octicon-arrow-small-up:before { content: '\f09f'} /*  */
55
+ .octicon-arrow-up:before { content: '\f03d'} /*  */
56
+ .octicon-beer:before { content: '\f069'} /*  */
57
+ .octicon-book:before { content: '\f007'} /*  */
58
+ .octicon-bookmark:before { content: '\f07b'} /*  */
59
+ .octicon-briefcase:before { content: '\f0d3'} /*  */
60
+ .octicon-broadcast:before { content: '\f048'} /*  */
61
+ .octicon-browser:before { content: '\f0c5'} /*  */
62
+ .octicon-bug:before { content: '\f091'} /*  */
63
+ .octicon-calendar:before { content: '\f068'} /*  */
64
+ .octicon-check:before { content: '\f03a'} /*  */
65
+ .octicon-checklist:before { content: '\f076'} /*  */
66
+ .octicon-chevron-down:before { content: '\f0a3'} /*  */
67
+ .octicon-chevron-left:before { content: '\f0a4'} /*  */
68
+ .octicon-chevron-right:before { content: '\f078'} /*  */
69
+ .octicon-chevron-up:before { content: '\f0a2'} /*  */
70
+ .octicon-circle-slash:before { content: '\f084'} /*  */
71
+ .octicon-circuit-board:before { content: '\f0d6'} /*  */
72
+ .octicon-clippy:before { content: '\f035'} /*  */
73
+ .octicon-clock:before { content: '\f046'} /*  */
74
+ .octicon-cloud-download:before { content: '\f00b'} /*  */
75
+ .octicon-cloud-upload:before { content: '\f00c'} /*  */
76
+ .octicon-code:before { content: '\f05f'} /*  */
77
+ .octicon-color-mode:before { content: '\f065'} /*  */
78
+ .octicon-comment-add:before,
79
+ .octicon-comment:before { content: '\f02b'} /*  */
80
+ .octicon-comment-discussion:before { content: '\f04f'} /*  */
81
+ .octicon-credit-card:before { content: '\f045'} /*  */
82
+ .octicon-dash:before { content: '\f0ca'} /*  */
83
+ .octicon-dashboard:before { content: '\f07d'} /*  */
84
+ .octicon-database:before { content: '\f096'} /*  */
85
+ .octicon-device-camera:before { content: '\f056'} /*  */
86
+ .octicon-device-camera-video:before { content: '\f057'} /*  */
87
+ .octicon-device-desktop:before { content: '\f27c'} /*  */
88
+ .octicon-device-mobile:before { content: '\f038'} /*  */
89
+ .octicon-diff:before { content: '\f04d'} /*  */
90
+ .octicon-diff-added:before { content: '\f06b'} /*  */
91
+ .octicon-diff-ignored:before { content: '\f099'} /*  */
92
+ .octicon-diff-modified:before { content: '\f06d'} /*  */
93
+ .octicon-diff-removed:before { content: '\f06c'} /*  */
94
+ .octicon-diff-renamed:before { content: '\f06e'} /*  */
95
+ .octicon-ellipsis:before { content: '\f09a'} /*  */
96
+ .octicon-eye-unwatch:before,
97
+ .octicon-eye-watch:before,
98
+ .octicon-eye:before { content: '\f04e'} /*  */
99
+ .octicon-file-binary:before { content: '\f094'} /*  */
100
+ .octicon-file-code:before { content: '\f010'} /*  */
101
+ .octicon-file-directory:before { content: '\f016'} /*  */
102
+ .octicon-file-media:before { content: '\f012'} /*  */
103
+ .octicon-file-pdf:before { content: '\f014'} /*  */
104
+ .octicon-file-submodule:before { content: '\f017'} /*  */
105
+ .octicon-file-symlink-directory:before { content: '\f0b1'} /*  */
106
+ .octicon-file-symlink-file:before { content: '\f0b0'} /*  */
107
+ .octicon-file-text:before { content: '\f011'} /*  */
108
+ .octicon-file-zip:before { content: '\f013'} /*  */
109
+ .octicon-flame:before { content: '\f0d2'} /*  */
110
+ .octicon-fold:before { content: '\f0cc'} /*  */
111
+ .octicon-gear:before { content: '\f02f'} /*  */
112
+ .octicon-gift:before { content: '\f042'} /*  */
113
+ .octicon-gist:before { content: '\f00e'} /*  */
114
+ .octicon-gist-secret:before { content: '\f08c'} /*  */
115
+ .octicon-git-branch-create:before,
116
+ .octicon-git-branch-delete:before,
117
+ .octicon-git-branch:before { content: '\f020'} /*  */
118
+ .octicon-git-commit:before { content: '\f01f'} /*  */
119
+ .octicon-git-compare:before { content: '\f0ac'} /*  */
120
+ .octicon-git-merge:before { content: '\f023'} /*  */
121
+ .octicon-git-pull-request-abandoned:before,
122
+ .octicon-git-pull-request:before { content: '\f009'} /*  */
123
+ .octicon-globe:before { content: '\f0b6'} /*  */
124
+ .octicon-graph:before { content: '\f043'} /*  */
125
+ .octicon-heart:before { content: '\2665'} /* ♥ */
126
+ .octicon-history:before { content: '\f07e'} /*  */
127
+ .octicon-home:before { content: '\f08d'} /*  */
128
+ .octicon-horizontal-rule:before { content: '\f070'} /*  */
129
+ .octicon-hourglass:before { content: '\f09e'} /*  */
130
+ .octicon-hubot:before { content: '\f09d'} /*  */
131
+ .octicon-inbox:before { content: '\f0cf'} /*  */
132
+ .octicon-info:before { content: '\f059'} /*  */
133
+ .octicon-issue-closed:before { content: '\f028'} /*  */
134
+ .octicon-issue-opened:before { content: '\f026'} /*  */
135
+ .octicon-issue-reopened:before { content: '\f027'} /*  */
136
+ .octicon-jersey:before { content: '\f019'} /*  */
137
+ .octicon-jump-down:before { content: '\f072'} /*  */
138
+ .octicon-jump-left:before { content: '\f0a5'} /*  */
139
+ .octicon-jump-right:before { content: '\f0a6'} /*  */
140
+ .octicon-jump-up:before { content: '\f073'} /*  */
141
+ .octicon-key:before { content: '\f049'} /*  */
142
+ .octicon-keyboard:before { content: '\f00d'} /*  */
143
+ .octicon-law:before { content: '\f0d8'} /* */
144
+ .octicon-light-bulb:before { content: '\f000'} /*  */
145
+ .octicon-link:before { content: '\f05c'} /*  */
146
+ .octicon-link-external:before { content: '\f07f'} /*  */
147
+ .octicon-list-ordered:before { content: '\f062'} /*  */
148
+ .octicon-list-unordered:before { content: '\f061'} /*  */
149
+ .octicon-location:before { content: '\f060'} /*  */
150
+ .octicon-gist-private:before,
151
+ .octicon-mirror-private:before,
152
+ .octicon-git-fork-private:before,
153
+ .octicon-lock:before { content: '\f06a'} /*  */
154
+ .octicon-logo-github:before { content: '\f092'} /*  */
155
+ .octicon-mail:before { content: '\f03b'} /*  */
156
+ .octicon-mail-read:before { content: '\f03c'} /*  */
157
+ .octicon-mail-reply:before { content: '\f051'} /*  */
158
+ .octicon-mark-github:before { content: '\f00a'} /*  */
159
+ .octicon-markdown:before { content: '\f0c9'} /*  */
160
+ .octicon-megaphone:before { content: '\f077'} /*  */
161
+ .octicon-mention:before { content: '\f0be'} /*  */
162
+ .octicon-microscope:before { content: '\f089'} /*  */
163
+ .octicon-milestone:before { content: '\f075'} /*  */
164
+ .octicon-mirror-public:before,
165
+ .octicon-mirror:before { content: '\f024'} /*  */
166
+ .octicon-mortar-board:before { content: '\f0d7'} /* */
167
+ .octicon-move-down:before { content: '\f0a8'} /*  */
168
+ .octicon-move-left:before { content: '\f074'} /*  */
169
+ .octicon-move-right:before { content: '\f0a9'} /*  */
170
+ .octicon-move-up:before { content: '\f0a7'} /*  */
171
+ .octicon-mute:before { content: '\f080'} /*  */
172
+ .octicon-no-newline:before { content: '\f09c'} /*  */
173
+ .octicon-octoface:before { content: '\f008'} /*  */
174
+ .octicon-organization:before { content: '\f037'} /*  */
175
+ .octicon-package:before { content: '\f0c4'} /*  */
176
+ .octicon-paintcan:before { content: '\f0d1'} /*  */
177
+ .octicon-pencil:before { content: '\f058'} /*  */
178
+ .octicon-person-add:before,
179
+ .octicon-person-follow:before,
180
+ .octicon-person:before { content: '\f018'} /*  */
181
+ .octicon-pin:before { content: '\f041'} /*  */
182
+ .octicon-playback-fast-forward:before { content: '\f0bd'} /*  */
183
+ .octicon-playback-pause:before { content: '\f0bb'} /*  */
184
+ .octicon-playback-play:before { content: '\f0bf'} /*  */
185
+ .octicon-playback-rewind:before { content: '\f0bc'} /*  */
186
+ .octicon-plug:before { content: '\f0d4'} /*  */
187
+ .octicon-repo-create:before,
188
+ .octicon-gist-new:before,
189
+ .octicon-file-directory-create:before,
190
+ .octicon-file-add:before,
191
+ .octicon-plus:before { content: '\f05d'} /*  */
192
+ .octicon-podium:before { content: '\f0af'} /*  */
193
+ .octicon-primitive-dot:before { content: '\f052'} /*  */
194
+ .octicon-primitive-square:before { content: '\f053'} /*  */
195
+ .octicon-pulse:before { content: '\f085'} /*  */
196
+ .octicon-puzzle:before { content: '\f0c0'} /*  */
197
+ .octicon-question:before { content: '\f02c'} /*  */
198
+ .octicon-quote:before { content: '\f063'} /*  */
199
+ .octicon-radio-tower:before { content: '\f030'} /*  */
200
+ .octicon-repo-delete:before,
201
+ .octicon-repo:before { content: '\f001'} /*  */
202
+ .octicon-repo-clone:before { content: '\f04c'} /*  */
203
+ .octicon-repo-force-push:before { content: '\f04a'} /*  */
204
+ .octicon-gist-fork:before,
205
+ .octicon-repo-forked:before { content: '\f002'} /*  */
206
+ .octicon-repo-pull:before { content: '\f006'} /*  */
207
+ .octicon-repo-push:before { content: '\f005'} /*  */
208
+ .octicon-rocket:before { content: '\f033'} /*  */
209
+ .octicon-rss:before { content: '\f034'} /*  */
210
+ .octicon-ruby:before { content: '\f047'} /*  */
211
+ .octicon-screen-full:before { content: '\f066'} /*  */
212
+ .octicon-screen-normal:before { content: '\f067'} /*  */
213
+ .octicon-search-save:before,
214
+ .octicon-search:before { content: '\f02e'} /*  */
215
+ .octicon-server:before { content: '\f097'} /*  */
216
+ .octicon-settings:before { content: '\f07c'} /*  */
217
+ .octicon-log-in:before,
218
+ .octicon-sign-in:before { content: '\f036'} /*  */
219
+ .octicon-log-out:before,
220
+ .octicon-sign-out:before { content: '\f032'} /*  */
221
+ .octicon-split:before { content: '\f0c6'} /*  */
222
+ .octicon-squirrel:before { content: '\f0b2'} /*  */
223
+ .octicon-star-add:before,
224
+ .octicon-star-delete:before,
225
+ .octicon-star:before { content: '\f02a'} /*  */
226
+ .octicon-steps:before { content: '\f0c7'} /*  */
227
+ .octicon-stop:before { content: '\f08f'} /*  */
228
+ .octicon-repo-sync:before,
229
+ .octicon-sync:before { content: '\f087'} /*  */
230
+ .octicon-tag-remove:before,
231
+ .octicon-tag-add:before,
232
+ .octicon-tag:before { content: '\f015'} /*  */
233
+ .octicon-telescope:before { content: '\f088'} /*  */
234
+ .octicon-terminal:before { content: '\f0c8'} /*  */
235
+ .octicon-three-bars:before { content: '\f05e'} /*  */
236
+ .octicon-tools:before { content: '\f031'} /*  */
237
+ .octicon-trashcan:before { content: '\f0d0'} /*  */
238
+ .octicon-triangle-down:before { content: '\f05b'} /*  */
239
+ .octicon-triangle-left:before { content: '\f044'} /*  */
240
+ .octicon-triangle-right:before { content: '\f05a'} /*  */
241
+ .octicon-triangle-up:before { content: '\f0aa'} /*  */
242
+ .octicon-unfold:before { content: '\f039'} /*  */
243
+ .octicon-unmute:before { content: '\f0ba'} /*  */
244
+ .octicon-versions:before { content: '\f064'} /*  */
245
+ .octicon-remove-close:before,
246
+ .octicon-x:before { content: '\f081'} /*  */
247
+ .octicon-zap:before { content: '\26A1'} /* ⚡ */
@@ -4,12 +4,12 @@ module Hubstats
4
4
  class UsersController < ApplicationController
5
5
 
6
6
  def index
7
- if params[:query]
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.with_pulls_or_comments(@timespan)
12
+ @users = Hubstats::User.with_all_metrics(@timespan).with_id(params[:users]).custom_order(params[:order]).paginate(:page => params[:page], :per_page => 15)
13
13
  end
14
14
 
15
15
  respond_to do |format|
@@ -1,6 +1,8 @@
1
1
  module Hubstats
2
2
  class User < ActiveRecord::Base
3
3
 
4
+ scope :with_id, lambda {|user_id| where(id: user_id.split(',')) if user_id}
5
+
4
6
  scope :pull_requests_count, lambda { |time|
5
7
  select("hubstats_users.id as user_id")
6
8
  .select("COUNT(DISTINCT hubstats_pull_requests.id) AS pull_request_count")
@@ -34,6 +36,14 @@ module Hubstats
34
36
  .group("hubstats_users.id")
35
37
  }
36
38
 
39
+ scope :averages, lambda { |time|
40
+ select("hubstats_users.id as user_id")
41
+ .select("ROUND(IFNULL(AVG(hubstats_pull_requests.additions),0)) AS average_additions")
42
+ .select("ROUND(IFNULL(AVG(hubstats_pull_requests.deletions),0)) AS average_deletions")
43
+ .joins("LEFT JOIN hubstats_pull_requests ON hubstats_pull_requests.user_id = hubstats_users.id AND hubstats_pull_requests.closed_at > '#{time}'")
44
+ .group("hubstats_users.id")
45
+ }
46
+
37
47
  scope :pull_and_comment_count, lambda { |time|
38
48
  select("hubstats_users.*, pull_request_count, comment_count")
39
49
  .joins("LEFT JOIN (#{pull_requests_count(time).to_sql}) AS pull_requests ON pull_requests.user_id = hubstats_users.id")
@@ -42,12 +52,20 @@ module Hubstats
42
52
  }
43
53
 
44
54
  scope :pull_and_comment_count_by_repo, lambda { |time,repo_id|
45
- select("hubstats_users.*, pull_request_count, comment_count")
55
+ select("hubstats_users.*, pull_request_count, comment_count")
46
56
  .joins("LEFT JOIN (#{pull_requests_count_by_repo(time,repo_id).to_sql}) AS pull_requests ON pull_requests.user_id = hubstats_users.id")
47
57
  .joins("LEFT JOIN (#{comments_count_by_repo(time,repo_id).to_sql}) AS comments ON comments.user_id = hubstats_users.id")
48
58
  .group("hubstats_users.id")
49
59
  }
50
60
 
61
+ scope :with_all_metrics, lambda { |time|
62
+ select("hubstats_users.*, pull_request_count, comment_count, average_additions, average_deletions")
63
+ .joins("LEFT JOIN (#{averages(time).to_sql}) AS averages ON averages.user_id = hubstats_users.id")
64
+ .joins("LEFT JOIN (#{pull_requests_count(time).to_sql}) AS pull_requests ON pull_requests.user_id = hubstats_users.id")
65
+ .joins("LEFT JOIN (#{comments_count(time).to_sql}) AS comments ON comments.user_id = hubstats_users.id")
66
+ .group("hubstats_users.id")
67
+ }
68
+
51
69
  scope :only_active, having("comment_count > 0 OR pull_request_count > 0")
52
70
  scope :weighted_sort, order("(pull_request_count)*2 + (comment_count) DESC")
53
71
 
@@ -80,6 +98,20 @@ module Hubstats
80
98
  end
81
99
  end
82
100
 
101
+ def self.custom_order(order)
102
+
103
+ case order
104
+ when 'largest-pulls'
105
+ order("average_additions = 0, average_additions DESC")
106
+ when 'most-active'
107
+ order("(pull_request_count)*2 + (comment_count) DESC")
108
+ when 'least-active'
109
+ order("(pull_request_count)*2 + (comment_count) ASC")
110
+ else
111
+ order("average_additions = 0, average_additions ASC")
112
+ end
113
+ end
114
+
83
115
  def to_param
84
116
  self.login
85
117
  end
@@ -15,7 +15,8 @@
15
15
  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
16
16
  <ul class="nav navbar-nav navbar-right">
17
17
  <li><%= link_to "Metrics", root_path%></li>
18
- <li><%= link_to "Search", pulls_path%></li>
18
+ <li><%= link_to "Pulls", pulls_path%></li>
19
+ <li><%= link_to "Users", users_path%></li>
19
20
  <li>
20
21
  <select class="form-control push-down" id="time-select">
21
22
  <% Hubstats::TIMESPAN_ARRAY.each do |timespan| %>
@@ -0,0 +1,42 @@
1
+ <div class="row single-user">
2
+ <div class="user-image col-lg-1 col-md-1 col-sm-1" >
3
+ <img src= <%= user.avatar_url%> alt= <%= user.login %> >
4
+ </div>
5
+ <div class="user-info col-lg-3 col-md-3 col-sm-3">
6
+ <h4>
7
+ <%= link_to user.login, user_path(user) %>
8
+ </h4>
9
+ <br>
10
+ <h4>
11
+ <a class="subtle" href=<%= user.html_url %> >
12
+ <span class="octicon octicon-mark-github"></span>
13
+ <span class="octicon octicon-logo-github"></span>
14
+ </a>
15
+ </h4>
16
+ </div>
17
+ <div class="col-lg-2 col-md-2 col-sm-2">
18
+ <div class="push-down pull-right">
19
+ <span class="text-large"><%= user.pull_request_count %></span>
20
+ <span class="mega-octicon octicon-git-pull-request"></span>
21
+ </div>
22
+ </div>
23
+ <div class="col-lg-2 col-md-2 col-sm-2">
24
+ <div class="push-down pull-right">
25
+ <span class="text-large"><%= user.comment_count %></span>
26
+ <span class="mega-octicon octicon-comment"></span>
27
+ </div>
28
+ </div>
29
+ <div class="col-lg-2 col-md-2 col-sm-2">
30
+ <div class="push-down pull-right">
31
+ <span class="text-large"><%= user.average_additions %></span>
32
+ <span class="mega-octicon octicon-plus"></span>
33
+ </div>
34
+ </div>
35
+ <div class="col-lg-2 col-md-2 col-sm-2">
36
+ <div class="push-down pull-right">
37
+ <span class="text-large"><%= user.average_deletions %></span>
38
+ <span class="mega-octicon octicon-dash"></span>
39
+ </div>
40
+ </div>
41
+
42
+ </div>
@@ -1,8 +1,35 @@
1
- <div class="container" id="user">
2
- <div class="row">
3
- <div class="col col-lg-5 col-lg-offset-2">
4
- <h3> All Users </h3>
5
- <%= render 'hubstats/metrics/users_table' %>
1
+ <div class="container" id="user"%>
2
+ <div class="row"%>
3
+ <div class="col-lg-3">
4
+ <div class="form-group">
5
+ <input class="select2-control" id="users">
6
+ </input>
7
+ </div>
8
+ </div>
9
+
10
+ <div class="col-lg-9">
11
+
12
+ <div id="user-sort-group" class="btn-group" data-toggle="buttons">
13
+ <label class="btn btn-default" id='smallest-pulls'>
14
+ <input type="radio" name="sort"> Smallest Pulls
15
+ </label>
16
+ <label class="btn btn-default" id='largest-pulls'>
17
+ <input type="radio" name="sort"> Largest Pulls
18
+ </label>
19
+ <label class="btn btn-default" id='most-active'>
20
+ <input type="radio" name="sort"> Most Active
21
+ </label>
22
+ <label class="btn btn-default" id='least-active'>
23
+ <input type="radio" name="sort"> Least Active
24
+ </label>
25
+ </div>
26
+
27
+ <div class="users">
28
+ <%= render partial: 'hubstats/partials/user', collection: @users, as: :user %>
29
+ </div>
30
+ <div class="text-center">
31
+ <%= will_paginate @users, renderer: BootstrapPagination::Rails %>
32
+ </div>
6
33
  </div>
7
34
  </div>
8
35
  </div>
@@ -2,6 +2,10 @@ module Hubstats
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace Hubstats
4
4
 
5
+ initializer :assets do |config|
6
+ Rails.application.config.assets.paths << root.join("app", "assets", "fonts")
7
+ end
8
+
5
9
  require 'octokit'
6
10
  require 'select2-rails'
7
11
  require 'will_paginate-bootstrap'
@@ -1,3 +1,3 @@
1
1
  module Hubstats
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Hursh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-11 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -132,8 +132,8 @@ files:
132
132
  - MIT-LICENSE
133
133
  - README.rdoc
134
134
  - Rakefile
135
- - app/assets/images/hubstats/car.png
136
- - app/assets/images/hubstats/green.png
135
+ - app/assets/fonts/hubstats/octicons.ttf
136
+ - app/assets/fonts/hubstats/octicons.woff
137
137
  - app/assets/javascripts/hubstats/application.js
138
138
  - app/assets/javascripts/hubstats/bootstrap.js
139
139
  - app/assets/javascripts/hubstats/bootstrap.min.js
@@ -146,6 +146,7 @@ files:
146
146
  - app/assets/stylesheets/hubstats/bootstrap.css
147
147
  - app/assets/stylesheets/hubstats/events.css
148
148
  - app/assets/stylesheets/hubstats/label.css
149
+ - app/assets/stylesheets/hubstats/octicons.css.erb
149
150
  - app/assets/stylesheets/hubstats/pull_requests.css
150
151
  - app/assets/stylesheets/hubstats/repos.css
151
152
  - app/assets/stylesheets/hubstats/users.css
@@ -173,6 +174,7 @@ files:
173
174
  - app/views/hubstats/partials/_comment.html.erb
174
175
  - app/views/hubstats/partials/_header.html.erb
175
176
  - app/views/hubstats/partials/_pull.html.erb
177
+ - app/views/hubstats/partials/_user.html.erb
176
178
  - app/views/hubstats/pull_requests/index.html.erb
177
179
  - app/views/hubstats/pull_requests/repo_index.html.erb
178
180
  - app/views/hubstats/pull_requests/show.html.erb
@@ -244,6 +246,7 @@ files:
244
246
  - test/dummy/script/rails
245
247
  - test/dummy/tmp/cache/assets/C6A/070/sprockets%2F722061c11245ef57a10b2a8b249536a6
246
248
  - test/dummy/tmp/cache/assets/C80/780/sprockets%2Fc1cf9f40564205993336f5119dc8301d
249
+ - test/dummy/tmp/cache/assets/C86/E00/sprockets%2F652cdc396e5788a9241b9355e4c10640
247
250
  - test/dummy/tmp/cache/assets/C97/B60/sprockets%2Faec576e1f9385471867ed31d55077188
248
251
  - test/dummy/tmp/cache/assets/CA0/2B0/sprockets%2F00310502bf37155c1d795a84d46e1fa7
249
252
  - test/dummy/tmp/cache/assets/CA2/FC0/sprockets%2Fc0a86d68e0c4a2374484370da89d1000
@@ -260,7 +263,9 @@ files:
260
263
  - test/dummy/tmp/cache/assets/CE5/950/sprockets%2F6011591ca606d6465ffe00aa59798f4f
261
264
  - test/dummy/tmp/cache/assets/CED/160/sprockets%2Fd17778dcc64ba05d748e9596851b42b2
262
265
  - test/dummy/tmp/cache/assets/D00/000/sprockets%2Fca55ed2e244f0ae2454363027cae0865
266
+ - test/dummy/tmp/cache/assets/D07/C60/sprockets%2Fad1ce92f0e63a75c63272177af6c0542
263
267
  - test/dummy/tmp/cache/assets/D0D/BB0/sprockets%2F4b4c7844619dabbb1b0f7e2074492e84
268
+ - test/dummy/tmp/cache/assets/D1B/C20/sprockets%2F7246ab80e3a902497a99edde782139bd
264
269
  - test/dummy/tmp/cache/assets/D1E/160/sprockets%2F6b06e88c694fe253732afa662e4b83d8
265
270
  - test/dummy/tmp/cache/assets/D1E/690/sprockets%2F87b902b589445ed855fa47700d19ddcd
266
271
  - test/dummy/tmp/cache/assets/D20/FF0/sprockets%2F941bab9382328e98fd569386d1ec0af5
@@ -270,6 +275,7 @@ files:
270
275
  - test/dummy/tmp/cache/assets/D32/070/sprockets%2F7e8b1f51c452335eaa6dc3ac440332f9
271
276
  - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
272
277
  - test/dummy/tmp/cache/assets/D36/3E0/sprockets%2Fe7b229d2e8b64144c71d471fa910a2dd
278
+ - test/dummy/tmp/cache/assets/D36/A00/sprockets%2F75301ef3d29df5cff0d6594be00a2117
273
279
  - test/dummy/tmp/cache/assets/D38/CB0/sprockets%2F29c1b9d8419784ce13da2b3f174ac2d1
274
280
  - test/dummy/tmp/cache/assets/D3A/D50/sprockets%2Ff40159b97cbd42cd120ab6db69d67182
275
281
  - test/dummy/tmp/cache/assets/D3C/190/sprockets%2F5fe63949cfff6024125e2c1ef0242cd3
@@ -293,6 +299,7 @@ files:
293
299
  - test/dummy/tmp/cache/assets/D9E/0F0/sprockets%2Fddaeeb8234f096140f35c06ff538bbe6
294
300
  - test/dummy/tmp/cache/assets/DAA/D80/sprockets%2Fe7bd68eb95e047454adfc49e5f0b8e11
295
301
  - test/dummy/tmp/cache/assets/DC7/5C0/sprockets%2F4af3c5fb39b4b93a7fc1c5db2c05c583
302
+ - test/dummy/tmp/cache/assets/DC7/950/sprockets%2Fb2e4de5539bdbb6b902390acad4f384d
296
303
  - test/dummy/tmp/cache/assets/DD8/5A0/sprockets%2Fdc77251d6c233eeecb693ff083f35eee
297
304
  - test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
298
305
  - test/dummy/tmp/cache/assets/DDD/E60/sprockets%2Fe81c794a9e4d16cb9e35c8b8ee5b6b2c
@@ -306,6 +313,7 @@ files:
306
313
  - test/dummy/tmp/cache/assets/E10/920/sprockets%2Fe2793fe8a9f6773e8d2d5bececb01b7f
307
314
  - test/dummy/tmp/cache/assets/E30/D10/sprockets%2F5be1e5ad45bde1dbd7fb9f8d720277ea
308
315
  - test/dummy/tmp/cache/assets/E41/A20/sprockets%2F23cef5db9fa9d95cf84a2c688b5fe6ab
316
+ - test/dummy/tmp/cache/assets/E4E/EF0/sprockets%2F5783afe3d038c6cdce49c1cbdaa12acb
309
317
  - test/functional/hubstats/splash_controller_test.rb
310
318
  - test/hubstats_test.rb
311
319
  - test/integration/navigation_test.rb
@@ -379,6 +387,7 @@ test_files:
379
387
  - test/dummy/script/rails
380
388
  - test/dummy/tmp/cache/assets/C6A/070/sprockets%2F722061c11245ef57a10b2a8b249536a6
381
389
  - test/dummy/tmp/cache/assets/C80/780/sprockets%2Fc1cf9f40564205993336f5119dc8301d
390
+ - test/dummy/tmp/cache/assets/C86/E00/sprockets%2F652cdc396e5788a9241b9355e4c10640
382
391
  - test/dummy/tmp/cache/assets/C97/B60/sprockets%2Faec576e1f9385471867ed31d55077188
383
392
  - test/dummy/tmp/cache/assets/CA0/2B0/sprockets%2F00310502bf37155c1d795a84d46e1fa7
384
393
  - test/dummy/tmp/cache/assets/CA2/FC0/sprockets%2Fc0a86d68e0c4a2374484370da89d1000
@@ -395,7 +404,9 @@ test_files:
395
404
  - test/dummy/tmp/cache/assets/CE5/950/sprockets%2F6011591ca606d6465ffe00aa59798f4f
396
405
  - test/dummy/tmp/cache/assets/CED/160/sprockets%2Fd17778dcc64ba05d748e9596851b42b2
397
406
  - test/dummy/tmp/cache/assets/D00/000/sprockets%2Fca55ed2e244f0ae2454363027cae0865
407
+ - test/dummy/tmp/cache/assets/D07/C60/sprockets%2Fad1ce92f0e63a75c63272177af6c0542
398
408
  - test/dummy/tmp/cache/assets/D0D/BB0/sprockets%2F4b4c7844619dabbb1b0f7e2074492e84
409
+ - test/dummy/tmp/cache/assets/D1B/C20/sprockets%2F7246ab80e3a902497a99edde782139bd
399
410
  - test/dummy/tmp/cache/assets/D1E/160/sprockets%2F6b06e88c694fe253732afa662e4b83d8
400
411
  - test/dummy/tmp/cache/assets/D1E/690/sprockets%2F87b902b589445ed855fa47700d19ddcd
401
412
  - test/dummy/tmp/cache/assets/D20/FF0/sprockets%2F941bab9382328e98fd569386d1ec0af5
@@ -405,6 +416,7 @@ test_files:
405
416
  - test/dummy/tmp/cache/assets/D32/070/sprockets%2F7e8b1f51c452335eaa6dc3ac440332f9
406
417
  - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
407
418
  - test/dummy/tmp/cache/assets/D36/3E0/sprockets%2Fe7b229d2e8b64144c71d471fa910a2dd
419
+ - test/dummy/tmp/cache/assets/D36/A00/sprockets%2F75301ef3d29df5cff0d6594be00a2117
408
420
  - test/dummy/tmp/cache/assets/D38/CB0/sprockets%2F29c1b9d8419784ce13da2b3f174ac2d1
409
421
  - test/dummy/tmp/cache/assets/D3A/D50/sprockets%2Ff40159b97cbd42cd120ab6db69d67182
410
422
  - test/dummy/tmp/cache/assets/D3C/190/sprockets%2F5fe63949cfff6024125e2c1ef0242cd3
@@ -428,6 +440,7 @@ test_files:
428
440
  - test/dummy/tmp/cache/assets/D9E/0F0/sprockets%2Fddaeeb8234f096140f35c06ff538bbe6
429
441
  - test/dummy/tmp/cache/assets/DAA/D80/sprockets%2Fe7bd68eb95e047454adfc49e5f0b8e11
430
442
  - test/dummy/tmp/cache/assets/DC7/5C0/sprockets%2F4af3c5fb39b4b93a7fc1c5db2c05c583
443
+ - test/dummy/tmp/cache/assets/DC7/950/sprockets%2Fb2e4de5539bdbb6b902390acad4f384d
431
444
  - test/dummy/tmp/cache/assets/DD8/5A0/sprockets%2Fdc77251d6c233eeecb693ff083f35eee
432
445
  - test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
433
446
  - test/dummy/tmp/cache/assets/DDD/E60/sprockets%2Fe81c794a9e4d16cb9e35c8b8ee5b6b2c
@@ -441,6 +454,7 @@ test_files:
441
454
  - test/dummy/tmp/cache/assets/E10/920/sprockets%2Fe2793fe8a9f6773e8d2d5bececb01b7f
442
455
  - test/dummy/tmp/cache/assets/E30/D10/sprockets%2F5be1e5ad45bde1dbd7fb9f8d720277ea
443
456
  - test/dummy/tmp/cache/assets/E41/A20/sprockets%2F23cef5db9fa9d95cf84a2c688b5fe6ab
457
+ - test/dummy/tmp/cache/assets/E4E/EF0/sprockets%2F5783afe3d038c6cdce49c1cbdaa12acb
444
458
  - test/functional/hubstats/splash_controller_test.rb
445
459
  - test/hubstats_test.rb
446
460
  - test/integration/navigation_test.rb
Binary file
Binary file