Skip to content

Commit

Permalink
Revert back to old flash message building since new method doesn't wo…
Browse files Browse the repository at this point in the history
…rk with rails admin.
  • Loading branch information
Robert Clark committed Aug 22, 2016
1 parent 2522700 commit 5fccacf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ def enable_auto_reload
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Rails/OutputSafety
def load_game
@game = Game.instance
raise ActiveRecord::RecordNotFound unless @game
unless current_user.nil?
now = Time.zone.now
if now < @game.start
flash.now[:info] = 'The game will open ' +
simple_format("on #{@game.start.strftime('%b %e %y, %R %Z')}.", '', wrapper_tag: 'strong')
flash.now[:info] = "The game will open <strong><span id=\"major-tom\"></span> on
#{@game.start.strftime('%b %e %y, %R %Z')}</strong>.".html_safe
elsif now < @game.stop && now > @game.stop - 1.hour
flash.now[:info] = 'The game will stop accepting submissions ' +
simple_format("on #{@game.stop.strftime('%b %e %y, %R %Z')}", '', wrapper_tag: 'strong')
flash.now[:info] = "The game will stop accepting submissions
<strong><span id=\"major-tom\"></span> on #{@game.stop.strftime('%b %e %y, %R %Z')}
</strong>."
else
flash.now[:info] = I18n.t('game.closed') unless @game.open?
end
Expand All @@ -42,6 +44,7 @@ def load_game
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Rails/OutputSafety

def load_messages_count
unless current_user.nil?
Expand Down

0 comments on commit 5fccacf

Please sign in to comment.