minor inprovements and included organizations in changelog
This commit is contained in:
parent
68788ce9fc
commit
16f294f3e8
12 changed files with 199 additions and 90 deletions
|
|
@ -1,17 +1,32 @@
|
|||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state(version.item_type, version.item_id).try(:conference).try(:short_title) || ''
|
||||
- unless version.item_type == 'Role' || version.item_type == 'UsersRole'
|
||||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' '
|
||||
|
||||
- case version.item_type
|
||||
- when 'Organization'
|
||||
organization
|
||||
= link_to_organization(version.item_id)
|
||||
|
||||
- when 'UsersRole'
|
||||
- users_role = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= 'role'
|
||||
= link_to users_role.role.name, admin_conference_role_path(conference.short_title, users_role.role.name)
|
||||
- role = Role.find_by(id: users_role.role_id) if users_role
|
||||
role
|
||||
- if role.name == 'organization_admin'
|
||||
-# organization_admin belongs to organization and not conferences
|
||||
- organization = Organization.find(version.conference_id)
|
||||
= link_if_alive version, role.name,
|
||||
admins_admin_organization_path(organization), organization
|
||||
- else
|
||||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' '
|
||||
= link_if_alive version, role.try(:name), admin_conference_role_path(role.try(:name) || ' ', conference_short_title), conference
|
||||
|
||||
= version.event == 'create' ? 'to' : 'from'
|
||||
= 'user'
|
||||
user
|
||||
= link_to_user(users_role.user_id)
|
||||
|
||||
- when 'Subscription', 'Registration'
|
||||
= 'conference'
|
||||
conference
|
||||
= link_to_conference(version.conference_id)
|
||||
|
||||
- when 'Commercial'
|
||||
|
|
@ -20,72 +35,71 @@
|
|||
|
||||
- case commercial.commercialable_type
|
||||
- when 'Event'
|
||||
= 'commercial in event'
|
||||
commercial in event
|
||||
- if commercialable && conference
|
||||
= link_to commercialable.title,
|
||||
admin_conference_program_event_path(conference_id: conference.short_title,
|
||||
id: commercialable.id)
|
||||
admin_conference_program_event_path(conference, commercialable.id)
|
||||
- else
|
||||
= commercialable.title
|
||||
= "with ID #{commercialable.id}"
|
||||
|
||||
- when 'Venue'
|
||||
= 'commercial in venue'
|
||||
commercial in venue
|
||||
- if commercialable && conference
|
||||
= link_to commercialable.name,
|
||||
edit_admin_conference_venue_path(conference_id: conference_short_title,
|
||||
id: commercialable.id, anchor: 'commercials-content')
|
||||
edit_admin_conference_venue_path(conference_short_title,
|
||||
commercialable.id, anchor: 'commercials-content')
|
||||
- else
|
||||
= commercialable.name
|
||||
= "with ID #{commercialable.id}"
|
||||
|
||||
- when 'Conference'
|
||||
= 'commercial in conference'
|
||||
commercial in conference
|
||||
- if commercialable
|
||||
= link_to commercialable.short_title,
|
||||
admin_conference_commercials_path(conference_id: commercialable.short_title)
|
||||
admin_conference_commercials_path(commercialable.short_title)
|
||||
- else
|
||||
= commercialable.short_title
|
||||
= "with ID #{commercialable.id}"
|
||||
|
||||
- when 'EventsRegistration', 'Comment', 'Vote', 'Event'
|
||||
= 'event'
|
||||
event
|
||||
- object = current_or_last_object_state(version.item_type, version.item_id)
|
||||
- event_id = object.try(:event_id) || object.try(:commentable_id) || object.id
|
||||
= link_to (current_or_last_object_state('Event', event_id).try(:title) || 'deleted event'),
|
||||
admin_conference_program_event_path(conference_id: conference_short_title, id: event_id)
|
||||
admin_conference_program_event_path(conference_short_title, event_id)
|
||||
|
||||
- when 'Target'
|
||||
= 'target'
|
||||
target
|
||||
- target = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, target.to_s, admin_conference_targets_path(conference_id: conference_short_title), conference
|
||||
= link_if_alive version, target.to_s, admin_conference_targets_path(conference_short_title), conference
|
||||
|
||||
- when 'EventSchedule'
|
||||
- event_schedule = current_or_last_object_state(version.item_type, version.item_id)
|
||||
event
|
||||
= link_to (current_or_last_object_state('Event', event_schedule.event_id).try(:title) || 'deleted'),
|
||||
admin_conference_program_event_path(conference_id: conference_short_title, id: event_schedule.event_id)
|
||||
admin_conference_program_event_path(conference_short_title, event_schedule.event_id)
|
||||
in
|
||||
= link_to "Schedule #{event_schedule.schedule_id}",
|
||||
admin_conference_schedule_path(conference_id: conference_short_title, id: event_schedule.schedule_id)
|
||||
admin_conference_schedule_path(conference_short_title, event_schedule.schedule_id)
|
||||
|
||||
- when 'Schedule'
|
||||
= link_if_alive version, "Schedule #{version.item_id}",
|
||||
admin_conference_schedule_path(conference_id: conference_short_title, id: version.item_id),
|
||||
admin_conference_schedule_path(conference_short_title, version.item_id),
|
||||
conference
|
||||
|
||||
- when 'Conference'
|
||||
= 'conference'
|
||||
conference
|
||||
= link_to_conference(version.item_id)
|
||||
|
||||
- when 'RegistrationPeriod'
|
||||
= link_if_alive version, 'registration period',
|
||||
admin_conference_registration_period_path(conference_id: conference_short_title),
|
||||
admin_conference_registration_period_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Contact'
|
||||
= link_if_alive version, 'contact details',
|
||||
edit_admin_conference_contact_path(conference_id: conference_short_title),
|
||||
edit_admin_conference_contact_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Booth'
|
||||
|
|
@ -96,108 +110,120 @@
|
|||
|
||||
- when 'Program'
|
||||
= link_if_alive version, 'program',
|
||||
admin_conference_program_path(conference_id: conference_short_title),
|
||||
admin_conference_program_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Cfp'
|
||||
= 'cfp for'
|
||||
cfp for
|
||||
- cfp = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, cfp.cfp_type,
|
||||
admin_conference_program_cfp_path(conference_id: conference_short_title, id: version.item_id),
|
||||
admin_conference_program_cfp_path(conference_short_title, version.item_id),
|
||||
conference
|
||||
|
||||
- when 'Track'
|
||||
= 'track'
|
||||
track
|
||||
- track = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, track.name,
|
||||
admin_conference_program_track_path(conference_id: conference_short_title, id: track.try(:short_name)),
|
||||
admin_conference_program_track_path(conference_short_title, track.try(:short_name)),
|
||||
conference
|
||||
|
||||
- when 'EventType'
|
||||
= 'event type'
|
||||
event type
|
||||
- event_type = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, event_type.title,
|
||||
admin_conference_program_event_types_path(conference_id: conference_short_title),
|
||||
admin_conference_program_event_types_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Role'
|
||||
= 'role'
|
||||
role
|
||||
- role = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, role.name,
|
||||
admin_conference_role_path(conference_id: conference_short_title, id: role.name),
|
||||
conference
|
||||
- role_name = role.try(:name) || PaperTrail::Version.where(item_type: 'Role', item_id: version.item_id).last.changeset[:name].second
|
||||
- if role_name == 'organization_admin'
|
||||
-# organization_admin belongs to organization and not conferences
|
||||
- organization = Organization.find(version.conference_id)
|
||||
= link_if_alive version, role_name,
|
||||
admins_admin_organization_path(organization), organization
|
||||
- else
|
||||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' '
|
||||
= link_if_alive version, role_name,
|
||||
admin_conference_role_path(conference_short_title, role_name), conference
|
||||
|
||||
- when 'Venue'
|
||||
= 'venue'
|
||||
venue
|
||||
- venue = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, venue.name,
|
||||
admin_conference_venue_path(conference_id: conference_short_title),
|
||||
admin_conference_venue_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Lodging'
|
||||
= 'lodging'
|
||||
lodging
|
||||
- lodging = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, lodging.name,
|
||||
admin_conference_lodgings_path(conference_id: conference_short_title),
|
||||
admin_conference_lodgings_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Room'
|
||||
= 'room'
|
||||
room
|
||||
- room = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, room.name,
|
||||
admin_conference_venue_rooms_path(conference_id: conference_short_title),
|
||||
admin_conference_venue_rooms_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Sponsor'
|
||||
= 'sponsor'
|
||||
sponsor
|
||||
- sponsor = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, sponsor.name,
|
||||
admin_conference_sponsors_path(conference_id: conference_short_title),
|
||||
admin_conference_sponsors_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'SponsorshipLevel'
|
||||
= 'sponsorship level'
|
||||
sponsorship level
|
||||
- sponsorship_level = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, sponsorship_level.title,
|
||||
admin_conference_sponsorship_levels_path(conference_id: conference_short_title),
|
||||
admin_conference_sponsorship_levels_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'Ticket'
|
||||
= 'ticket'
|
||||
ticket
|
||||
- ticket = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, ticket.title,
|
||||
admin_conference_ticket_path(conference_id: conference_short_title, id: version.item_id),
|
||||
admin_conference_ticket_path(conference_short_title, version.item_id),
|
||||
conference
|
||||
|
||||
- when 'Campaign'
|
||||
= 'campaign'
|
||||
campaign
|
||||
- campaign = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, campaign.name,
|
||||
admin_conference_campaigns_path(conference_id: conference_short_title),
|
||||
admin_conference_campaigns_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'DifficultyLevel'
|
||||
= 'difficulty level'
|
||||
difficulty level
|
||||
- difficulty_level = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, difficulty_level.title,
|
||||
admin_conference_program_difficulty_level_path(conference_id: conference_short_title, id: version.item_id),
|
||||
admin_conference_program_difficulty_level_path(conference_short_title, version.item_id),
|
||||
conference
|
||||
|
||||
- when 'Splashpage'
|
||||
= link_if_alive version, 'splashpage',
|
||||
admin_conference_splashpage_path(conference_id: conference_short_title),
|
||||
admin_conference_splashpage_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'EmailSettings'
|
||||
= link_if_alive version, 'email settings',
|
||||
admin_conference_emails_path(conference_id: conference_short_title),
|
||||
admin_conference_emails_path(conference_short_title),
|
||||
conference
|
||||
|
||||
- when 'User'
|
||||
- if version.event == 'update'
|
||||
= 'user'
|
||||
user
|
||||
= link_to_user(version.item_id)
|
||||
|
||||
- unless %w(Conference Subscription Registration User).include?(version.item_type)
|
||||
= 'in conference'
|
||||
= link_to_conference(version.conference_id)
|
||||
- unless %w(Conference Subscription Registration User Organization).include?(version.item_type)
|
||||
- if (version.item_type == 'Role' && role_name == 'organization_admin') || (version.item_type == 'UsersRole' && role.name == 'organization_admin')
|
||||
in organization
|
||||
= link_to_organization(version.conference_id)
|
||||
- else
|
||||
in conference
|
||||
= link_to_conference(version.conference_id)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to 'All Conferences & Users', admin_revision_history_path
|
||||
- @conf_ids_with_role.each do |conference_short_title|
|
||||
- @conferences_with_role.each do |conference_short_title|
|
||||
%li= link_to conference_short_title, admin_conference_revision_history_path(conference_id: conference_short_title)
|
||||
|
||||
%h1 Revision History
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue