Sha256: 603bfcd0e9a5e356dbfd41ec54b2ca7bc1f364b3f8eece6568dc2a5be8df90c8

Contents?: true

Size: 861 Bytes

Versions: 7

Compression:

Stored size: 861 Bytes

Contents

module TasksHelper
  def icon_for_task task
    icon = 'icon_warning.gif'
    alt  = 'Unknwon'

    if task.pending?
      if task.reloading_config?
        icon = 'icon_init_queue.gif'
        alt  = 'Reloading Config'
      else
        icon = 'icon_pending.gif'
        alt  = 'Pending'
      end
    elsif task.init_queue?
      icon = 'icon_init_queue.gif'
      alt  = 'Initialize Queue'
    elsif task.acquire_lock?
      icon = 'icon_acquire_lock.png'
      alt  = 'Acquire Lock'
    elsif task.running?
      icon = 'icon_running.gif'
      alt  = 'Running'
    elsif task.successful?
      icon = 'icon_successful.png'
      alt  = 'Successful'
    elsif task.error?
      icon = 'icon_error.png'
      alt  = 'Error!'
    elsif task.aborted?
      icon = 'icon_aborted.png'
      alt  = 'Aborted!'
    end

    image_tag(icon, :alt => alt)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
queue_dispatcher-2.5.3 app/helpers/tasks_helper.rb
queue_dispatcher-2.3.0 app/helpers/tasks_helper.rb
queue_dispatcher-2.1.0 app/helpers/tasks_helper.rb
queue_dispatcher-1.5.1 app/helpers/tasks_helper.rb
queue_dispatcher-1.3.1 app/helpers/tasks_helper.rb
queue_dispatcher-1.3.0 app/helpers/tasks_helper.rb
queue_dispatcher-1.2.0 app/helpers/tasks_helper.rb