From d9b2ebfc369143c01c3c626026a7b609182b405e Mon Sep 17 00:00:00 2001 From: nasia Date: Mon, 17 Jul 2017 12:00:06 +0300 Subject: [PATCH] Add paper_trail --- app/models/booth.rb | 1 + app/views/admin/booths/_form.html.haml | 4 ++-- app/views/admin/booths/index.html.haml | 3 ++- app/views/admin/versions/_object_desc_and_link.html.haml | 6 ++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/models/booth.rb b/app/models/booth.rb index e692c663..911f9485 100644 --- a/app/models/booth.rb +++ b/app/models/booth.rb @@ -1,5 +1,6 @@ class Booth < ActiveRecord::Base include ActiveRecord::Transitions + has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id } belongs_to :conference has_many :booth_requests, dependent: :destroy diff --git a/app/views/admin/booths/_form.html.haml b/app/views/admin/booths/_form.html.haml index 41637ac0..e4a7d05d 100644 --- a/app/views/admin/booths/_form.html.haml +++ b/app/views/admin/booths/_form.html.haml @@ -11,8 +11,8 @@ = f.input :reasoning, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true, label: 'How it fits the conference' = f.input :submitter_relationship, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true, - label: 'Your personal relationship with the organization you are applying for', - hint: 'e.g. employee, member of the open source community etc' + label: 'Submitter\'s relation', + hint: 'e.g. employee, comunity manager, etc' = f.input :website_url = responsibles_selector_input f = image_tag f.object.picture.thumb.url if f.object.picture? diff --git a/app/views/admin/booths/index.html.haml b/app/views/admin/booths/index.html.haml index 0bcccb91..15833bd7 100644 --- a/app/views/admin/booths/index.html.haml +++ b/app/views/admin/booths/index.html.haml @@ -33,7 +33,8 @@ %td = booth.id %td - = image_tag(booth.picture.thumb.url, width: '20%') + - if booth.logo_link + = image_tag(booth.picture.thumb.url, width: '20%') %td = link_to booth.title, admin_conference_booth_path(@conference.short_title, booth) %td diff --git a/app/views/admin/versions/_object_desc_and_link.html.haml b/app/views/admin/versions/_object_desc_and_link.html.haml index 83542ef1..d29e5f9b 100644 --- a/app/views/admin/versions/_object_desc_and_link.html.haml +++ b/app/views/admin/versions/_object_desc_and_link.html.haml @@ -80,6 +80,12 @@ = link_if_alive version, 'contact details', edit_admin_conference_contact_path(conference_id: Conference.find(version.conference_id).short_title) +- when 'Booth' + = 'booth' + - booth = current_or_last_object_state(version.item_type, version.item_id) + = link_if_alive version, booth.title, + admin_conference_booth_path(conference_id: Conference.find(version.conference_id).short_title, id: version.item_id ) + - when 'Program' = link_if_alive version, 'program', admin_conference_program_path(conference_id: Conference.find(version.conference_id).short_title)