forked from insoshi/insoshi
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
672440d
commit 3b254a9
Showing
7 changed files
with
110 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
module TransactsHelper | ||
def counterparty(t) | ||
counterparty = current_person?(t.worker) ? t.customer : t.worker | ||
end | ||
|
||
def counterparty_action(t) | ||
units = t.group.nil? ? "hours" : t.group.unit | ||
if current_person?(t.worker) | ||
"+#{t.amount.to_s} #{units} (received from " | ||
else | ||
"-#{t.amount.to_s} #{units} (paid to " | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="profile-image"> | ||
<%= image_link counterparty(transact), :image => :thumbnail %> | ||
<%= image_tag "icons/switch.gif", :class => "icon", :alt => "Transaction" %> | ||
</div> | ||
<p> | ||
<%= counterparty_action(transact) %><%= person_link counterparty(transact) %>) for <%= link_to h(transact.metadata.name), transact.metadata %> | ||
</p> | ||
<p class="meta published"> | ||
<%= time_ago_in_words(transact.created_at).capitalize %> ago | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%- column_div :type => :primary do -%> | ||
<h2>Transactions</h2> | ||
<ul class="list activity full"> | ||
<%= render :partial => 'shared/transact', :collection => @transactions %> | ||
</ul> | ||
<%- end -%> | ||
<%- column_div :type => :secondary do -%> | ||
<%= render :partial => 'shared/minifeed' %> | ||
<%- end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%- column_div :type => :primary do -%> | ||
<h2>Transaction</h2> | ||
<ul class="list activity full"> | ||
<%= render :partial => 'shared/transact' %> | ||
</ul> | ||
<%- end -%> | ||
<%- column_div :type => :secondary do -%> | ||
<%= render :partial => 'shared/minifeed' %> | ||
<%- end -%> |