- is_facilitator = workshop.active_facilitator?(current_user) = row class: 'view-object' do = columns(medium: 12) do %h2=_!workshop.title .workshop-interest - if workshop.interested?(current_user) =_'articles.workshops.info.you_are_interested_count', "You and #{workshop.interested_count - 1} others are interested in this workshop", :vars => {:count => (workshop.interested_count - 1)} - else =_'articles.workshops.info.interested_count', "#{workshop.interested_count} people are interested in this workshop", :vars => {:count => workshop.interested_count} - if preview.blank? && workshop.can_show_interest?(current_user) = form_tag toggle_workshop_interest_path(workshop.conference.slug, workshop.id), class: 'js-xhr' do %span.interest-button=interest_button(workshop) = richtext workshop.info - if preview.blank? && translations_available_for_editing .actions - translations_available_for_editing.each do |locale| = link_to (_'actions.workshops.Translate', "Translate into #{language_name(locale)}", :vars => {:language => language_name(locale)}), translate_workshop_url(workshop.conference.slug, workshop.id, locale), :class => [:button, :translate] = columns(medium: 6) do %h3=_'articles.workshops.headings.facilitators' .facilitators - workshop.workshop_facilitators.each do |f| - u = User.find(f.user_id) - is_this_user = (f.user_id == current_user.id) - if logged_in? && (workshop.public_facilitator?(u) || is_this_user || is_facilitator) .facilitator .name=_!u.name .role =_"roles.workshops.facilitator.#{workshop.role(u).to_s}" - if is_facilitator && preview.blank? .details .email=u.email - if f.role.to_sym == :requested =(link_to (_'actions.workshops.Approve'), approve_facilitate_workshop_request_path(workshop.conference.slug, workshop.id, f.user_id, 'approve'), :class => [:button, :modify]) =(link_to (_'actions.workshops.Deny'), approve_facilitate_workshop_request_path(workshop.conference.slug, workshop.id, f.user_id, 'deny'), :class => [:button, :delete]) - elsif workshop.can_remove?(current_user, u) =(link_to (_'actions.workshops.Make_Owner'), approve_facilitate_workshop_request_path(workshop.conference.slug, workshop.id, f.user_id, 'switch_ownership'), :class => [:button, :modify], data: {confirmation: CGI::escapeHTML(_'modals.workshops.facilitators.confirm_transfer_ownership', vars: { user_name: u.name})}) unless f.role.to_sym == :creator || !workshop.creator?(current_user) =(link_to (_"actions.workshops.#{is_this_user ? 'Leave' : 'Remove'}"), approve_facilitate_workshop_request_path(workshop.conference.slug, workshop.id, f.user_id, 'remove'), :class => [:button, :delete], data: {confirmation: CGI::escapeHTML(_"modals.workshops.facilitators.confirm_remove#{is_this_user ? '_self' : ''}", vars: { user_name: u.name})}) - if is_this_user && workshop.requested_collaborator?(current_user) .details =(link_to (_'actions.workshops.Cancel_Request'), approve_facilitate_workshop_request_path(workshop.conference.slug, workshop.id, f.user_id, 'remove'), :class => [:button, :delete], data: {confirmation: CGI::escapeHTML(_'modals.workshops.facilitators.confirm_cancel_request')}) - unless preview.present? =(link_to (_'actions.workshops.Facilitate'), facilitate_workshop_path(workshop.conference.slug, workshop.id), :class => [:button, workshop.needs_facilitators ? :accented : :subdued]) unless workshop.facilitator?(current_user) - if is_facilitator %h4=_'articles.workshops.headings.add_facilitator','Add a facilitator' = form_tag workshop_add_facilitator_path(workshop.conference.slug, workshop.id), :class => 'add-facilitator mini-flex-form' do .email-field.input-field = email_field_tag :email, nil, required: true = label_tag :email = off_screen (_'forms.actions.aria.add'), 'add-new-desc' = button_tag :add, aria: { labelledby: 'add-new-desc' } - languages = JSON.parse(workshop.languages || '[]') - if languages.present? = columns(medium: 6) do %h3=_'articles.workshops.headings.languages','Workshop Language' %p= _!((languages.map { |x| _"languages.#{x}" }).join(', ').to_s.html_safe) - if workshop.theme.present? = columns(medium: 6) do %h3=_'articles.workshops.headings.theme','Theme' %p= Workshop.all_themes.include?((workshop.theme || '').to_sym) ? (_"workshop.options.theme.#{workshop.theme}") : workshop.theme - if is_facilitator || workshop.conference.host?(current_user) - needs = JSON.parse(workshop.needs || '[]') - if needs.present? = columns(medium: 6) do %h3=_'articles.workshops.headings.needs','What do you need?' %p= _!((needs.map { |x| _"workshop.options.needs.#{x}" }).join(', ').to_s.html_safe) - if workshop.notes.present? = columns(medium: 12, class: 'workshop-notes') do %h3=_'articles.workshops.headings.notes','Notes' = richtext workshop.notes, 3