Module: Card::Set::Type::Mod::HtmlFormat

Extended by:
AbstractFormat
Defined in:
platypus/tmp/set/gem-card/mod001-core/type/mod.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/mod.rb

Instance Method Summary collapse

Instance Method Details

#before_barObject



19
20
21
# File 'platypus/tmp/set/gem-defaults/mod004-format/type/mod.rb', line 19

def before_bar
  voo.show :bar_middle
end

#render_section_views(list) ⇒ Object



32
33
34
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 32

def render_section_views list
  list.map { |view_name| send("render_#{view_name}") }.compact.join "<br/>"
end

#view: adminObject



9
10
11
# File 'platypus/tmp/set/gem-defaults/mod004-format/type/mod.rb', line 9

view :admin do
  render_core
end

#view: bar_rightObject



13
14
15
16
17
# File 'platypus/tmp/set/gem-defaults/mod004-format/type/mod.rb', line 13

view :bar_right do
  %w[settings configurations tasks cardtypes scripts styles].filter do |name|
    card.send("#{name}?")
  end.join ", "
end

#view: cardtypesObject



40
41
42
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 40

view :cardtypes do
  nested_list_section "Cardtypes", card.cardtypes
end

#view: configurationsObject



44
45
46
47
48
49
50
51
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 44

view :configurations do
  return unless card.configurations

  card.configurations.map do |category, names|
    list_section("#{category.capitalize} Configuration",
                 names.map(&:to_sym))
  end.join " "
end

#view: coreObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 14

view :core do
  render_section_views(%i[
    description
    settings
    configurations
    cardtypes
    styles
    scripts
    tasks
    views
    depends_on
  ].select { |name| card.send("#{name}?") })
end

#view: depends_onObject



89
90
91
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 89

view :depends_on do
  list_section "Depends on", card.depends_on
end

#view: descriptionObject



28
29
30
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 28

view :description do
  (:p, card.description)
end

#view: gem_infoObject



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 72

view :gem_info do
  return unless card.mod&.spec
  properties =
    %w[name summary version authors description email homepage].map do |property|
      "#{property}: #{card.mod.spec.send(property)}"
    end

  section "Gem info",
          list_group(properties) +
          accordion_item("files",
                         body: list_group(card.mod.spec.files),
                         context: "files") +
          accordion_item("depends on ",
                         body: list_section_content(card.depends_on),
                         context: "depends_on")
end

#view: scriptsObject



66
67
68
69
70
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 66

view :scripts do
  style = card.fetch :script
  return unless style
  section "Scripts", nest(style, view: :core)
end

#view: settingsObject



36
37
38
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 36

view :settings do
  list_section "Settings", card.settings
end

#view: stylesObject



60
61
62
63
64
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 60

view :styles do
  style = card.fetch :style
  return unless style
  section "Styles", nest(style, view: :core)
end

#view: tasksObject



53
54
55
56
57
58
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 53

view :tasks do
  tasks = card.tasks
  return unless tasks.present?

  section "Tasks", task_table(tasks)
end

#view: viewsObject



93
94
95
# File 'platypus/tmp/set/gem-card/mod001-core/type/mod.rb', line 93

view :views do
  section "Views", list_group(card.views)
end