add missing gallery section

This commit is contained in:
byte[] 2019-12-08 11:00:46 -05:00
parent 7de9c69434
commit d3972f728f
2 changed files with 25 additions and 1 deletions

View file

@ -82,7 +82,13 @@ defmodule PhilomenaWeb.StatController do
defp galleries do
gallery_count = Repo.aggregate(Gallery, :count, :id)
gallery_size = Float.round(Repo.aggregate(Gallery, :avg, :image_count) || 0.0, 2)
gallery_size =
Repo.aggregate(Gallery, :avg, :image_count)
|> Kernel.||(Decimal.new(0))
|> Decimal.to_float()
|> trunc()
distinct_creators =
Gallery
|> distinct(:creator_id)

View file

@ -75,6 +75,24 @@ elixir:
= number_with_delimiter(@users_24h)
' have joined in the last 24 hours.
h3 Galleries
p
' There are
span.stat>
= number_with_delimiter(@gallery_count)
' existing image galleries on the site, created by
span.stat>
= number_with_delimiter(@distinct_creators)
' distinct creators. There are, on average,
span.stat>
= number_with_delimiter(@gallery_size)
' images in each gallery.
p
' In total, images have been added to galleries
span.stat>
= number_with_delimiter(@images_in_galleries)
' times.
h3 Commissions
p
' There are