UNFINISHED budget management
This commit is contained in:
@@ -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
|
||||
|
||||
16
app/controllers/management/budgets_controller.rb
Normal file
16
app/controllers/management/budgets_controller.rb
Normal 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
|
||||
@@ -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">
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user