Fix price duration

#475
This commit is contained in:
Artur Beljajev 2017-04-26 17:02:43 +03:00
parent a3b3490591
commit 22a2329ba5
7 changed files with 28 additions and 13 deletions

View file

@ -79,7 +79,8 @@ module Admin
end
def durations
::Billing::Price::durations
durations = ::Billing::Price::durations
durations.collect { |duration| [duration.sub('mon', 'month'), duration] }
end
end
end

View file

@ -17,9 +17,9 @@ module Billing
def self.durations
[
'3 months',
'6 months',
'9 months',
'3 mons',
'6 mons',
'9 mons',
'1 year',
'2 years',
'3 years',

View file

@ -1,10 +1,10 @@
<tr>
<td><%= price.zone_name %></td>
<td><%= price.duration %></td>
<td><%= price.duration.sub('mons', 'months') %></td>
<td><%= price.operation_category %></td>
<td><%= currency(price.price) %></td>
<td><%= l(price.valid_from, format: :ydate) %></td>
<td><%= l(price.valid_to, format: :ydate) %></td>
<td><%= l price.valid_from, format: :date %></td>
<td><%= l price.valid_to, format: :date %></td>
<td>
<%= link_to t('.edit_btn'), edit_admin_price_path(price), class: 'btn btn-xs btn-primary' %>
<%= link_to(t('.delete_btn'), admin_price_path(price),