Include code of conduct on conference
This commit is contained in:
parent
217ec1a46f
commit
95196c7f80
5 changed files with 47 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ class Conference < ApplicationRecord
|
||||||
scope :past, (-> { where('end_date < ?', Date.current) })
|
scope :past, (-> { where('end_date < ?', Date.current) })
|
||||||
|
|
||||||
belongs_to :organization
|
belongs_to :organization
|
||||||
|
delegate :code_of_conduct, to: :organization
|
||||||
|
|
||||||
has_paper_trail ignore: %i(updated_at guid revision events_per_week), meta: { conference_id: :id }
|
has_paper_trail ignore: %i(updated_at guid revision events_per_week), meta: { conference_id: :id }
|
||||||
|
|
||||||
|
|
|
||||||
20
app/views/conferences/_code_of_conduct.haml
Normal file
20
app/views/conferences/_code_of_conduct.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
= content_for :splash_nav do
|
||||||
|
%li
|
||||||
|
= link_to 'Code of Conduct', '#',
|
||||||
|
data: { toggle: 'modal', target: '#modal-code-of-conduct'}
|
||||||
|
|
||||||
|
- content_for :modals do
|
||||||
|
- cache [organization, '#CoC-modal'] do
|
||||||
|
.modal.fade{ id: "modal-code-of-conduct" }
|
||||||
|
.modal-dialog
|
||||||
|
.modal-content
|
||||||
|
.modal-header
|
||||||
|
%button.close{ data: { dismiss: 'modal' } }
|
||||||
|
%i.fa.fa-close
|
||||||
|
%h3.modal-title Code of Conduct
|
||||||
|
.modal-body
|
||||||
|
= markdown organization.code_of_conduct
|
||||||
|
.modal-footer
|
||||||
|
= link_to 'permalink',
|
||||||
|
[:code_of_conduct, organization],
|
||||||
|
target: '_blank'
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
.row
|
.row{ id: "conference-#{conference.id}" }
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.well
|
.well
|
||||||
.row
|
.row
|
||||||
|
|
@ -23,6 +23,10 @@
|
||||||
= link_to "View Conference", conference_path(conference.short_title), class: 'btn btn-default'
|
= link_to "View Conference", conference_path(conference.short_title), class: 'btn btn-default'
|
||||||
- if conference.program and conference.program.schedule_public
|
- if conference.program and conference.program.schedule_public
|
||||||
= link_to "Schedule", conference_schedule_path(conference.short_title), class: 'btn btn-default'
|
= link_to "Schedule", conference_schedule_path(conference.short_title), class: 'btn btn-default'
|
||||||
|
- unless conference.code_of_conduct.blank?
|
||||||
|
= link_to "Code of Conduct",
|
||||||
|
[:code_of_conduct, conference.organization],
|
||||||
|
class: 'btn btn-default'
|
||||||
- if conference.registration_open?
|
- if conference.registration_open?
|
||||||
- if conference.user_registered?(current_user)
|
- if conference.user_registered?(current_user)
|
||||||
= link_to "My Registration", conference_conference_registration_path(conference.short_title), class: 'btn btn-default'
|
= link_to "My Registration", conference_conference_registration_path(conference.short_title), class: 'btn btn-default'
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@
|
||||||
= @conference.title
|
= @conference.title
|
||||||
|
|
||||||
#splash
|
#splash
|
||||||
|
- if @conference.code_of_conduct.present?
|
||||||
|
= render 'code_of_conduct', organization: @conference.organization
|
||||||
|
|
||||||
-# header/description
|
-# header/description
|
||||||
= render 'header', conference: @conference, venue: @conference.venue
|
= render 'header', conference: @conference, venue: @conference.venue
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,24 @@ feature 'Code of Conduct:' do
|
||||||
expect(page).to have_text(sample_text)
|
expect(page).to have_text(sample_text)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'on a conference' do
|
||||||
|
let!(:conference) { create(:full_conference, organization: organization) }
|
||||||
|
|
||||||
|
it 'is linked from the index' do
|
||||||
|
visit conferences_path
|
||||||
|
within "#conference-#{conference.id}" do
|
||||||
|
click_on 'Code of Conduct'
|
||||||
|
end
|
||||||
|
expect(page).to have_text(sample_text)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'is included in the splash page', js: true do
|
||||||
|
visit conference_path(conference)
|
||||||
|
click_on 'Code of Conduct'
|
||||||
|
expect(page).to have_text(sample_text)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue