A calendar management project, for events and activities related to communities fighting for freedoms.
This can be related to software, art, data, hardware, content, commons, internet.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.7 KiB

= title t '.title'
= link_to versions_path(format: :rss) do
= t '.feed'
%th.whodunnit= sort_link @search, :whodunnit
%th.object= sort_link @search, :object_id
%th.changeset= sort_link @search, :changeset
%th.created_at= sort_link @search, :created_at
- @versions.each do |version|
if version.event == 'create'
object = version.item_type.constantize.find_by_id version.item_id
next unless object.try(:moderated?)
object = version.reify if object.nil?
changes = ''
if version.event == 'update'
version.changeset.each do |key, val|
changes += version.item_type.constantize.human_attribute_name(key)
changes += ': '
if key == 'description' && val[0].present? && val[1].present?
changes += Differ.diff(val[1], val[0]).to_s
changes += "#{val[0]} → #{val[1]}"
changes += '
changes = strip_tags(changes).gsub(/^\s*/, '')
%td= t ".#{version.event}_html"
%td= User.find version.whodunnit if version.whodunnit
%td= object
%td.changes= changes
%td= l version.created_at, format: :short
- unless version.event == 'destroy'
%a{ href: polymorphic_path(version.item_type.tableize.singularize,
id: version.item_id) }
%th(colspan='6')= paginate @versions