From f2c580ed4077b1100cdfb3dbc2f50bea83178797 Mon Sep 17 00:00:00 2001 From: Hugo Melo Date: Mon, 2 Nov 2015 18:28:18 -0200 Subject: [PATCH] Hide gamification dashboard and its link. --- controllers/gamification_plugin_profile_controller.rb | 7 ++++++- lib/gamification_plugin.rb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/controllers/gamification_plugin_profile_controller.rb b/controllers/gamification_plugin_profile_controller.rb index 82e29a7..5740e25 100644 --- a/controllers/gamification_plugin_profile_controller.rb +++ b/controllers/gamification_plugin_profile_controller.rb @@ -2,7 +2,12 @@ class GamificationPluginProfileController < ProfileController def dashboard @target = profile - render 'gamification/dashboard' + # temporarily render not found + if (user and user.is_admin?) || user.environment.name != 'Juventude.gov.br' + render 'gamification/dashboard' + else + render_not_found + end end end diff --git a/lib/gamification_plugin.rb b/lib/gamification_plugin.rb index 6ce3237..6b8d338 100644 --- a/lib/gamification_plugin.rb +++ b/lib/gamification_plugin.rb @@ -35,7 +35,7 @@ class GamificationPlugin < Noosfero::Plugin def body_ending proc do - if current_person.present? && response.status == 200 + if current_person.present? && response.status == 200 && current_person.environment.name != 'Juventude.gov.br' badges = current_person.badges.notification_pending.all current_person.sash.notify_all_badges_from_user render :file => 'gamification/display_notifications', :locals => {:badges => badges} -- libgit2 0.21.2