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])
|
@budgets = Budget.send(@current_filter).order(created_at: :desc).page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@budget = Budget.new
|
@budget = Budget.new
|
||||||
end
|
end
|
||||||
@@ -15,7 +18,7 @@ class Admin::BudgetsController < Admin::BaseController
|
|||||||
def create
|
def create
|
||||||
@budget = Budget.new(budget_params)
|
@budget = Budget.new(budget_params)
|
||||||
if @budget.save
|
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
|
else
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,5 +26,4 @@
|
|||||||
<input type="submit" value="<%= t("admin.budgets.new.create") %>" class="button success">
|
<input type="submit" value="<%= t("admin.budgets.new.create") %>" class="button success">
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</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_heading: Heading
|
||||||
table_amount: Amount
|
table_amount: Amount
|
||||||
table_geozone: Scope of operation
|
table_geozone: Scope of operation
|
||||||
|
show:
|
||||||
|
phase: Current phase
|
||||||
|
currency: Currency
|
||||||
comments:
|
comments:
|
||||||
index:
|
index:
|
||||||
filter: Filter
|
filter: Filter
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ es:
|
|||||||
table_heading: Partida
|
table_heading: Partida
|
||||||
table_amount: Cantidad
|
table_amount: Cantidad
|
||||||
table_geozone: Ámbito de actuación
|
table_geozone: Ámbito de actuación
|
||||||
|
show:
|
||||||
|
phase: Fase actual
|
||||||
|
currency: Divisa
|
||||||
comments:
|
comments:
|
||||||
index:
|
index:
|
||||||
filter: Filtro
|
filter: Filtro
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ feature 'Admin budgets' do
|
|||||||
expect(page).to_not have_content(budget5.name)
|
expect(page).to_not have_content(budget5.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
scenario 'Current filter is properly highlighted' do
|
scenario 'Current filter is properly highlighted' do
|
||||||
filters_links = {'open' => 'Open', 'finished' => 'Finished'}
|
filters_links = {'open' => 'Open', 'finished' => 'Finished'}
|
||||||
|
|
||||||
@@ -78,6 +77,7 @@ feature 'Admin budgets' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'New' do
|
context 'New' do
|
||||||
|
|
||||||
scenario 'Create budget' do
|
scenario 'Create budget' do
|
||||||
visit admin_budgets_path
|
visit admin_budgets_path
|
||||||
click_link 'Create new'
|
click_link 'Create new'
|
||||||
|
|||||||
Reference in New Issue
Block a user