Refs #2603 Show 'See Results' button in admin panel
This commit is contained in:
@@ -159,6 +159,10 @@ class Budget < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def has_winning_investments?
|
||||
investments.winners.any?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sanitize_descriptions
|
||||
|
||||
@@ -63,6 +63,12 @@
|
||||
class: "button hollow" %>
|
||||
<% end %>
|
||||
|
||||
<% if @budget.has_winning_investments? %>
|
||||
<%= link_to t("budgets.show.see_results"),
|
||||
budget_results_path(@budget),
|
||||
class: "button hollow margin-left" %>
|
||||
<% end %>
|
||||
|
||||
<% if @budget.persisted? %>
|
||||
<%= link_to t("admin.budgets.edit.delete"),
|
||||
admin_budget_path(@budget),
|
||||
|
||||
Reference in New Issue
Block a user