pic_vert_app/app/views/admin/sheets/stats.html.haml
2013-06-29 23:10:44 +02:00

121 lines
3.0 KiB
Plaintext

-last_year= SheetYear.find(:first, :order => "year DESC").year
-first_year= SheetYear.find(:first, :order => "year ASC").year
-y = last_year
#stat_years
=link_to "fiches", admin_sheets_path()
| Stats :
-while y >= first_year
=link_to y, {:controller => :sheets, :action => :stats, :year => y}, :class => ("now" if y == params[:year].to_i)
-y -= 1
%br
%br
%h1
Statistiques pour l'année
=@year
%h2 En bref
%table.stat_table.table.table-striped.table-hover.table-bordered
%tr
%th Nombre de foyers
%th Nombre d'adhésion individuelle
%th Nombre d'adhésion famille
%th Nombre d'adhésion association
%th Nombre d'adhésion bienfaiteur
%th Nombre de pouvoirs
%tr
%td=@months["12"][:cumul_foyers]
%td=@months["12"][:cumul_individuel]
%td=@months["12"][:cumul_familles]
%td=@months["12"][:cumul_associations]
%td=@months["12"][:cumul_benefactors]
%td= @months["12"][:cumul_pouvoirs]
= content_tag :div, "", id: "sheets_chart", :style => "height:500px;border:1px solid grey;margin:1em;padding:1em;", data: {values: @chart_values}
%h2 Détail
%h3 Adhésions offertes
%p
Adhérents ayant adhéré fin
=(@year -1)
et ayant donc l'adhésion
=@year
offerte
%table.stat_table.table.table-striped.table-hover.table-bordered
%tr
%th Nombre de foyers
%th Nombre d'adhésion individuelle
%th Nombre d'adhésion famille
%th Nombre d'adhésion association
%th Nombre d'adhésion bienfaiteur
%th Nombre de pouvoirs
%tr
%td=@gift_years[:nbr_foyers]
%td=@gift_years[:nbr_individuel]
%td=@gift_years[:nbr_familles]
%td=@gift_years[:nbr_associations]
%td=@gift_years[:nbr_benefactors]
%td= @gift_years[:pouvoirs]
%h3 Adhésions renouvellé l'année précédente
%p
Adhérent déjà adhérent en
=@year - 1
mais ayant déjà payé leur cotisation
=@year
l'année passé
%table.stat_table.table.table-striped.table-hover.table-bordered
%tr
%th Nombre de foyers
%th Nombre d'adhésion individuelle
%th Nombre d'adhésion famille
%th Nombre d'adhésion association
%th Nombre d'adhésion bienfaiteur
%th Nombre de pouvoirs
%tr
%td=@renewed_prev_year[:nbr_foyers]
%td=@renewed_prev_year[:nbr_individuel]
%td=@renewed_prev_year[:nbr_familles]
%td=@renewed_prev_year[:nbr_associations]
%td=@renewed_prev_year[:nbr_benefactors]
%td= @renewed_prev_year[:pouvoirs]
%h3 Evolution du nombre d'adhérents
%table.stat_table.table.table-striped.table-hover.table-bordered
%tr
%th
%th Nombre de foyers
%th Nombre d'adhésion individuelle
%th Nombre d'adhésion famille
%th Nombre d'adhésion association
%th Nombre d'adhésion bienfaiteur
%th Nombre de pouvoirs
-@months.sort { |a,b| a[0].to_i <=> b[0].to_i }.each do |month|
-if month[1][:month]
%tr
%th=l Date.new(2010,month[0].to_i,1), :format => :only_month_name
%td=month[1][:nbr_foyers]
%td=month[1][:nbr_individuel]
%td=month[1][:nbr_familles]
%td=month[1][:nbr_associations]
%td=month[1][:nbr_benefactors]
%td=month[1][:pouvoirs]
%br
%br