osem-fcy/app/views/admin/versions/index.html.haml
2016-08-15 18:17:59 +05:30

63 lines
1.8 KiB
Text

.row
.col-md-12
.page-header
%h1 Revision History
%p.text-muted
Log of changes made to conferences and associated resources
%table.table.table-striped.table-bordered.table-hover#versionstable
%thead
%td ID
%td Description
%td Actions
%tbody
- @versions.each do |version|
%tr
%td.col-md-1
= version.id
%td.col-md-9
%p
= change_creator_link(version.whodunnit) unless version.item_type == 'User'
- case version.item_type
- when 'Event'
= event_change_description(version)
-when 'UsersRole'
= users_role_change_description(version)
- when 'Subscription'
= subscription_change_description(version)
- when 'Registration', 'EventsRegistration'
= registration_change_description(version)
- when 'Comment'
= comment_change_description(version)
- when 'Vote'
= vote_change_description(version)
- when 'User'
= user_change_description(version)
- else
- if version.event == 'create'
= 'created new'
- elsif version.event == 'update'
= "updated #{updated_attributes(version)} of"
- else
= 'deleted'
= render partial: 'object_desc_and_link', locals: { version: version }
%small.text-muted
= distance_of_time_in_words(Time.now,version.created_at) + ' ago'
%br
= "(#{version.created_at.strftime('%B %-d, %Y %H:%M')})"
%br
= render partial: 'shared/object_changes', locals: { version: version }
%td.col-md-2
= render partial: 'shared/changelog_actions', locals: { version: version }