Module: Card::Set::All::HistoryBridge::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb,
card/tmpsets/set/mod012-card-mod-history/all/history_bridge.rb

Instance Method Summary collapse

Instance Method Details



46
47
48
49
50
51
# File 'card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb', line 46

def act_link_list acts, context
  items = acts_for_accordion(acts, context) do |act, seq|
    act_link_list_item act, seq, context
  end
  bridge_pills items
end


53
54
55
56
57
# File 'card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb', line 53

def act_link_list_item act, seq=nil, _context=nil
  opts = act_listing_opts_from_params(seq)
  opts[:slot_class] = "revision-#{act.id} history-slot nav-item"
  act_renderer(:bridge).new(self, act, opts).bridge_link
end

#act_list_group(acts, context, &block) ⇒ Object



59
60
61
# File 'card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb', line 59

def act_list_group acts, context, &block
  list_group acts_for_accordion(acts, context, &block), class: "clear-both"
end

#acts_bridge_layout(acts, context = :bridge) ⇒ Object



38
39
40
41
42
43
44
# File 'card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb', line 38

def acts_bridge_layout acts, context=:bridge
  output [
    _render_creator_credit,
    act_link_list(acts, context),
    act_paging(acts, context)
  ]
end

#view: bridge_actObject



63
64
65
66
67
68
69
70
71
# File 'card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb', line 63

view :bridge_act, cache: :never do
  opts = act_listing_opts_from_params(nil)
  act = act_from_context
  ar = act_renderer(:bridge).new(self, act, opts)
  class_up "action-list", "my-3"
  wrap_with_overlay title: ar.overlay_title, slot: breadcrumb_data("History") do
    act_listing(act, opts[:act_seq], :bridge)
  end
end

#view: creator_creditObject



9
10
11
12
13
14
# File 'card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb', line 9

view :creator_credit,
     wrap: { div: { class: "text-muted creator-credit" } }, cache: :never do
  return "" unless card.real?
  "Created by #{nest card.creator, view: :link} "\
  "#{time_ago_in_words(card.created_at)} ago"
end

#view: updated_byObject



16
17
18
19
20
21
22
23
# File 'card/tmpsets/set/mod013-card-mod-history/all/history_bridge.rb', line 16

view :updated_by, wrap: { div: { class: "text-muted" } } do
  return "" unless card.id
  updaters = Card.search(updater_of: { id: card.id })
  return "" unless updaters.present?

  updaters = updater_links updaters, others_target: Card.fetch(card, :editors)
  "Updated by #{updaters}"
end