diff --git a/app/controllers/admin/budget_investments_controller.rb b/app/controllers/admin/budget_investments_controller.rb index 869ba1ad4..2e5c17329 100644 --- a/app/controllers/admin/budget_investments_controller.rb +++ b/app/controllers/admin/budget_investments_controller.rb @@ -1,8 +1,10 @@ class Admin::BudgetInvestmentsController < Admin::BaseController - include FeatureFlags + include CommentableActions + feature_flag :budgets + has_orders %w{oldest}, only: [:show, :edit] has_filters(%w{all without_admin without_valuator under_valuation valuation_finished winners}, only: [:index, :toggle_selection]) @@ -24,6 +26,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController end def show + load_comments end def edit @@ -55,6 +58,20 @@ class Admin::BudgetInvestmentsController < Admin::BaseController private + def load_comments + @commentable = @investment + @comment_tree = CommentTree.new(@commentable, params[:page], @current_order, valuations: true) + set_comment_flags(@comment_tree.comments) + end + + def resource_model + Budget::Investment + end + + def resource_name + resource_model.parameterize('_') + end + def sort_by(params) if params.present? && Budget::Investment::SORTING_OPTIONS.include?(params) "#{params == 'supports' ? 'cached_votes_up' : params} ASC" diff --git a/app/views/admin/budget_investments/show.html.erb b/app/views/admin/budget_investments/show.html.erb index 2c13d50e3..939830aff 100644 --- a/app/views/admin/budget_investments/show.html.erb +++ b/app/views/admin/budget_investments/show.html.erb @@ -45,6 +45,7 @@ <%= link_to t("admin.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) unless @budget.finished? %>

+<%= render 'valuation/budget_investments/valuation_comments' %>

<%= t("admin.budget_investments.show.milestone") %>