internetee-registry/app/views/admin/billing/prices/edit.html.erb
2017-05-25 19:17:11 +03:00

31 lines
1 KiB
Text

<ol class="breadcrumb">
<li><%= link_to t('admin.billing.prices.index.title'), admin_prices_path %></li>
</ol>
<div class="page-header">
<div class="row">
<div class="col-sm-10">
<h1><%= t '.title' %></h1>
</div>
<div class="col-sm-2 text-right">
<%= link_to(t('.expire_btn'), expire_admin_price_path(@price),
method: :patch,
data: { confirm: t('.expire_btn_confirm') },
class: 'btn btn-danger') %>
</div>
</div>
</div>
<% if @price.persisted? && @price.errors.none? %>
<div class="alert alert-info">
<% active_price = ::Billing::Price.price_for(@price.zone, @price.operation_category, @price.duration) %>
<% if active_price %>
<%= t('active_price_for_this_operation_is', price: "#{active_price.price.amount.to_s} EUR") %>
<% else %>
<%= t('active_price_missing_for_this_operation') %>
<% end %>
</div>
<% end %>
<%= render 'form', price: @price %>