Class: Card::Act::ActRenderer::BridgeActRenderer

Inherits:
RelativeActRenderer show all
Defined in:
mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb

Overview

Used for the bridge

Instance Method Summary collapse

Methods inherited from RelativeActRenderer

#act_links, #actions, #current_act?, #revert_link, #show_rollback_link?, #subtitle

Methods inherited from Card::Act::ActRenderer

#absolute_title, #accordion_expand_link, #accordion_expand_options, #act_accordion, #act_accordion_body, #act_accordion_heading, #act_accordion_panel, #act_links, #act_panel_options, #act_type, #action_header?, #approved_actions, #autosaved_draft_link, #collapse_id, #count_types, #deletion_act?, #details, #edited_ago, #header, #initialize, #link_to_act_card, #link_to_history, #method_missing, #respond_to_missing?, #rollback_link, #show_or_hide_changes_link, #summary

Methods included from Bootstrapper

#bootstrap, #bs

Methods included from Bootstrap::ComponentLoader

#components, #include_component, #load_components, #to_const

Constructor Details

This class inherits a constructor from Card::Act::ActRenderer

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Card::Act::ActRenderer

Instance Method Details



25
26
27
28
29
30
31
32
33
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 25

def bridge_link
  opts = @format.bridge_link_opts(
    path: { act_id: @act.id, view: :bridge_act, act_seq: @args[:act_seq] },
    "data-toggle": "pill"
  )
  add_class opts, "d-flex nav-link"
  opts[:path].delete :layout
  link_to_card @card, title, opts
end

#left_titleObject



11
12
13
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 11

def left_title
  ["##{@args[:act_seq]}", @act.actor.name, wrap_with(:small, edited_ago)].join " "
end

#overlay_titleObject



35
36
37
38
39
40
41
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 35

def overlay_title
  wrap_with :div do
    [left_title, summary,
     subtitle.present? ? subtitle : nil,
     rollback_or_edit_link].compact.join " | "
  end
end

#renderObject



19
20
21
22
23
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 19

def render
  return "" unless @act_card

  details
end

#right_titleObject



15
16
17
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 15

def right_title
  summary
end


43
44
45
46
47
48
49
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 43

def rollback_or_edit_link
  if @act.draft?
    autosaved_draft_link text: "continue editing"
  elsif show_rollback_link?
    revert_link
  end
end

#titleObject



6
7
8
9
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 6

def title
  wrap_with(:div, left_title, class: "mr-2") +
    wrap_with(:div, right_title, class: "ml-auto act-summary")
end