Class: Decidim::Accountability::ProjectCell

Inherits:
ViewModel
  • Object
show all
Includes:
Cell::ViewModel::Partial, ApplicationHelper
Defined in:
app/cells/decidim/accountability/project_cell.rb

Overview

This cell renders a project

Instance Method Summary collapse

Methods included from ApplicationHelper

#apply_accountability_pack_tags, #component_name, #display_percentage

Instance Method Details

#showObject



15
16
17
# File 'app/cells/decidim/accountability/project_cell.rb', line 15

def show
  render template
end

#tab_panel_itemsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/cells/decidim/accountability/project_cell.rb', line 19

def tab_panel_items
  [
    {
      enabled: milestones.any?,
      id: "milestones",
      text: t("decidim.accountability.results.milestones.title"),
      icon: "route-line",
      method: :cell,
      args: ["decidim/accountability/project", result, { template: :milestones }]
    },
    {
      enabled: ResultHistoryCell.new(result).render?,
      id: "included_history",
      text: t("decidim.history", scope: "activerecord.models", count: 2),
      icon: resource_type_icon_key("history"),
      method: :cell,
      args: ["decidim/accountability/result_history", result]
    },
    {
      enabled: children.any?,
      id: "included_results",
      text: t("activemodel.attributes.result.subresults"),
      icon: "briefcase-2-line",
      method: :cell,
      args: ["decidim/accountability/results", result.children]
    }
  ] + attachments_tab_panel_items(result)
end