Class: Card::Act::ActRenderer::RelativeActRenderer

Inherits:
Card::Act::ActRenderer show all
Defined in:
mod/history/lib/card/act/act_renderer/relative_act_renderer.rb

Overview

Use for the history for one specific card It shows only the actions of an act that are relevant for the card of the format that renders the act.

Instance Method Summary collapse

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_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, #render, #respond_to_missing?, #revert_actions_link, #revert_link, #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



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

def act_links
  return unless (content = rollback_or_edit_link)
  wrap_with :small, content
end

#actionsObject



43
44
45
# File 'mod/history/lib/card/act/act_renderer/relative_act_renderer.rb', line 43

def actions
  @actions ||= @act.actions_affecting(@card)
end

#current_act?Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'mod/history/lib/card/act/act_renderer/relative_act_renderer.rb', line 38

def current_act?
  return unless @format.card.last_act && @act
  @act.id == @format.card.last_act.id
end


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

def rollback_or_edit_link
  if @act.draft?
    autosaved_draft_link text: "continue editing",
                         class: "collapse #{collapse_id}"
  elsif show_rollback_link?
    rollback_link
  end
end

#show_rollback_link?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'mod/history/lib/card/act/act_renderer/relative_act_renderer.rb', line 34

def show_rollback_link?
  !current_act?
end

#subtitleObject



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

def subtitle
  return "" unless @act.card_id != @format.card.id
  wrap_with :small, "act on #{absolute_title}"
end

#titleObject



8
9
10
11
12
13
# File 'mod/history/lib/card/act/act_renderer/relative_act_renderer.rb', line 8

def title
  "<span class=\"nr\">##{@args[:act_seq]}</span>" +
    accordion_expand_link(@act.actor.name) +
    " " +
    wrap_with(:small, edited_ago)
end