Commit 771a00e0e003a630fada95d0b84f5388ad588e64
1 parent
bf41911c
Exists in
master
and in
5 other branches
Add portal suggest values in software statistics block
Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com> Signed-off-by: Simiao Carvalho <simiaosimis@gmail.com> Signed-off-by: Thiago Ribeiro <thiagitosouza@gmail.com>
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
views/box_organizer/_statistic_block.html.erb
1 | 1 | <div id='edit-softwares-block'> |
2 | + <% suggestion_benefited_people = @block.owner.community_ratings.collect{|community_rating| community_rating.people_benefited.to_f}.inject(:+) || 0.0 %> | |
3 | + <% suggestion_saved_resources = @block.owner.community_ratings.collect{|community_rating| community_rating.saved_value.to_f}.inject(:+) || 0.0 %> | |
4 | + | |
2 | 5 | <%= labelled_form_field _('Benefited People'), text_field(:block, :benefited_people) %> |
6 | + <p> <%= _("Portal suggested value: ") %> <span> <%= "%d" % (suggestion_benefited_people) %> <span> </p> | |
3 | 7 | <%= labelled_form_field _('Saved Resources'), text_field(:block, :saved_resources) %> |
8 | + <p> <%= _("Portal suggested value: ") %> <span> <%= "R$%.2f" % (suggestion_saved_resources) %> <span> </p> | |
4 | 9 | </div> |
5 | 10 | ... | ... |