Sha256: da6683f4605c40617bd9609cb489fd04cd4e2511c2fffbc4a1ea039a9d7fa8ef

Contents?: true

Size: 653 Bytes

Versions: 13

Compression:

Stored size: 653 Bytes

Contents

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

    if task.pending?
      icon = 'icon_pending.gif'
      alt  = 'Pending'
    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

13 entries across 13 versions & 1 rubygems

Version Path
queue_dispatcher-1.1.12 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.11 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.10 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.9 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.8 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.7 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.6 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.5 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.4 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.3 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.2 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.1 app/helpers/tasks_helper.rb
queue_dispatcher-1.1.0 app/helpers/tasks_helper.rb