mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #1283 from siddhantbajaj/Voteschange
show vote changes
This commit is contained in:
commit
acc4cc3aef
3 changed files with 8 additions and 1 deletions
|
|
@ -51,7 +51,9 @@ module Admin
|
|||
@difficulty_levels = @program.difficulty_levels
|
||||
@versions = @event.versions |
|
||||
PaperTrail::Version.where(item_type: 'Commercial').where_object(commercialable_id: @event.id, commercialable_type: 'Event') |
|
||||
PaperTrail::Version.where(item_type: 'Commercial').where_object_changes(commercialable_id: @event.id, commercialable_type: 'Event')
|
||||
PaperTrail::Version.where(item_type: 'Commercial').where_object_changes(commercialable_id: @event.id, commercialable_type: 'Event') |
|
||||
PaperTrail::Version.where(item_type: 'Vote').where('object_changes LIKE ?', "%\nevent_id:\n- \n- #{@event.id}\n%") |
|
||||
PaperTrail::Version.where(item_type: 'Vote').where('object LIKE ?', "%\nevent_id: #{@event.id}\n%")
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
|||
|
|
@ -215,6 +215,7 @@ class Ability
|
|||
end
|
||||
|
||||
can [:index, :revert_object, :revert_attribute], PaperTrail::Version, item_type: 'Event', conference_id: conf_ids_for_cfp
|
||||
can [:index, :revert_object, :revert_attribute], PaperTrail::Version, item_type: 'Vote', conference_id: conf_ids_for_cfp
|
||||
can [:index, :revert_object, :revert_attribute], PaperTrail::Version do |version|
|
||||
version.item_type == 'Commercial' && conf_ids_for_cfp.include?(version.conference_id) &&
|
||||
(version.object.to_s.include?('Event') || version.object_changes.to_s.include?('Event'))
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@
|
|||
= event_change_description(version)
|
||||
= "event #{@event.title}"
|
||||
|
||||
- elsif version.item_type == 'Vote'
|
||||
= vote_change_description(version)
|
||||
= "event #{@event.title}"
|
||||
|
||||
- else
|
||||
= general_change_description(version)
|
||||
= link_to 'commercial',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue