L'écran des statistiques est maintenant en place
This commit is contained in:
parent
2da217e4b1
commit
747dc30cd0
@ -15,6 +15,8 @@ table.list
|
||||
background-color: #C9E2F5
|
||||
td
|
||||
padding: 0.2em
|
||||
&.quantity
|
||||
text-align: right
|
||||
|
||||
.view_link:link, .edit_link:link, .delete_link:link
|
||||
font-size: 0
|
||||
|
7
app/assets/stylesheets/region.css.sass
Normal file
7
app/assets/stylesheets/region.css.sass
Normal file
@ -0,0 +1,7 @@
|
||||
.regions
|
||||
table.stats
|
||||
margin: 1em 0
|
||||
min-width: 60%
|
||||
text-align: left
|
||||
td.item
|
||||
width: 90%
|
@ -2,4 +2,17 @@ class RegionsController < InheritedResources::Base
|
||||
def icallist
|
||||
@regions = Region.all
|
||||
end
|
||||
|
||||
def stats
|
||||
@regions = Region.all
|
||||
|
||||
@events = Event.group(:city).having('count(city) > 3').order('count(city) desc').count(:city)
|
||||
|
||||
@months = Event
|
||||
.select('extract(year from start_time)')
|
||||
.select('extract(month from start_time)')
|
||||
.group('extract(year from start_time)')
|
||||
.group('extract(month from start_time)')
|
||||
.count()
|
||||
end
|
||||
end
|
||||
|
@ -64,6 +64,6 @@
|
||||
= link_to t('.map'), users_url
|
||||
= link_to t('.tags'), users_url
|
||||
= link_to t('.infos'), users_url
|
||||
= link_to t('.stats'), users_url
|
||||
= link_to t('.stats'), stats_regions_url
|
||||
= link_to t('.contact'), users_url
|
||||
= link_to t('.moderation'), users_url
|
||||
|
42
app/views/regions/stats.html.haml
Normal file
42
app/views/regions/stats.html.haml
Normal file
@ -0,0 +1,42 @@
|
||||
%h2=t '.title'
|
||||
|
||||
%h3=t '.general'
|
||||
|
||||
%table.list.stats
|
||||
%tr
|
||||
%td.item=t '.all'
|
||||
%td.quantity= Event.count()
|
||||
%tr
|
||||
%td.item=t '.allModeration'
|
||||
%td.quantity= Event.unscoped.where(moderated: 0).count()
|
||||
|
||||
%h3=t '.regional'
|
||||
|
||||
%table.list.stats
|
||||
- @regions.each do |region|
|
||||
%tr
|
||||
%td.item= region.name
|
||||
%td.quantity= Event.where(region: region).count()
|
||||
|
||||
%h3=t '.city'
|
||||
|
||||
%p Seules les villes où plus de trois évènements ont été organisés sont mentionnées.
|
||||
|
||||
%table.list.stats
|
||||
- @events.each do |event|
|
||||
%tr
|
||||
%td.item= event[0]
|
||||
%td.quantity= event[1]
|
||||
|
||||
%h3=t '.dates'
|
||||
|
||||
%table.list.stats
|
||||
- @months.each do |month|
|
||||
%tr
|
||||
%td.item= l(Date.new(month[0][0], month[0][1]), format: :month).capitalize
|
||||
%td.quantity= month[1]
|
||||
|
||||
%h3=t '.web'
|
||||
|
||||
:markdown
|
||||
Des statistiques Web générées par Webalizer [sont disponibles](http://agendadulibre.org/stats/). Elles sont protégées par le login *stats*, mot de passe *Cuntipshaf6* pour éviter le *spam de referers*.
|
@ -44,6 +44,9 @@ en:
|
||||
password: Password
|
||||
lastname: Name
|
||||
firstname: First name
|
||||
date:
|
||||
formats:
|
||||
month: "%B %Y"
|
||||
time:
|
||||
formats:
|
||||
at: "%A %d %B %Y at %Hh%M"
|
||||
|
@ -72,6 +72,7 @@ fr:
|
||||
- Samedi
|
||||
formats:
|
||||
long: "%A %d %B %Y"
|
||||
month: "%B %Y"
|
||||
time:
|
||||
formats:
|
||||
at: "%A %d %B %Y à %Hh%M"
|
||||
@ -110,3 +111,12 @@ fr:
|
||||
title: Liste des flux RSS
|
||||
icallist:
|
||||
title: Liste des calendriers iCal
|
||||
stats:
|
||||
title: Statistiques
|
||||
general: Statistiques générales
|
||||
all: Nombre d'évènements validés depuis la création de l'Agenda
|
||||
allModeration: Nombre d'évènements en cours de modération
|
||||
regional: Statistiques par région
|
||||
city: Statistiques par ville
|
||||
dates: Statistiques par date
|
||||
web: Statistiques Web
|
||||
|
@ -1,6 +1,7 @@
|
||||
AgendaDuLibreRails::Application.routes.draw do
|
||||
resources :regions, only: [ :index ] do
|
||||
get 'icallist', on: :collection
|
||||
get 'stats', on: :collection
|
||||
end
|
||||
resources :events
|
||||
resources :users
|
||||
|
Loading…
Reference in New Issue
Block a user