Class: Card::Act::ActRenderer::BridgeActRenderer
Overview
Instance Method Summary
collapse
#act_links, #actions, #current_act?, #show_rollback_link?, #subtitle
#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, #collapse_id, #count_types, #deletion_act?, #details, #edited_ago, #header, #initialize, #link_to_act_card, #link_to_history, #method_missing, #respond_to_missing?, #revert_actions_link, #revert_link, #rollback_link, #show_or_hide_changes_link, #summary
#bootstrap, #bs
#components, #include_component, #load_components, #to_const
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Card::Act::ActRenderer
Instance Method Details
#bridge_link ⇒ Object
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_title ⇒ Object
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_title ⇒ Object
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
|
#render ⇒ Object
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_title ⇒ Object
15
16
17
|
# File 'mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb', line 15
def right_title
summary
end
|
#rollback_or_edit_link ⇒ Object
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
|
#title ⇒ Object
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")
end
|