%li.highlight[opportunity] - if opportunity.stage .strip{:class => opportunity.stage}= t(opportunity.stage) - else .strip.white #{t :other} .indent = link_to(h(opportunity.name), opportunity) - if opportunity.account == #{t :from} #{link_to(h(opportunity.account.name), account_path(opportunity.account))} %tt – - user_name = opportunity.user.try(:full_name) - if user_name = t(:added_by, :time_ago => timeago(opportunity.created_at), :user => h(user_name)).html_safe - else = t(:added_ago, :value => timeago(opportunity.created_at)).html_safe - unless current_user.preference[:opportunities_index_view] == "opportunities_index_brief" %dt %b= number_to_currency(opportunity.weighted_amount, :precision => 0) + " | " - won_or_lost = %w(won lost).include?(opportunity.stage) - unless won_or_lost = t(:probability_number, (opportunity.probability || 0).to_s + '%') + " | " - 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)) - 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 %span.warn= t(:closes_today) - else %span.warn= t(:past_due, distance_of_time_in_words(opportunity.closes_on, Date.today)) - else = t(:no_closing_date) - if opportunity.tags.present? %dt .tags= tags_for_dashboard(opportunity) = hook(:opportunity_bottom, self, :opportunity => opportunity)