Meilleur affichage des stats

This commit is contained in:
echarp 2014-07-26 18:27:19 +02:00
parent cda595d0f5
commit 4320902f06
10 changed files with 113 additions and 51 deletions

View File

@ -0,0 +1,42 @@
// Mixins
// --------------------------
@mixin fa-icon-rotate($degrees, $rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
-webkit-transform: rotate($degrees);
-moz-transform: rotate($degrees);
-ms-transform: rotate($degrees);
-o-transform: rotate($degrees);
transform: rotate($degrees);
}
@mixin fa-icon-flip($horiz, $vert, $rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
-webkit-transform: scale($horiz, $vert);
-moz-transform: scale($horiz, $vert);
-ms-transform: scale($horiz, $vert);
-o-transform: scale($horiz, $vert);
transform: scale($horiz, $vert);
}
@mixin fa-icon-base() {
&:before {
display: inline-block;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
margin-right: 5px;
}
}
@mixin fa-icon($icon-char) {
@include fa-icon-base();
&:before {
@if($icon-char != null) {
content: $icon-char;
}
}
}

View File

@ -112,7 +112,8 @@ main
margin-left: 2em margin-left: 2em
line-height: 1.3em line-height: 1.3em
p p
margin: 0.95em 0 margin: 0.95em auto
max-width: 80em
text-align: justify text-align: justify
line-height: 1.3em line-height: 1.3em
&.label &.label

View File

@ -14,6 +14,17 @@
*= require_self *= require_self
*/ */
body.application.infos @import 'awesome_mixins'
h4
body.application
&.infos h4
text-align: left text-align: left
&.infos main h2:first-child
@include fa-icon('')
&.contact main h2:first-child
@include fa-icon('')
&.rules main h2:first-child
@include fa-icon('')

View File

@ -1,20 +1,34 @@
@import "compass" @import "compass"
table table
margin: auto margin: 1em auto
border-spacing: 2px border-spacing: 2px
th th
padding: 0.3em 0.6em padding: 0.3em 0.6em
table.list &.list
tr:nth-child(odd) tr:nth-child(odd)
background-color: #D1EAFF background-color: #D1EAFF
tr:nth-child(even) tr:nth-child(even)
background-color: #C9E2F5 background-color: #C9E2F5
td th
padding: 0.2em font-size: larger
&.quantity td
text-align: right padding: 0.2em
&.quantity
text-align: right
dl
margin: 1em auto
max-width: 40em
dt
float: left
padding: 0.2em 1em
.quantity
text-align: right
dd
padding: 0.2em 1em
border-top: 1px solid #999
.view_link:link, .edit_link:link, .delete_link:link .view_link:link, .edit_link:link, .delete_link:link
font-size: 0 font-size: 0

View File

@ -3,7 +3,7 @@ h2.warning
.events.edit, .events.update, .events.cancel, .moderations, .notes .events.edit, .events.update, .events.cancel, .moderations, .notes
table.list table.list
width: 100% min-width: 90%
margin-top: 15px margin-top: 15px
thead tr thead tr
background-color: transparent background-color: transparent
@ -30,6 +30,8 @@ h2.warning
th.actions th.actions
padding: 0 padding: 0
a a
padding: 0.2em
display: inline-block
font-weight: normal font-weight: normal
main > h3 main > h3

View File

@ -1,7 +1,3 @@
.regions.stats body.stats
table.list h3
margin: 1em 0 text-align: center
min-width: 60%
text-align: left
td.item
width: 90%

View File

@ -5,8 +5,8 @@ class RegionsController < InheritedResources::Base
@city_events = Event.group(:city).having('count(city) > 3').order('count(city) desc').count(:city) @city_events = Event.group(:city).having('count(city) > 3').order('count(city) desc').count(:city)
@month_events = Event @month_events = Event
.group('extract(year from start_time)') .group('strftime("%Y", start_time)')
.group('extract(month from start_time)') .group('strftime("%m", start_time)')
.count() .count()
end end
end end

