Class: Decidim::Budgets::ProjectHistoryCell

Inherits:
ResourceHistoryCell
  • Object
show all
Defined in:
app/cells/decidim/budgets/project_history_cell.rb

Overview

This cell is used to render the project history panel of a resource inside a tab of a show view

The ‘model` must be a project’s budget resource to get the history from.

Example:

cell(
  "decidim/project_history",
  budget
)

Instance Method Summary collapse

Instance Method Details

#creation_itemObject



34
35
36
37
38
39
40
41
# File 'app/cells/decidim/budgets/project_history_cell.rb', line 34

def creation_item
  {
    id: "budget_creation",
    date: @model.created_at,
    text: t("decidim.budgets.creation.text"),
    icon: resource_type_icon_key("Decidim::Budgets::Project")
  }
end

#history_cell_idObject



43
44
45
# File 'app/cells/decidim/budgets/project_history_cell.rb', line 43

def history_cell_id
  "budget"
end

#linked_resources_itemsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/cells/decidim/budgets/project_history_cell.rb', line 17

def linked_resources_items
  [
    {
      resources: @model.linked_resources(:proposals, "included_proposals"),
      link_name: "included_proposals",
      text_key: "decidim.proposals.proposal.budget_text",
      icon_key: "Decidim::Proposals::Proposal"
    },
    {
      resources: @model.linked_resources(:results, "included_projects"),
      link_name: "included_projects",
      text_key: "decidim.accountability.result.budget_text",
      icon_key: "Decidim::Accountability::Result"
    }
  ]
end