Commit d2b77d7a39630859fb982c9fc784f5bcd8186ae0
1 parent
5f4ddcb7
Exists in
master
and in
2 other branches
Count users from google and facebook
Showing
2 changed files
with
15 additions
and
6 deletions
Show diff stats
header.html.erb
| ... | ... | @@ -29,19 +29,23 @@ |
| 29 | 29 | <% cache_timeout('dialoga_statistics', 1.hour) do %> |
| 30 | 30 | <div id="dialoga-statistics"> |
| 31 | 31 | <div class="users"> |
| 32 | - <span>Usuários: </span> | |
| 33 | - <span><%= environment.users.count %> (<%= environment.users.where('users.activated_at IS NOT NULL').count %> ativos)</span> | |
| 32 | + <span class="label">Usuários: </span> | |
| 33 | + <% users = environment.users %> | |
| 34 | + <span><%= users.count %> </span> | |
| 35 | + <span>(<%= users.where('users.activated_at IS NOT NULL').count %> ativos, </span> | |
| 36 | + <span><%= users.joins(:oauth_providers).where(:oauth_client_plugin_providers => {:strategy => 'google_oauth2'}).count %> google, </span> | |
| 37 | + <span><%= users.joins(:oauth_providers).where(:oauth_client_plugin_providers => {:strategy => 'facebook'}).count %> facebook)</span> | |
| 34 | 38 | </div> |
| 35 | 39 | <div class="votes"> |
| 36 | - <span>Votos: </span> | |
| 40 | + <span class="label">Votos: </span> | |
| 37 | 41 | <span><%= Vote.count %></span> |
| 38 | 42 | </div> |
| 39 | 43 | <div class="followers"> |
| 40 | - <span>Participações nos hangouts: </span> | |
| 44 | + <span class="label">Participações nos hangouts: </span> | |
| 41 | 45 | <span><%= ArticleFollower.count %></span> |
| 42 | 46 | </div> |
| 43 | 47 | <div class="proposals"> |
| 44 | - <span>Propostas: </span> | |
| 48 | + <span class="label">Propostas: </span> | |
| 45 | 49 | <% proposals = profile.tasks.where(:type => 'ProposalsDiscussionPlugin::ProposalTask') %> |
| 46 | 50 | <span><%= proposals.count %></span> |
| 47 | 51 | <span>(<%= proposals.where(:status => Task::Status::ACTIVE).count %> pendentes, </span> | ... | ... |
style.css
| ... | ... | @@ -256,9 +256,14 @@ div#inlineLoginBox label.formlabel { |
| 256 | 256 | right: 0; |
| 257 | 257 | color: gray; |
| 258 | 258 | font-size: 11px; |
| 259 | - max-width: 300px; | |
| 259 | + max-width: 350px; | |
| 260 | + margin-right: 10px; | |
| 260 | 261 | } |
| 261 | 262 | #dialoga-statistics .updated-at { |
| 262 | 263 | font-size: 10px; |
| 263 | 264 | color: rgb(182, 182, 182); |
| 264 | 265 | } |
| 266 | +#dialoga-statistics .label { | |
| 267 | + font-weight: bold; | |
| 268 | + color: rgb(170, 170, 170); | |
| 269 | +} | ... | ... |