Sha256: 7f4d812ae032e8a2842114599b37738bd78f1ccb002b6c1c9e1962909ed5678f

Contents?: true

Size: 654 Bytes

Versions: 2

Compression:

Stored size: 654 Bytes

Contents

module PgqWeb::PgqHelper

  def class_menu(act)
    act == params[:action] ? 'active' : ''
  end
  
  def status_span(status = :ok)
    case status
    when :ok then content_tag(:span, 'ok', :class => "label label-success")
    when :warn then content_tag(:span, 'warn', :class => "label label-warning")
    when :error then content_tag(:span, 'error', :class => "label label-important")
    when :stopped then content_tag(:span, 'stopped', :class => "label")
    else
      content_tag(:span, 'ok', :class => "label label-success")
    end
  end
  
  def human_time(str_time)
    Time.parse(str_time).strftime("%d.%m.%Y %H:%M:%S") rescue '-'
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pgq_web-0.0.2 app/helpers/pgq_web/pgq_helper.rb
pgq_web-0.0.1 app/helpers/pgq_web/pgq_helper.rb