2009-08-01 13:41:22 +02:00
|
|
|
<%
|
|
|
|
max_width = 600
|
|
|
|
|
|
|
|
global_avg = Ordergroup.avg_jobs_per_euro
|
|
|
|
group_avg = @ordergroup.avg_jobs_per_euro.to_f
|
|
|
|
|
2009-08-04 12:32:25 +02:00
|
|
|
unless global_avg == 0 or global_avg.nan?
|
|
|
|
length_of_global_bar = max_width / 2.0
|
|
|
|
length_of_group_bar = (group_avg / global_avg) * length_of_global_bar
|
2009-08-01 13:41:22 +02:00
|
|
|
|
2009-08-04 12:32:25 +02:00
|
|
|
length_of_group_bar = max_width if length_of_group_bar > max_width
|
2009-08-01 13:41:22 +02:00
|
|
|
|
2009-08-04 12:32:25 +02:00
|
|
|
color = group_avg >= global_avg ? "#78b74e" : "red"
|
2009-08-01 13:41:22 +02:00
|
|
|
%>
|
2009-08-04 12:32:25 +02:00
|
|
|
Engagement Deiner Bestellgruppe
|
|
|
|
<div class="stats-bar" style="width:<%= length_of_group_bar -%>px; background-color:<%= color -%>">
|
|
|
|
<%= ((group_avg / global_avg) * 100).to_i -%><%= " Äpfel" if length_of_group_bar > 50 -%>
|
|
|
|
</div>
|
|
|
|
Durchschnittsengagement
|
|
|
|
<div class="stats-bar" style="width:<%= length_of_global_bar -%>px">
|
|
|
|
100 Birnen
|
|
|
|
</div>
|
|
|
|
<span class="description">
|
|
|
|
Abgebildet ist das Verhältnis von erledigten Aufgaben zu dem Bestellvolumen Deiner Bestellgruppe im Vergleich zum Durchschnitt in der Foodcoop.
|
2010-02-09 23:56:16 +01:00
|
|
|
Konkret: Für jede <%= number_to_currency 1/global_avg %> Bestellsumme solltest Du eine Aufgabe machen!
|
2009-08-04 12:32:25 +02:00
|
|
|
</span>
|
|
|
|
<%- end -%>
|