Commit 68ef367f60ebc31942f68cd96f657f3c53c5537c

Authored by Evandro Junior
1 parent 8c9153c0
Exists in master

Fix pairwise disabled at control panel

lib/pairwise_plugin/pairwise_content.rb
@@ -59,9 +59,17 @@ class PairwisePlugin::PairwiseContent < Article @@ -59,9 +59,17 @@ class PairwisePlugin::PairwiseContent < Article
59 embeded = options.has_key? "embeded" 59 embeded = options.has_key? "embeded"
60 prompt_id = options["prompt_id"] 60 prompt_id = options["prompt_id"]
61 pairwise_content = self 61 pairwise_content = self
62 - proc do  
63 - locals = {:pairwise_content => pairwise_content, :source => source, :embeded => embeded, :prompt_id => prompt_id }  
64 - render :file => 'content_viewer/prompt', :locals => locals 62 +
  63 + if not Environment.default.enabled_plugins.include? "PairwisePlugin"
  64 + proc do
  65 + locals = {:pairwise_content => pairwise_content, :source => source, :embeded => embeded, :prompt_id => prompt_id }
  66 + render :file => 'content_viewer/closed_pool', :locals => locals
  67 + end
  68 + else
  69 + proc do
  70 + locals = {:pairwise_content => pairwise_content, :source => source, :embeded => embeded, :prompt_id => prompt_id }
  71 + render :file => 'content_viewer/prompt', :locals => locals
  72 + end
65 end 73 end
66 end 74 end
67 75
views/content_viewer/closed_pool.html.erb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +<h3>
  2 +<%= _("This pool has been closed by the administrator") %>
  3 +</h3>