View File

@ -2,41 +2,35 @@
%em.fa.fa-signal %em.fa.fa-signal
= title t '.title' = title t '.title'
%h3=t '.general' %dl
%dt=t '.all'
%dd.quantity= Event.count()
%table.list %dt=t '.allModeration'
%tr %dd.quantity= Event.unscoped.where(moderated: 0).count()
%td.item=t '.all'
%td.quantity= Event.count()
%tr
%td.item=t '.allModeration'
%td.quantity= Event.unscoped.where(moderated: 0).count()
%h3=t '.regional' %h3=t '.regional'
%table.list %dl
- @region_events.each do |region| - @region_events.each do |region|
%tr %dt.item= region[0]
%td.item= region[0] %dd.quantity= region[1]
%td.quantity= region[1]
%h3=t '.city' %h3=t '.city'
%p=t '.city_conditions' %p=t '.city_conditions'
%table.list %dl
- @city_events.each do |city| - @city_events.each do |city|
%tr %dt.item= city[0]
%td.item= city[0] %dd.quantity= city[1]
%td.quantity= city[1]
%h3=t '.dates' %h3=t '.dates'
%table.list %dl
- @month_events.each do |month| - @month_events.each do |month|
%tr %dt.item= l(Date.new(month[0][0].to_i, month[0][1].to_i), format: :month).capitalize
%td.item= l(Date.new(month[0][0], month[0][1]), format: :month).capitalize %dd.quantity= month[1]
%td.quantity= month[1]
%h3=t '.web' %h3=t '.web'

View File

@ -163,13 +163,12 @@ Exemple: `%{tag}`\n
Exemple: `%{daylimit}`" Exemple: `%{daylimit}`"
stats: stats:
title: Statistiques title: Statistiques
general: Statistiques générales
all: Nombre d'événements validés depuis la création de l'Agenda all: Nombre d'événements validés depuis la création de l'Agenda
allModeration: Nombre d'événements en cours de modération allModeration: Nombre d'événements en cours de modération
regional: Statistiques par région regional: Par région
city: Statistiques par ville city: Par ville
city_conditions: Seules les villes où plus de trois événements ont été organisés sont mentionnées. city_conditions: Seules les villes où plus de trois événements ont été organisés sont mentionnées.
dates: Statistiques par date dates: Par date
web: Statistiques Web web: Statistiques Web
webalizer: 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* webalizer: 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*
tags: tags:
@ -244,12 +243,18 @@ Exemple: `%{daylimit}`"
users: users:
sign_in: sign_in:
title: Identification title: Identification
lugs:
index:
title: Groupes d'Utilisateurs de Logiciels Libres
show:
title: Groupe d'Utilisateurs de Logiciels Libres
devise: devise:
sessions: sessions:
new: new:
title: Identification title: Identification
sign_in: Identifier sign_in: Identifier
event_mailer: event_mailer:
create: create:
subject: "[Agenda du Libre] Votre événement: '%{subject}' est en attente de modération" subject: "[Agenda du Libre] Votre événement: '%{subject}' est en attente de modération"

View File

@ -1,8 +1,4 @@
Rails.application.routes.draw do Rails.application.routes.draw do
get 'maps/index'
get 'map/index'
get 'application/infos' get 'application/infos'
get 'application/contact' get 'application/contact'
get 'application/rules' get 'application/rules'
@ -21,6 +17,7 @@ Rails.application.routes.draw do
end end
resources :tags, only: [ :index, :show ] resources :tags, only: [ :index, :show ]
resources :maps, only: [:index] resources :maps, only: [:index]
resources :lugs, only: [:index, :show]
# Manage former php pages # Manage former php pages
get 'showevent.php', to: redirect { |params, request| "events/#{request.params[:id]}" } get 'showevent.php', to: redirect { |params, request| "events/#{request.params[:id]}" }