Commit f2c580ed4077b1100cdfb3dbc2f50bea83178797

Authored by Hugo Melo
1 parent 046756e4

Hide gamification dashboard and its link.

controllers/gamification_plugin_profile_controller.rb
... ... @@ -2,7 +2,12 @@ class GamificationPluginProfileController < ProfileController
2 2  
3 3 def dashboard
4 4 @target = profile
5   - render 'gamification/dashboard'
  5 + # temporarily render not found
  6 + if (user and user.is_admin?) || user.environment.name != 'Juventude.gov.br'
  7 + render 'gamification/dashboard'
  8 + else
  9 + render_not_found
  10 + end
6 11 end
7 12  
8 13 end
... ...
lib/gamification_plugin.rb
... ... @@ -35,7 +35,7 @@ class GamificationPlugin < Noosfero::Plugin
35 35  
36 36 def body_ending
37 37 proc do
38   - if current_person.present? && response.status == 200
  38 + if current_person.present? && response.status == 200 && current_person.environment.name != 'Juventude.gov.br'
39 39 badges = current_person.badges.notification_pending.all
40 40 current_person.sash.notify_all_badges_from_user
41 41 render :file => 'gamification/display_notifications', :locals => {:badges => badges}
... ...
  • 5bf9bf341e9d00ebd854cdaf1a4299b2?s=40&d=identicon
    Leandro Santos @leandronunes

    Esse código é muito específico para o juventude e este não é um plugin do juventude. Coisas específicas do juventude devem ser feitas no plugin do juventude.

    Choose File ...   File name...
    Cancel
  • Cajon low quality2
    Hugo Melo @hugomelo

    Cara, esse código não vai ficar ai. É temporário. Não dá pra manter num branch e apontar o deploy pra ele até que o resultado dos delegados saia?

    Choose File ...   File name...
    Cancel