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 :only_verified_users, except: :print
|
||||||
before_action :set_budget_investment, only: [:vote, :show]
|
before_action :set_budget_investment, only: [:vote, :show]
|
||||||
|
before_action :load_budget
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@budget_investments = apply_filters_and_search(Budget::Investment).order(cached_votes_up: :desc).page(params[:page]).for_render
|
@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">
|
<div class="small-12 column">
|
||||||
<%= f.label :heading_id, t("budget.investments.form.heading") %>
|
<%= 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>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
|
|||||||
@@ -4,6 +4,15 @@ feature 'Budget Investments' do
|
|||||||
|
|
||||||
background do
|
background do
|
||||||
login_as_manager
|
login_as_manager
|
||||||
|
@budget = create(:budget)
|
||||||
|
end
|
||||||
|
|
||||||
|
context "Select a budget" do
|
||||||
|
budget2 = create(:budget)
|
||||||
|
budget3 = create(:budget)
|
||||||
|
|
||||||
|
click_link "Create budget investment"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "Create" do
|
context "Create" do
|
||||||
@@ -12,7 +21,6 @@ feature 'Budget Investments' do
|
|||||||
user = create(:user, :level_two)
|
user = create(:user, :level_two)
|
||||||
login_managed_user(user)
|
login_managed_user(user)
|
||||||
|
|
||||||
save_and_open_page
|
|
||||||
click_link "Create budget investment"
|
click_link "Create budget investment"
|
||||||
|
|
||||||
within(".account-info") do
|
within(".account-info") do
|
||||||
|
|||||||
Reference in New Issue
Block a user