diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index bc4e7cbf..69ee19a3 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -181,7 +181,7 @@ module Admin :vpositions_attributes, :use_volunteers, :color, :sponsorship_levels_attributes, :sponsors_attributes, :registration_limit, :ticket_layout, - :booth_limit) + :booth_limit, :code_of_conduct) end end end diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index a9dcdd3b..8a4262f1 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -108,6 +108,8 @@ class ConferencesController < ApplicationController end end + def code_of_conduct; end + private def conference_finder_conditions diff --git a/app/views/admin/conferences/_form_fields.html.haml b/app/views/admin/conferences/_form_fields.html.haml index bcba474f..c9a20452 100644 --- a/app/views/admin/conferences/_form_fields.html.haml +++ b/app/views/admin/conferences/_form_fields.html.haml @@ -32,6 +32,11 @@ %span.help-block This will be displayed on the front page. = f.hidden_field :picture_cache + .form-group + = f.text_area :code_of_conduct, rows: 10, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + Rules governing behavior and dispute resolution... + = markdown_hint = f.select :ticket_layout, Conference.ticket_layouts.keys, {}, class: 'form-control' %span.help-block Layout type for tickets of the conference. diff --git a/app/views/conference_registrations/_registration_info.html.haml b/app/views/conference_registrations/_registration_info.html.haml index 0fd04b51..cb2a3086 100644 --- a/app/views/conference_registrations/_registration_info.html.haml +++ b/app/views/conference_registrations/_registration_info.html.haml @@ -1,16 +1,14 @@ -- unless @conference.code_of_conduct.blank? - - code_of_conduct_link = link_to 'Code of Conduct', '#', - data: { toggle: 'modal', target: '#modal-code-of-conduct'} +- if @conference.code_of_conduct.present? - if @registration.accepted_code_of_conduct = icon 'fa-solid', 'square-check' I have read and accepted the - = code_of_conduct_link + = link_to "Code of Conduct", code_of_conduct_conference_path(@conference.short_title) - else .checkbox %label = f.check_box :accepted_code_of_conduct, required: true I have read and accept the - = code_of_conduct_link + = link_to "Code of Conduct", code_of_conduct_conference_path(@conference.short_title) %abbr{title: 'This field is required'} * - if @conference.program.events.with_registration_open.any? || @registration.events.any? @@ -26,5 +24,3 @@ - if event.scheduled? (Scheduled on: #{event.time.to_date}) %br - -= render 'conferences/code_of_conduct' diff --git a/app/views/conferences/_code_of_conduct.haml b/app/views/conferences/_code_of_conduct.haml deleted file mode 100644 index d3110867..00000000 --- a/app/views/conferences/_code_of_conduct.haml +++ /dev/null @@ -1,18 +0,0 @@ -= content_for :splash_nav do - %li - = link_to 'Code of Conduct', '#', - data: { toggle: 'modal', target: '#modal-code-of-conduct'} - -- content_for :modals do - - cache '#CoC-modal' do - .modal.fade{ id: "modal-code-of-conduct" } - .modal-dialog - .modal-content - .modal-header - %button.close{ data: { dismiss: 'modal' } } - %i.fa-solid.fa-xmark - %h3.modal-title Code of Conduct - .modal-body - = markdown conference.code_of_conduct - .modal-footer - = link_to 'permalink', :code_of_conduct diff --git a/app/views/conferences/_conference_details.html.haml b/app/views/conferences/_conference_details.html.haml index ffdd197a..571cca4a 100644 --- a/app/views/conferences/_conference_details.html.haml +++ b/app/views/conferences/_conference_details.html.haml @@ -26,8 +26,8 @@ = link_to "View Conference", conference_path(conference.short_title), class: 'btn btn-default' - if conference.program and conference.program.schedule_public = 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, class: 'btn btn-default' + - if conference.code_of_conduct.present? + = link_to "Code of Conduct", code_of_conduct_conference_path(conference.short_title), class: 'btn btn-default' - if conference.registration_open? - if conference.user_registered?(current_user) = link_to "My Registration", conference_conference_registration_path(conference.short_title), class: 'btn btn-default' diff --git a/app/views/conferences/_social_media.haml b/app/views/conferences/_social_media.haml index 672a19cd..9b542aa0 100644 --- a/app/views/conferences/_social_media.haml +++ b/app/views/conferences/_social_media.haml @@ -27,3 +27,9 @@ - if contact.email? = mail_to "#{ contact.email }" do %i.fa-solid.fa-envelope.fa-4x + .row + .col-md-12 + - if @conference.code_of_conduct.present? + %hr + %p.text-center + = link_to "Code of Conduct", code_of_conduct_conference_path(@conference.short_title) diff --git a/app/views/conferences/code_of_conduct.html.haml b/app/views/conferences/code_of_conduct.html.haml new file mode 100644 index 00000000..57f27cf7 --- /dev/null +++ b/app/views/conferences/code_of_conduct.html.haml @@ -0,0 +1,10 @@ +.container + .row + .col-md-12 + .page-header + %h1 + = @conference.short_title + Code Of Conduct + .row + .col-md-12 + = markdown @conference.code_of_conduct diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 41718b66..1bdf80b3 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -18,9 +18,6 @@ #splash - - if @conference.code_of_conduct.present? - = render 'code_of_conduct' - -# header/description = render 'header', conference: @conference, venue: @conference.venue diff --git a/config/routes.rb b/config/routes.rb index cc6147e6..730d43cf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -192,6 +192,10 @@ Osem::Application.routes.draw do get :events end end + + member do + get 'code-of-conduct' + end end namespace :api, defaults: {format: 'json'} do