Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/models/statistics/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ class Statistics::Users < Statistics::Statistics
def pctrecent(value)
"%.0f%%" % (100.0 * value / nb_recently_seen_accounts)
end


def pctrecent_filled(value,field)
# take into account those having declared an xmpp or mastodon account
"%.0f%%" % (100.0 * value / filled(field))
end

def nb_users
count "SELECT COUNT(*) AS cnt FROM users"
end
Expand Down
7 changes: 7 additions & 0 deletions app/views/statistics/users.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
%th Domaines à plus de trois comptes
%th Nombre de comptes
%th Actifs
%th % déclarés
- @stats.top_xmpp_domains.each do |domain|
%tr
%td.stat
Expand All @@ -257,6 +258,8 @@
.stat.misc(style="width: #{(width_stats * domain["cnt"] / maxval).to_i}px;")= domain["cnt"]
%td
#{@stats.pctrecent(domain["cnt"])}
%td
#{@stats.pctrecent_filled(domain["cnt"],"jabber_id")}

%h2#stats_mastodon Domaines Mastodon
%p
Expand All @@ -267,6 +270,7 @@
%th Domaines à plus de trois comptes
%th Nombre de comptes
%th Actifs
%th % déclarés
- @stats.top_mastodon_domains.each do |domain|
%tr
%td.stat
Expand All @@ -275,6 +279,9 @@
.stat.misc(style="width: #{(width_stats * domain["cnt"] / maxval).to_i}px;")= domain["cnt"]
%td
#{@stats.pctrecent(domain["cnt"])}
%td
#{@stats.pctrecent_filled(domain["cnt"],"mastodon_url")}


%h2#stats_fonctionnalites Utilisation des fonctionnalités
%p
Expand Down