UNFINISHED budget management

This commit is contained in:
kikito
2016-09-13 12:33:34 +02:00
parent 2bc9e7be78
commit 13ffd73fee
4 changed files with 27 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ class Management::BudgetInvestmentsController < Management::BaseController
before_action :only_verified_users, except: :print
before_action :set_budget_investment, only: [:vote, :show]
before_action :load_budget
def index
@budget_investments = apply_filters_and_search(Budget::Investment).order(cached_votes_up: :desc).page(params[:page]).for_render

View File

@@ -0,0 +1,16 @@
class Management::BudgetsController < Management::BaseController
include FeatureFlags
feature_flag :budgets
has_filters %w{open finished}, only: :index
load_and_authorize_resource
def index
@budgets = @budgets.send(@current_filter).order(created_at: :desc).page(params[:page])
end
def show
@budget = Budget.includes(groups: :headings).find(params[:id])
end
end

View File

@@ -21,7 +21,7 @@
<div class="small-12 column">
<%= f.label :heading_id, t("budget.investments.form.heading") %>
<%= f.select :heading_id, heading_select_options, {include_blank: t("budget.headings.none"), label: false} %>
<%= f.select :heading_id, budget_heading_select_options(@budget), {include_blank: t("budget.headings.none"), label: false} %>
</div>
<div class="small-12 column">

View File

@@ -4,6 +4,15 @@ feature 'Budget Investments' do
background do
login_as_manager
@budget = create(:budget)
end
context "Select a budget" do
budget2 = create(:budget)
budget3 = create(:budget)
click_link "Create budget investment"
end
context "Create" do
@@ -12,7 +21,6 @@ feature 'Budget Investments' do
user = create(:user, :level_two)
login_managed_user(user)
save_and_open_page
click_link "Create budget investment"
within(".account-info") do