app/helpers/opportunities_helper.rb
# Sidebar checkbox control for filtering opportunities by stage.
#----------------------------------------------------------------------------
Sidebar checkbox control for filtering opportunities by stage.
Sidebar checkbox control for filtering opportunities by stage .
def opportunity_closes_on_message(opportunity, won_or_lost)
    if opportunity.closes_on
      if won_or_lost
        if opportunity.closes_on >= Date.today
          t(:closing_date, l(opportunity.closes_on, format: :mmddyy))
        else
          t(:closed_ago_on, time_ago: distance_of_time_in_words(opportunity.closes_on, Date.today), date: l(opportunity.closes_on, format: :mmddyy))
        end
      elsif opportunity.closes_on > Date.today
        t(:expected_to_close, time: distance_of_time_in_words(Date.today, opportunity.closes_on), date: l(opportunity.closes_on, format: :mmddyy))
      elsif opportunity.closes_on == Date.today
        content_tag(:span, t(:closes_today), class: 'warn')
      else
        content_tag(:span, t(:past_due, distance_of_time_in_words(opportunity.closes_on, Date.today)), class: 'warn')
      end
    else
      t(:no_closing_date)
    end
  end
def opportunity_closes_on_message ( opportunity , won_or_lost ) if opportunity . closes_on if won_or_lost if opportunity . closes_on >= Date . today t ( :closing_date , l ( opportunity . closes_on , format : :mmddyy ) ) else t ( :closed_ago_on , time_ago : distance_of_time_in_words ( opportunity . closes_on , Date . today ) , date : l ( opportunity . closes_on , format : :mmddyy ) ) end elsif opportunity . closes_on > Date . today t ( :expected_to_close , time : distance_of_time_in_words ( Date . today , opportunity . closes_on ) , date : l ( opportunity . closes_on , format : :mmddyy ) ) elsif opportunity . closes_on == Date . today content_tag ( :span , t ( :closes_today ) , class : 'warn' ) else content_tag ( :span , t ( :past_due , distance_of_time_in_words ( opportunity . closes_on , Date . today ) ) , class : 'warn' ) end else t ( :no_closing_date ) end end
Sidebar checkbox control for filtering opportunities by stage.
Sidebar checkbox control for filtering opportunities by stage .
opportunity
won_or_lost