Sha256: 083d5365594e94f4dc2e829fc7764e067a709af54161fa9df1432365b694dd69

Contents?: true

Size: 1.42 KB

Versions: 7

Compression:

Stored size: 1.42 KB

Contents

# History views

format :html do
  view :history, cache: :never do # why no cache?
    frame do
      class_up "d0-card-body",  "history-slot"
      render_relative_history
    end
  end

  view :relative_history do
    acts_layout card.history_acts, :relative, :show
  end

  view :act, cache: :never do
    act_listing act_from_context
  end

  view :act_legend do
    bs_layout do
      row md: [12, 12], lg: [7, 5], class: "pb-3" do
        col action_legend
        col content_legend, class: "text-end"
      end
    end
  end

  view :draft_legend do
    "#{action_icon(:draft)} unsaved draft"
  end

  view :action_summary do
    action_content action_from_context, :summary
  end

  view :action_expanded do
    action_content action_from_context, :expanded
  end

  view :change do
    voo.show :title_link
    voo.hide :menu
    wrap do
      [_render_title,
       _render_menu,
       _render_last_action]
    end
  end

  view :last_action do
    %(
      <span class="last-update">
        #{render_last_action_verb} #{render_acted_at} ago by
        #{nest card.last_actor, view: :link}
      </span>
    )
  end

  view :last_action_verb, cache: :never do
    return unless (act = card.last_act)
    return unless (action = act.action_on card.id)

    case action.action_type
    when :create then "added"
    when :delete then "deleted"
    else
      link_to_view :history, "edited", class: "last-edited", rel: "nofollow"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
card-mod-history-0.15.6 set/all/history/views.rb
card-mod-history-0.15.5 set/all/history/views.rb
card-mod-history-0.15.4 set/all/history/views.rb
card-mod-history-0.15.3 set/all/history/views.rb
card-mod-history-0.15.2.pre1 set/all/history/views.rb
card-mod-history-0.15.1.1 set/all/history/views.rb
card-mod-history-0.15.1 set/all/history/views.rb