Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
module ApplicationHelper
def number_to_won(number)
number_to_currency number, unit: '원', precision: 0, format: '%n%u'
end

def facebook_image_tag_by_uid(uid, *args, &block)
options = args.extract_options!
url_options = options.slice(:width, :height)
image_url = "//graph.facebook.com/#{uid}/picture?#{url_options.to_query}"
image_tag image_url, options, &block
end
end
2 changes: 1 addition & 1 deletion app/views/contributions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="cont-container container">
<h3 class="page-header">선물 참여하기<small> 최대 참여 가능 금액은 <%= number_to_currency @fund.remain_amount, unit: '원', precision: 0, format: '%n%u' %>입니다.</small></h3>
<h3 class="page-header">선물 참여하기<small> 최대 참여 가능 금액은 <%= number_to_won @fund.remain_amount %>입니다.</small></h3>
<div class="row">
<div class="cont-form-container col-md-8">
<%= form_for @contribution_form, url: fund_contributions_path do |f| %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/friends/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="col-sm-4 col-md-2">
<%= link_to new_friend_path(uid: @user.uid, name: @user.name) do %>
<div class="thumbnail">
<img src="http://graph.facebook.com/<%= @user.uid %>/picture?height=192&width=192">
<%= facebook_image_tag_by_uid(@user.uid, width: 192, height: 192) %>
<div class="caption">
<p>나에게 선물하기</p>
</div>
Expand All @@ -20,7 +20,7 @@
<div class="col-sm-4 col-md-2">
<%= link_to new_friend_path(uid: f['id'], name: f['name']) do %>
<div class="thumbnail">
<img src="http://graph.facebook.com/<%= f["id"] %>/picture?height=192&width=192">
<%= facebook_image_tag_by_uid(f.id, width: 192, height: 192) %>
<div class="caption">
<p><%= f["name"] %></p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/funds/_new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="col-md-4">
<div class="friend-information">
<h4 class="gift-name"><%= @gift.name %></h4>
<span class="gift-price pull-left"><%= number_to_currency @gift.price, unit: '₩', precision: 0 %></span>
<span class="gift-price pull-left"><%= number_to_won @gift.price %></span>
<small class="pull-right">To <%= @friend.name %></small>
<div class="clearfix"></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/views/funds/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</div>
<div class="friend-information">
<h4 class="gift-name"><%= @fund.gift.name %></h4>
<span class="gift-price pull-left"><%= number_to_currency @fund.gift.price, unit: '₩', precision: 0 %></span>
<span class="gift-price pull-left"><%= number_to_won @fund.gift.price %></span>
<div class="clearfix"></div>
</div>
<div class="friend-information">
Expand All @@ -49,7 +49,7 @@
</div>
<div class="friend-information">
<h3 class="page-header">모금 현황</h3>
<h2 class="text-center contribute-amount"><%= number_to_currency @fund.total_amount, unit: '원', precision: 0, format: '%n%u' %></h2>
<h2 class="text-center contribute-amount"><%= number_to_won @fund.total_amount %></h2>

<div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<%= @fund.percentage %>" aria-valuemin="0" aria-valuemax="100" style="width: <%= @fund.percentage %>%;">
Expand All @@ -66,7 +66,7 @@
<div>
<% contributions.each do |contribution| %>
<div class="contributor-image pull-left">
<%= image_tag "http://graph.facebook.com/#{ contribution.user.uid}/picture?height=1000&width=1000" %>
<%= facebook_image_tag_by_uid(contribution.user.uid, width: 1000, height: 1000)
</div>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/gifts/_gift.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h4><%= gift.name %></h4>
</div>
<p class="gift-price">
<%= number_to_currency gift.price, unit: '₩ ', precision: 0 %>
<%= number_to_won gift.price %>
</p>
</div>
<!-- <div class="gift-feeling">
Expand Down
2 changes: 1 addition & 1 deletion app/views/gifts/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
});
});
} );

</script>
</body>

Expand Down