Sha256: cdd9212475c0097dc216db65e8264809248e304f1309d4a6f8571b74b7167d8a

Contents?: true

Size: 1.3 KB

Versions: 32

Compression:

Stored size: 1.3 KB

Contents

class Card
  class Act
    class ActRenderer
      # 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.
      class RelativeActRenderer < ActRenderer
        def title
          "<span class=\"nr\">##{@args[:act_seq]}</span>" +
            accordion_expand_link(@act.actor.name) +
            " " +
            wrap_with(:small, edited_ago)
        end

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

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

        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

        def show_rollback_link?
          !current_act?
        end

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

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
card-1.96.8 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.7 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.6 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.5 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.4 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.3 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.2 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.1 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.96.0 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.95.3 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.95.2 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.95.1 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.95.0 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.94.1 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.94.0 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.93.13 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.93.12 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.93.11 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.93.10 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
card-1.93.9 mod/history/lib/card/act/act_renderer/relative_act_renderer.rb