app/controllers/tr8n/awards_controller.rb in tr8n-3.1.1 vs app/controllers/tr8n/awards_controller.rb in tr8n-3.1.2
- old
+ new
@@ -1,7 +1,7 @@
#--
-# Copyright (c) 2010-2011 Michael Berkovich
+# Copyright (c) 2010-2011 Michael Berkovich, tr8n.net
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
@@ -19,23 +19,23 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-class Tr8n::AwardsController < Tr8n::BaseController
+module Tr8n
+ class AwardsController < Tr8n::BaseController
- before_filter :validate_current_translator
+ before_filter :validate_current_translator
- def index
- params[:mode] = "all" if tr8n_current_language.default?
+ def index
+ if params[:mode] == "all"
+ @translator_metrics = Tr8n::TranslatorMetric.where("language_id is null").order("total_translations desc, total_votes desc").limit(25)
+ else
+ @translator_metrics = Tr8n::TranslatorMetric.where("language_id = ?", tr8n_current_language.id).order("total_translations desc, total_votes desc").limit(25)
+ end
- if params[:mode] == "all"
- @translator_metrics = Tr8n::TranslatorMetric.where("language_id is null").order("total_translations desc, total_votes desc").limit(25)
- else
- @translator_metrics = Tr8n::TranslatorMetric.where("language_id = ?", tr8n_current_language.id).order("total_translations desc, total_votes desc").limit(25)
+ @leaders = @translator_metrics[0..2]
+ @runners = (@translator_metrics.size > 3) ? @translator_metrics[3..-1] : []
end
- @leaders = @translator_metrics[0..2]
- @runners = (@translator_metrics.size > 3) ? @translator_metrics[3..-1] : []
end
-
end
\ No newline at end of file