mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-20 04:14:23 +01:00
add missing gallery section
This commit is contained in:
parent
7de9c69434
commit
d3972f728f
2 changed files with 25 additions and 1 deletions
|
@ -82,7 +82,13 @@ defmodule PhilomenaWeb.StatController do
|
||||||
|
|
||||||
defp galleries do
|
defp galleries do
|
||||||
gallery_count = Repo.aggregate(Gallery, :count, :id)
|
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 =
|
distinct_creators =
|
||||||
Gallery
|
Gallery
|
||||||
|> distinct(:creator_id)
|
|> distinct(:creator_id)
|
||||||
|
|
|
@ -75,6 +75,24 @@ elixir:
|
||||||
= number_with_delimiter(@users_24h)
|
= number_with_delimiter(@users_24h)
|
||||||
' have joined in the last 24 hours.
|
' 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
|
h3 Commissions
|
||||||
p
|
p
|
||||||
' There are
|
' There are
|
||||||
|
|
Loading…
Reference in a new issue