Commit 2f6ee0813cb283f07c5d29ad456a44bdc1694478
Committed by
Álvaro Fernando Matos de Souza
1 parent
567f4aab
Exists in
master
and in
5 other branches
Insert software_communities rating fields data into community rating list
Signed-off-by: Brenddon Gontijo <brenddongontijo@msn.com> Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing
2 changed files
with
18 additions
and
0 deletions
Show diff stats
lib/software_communities_plugin.rb
... | ... | @@ -84,6 +84,14 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin |
84 | 84 | Proc::new do "<h1 class='title'>#{_("Use reports")}</h1>" end |
85 | 85 | end |
86 | 86 | |
87 | + def communities_ratings_plugin_extra_fields_show_data user_rating | |
88 | + is_admin = environment.admins.include?(current_user.person) | |
89 | + | |
90 | + if is_admin and context.profile.software? | |
91 | + Proc::new { render :file => 'communities_ratings_extra_fields_show_data', :locals => {:user_rating => user_rating} } | |
92 | + end | |
93 | + end | |
94 | + | |
87 | 95 | # FIXME - if in error log apears has_permission?, try to use this method |
88 | 96 | def has_permission?(person, permission, target) |
89 | 97 | person.has_permission_without_plugins?(permission, target) | ... | ... |
views/communities_ratings_extra_fields_show_data.html.erb
0 → 100644
... | ... | @@ -0,0 +1,10 @@ |
1 | +<div class="aditional-informations"> | |
2 | + <div class="comments-people-benefited"> | |
3 | + <span>People benefited :</span> <%= user_rating.comment.people_benefited %> | |
4 | + </div> | |
5 | + | |
6 | + <div class="comments-saved-value"> | |
7 | + <span>Saved Value :</span> <%= user_rating.comment.saved_value %> | |
8 | + </div> | |
9 | +</div> | |
10 | + | ... | ... |