Skip to content

Commit

Permalink
Corrected format of opportunity closing date (closes #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dvorkin committed Aug 16, 2009
1 parent 3fa5d86 commit a61fb98
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Sat, Aug 15, 2009
---------------------------------------------------------------------
- Implemented plugin dependencies to be able to change plugin loading order.
- Pass on [lead.id] when converting it into a contact (LH #86).
- Corrected format of opportunity closing date (GH #7).

Fri, Aug 14, 2009
---------------------------------------------------------------------
Expand Down
17 changes: 15 additions & 2 deletions app/views/opportunities/_opportunity.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,31 @@
= link_to_edit(opportunity) + " | "
= link_to_delete(opportunity) + " "
= link_to(opportunity.name, opportunity)
- if opportunity.account
== from #{link_to(opportunity.account.name, account_path(opportunity.account))}
%tt
–
== added #{time_ago_in_words(opportunity.created_at)} ago by
== #{opportunity.user.id == @current_user.id ? "me" : opportunity.user.full_name}
- unless @current_user.preference[:opportunities_outline] == "brief"
%dt
%b= number_to_currency(opportunity.weighted_amount, :precision => 0) << " | "
- unless %w(won lost).include?(opportunity.stage)
- won_or_lost = %w(won lost).include?(opportunity.stage)
- unless won_or_lost
== #{number_to_currency(opportunity.amount || 0, :precision => 0)} with
== #{opportunity.discount ? number_to_currency(opportunity.discount, :precision => 0) : "no"} discount and
== #{opportunity.probability || 0}% probability #{"|"}
- if opportunity.closes_on
== expected to close in #{distance_of_time_in_words(Date.today, opportunity.closes_on)}
- if won_or_lost
- if opportunity.closes_on >= Date.today
== closing date is #{opportunity.closes_on.to_s(:mmddyy)}
- else
== closed #{distance_of_time_in_words(opportunity.closes_on, Date.today)} ago on #{opportunity.closes_on.to_s(:mmddyy)}
- elsif opportunity.closes_on > Date.today
== expected to close in #{distance_of_time_in_words(Date.today, opportunity.closes_on)} on #{opportunity.closes_on.to_s(:mmddyy)}
- elsif opportunity.closes_on == Date.today
%span.warn== expected to close today!
- else
%span.warn== past due, was expected to close #{distance_of_time_in_words(opportunity.closes_on, Date.today)} ago
- else
no expected closing date

0 comments on commit a61fb98

Please sign in to comment.