adds budget show to admin
This commit is contained in:
@@ -8,6 +8,9 @@ class Admin::BudgetsController < Admin::BaseController
|
||||
@budgets = Budget.send(@current_filter).order(created_at: :desc).page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def new
|
||||
@budget = Budget.new
|
||||
end
|
||||
@@ -15,7 +18,7 @@ class Admin::BudgetsController < Admin::BaseController
|
||||
def create
|
||||
@budget = Budget.new(budget_params)
|
||||
if @budget.save
|
||||
redirect_to admin_budgets_path, notice: t('admin.budgets.create.notice')
|
||||
redirect_to admin_budget_path(@budget), notice: t('admin.budgets.create.notice')
|
||||
else
|
||||
render :new
|
||||
end
|
||||
|
||||
@@ -26,5 +26,4 @@
|
||||
<input type="submit" value="<%= t("admin.budgets.new.create") %>" class="button success">
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
12
app/views/admin/budgets/show.html.erb
Normal file
12
app/views/admin/budgets/show.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<h2><%= @budget.name %></h2>
|
||||
|
||||
<%= simple_format(text_with_links(@budget.description), {}, sanitize: false) %>
|
||||
|
||||
<p>
|
||||
<strong><%= t('admin.budgets.show.phase') %>:</strong> <%= t("budget.phase.#{@budget.phase}") %> |
|
||||
<strong><%= t('admin.budgets.show.currency') %>:</strong> <%= @budget.currency_symbol %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,6 +87,9 @@ en:
|
||||
table_heading: Heading
|
||||
table_amount: Amount
|
||||
table_geozone: Scope of operation
|
||||
show:
|
||||
phase: Current phase
|
||||
currency: Currency
|
||||
comments:
|
||||
index:
|
||||
filter: Filter
|
||||
|
||||
@@ -87,6 +87,9 @@ es:
|
||||
table_heading: Partida
|
||||
table_amount: Cantidad
|
||||
table_geozone: Ámbito de actuación
|
||||
show:
|
||||
phase: Fase actual
|
||||
currency: Divisa
|
||||
comments:
|
||||
index:
|
||||
filter: Filtro
|
||||
|
||||
@@ -55,7 +55,6 @@ feature 'Admin budgets' do
|
||||
expect(page).to_not have_content(budget5.name)
|
||||
end
|
||||
|
||||
|
||||
scenario 'Current filter is properly highlighted' do
|
||||
filters_links = {'open' => 'Open', 'finished' => 'Finished'}
|
||||
|
||||
@@ -78,6 +77,7 @@ feature 'Admin budgets' do
|
||||
end
|
||||
|
||||
context 'New' do
|
||||
|
||||
scenario 'Create budget' do
|
||||
visit admin_budgets_path
|
||||
click_link 'Create new'
|
||||
|
||||
Reference in New Issue
Block a user