Class: Card::Act::ActRenderer::BoardActRenderer
Overview
Instance Method Summary
collapse
#act_links, #actions, #current_act?, #relative_title, #revert_link, #rollback_link, #show_rollback_link?, #subtitle
#absolute_title, #accordion_item, #act_links, #act_type, #action_summary, #actor_and_ago, #approved_actions, #autosaved_draft_link, #count_types, #details, #edited_ago, #header, #initialize, #link_to_act_card, #link_to_history, #method_missing, #respond_to_missing?, #summary
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Card::Act::ActRenderer
Instance Method Details
#board_link ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'lib/card/act/act_renderer/board_act_renderer.rb', line 25
def board_link
opts = @format.board_link_opts(
path: { act_id: @act.id, view: :board_act, act_seq: @args[:act_seq] },
"data-bs-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 'lib/card/act/act_renderer/board_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 'lib/card/act/act_renderer/board_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 'lib/card/act/act_renderer/board_act_renderer.rb', line 19
def render
return "" unless @act_card
details
end
|
#right_title ⇒ Object
15
16
17
|
# File 'lib/card/act/act_renderer/board_act_renderer.rb', line 15
def right_title
summary
end
|
#rollback_or_edit_link ⇒ Object
43
44
45
46
47
48
49
|
# File 'lib/card/act/act_renderer/board_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 'lib/card/act/act_renderer/board_act_renderer.rb', line 6
def title
wrap_with(:div, left_title, class: "me-2") +
wrap_with(:div, right_title, class: "ms-auto act-summary")
end
|