Sha256: f01517ecb827f6dc59e8075e53f951f3149e8ef70b04aea9ee5a93f031d61481

Contents?: true

Size: 781 Bytes

Versions: 4

Compression:

Stored size: 781 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!'
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
queue_dispatcher-1.1.19 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.18 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.17 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.16 app/helpers/tasks_helper.rb