Before Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 320 B |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 390 B |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 286 B |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 584 B |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 676 B |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 459 B |
After Width: | Height: | Size: 582 B |
After Width: | Height: | Size: 290 B |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 377 B |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 423 B |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 272 B |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 519 B |
After Width: | Height: | Size: 858 KiB |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
After Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 470 B |
After Width: | Height: | Size: 972 B |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,31 @@ |
|||||
|
(function() { |
||||
|
document.addEventListener('DOMContentLoaded', function() { |
||||
|
var fields = document.getElementsByClassName('file-field'); |
||||
|
for (var i = 0; i < fields.length; i++) { |
||||
|
var field = fields[i]; |
||||
|
var input = field.getElementsByTagName('input')[0]; |
||||
|
var image = field.getElementsByTagName('img')[0]; |
||||
|
var state = field.getElementsByClassName('file-field-name')[0]; |
||||
|
|
||||
|
input.onchange = function() { |
||||
|
state.className = 'file-field-name selected'; |
||||
|
state.innerHTML = this.value.split(/[\/\\]/).reverse()[0]; |
||||
|
var uploadButton = this.form.querySelector('[value="upload"]'); |
||||
|
if (uploadButton) { |
||||
|
uploadButton.setAttribute('data-enabled', '1'); |
||||
|
} |
||||
|
|
||||
|
if (this.files && this.files[0] && typeof FileReader !== "undefined") { |
||||
|
var reader = new FileReader(); |
||||
|
|
||||
|
reader.onload = function (e) { |
||||
|
image.className = 'changed'; |
||||
|
image.src = e.target.result; |
||||
|
}; |
||||
|
|
||||
|
reader.readAsDataURL(this.files[0]); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, false); |
||||
|
})(); |
@ -0,0 +1,117 @@ |
|||||
|
(function() { |
||||
|
function loadMap() { |
||||
|
var projection = d3.geo.mercator(); |
||||
|
var path = d3.geo.path().projection(projection); |
||||
|
var tooltip = document.getElementById('tooltip'); |
||||
|
|
||||
|
var initialScale = 3.5; |
||||
|
var initialPosition = [-100, -175]; |
||||
|
|
||||
|
var zoom = d3.behavior.zoom() |
||||
|
.scaleExtent([1, 20]) |
||||
|
.scale(initialScale).translate(initialPosition) |
||||
|
.on("zoom", function() { |
||||
|
setZoom(d3.event.translate, d3.event.scale); |
||||
|
}); |
||||
|
|
||||
|
function setZoom(translate, scale) { |
||||
|
container.attr("transform", "translate(" + translate + ") scale(" + scale + ")").attr('data-scale', scale); |
||||
|
} |
||||
|
|
||||
|
var container = d3.select('#map').call(zoom).insert('g', ':first-child').attr('class', 'map'); |
||||
|
|
||||
|
setZoom(initialPosition, initialScale); |
||||
|
|
||||
|
container.append("path") |
||||
|
.datum(d3.geo.graticule()) |
||||
|
.attr("class", "graticule") |
||||
|
.attr("d", path); |
||||
|
|
||||
|
d3.selection.prototype.moveToFront = function() { |
||||
|
return this.each(function(){ |
||||
|
this.parentNode.appendChild(this); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
d3.json('/assets/world-110m.json', function(error, world) { |
||||
|
if (error) { |
||||
|
throw error; |
||||
|
} |
||||
|
|
||||
|
container.selectAll('path') |
||||
|
.data(topojson.feature(world, world.objects.countries).features) |
||||
|
.enter() |
||||
|
.append('path') |
||||
|
.attr('d', path) |
||||
|
.attr('class', 'country'); |
||||
|
|
||||
|
var year = (new Date()).getFullYear(); |
||||
|
var conferences = document.querySelectorAll('#conferences .conference'); |
||||
|
var conference_path = [] |
||||
|
|
||||
|
for (var i = 0; i < conferences.length; i++) { |
||||
|
var d = conferences[i]; |
||||
|
if (d.getAttribute('data-t') === 'annual') { |
||||
|
var coords = projection([d.getAttribute('data-o'), d.getAttribute('data-a')]); |
||||
|
if (conference_path.length) { |
||||
|
conference_path[conference_path.length - 1].x2 = coords[0]; |
||||
|
conference_path[conference_path.length - 1].y2 = coords[1]; |
||||
|
} |
||||
|
conference_path.push({ |
||||
|
x1: coords[0], |
||||
|
y1: coords[1] |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
container.append('defs').html('<filter id="svg-gooey-filter"><feGaussianBlur in="SourceGraphic" stdDeviation="3" result="blur"></feGaussianBlur><feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="svg-gooey-filter"></feColorMatrix><feComposite in="SourceGraphic" in2="svg-gooey-filter" operator="atop"></feComposite></filter>') |
||||
|
|
||||
|
var regionalConferences = container.append('g').attr('filter', 'url(#svg-gooey-filter)').attr('class', 'cities regional-conferences'); |
||||
|
var annualConferences = container.append('g').attr('filter', 'url(#svg-gooey-filter)').attr('class', 'cities annual-conferences'); |
||||
|
|
||||
|
function mouseover(e) { |
||||
|
c = document.getElementById('conference-' + event.target.getAttribute('data-c')); |
||||
|
tooltip.innerHTML = '<h3>' + c.querySelector('.title').innerHTML + '</h3>' + |
||||
|
'<div class="conference-details">' + c.querySelector('.conference-details').innerHTML + '</div>'; |
||||
|
tooltip.className = 'open'; |
||||
|
} |
||||
|
|
||||
|
function mouseout(e) { |
||||
|
tooltip.className = ''; |
||||
|
} |
||||
|
|
||||
|
function click(e) { |
||||
|
l = document.querySelector('#conference-' + event.target.getAttribute('data-c') + ' .conference-link'); |
||||
|
window.location.href = l.getAttribute('href'); |
||||
|
} |
||||
|
|
||||
|
for (var i = conferences.length - 1; i >= 0; i--) { |
||||
|
var c = conferences[i]; |
||||
|
var type = c.getAttribute('data-t'); |
||||
|
var coords = projection([c.getAttribute('data-o'), c.getAttribute('data-a')]); |
||||
|
|
||||
|
(type === 'annual' ? annualConferences : regionalConferences) |
||||
|
.append('circle') |
||||
|
.attr('class', 'city type-' + type) |
||||
|
.attr('data-c', c.id.replace(/^conference\-/, '')) |
||||
|
.attr('cx', function(d) { return coords[0]; }) |
||||
|
.attr('cy', function(d) { return coords[1]; }) |
||||
|
.attr('r', Math.max(3, |
||||
|
(15 - ( |
||||
|
(year - parseInt(c.getAttribute('data-y'))) * 2.5)) * 1.125) |
||||
|
) |
||||
|
.on('mouseover', mouseover) |
||||
|
.on('mouseout', mouseout) |
||||
|
.on('click', click); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
d3.select("#map").attr('class', 'loaded'); |
||||
|
} |
||||
|
|
||||
|
document.onreadystatechange = function () { |
||||
|
if (document.readyState == 'complete') { |
||||
|
loadMap(); |
||||
|
} |
||||
|
}; |
||||
|
})(); |
@ -0,0 +1,26 @@ |
|||||
|
(function() { |
||||
|
function find_user(email, f) { |
||||
|
var request = new XMLHttpRequest(); |
||||
|
request.open('POST', '/user/find', true); |
||||
|
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); |
||||
|
request.setRequestHeader('X-CSRF-Token', encodeURI(document.querySelector('meta[name="csrf-token"]').getAttribute('content'))); |
||||
|
request.send('e=' + encodeURI(email)); |
||||
|
request.onreadystatechange = function() { |
||||
|
if (request.readyState == 4) { |
||||
|
if (request.status == 200) { |
||||
|
f(JSON.parse(request.responseText)); |
||||
|
} else { |
||||
|
f({error: request.status}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
document.addEventListener('DOMContentLoaded', function() { |
||||
|
var fields = document.getElementsByClassName('user-field'); |
||||
|
for (var i = 0; i < fields.length; i++) { |
||||
|
var field = fields[i]; |
||||
|
var input = field.getElementsByTagName('input')[0]; |
||||
|
var name = field.getElementsByClassName('user-name')[0]; |
||||
|
} |
||||
|
}, false); |
||||
|
})(); |
@ -0,0 +1,36 @@ |
|||||
|
require 'geocoder/calculations' |
||||
|
|
||||
|
class AdminController < ApplicationController |
||||
|
def new |
||||
|
return do_404 unless logged_in? && current_user.administrator? |
||||
|
@this_conference = Conference.new |
||||
|
@page_title = 'articles.conferences.headings.new' |
||||
|
end |
||||
|
|
||||
|
def edit |
||||
|
return do_404 unless logged_in? && current_user.administrator? |
||||
|
@this_conference = Conference.find_by!(slug: params[:slug]) |
||||
|
@page_title = 'articles.conferences.headings.edit' |
||||
|
render 'new' |
||||
|
end |
||||
|
|
||||
|
def save |
||||
|
conference = params[:id].present? ? Conference.find_by!(id: params[:id]) : Conference.new |
||||
|
|
||||
|
if params[:button] == 'save' |
||||
|
city = City.search(params[:city]) |
||||
|
conference.city_id = city.id |
||||
|
conference.conferencetype = params[:type] |
||||
|
conference.year = params[:year].to_i |
||||
|
conference.is_public = params[:is_public].present? |
||||
|
conference.is_featured = params[:is_featured].present? |
||||
|
conference.make_slug(true) |
||||
|
conference.save! |
||||
|
elsif params[:button] == 'delete' |
||||
|
conference.destroy |
||||
|
return redirect_to conferences_url |
||||
|
end |
||||
|
|
||||
|
redirect_to conference_url(conference.slug) |
||||
|
end |
||||
|
end |
@ -0,0 +1,355 @@ |
|||||
|
|
||||
|
class WorkshopsController < ApplicationController |
||||
|
def workshops |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
@workshops = Workshop.where(:conference_id => @this_conference.id) |
||||
|
@my_workshops = Workshop.joins(:workshop_facilitators).where(:workshop_facilitators => {:user_id => current_user.id}, :conference_id => @this_conference.id) |
||||
|
render 'workshops/index' |
||||
|
end |
||||
|
|
||||
|
def view_workshop |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
@workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
return do_404 unless @workshop |
||||
|
|
||||
|
@translations_available_for_editing = [] |
||||
|
I18n.backend.enabled_locales.each do |locale| |
||||
|
@translations_available_for_editing << locale if @workshop.can_translate?(current_user, locale) |
||||
|
end |
||||
|
@page_title = 'page_titles.conferences.View_Workshop' |
||||
|
@register_template = :workshops |
||||
|
|
||||
|
render 'workshops/show' |
||||
|
end |
||||
|
|
||||
|
def create_workshop |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
@workshop = Workshop.new |
||||
|
@languages = [I18n.locale.to_sym] |
||||
|
@needs = [] |
||||
|
@page_title = 'page_titles.conferences.Create_Workshop' |
||||
|
@register_template = :workshops |
||||
|
render 'workshops/new' |
||||
|
end |
||||
|
|
||||
|
def translate_workshop |
||||
|
@is_translating = true |
||||
|
@translation = params[:locale] |
||||
|
@page_title = 'page_titles.conferences.Translate_Workshop' |
||||
|
@page_title_vars = { language: view_context.language_name(@translation) } |
||||
|
@register_template = :workshops |
||||
|
|
||||
|
edit_workshop |
||||
|
end |
||||
|
|
||||
|
def edit_workshop |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
@workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
|
||||
|
return do_404 unless @workshop.present? |
||||
|
|
||||
|
@page_title ||= 'page_titles.conferences.Edit_Workshop' |
||||
|
|
||||
|
@can_edit = @workshop.can_edit?(current_user) |
||||
|
|
||||
|
@is_translating ||= false |
||||
|
if @is_translating |
||||
|
return do_404 if @translation.to_s == @workshop.locale.to_s || !I18n.backend.enabled_locales.include?(@translation.to_s) |
||||
|
return do_403 unless @workshop.can_translate?(current_user, @translation) |
||||
|
|
||||
|
@title = @workshop._title(@translation) |
||||
|
@info = @workshop._info(@translation) |
||||
|
else |
||||
|
return do_403 unless @can_edit |
||||
|
|
||||
|
@title = @workshop.title |
||||
|
@info = @workshop.info |
||||
|
end |
||||
|
|
||||
|
@needs = JSON.parse(@workshop.needs || '[]').map &:to_sym |
||||
|
@languages = JSON.parse(@workshop.languages || '[]').map &:to_sym |
||||
|
@space = @workshop.space.to_sym if @workshop.space |
||||
|
@theme = @workshop.theme.to_sym if @workshop.theme |
||||
|
@notes = @workshop.notes |
||||
|
@register_template = :workshops |
||||
|
|
||||
|
render 'workshops/new' |
||||
|
end |
||||
|
|
||||
|
def delete_workshop |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
@workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
|
||||
|
return do_404 unless @workshop.present? |
||||
|
return do_403 unless @workshop.can_delete?(current_user) |
||||
|
|
||||
|
if request.post? |
||||
|
if params[:button] == 'confirm' |
||||
|
if @workshop |
||||
|
@workshop.workshop_facilitators.destroy_all |
||||
|
@workshop.destroy |
||||
|
end |
||||
|
|
||||
|
return redirect_to register_step_path(@this_conference.slug, 'workshops') |
||||
|
end |
||||
|
return redirect_to view_workshop_url(@this_conference.slug, @workshop.id) |
||||
|
end |
||||
|
@register_template = :workshops |
||||
|
|
||||
|
render 'workshops/delete' |
||||
|
end |
||||
|
|
||||
|
def save_workshop |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
|
||||
|
if params[:button].to_sym != :save |
||||
|
if params[:workshop_id].present? |
||||
|
return redirect_to view_workshop_url(@this_conference.slug, params[:workshop_id]) |
||||
|
end |
||||
|
return redirect_to register_step_path(@this_conference.slug, 'workshops') |
||||
|
end |
||||
|
|
||||
|
if params[:workshop_id].present? |
||||
|
workshop = Workshop.find(params[:workshop_id]) |
||||
|
return do_404 unless workshop.present? |
||||
|
can_edit = workshop.can_edit?(current_user) |
||||
|
else |
||||
|
workshop = Workshop.new(:conference_id => @this_conference.id) |
||||
|
workshop.workshop_facilitators = [WorkshopFacilitator.new(:user_id => current_user.id, :role => :creator)] |
||||
|
can_edit = true |
||||
|
end |
||||
|
|
||||
|
title = params[:title] |
||||
|
info = params[:info].gsub(/^\s*(.*?)\s*$/, '\1') |
||||
|
|
||||
|
if params[:translation].present? && workshop.can_translate?(current_user, params[:translation]) |
||||
|
old_title = workshop._title(params[:translation]) |
||||
|
old_info = workshop._info(params[:translation]) |
||||
|
|
||||
|
do_save = false |
||||
|
|
||||
|
unless title == old_title |
||||
|
workshop.set_column_for_locale(:title, params[:translation], title, current_user.id) |
||||
|
do_save = true |
||||
|
end |
||||
|
unless info == old_info |
||||
|
workshop.set_column_for_locale(:info, params[:translation], info, current_user.id) |
||||
|
do_save = true |
||||
|
end |
||||
|
|
||||
|
# only save if the text has changed, if we want to make sure only to update the translator id if necessary |
||||
|
workshop.save_translations if do_save |
||||
|
elsif can_edit |
||||
|
workshop.title = title |
||||
|
workshop.info = info |
||||
|
workshop.languages = (params[:languages] || {}).keys.to_json |
||||
|
workshop.needs = (params[:needs] || {}).keys.to_json |
||||
|
workshop.theme = params[:theme] == 'other' ? params[:other_theme] : params[:theme] |
||||
|
workshop.space = params[:space] |
||||
|
workshop.notes = params[:notes] |
||||
|
workshop.needs_facilitators = params[:needs_facilitators].present? |
||||
|
workshop.save |
||||
|
|
||||
|
# Rouge nil facilitators have been know to be created, just destroy them here now |
||||
|
WorkshopFacilitator.where(:user_id => nil).destroy_all |
||||
|
else |
||||
|
return do_403 |
||||
|
end |
||||
|
|
||||
|
redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
||||
|
end |
||||
|
|
||||
|
def toggle_workshop_interest |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
return do_404 unless workshop |
||||
|
|
||||
|
# save the current state |
||||
|
interested = workshop.interested? current_user |
||||
|
# remove all associated fields |
||||
|
WorkshopInterest.delete_all(:workshop_id => workshop.id, :user_id => current_user.id) |
||||
|
|
||||
|
# creat the new interest row if we weren't interested before |
||||
|
WorkshopInterest.create(:workshop_id => workshop.id, :user_id => current_user.id) unless interested |
||||
|
|
||||
|
if request.xhr? |
||||
|
render json: [ |
||||
|
{ |
||||
|
selector: '.interest-button', |
||||
|
html: view_context.interest_button(workshop) |
||||
|
}, |
||||
|
{ |
||||
|
selector: '.interest-text', |
||||
|
html: view_context.interest_text(workshop) |
||||
|
} |
||||
|
] |
||||
|
else |
||||
|
# go back to the workshop |
||||
|
redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
def facilitate_workshop |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
@workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
return do_404 unless @workshop |
||||
|
return do_403 if @workshop.facilitator?(current_user) || !current_user |
||||
|
|
||||
|
@register_template = :workshops |
||||
|
render 'workshops/facilitate' |
||||
|
end |
||||
|
|
||||
|
def facilitate_request |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
return do_404 unless workshop |
||||
|
return do_403 if workshop.facilitator?(current_user) || !current_user |
||||
|
|
||||
|
# create the request by making the user a facilitator but making their role 'requested' |
||||
|
WorkshopFacilitator.create(user_id: current_user.id, workshop_id: workshop.id, role: :requested) |
||||
|
|
||||
|
UserMailer.send_mail :workshop_facilitator_request do |
||||
|
{ |
||||
|
:args => [ workshop, current_user, params[:message] ] |
||||
|
} |
||||
|
end |
||||
|
|
||||
|
redirect_to sent_facilitate_workshop_url(@this_conference.slug, workshop.id) |
||||
|
end |
||||
|
|
||||
|
def sent_facilitate_request |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
@workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
return do_404 unless @workshop |
||||
|
return do_403 unless @workshop.requested_collaborator?(current_user) |
||||
|
|
||||
|
@register_template = :workshops |
||||
|
render 'workshops/facilitate_request_sent' |
||||
|
end |
||||
|
|
||||
|
def approve_facilitate_request |
||||
|
return do_403 unless logged_in? |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
return do_404 unless workshop.present? |
||||
|
|
||||
|
user_id = params[:user_id].to_i |
||||
|
action = params[:approve_or_deny].to_sym |
||||
|
user = User.find(user_id) |
||||
|
case action |
||||
|
when :approve |
||||
|
if workshop.active_facilitator?(current_user) && workshop.requested_collaborator?(User.find(user_id)) |
||||
|
f = WorkshopFacilitator.find_by_workshop_id_and_user_id( |
||||
|
workshop.id, user_id) |
||||
|
f.role = :collaborator |
||||
|
f.save |
||||
|
UserMailer.send_mail :workshop_facilitator_request_approved, user.locale do |
||||
|
[ workshop, user ] |
||||
|
end |
||||
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
||||
|
end |
||||
|
when :deny |
||||
|
if workshop.active_facilitator?(current_user) && workshop.requested_collaborator?(User.find(user_id)) |
||||
|
WorkshopFacilitator.delete_all( |
||||
|
:workshop_id => workshop.id, |
||||
|
:user_id => user_id) |
||||
|
UserMailer.send_mail :workshop_facilitator_request_denied, user.locale do |
||||
|
[ workshop, user ] |
||||
|
end |
||||
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
||||
|
end |
||||
|
when :remove |
||||
|
if workshop.can_remove?(current_user, user) |
||||
|
WorkshopFacilitator.delete_all( |
||||
|
:workshop_id => workshop.id, |
||||
|
:user_id => user_id) |
||||
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
||||
|
end |
||||
|
when :switch_ownership |
||||
|
if workshop.creator?(current_user) |
||||
|
f = WorkshopFacilitator.find_by_workshop_id_and_user_id( |
||||
|
workshop.id, current_user.id) |
||||
|
f.role = :collaborator |
||||
|
f.save |
||||
|
f = WorkshopFacilitator.find_by_workshop_id_and_user_id( |
||||
|
workshop.id, user_id) |
||||
|
f.role = :creator |
||||
|
f.save |
||||
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
return do_403 |
||||
|
end |
||||
|
|
||||
|
def add_workshop_facilitator |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
|
||||
|
user = User.find_by_email(params[:email]) |
||||
|
|
||||
|
# create the user if they don't exist and send them a link to register |
||||
|
unless user |
||||
|
user = User.create(email: params[:email]) |
||||
|
generate_confirmation(user, register_path(@this_conference.slug)) |
||||
|
end |
||||
|
|
||||
|
workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
|
||||
|
return do_404 unless workshop && current_user |
||||
|
|
||||
|
unless workshop.facilitator?(user) |
||||
|
WorkshopFacilitator.create(user_id: user.id, workshop_id: workshop.id, role: :collaborator) |
||||
|
|
||||
|
UserMailer.send_mail :workshop_facilitator_request_approved, user.locale do |
||||
|
[ workshop, user ] |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
return redirect_to view_workshop_url(@this_conference.slug, params[:workshop_id]) |
||||
|
end |
||||
|
|
||||
|
def add_comment |
||||
|
set_conference |
||||
|
set_conference_registration! |
||||
|
workshop = Workshop.find_by_id_and_conference_id(params[:workshop_id], @this_conference.id) |
||||
|
|
||||
|
return do_404 unless workshop && current_user |
||||
|
|
||||
|
if params[:button] == 'reply' |
||||
|
comment = Comment.find_by!(id: params[:comment_id].to_i, model_type: :workshops, model_id: workshop.id) |
||||
|
new_comment = comment.add_comment(current_user, params[:reply]) |
||||
|
|
||||
|
unless comment.user.id == current_user.id |
||||
|
UserMailer.send_mail :workshop_comment, comment.user.locale do |
||||
|
[ workshop, new_comment, comment.user ] |
||||
|
end |
||||
|
end |
||||
|
elsif params[:button] = 'add_comment' |
||||
|
new_comment = workshop.add_comment(current_user, params[:comment]) |
||||
|
|
||||
|
workshop.active_facilitators.each do | u | |
||||
|
unless u.id == current_user.id |
||||
|
UserMailer.send_mail :workshop_comment, u.locale do |
||||
|
[ workshop, new_comment, u ] |
||||
|
end |
||||
|
end |
||||
|
end |
||||
|
else |
||||
|
return do_404 |
||||
|
end |
||||
|
|
||||
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id, anchor: "comment-#{new_comment.id}") |
||||
|
end |
||||
|
end |
@ -0,0 +1,77 @@ |
|||||
|
require 'geocoder' |
||||
|
require 'geocoder/railtie' |
||||
|
require 'geocoder/calculations' |
||||
|
|
||||
|
Geocoder::Railtie.insert |
||||
|
|
||||
|
class City < ActiveRecord::Base |
||||
|
geocoded_by :address |
||||
|
translates :city |
||||
|
|
||||
|
reverse_geocoded_by :latitude, :longitude, :address => :full_address |
||||
|
after_validation :geocode, if: ->(obj){ obj.country_changed? or obj.territory_changed? or obj.city_changed? or obj.latitude.blank? or obj.longitude.blank? } |
||||
|
|
||||
|
def address |
||||
|
([city!, territory, country] - [nil, '']).join(', ') |
||||
|
end |
||||
|
|
||||
|
def get_translation(locale) |
||||
|
location = Geocoder.search(address, language: locale.to_s).first |
||||
|
|
||||
|
location.data['address_components'].each do | component | |
||||
|
if component['types'].first == 'locality' |
||||
|
return component['short_name'] |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
return nil |
||||
|
end |
||||
|
|
||||
|
def translate_city(locale) |
||||
|
translation = get_translation(locale) |
||||
|
set_column_for_locale(:city, locale, translation) |
||||
|
save! |
||||
|
|
||||
|
return translation |
||||
|
end |
||||
|
|
||||
|
def self.search(str) |
||||
|
cache = CityCache.search(str) |
||||
|
|
||||
|
# return the city if this search is in our cache |
||||
|
return cache.city if cache.present? |
||||
|
|
||||
|
# look up the city in the geocoder |
||||
|
location = Geocoder.search(str, language: 'en').first |
||||
|
|
||||
|
# see if the city is already present in our database |
||||
|
city = City.find_by_place_id(location.data['place_id']) |
||||
|
|
||||
|
# return the city if we found it in the db already |
||||
|
return city if city.present? |
||||
|
|
||||
|
# otherwise build a new city |
||||
|
component_alises = { |
||||
|
'locality' => :city, |
||||
|
'administrative_area_level_1' => :territory, |
||||
|
'country' => :country |
||||
|
} |
||||
|
city_data = { |
||||
|
locale: :en, |
||||
|
latitude: location.data['geometry']['location']['lat'], |
||||
|
longitude: location.data['geometry']['location']['lng'], |
||||
|
place_id: location.data['place_id'] |
||||
|
} |
||||
|
location.data['address_components'].each do | component | |
||||
|
property = component_alises[component['types'].first] |
||||
|
city_data[property] = component['short_name'] if property.present? |
||||
|
end |
||||
|
|
||||
|
# save the new city |
||||
|
city = City.new(city_data) |
||||
|
city.save! |
||||
|
|
||||
|
# and return it |
||||
|
return city |
||||
|
end |
||||
|
end |
@ -0,0 +1,9 @@ |
|||||
|
class CityCache < ActiveRecord::Base |
||||
|
self.table_name = :city_cache |
||||
|
|
||||
|
belongs_to :city |
||||
|
|
||||
|
def self.search(str) |
||||
|
CityCache.find_by_search(str.downcase) |
||||
|
end |
||||
|
end |
@ -0,0 +1,4 @@ |
|||||
|
class ConferenceAdministrator < ActiveRecord::Base |
||||
|
belongs_to :user |
||||
|
belongs_to :conference |
||||
|
end |
@ -0,0 +1,24 @@ |
|||||
|
- body_class 'banner-bottom' |
||||
|
= render :partial => 'application/header', :locals => {:page_group => :administration, :page_key => 'Administration', :image_file => 'admin.jpg'} |
||||
|
|
||||
|
%article |
||||
|
= row do |
||||
|
= form_tag save_conference_path, class: 'composition' do |
||||
|
= columns(medium: 12) do |
||||
|
%h2=_@page_title, :t |
||||
|
= hidden_field_tag :id, @this_conference.id if @this_conference.id.present? |
||||
|
|
||||
|
= columns(medium: 12) do |
||||
|
= textfield :city, location(@this_conference.city), required: true, big: true |
||||
|
= columns(medium: 12, class: 'flex-column') do |
||||
|
= selectfield :type, @this_conference.conferencetype, Conference.conference_types.keys.map { |k| [(_"forms.options.conferences.types.#{k}"), k]}, required: true, stretch: true |
||||
|
= numberfield :year, @this_conference.conference_year || Date.today.year, required: true |
||||
|
= columns(medium: 6) do |
||||
|
= checkbox :is_public, @this_conference.is_public != false, 'forms.labels.generic.is_public' |
||||
|
= columns(medium: 6) do |
||||
|
= checkbox :is_featured, @this_conference.is_featured != false, 'forms.labels.generic.is_featured' |
||||
|
= columns(medium: 12) do |
||||
|
.actions.next-prev |
||||
|
= button_tag :save, value: :save |
||||
|
- if @this_conference.id.present? |
||||
|
= button_with_confirmation :delete, value: :delete, class: 'delete' |
@ -1,17 +1,5 @@ |
|||||
- this_is_the_front_page |
- content_for :og_image do |
||||
- if @conference |
= @conference.poster.full.url || image_path('default_poster.jpg') |
||||
= render 'conferences/header' |
- if @conferences |
||||
%article |
- @conferences.each do | conference | |
||||
= row do |
= render 'conferences/conference', conference: conference, links: [ :read_more, :register ] |
||||
= columns(medium: 10, push: {medium: 1}) do |
|
||||
%h2=_!@conference.title |
|
||||
= richtext @conference.info |
|
||||
- if @conference.registration_status == :open |
|
||||
- if @conference.workshop_schedule_published |
|
||||
- add_inline_script :home_schedule |
|
||||
%h3=_'articles.workshops.headings.Schedule' |
|
||||
= render 'conferences/admin/schedule' |
|
||||
- else |
|
||||
%h3=_'articles.workshops.headings.Proposed_Workshops' |
|
||||
%p=_'articles.workshops.paragraphs.Proposed_Workshops' |
|
||||
= render 'workshops/workshop_previews', :workshops => (@conference.workshops.sort { |a, b| a.title.downcase <=> b.title.downcase }) |
|
||||
|
@ -0,0 +1,41 @@ |
|||||
|
= columns(large: 8, push: { large: 2}) do |
||||
|
%h3=_'articles.admin.info.headings.Host_Organizations' |
||||
|
%p=_'articles.admin.info.descriptions.Host_Organizations', vars: { city_name: @this_conference.city.city } |
||||
|
= admin_update_form do |
||||
|
= checkboxes :organizations, (@organizations.map { |org| [org.name, org.id] }), @this_conference.organizations.map(&:id), 'test.test', vertical: true, big: true |
||||
|
.actions.right.small |
||||
|
= button_tag :save, value: :set_organizations |
||||
|
- @this_conference.organizations.each do | organization | |
||||
|
%h4=organization.name |
||||
|
- if organization.users.present? |
||||
|
.details.org-members |
||||
|
- organization.users.each do | user | |
||||
|
= raw_data_set(:h5, user.name) do |
||||
|
= user.email |
||||
|
- unless user.id == current_user.id && !current_user.administrator? |
||||
|
= admin_update_form class: [:inline, :right] do |
||||
|
= hidden_field_tag :user_id, user.id |
||||
|
= hidden_field_tag :org_id, organization.id |
||||
|
= button_tag :remove_member, value: :remove_org_member, class: [:small, :delete] |
||||
|
= admin_update_form class: 'mini-flex-form' do |
||||
|
= hidden_field_tag :org_id, organization.id |
||||
|
= emailfield :email, nil, required: true |
||||
|
= button_tag :add_member, value: :add_org_member, class: :small |
||||
|
|
||||
|
%h3=_'articles.admin.info.headings.External_Administrators' |
||||
|
%p=_'articles.admin.info.descriptions.External_Administrators' |
||||
|
- if @this_conference.administrators.present? |
||||
|
.details.org-members |
||||
|
- @this_conference.administrators.each do | user | |
||||
|
= raw_data_set(:h5, user.name) do |
||||
|
= user.email |
||||
|
- unless user.id == current_user.id && !current_user.administrator? |
||||
|
= admin_update_form class: [:inline, :right] do |
||||
|
= hidden_field_tag :user_id, user.id |
||||
|
= button_tag :remove_member, value: :remove_administrator, class: [:small, :delete] |
||||
|
= admin_update_form class: 'mini-flex-form' do |
||||
|
= userfield :email, nil, required: true |
||||
|
-#= emailfield :email, nil, required: true |
||||
|
= button_tag :add_member, value: :add_administrator, class: :small |
||||
|
= columns(large: 2) do |
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= admin_update_form do |
||||
|
- if @broadcast_step == :preview || @broadcast_step == :test |
||||
|
= hidden_field_tag :subject, @subject |
||||
|
= hidden_field_tag :body, @body |
||||
|
= hidden_field_tag :send_to, @send_to |
||||
|
- if @broadcast_step == :preview |
||||
|
%p= _'articles.conference_registration.paragraphs.admin.broadcast.test', vars: { send_to_count: "<strong>#{(@send_to_count || 0)}</strong>".html_safe } |
||||
|
- else |
||||
|
.warning-info.make-room= _'articles.conference_registration.paragraphs.admin.broadcast.preview', vars: { send_to_count: "<strong>#{(@send_to_count || 0)}</strong>".html_safe } |
||||
|
.test-preview |
||||
|
%h3=@subject |
||||
|
= richtext @body, 4 |
||||
|
.actions.right |
||||
|
= button_tag :test, value: :test, class: :secondary if @broadcast_step == :preview |
||||
|
= button_with_confirmation :send, (_'modals.admin.broadcast.confirm', vars: { number: "<strong>#{(@send_to_count || 0)}</strong>".html_safe }), value: :send, class: :delete if @broadcast_step == :test |
||||
|
= button_tag :edit, value: :edit |
||||
|
- else |
||||
|
= selectfield :send_to, nil, broadcast_options, full: true |
||||
|
= textfield :subject, @subject, required: true, big: true |
||||
|
= textarea :body, @body, lang: @this_conference.locale, edit_on: :focus |
||||
|
.actions.right |
||||
|
= button_tag :preview, value: :preview |
@ -0,0 +1,17 @@ |
|||||
|
= admin_update_form do |
||||
|
= row do |
||||
|
= columns(medium: 6, push: { medium: 1 }) do |
||||
|
= fieldset :start_date, inline: true, inline_label: true do |
||||
|
= month_select @start_month, name: :start_month, label: false |
||||
|
= month_day_select @start_day, name: :start_day, label: false |
||||
|
|
||||
|
= row do |
||||
|
= columns(medium: 6, push: { medium: 1 }) do |
||||
|
= fieldset :end_date, inline: true, inline_label: true do |
||||
|
= month_select @end_month, name: :end_month, label: false |
||||
|
= month_day_select @end_day, name: :end_day, label: false |
||||
|
|
||||
|
= row do |
||||
|
= columns(medium: 6, push: { medium: 1 }) do |
||||
|
.actions |
||||
|
= button_tag :save, value: :save |
@ -0,0 +1,5 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= admin_update_form do |
||||
|
= translate_textarea :info, @this_conference, label: 'articles.conference_registration.headings.admin.edit.info', help: 'articles.conference_registration.paragraphs.admin.edit.info', edit_on: :focus |
||||
|
.actions.right |
||||
|
= button_tag :save, value: :save |
@ -0,0 +1,41 @@ |
|||||
|
- if @this_conference.event_locations.blank? |
||||
|
= columns(medium: 12) do |
||||
|
.warning-info=_'articles.admin.events.no_locations_warning' |
||||
|
- else |
||||
|
= columns(medium: 12) do |
||||
|
- if @events.present? && @event.id.blank? |
||||
|
%table.events.admin-edit |
||||
|
%tr |
||||
|
%th=_'forms.labels.generic.title' |
||||
|
%th=_'forms.labels.generic.event_location' |
||||
|
%th=_'forms.labels.generic.day' |
||||
|
%th=_'forms.labels.generic.time' |
||||
|
%th=_'forms.labels.generic.time_span' |
||||
|
%th.form |
||||
|
- @events.each do | event | |
||||
|
%tr |
||||
|
%th=event.title |
||||
|
%td=_!(event.event_location.present? ? event.event_location.title : '') |
||||
|
%td=date(event.start_time.to_date, :weekday) |
||||
|
%td=time(event.start_time, :short) |
||||
|
%td=hours(event.start_time, event.end_time) |
||||
|
%td.form |
||||
|
= admin_update_form do |
||||
|
= hidden_field_tag :id, event.id |
||||
|
= link_to (_'forms.actions.generic.edit'), edit_event_path(@this_conference, event.id), class: [:button, :small, :modify] |
||||
|
= button_with_confirmation :delete, (_'modals.admin.generic.delete.confirm', :p, vars: { title: event.title }), value: :delete, class: [:delete, :small] |
||||
|
|
||||
|
= columns(medium: 12) do |
||||
|
%h3=_"articles.admin.locations.headings.#{@event.id.present? ? 'edit' : 'add'}_event", :t |
||||
|
|
||||
|
= admin_update_form do |
||||
|
= hidden_field_tag :id, @event.id if @event.id.present? |
||||
|
.flex-inputs |
||||
|
= location_select @event.event_location_id, small: true, stretch: true |
||||
|
= day_select @day, small: true, format: :weekday |
||||
|
= hour_select @time, small: true |
||||
|
= length_select @length, small: true |
||||
|
= translate_fields @event, { title: { type: :textfield, big: true, label: 'forms.labels.generic.title' }, info: { type: :textarea, label: 'forms.labels.generic.info', edit_on: :focus } } |
||||
|
.actions.next-prev |
||||
|
= button_tag :save, value: :save |
||||
|
= button_tag :cancel, value: :cancel, class: :subdued, formnovalidate: true if @event.id.present? |
@ -0,0 +1,11 @@ |
|||||
|
.guests-housed |
||||
|
%h5 Guests Housed: |
||||
|
.data="#{@guests_housed} / #{@guests.size}" |
||||
|
|
||||
|
%table.hosts.admin-edit |
||||
|
- @hosts.each do | id, registration | |
||||
|
%tr.host |
||||
|
%th |
||||
|
.name=registration.user.name |
||||
|
.address=registration.housing_data['address'] |
||||
|
%td.inner-table{colspan: 2}=host_guests_table(registration) |
@ -0,0 +1,10 @@ |
|||||
|
- add_inline_script :housing |
||||
|
= columns(medium: 12) do |
||||
|
= admin_update_form id: 'housing-table-form' do |
||||
|
#housing-table= render partial: 'hosts_table' |
||||
|
#guest-selector |
||||
|
= admin_update_form class: 'guest-dlg', id: 'guest-list-table' do |
||||
|
%h3 Select a Guest |
||||
|
#table |
||||
|
.actions |
||||
|
= link_to (_'links.download.Excel'), administration_step_path(@this_conference.slug, @admin_step, :format => :xlsx), class: [:button, :download] |
@ -0,0 +1,42 @@ |
|||||
|
- unless @location.present? |
||||
|
- if @locations.present? |
||||
|
= columns(medium: 12) do |
||||
|
%table.locations.admin-edit |
||||
|
%tr |
||||
|
%th=_'forms.labels.generic.title' |
||||
|
%th=_'forms.labels.generic.address' |
||||
|
%th=_'articles.workshops.headings.space' |
||||
|
%th=_'articles.admin.locations.headings.amenities' |
||||
|
%th.form |
||||
|
- @locations.each do | location | |
||||
|
%tr |
||||
|
%th=_!(location.title || '') |
||||
|
%td=location_link location |
||||
|
%td=location.space.present? ? (_"workshop.options.space.#{location.space}") : '' |
||||
|
%td |
||||
|
- amenities = location.amenities.present? ? JSON.parse(location.amenities) : [] |
||||
|
=_!(amenities.collect { |amenity| _"workshop.options.needs.#{amenity}" }).join(', ') |
||||
|
%td.form |
||||
|
= admin_update_form do |
||||
|
= hidden_field_tag :id, location.id |
||||
|
= link_to (_'forms.actions.generic.edit'), edit_location_path(@this_conference, location.id), class: [:button, :small, :modify] |
||||
|
= button_with_confirmation :delete, (_'modals.admin.generic.delete.confirm', :p, vars: { title: location.title }), value: :delete, class: [:delete, :small] |
||||
|
= admin_update_form do |
||||
|
= columns(medium: 12) do |
||||
|
%h5=_"articles.admin.locations.headings.#{@location.present? ? 'edit' : 'add'}_location", :t |
||||
|
= hidden_field_tag :id, @location.id if @location.present? |
||||
|
= textfield :title, @location.present? ? @location.title : nil, required: true, big: true, help: 'articles.admin.locations.paragraphs.title' |
||||
|
.flex-column.address-form |
||||
|
= textfield :address, @location.present? ? @location.address : nil, required: true, help: 'articles.admin.locations.paragraphs.address', stretch: true |
||||
|
.city=location(@this_conference.city) |
||||
|
= columns(medium: 6) do |
||||
|
= radiobuttons :space, EventLocation.all_spaces, @space, 'workshop.options.space', vertical: true, heading: 'articles.workshops.headings.space', required: true, help: 'articles.admin.locations.paragraphs.space' |
||||
|
= columns(medium: 6) do |
||||
|
= checkboxes :needs, EventLocation.all_amenities, @amenities || [], 'workshop.options.needs', vertical: true, heading: 'articles.admin.locations.headings.amenities', help: 'articles.admin.locations.paragraphs.amenities' |
||||
|
= columns(medium: 12) do |
||||
|
.actions.next-prev |
||||
|
- if @location.present? |
||||
|
= button_tag :save, value: :save |
||||
|
= button_tag :cancel, value: :cancel, class: :subdued, formnovalidate: true |
||||
|
- else |
||||
|
= button_tag :create, value: :create |
@ -0,0 +1,35 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
- if @this_conference.event_locations.present? |
||||
|
- if @this_conference.meals.present? |
||||
|
%table.meals.admin-edit |
||||
|
%tr |
||||
|
%th=_'forms.labels.generic.title' |
||||
|
%th=_'forms.labels.generic.info' |
||||
|
%th=_'forms.labels.generic.event_location' |
||||
|
%th=_'forms.labels.generic.day' |
||||
|
%th=_'forms.labels.generic.time' |
||||
|
%th.form |
||||
|
- @meals.each do | time, meal | |
||||
|
%tr |
||||
|
%th |
||||
|
=_!(meal['title'] || '') |
||||
|
%td=_!(meal['info'] || '') |
||||
|
%td=_!location_name(meal['location'].to_i) |
||||
|
%td=date(meal['day'], :weekday) |
||||
|
%td=time(meal['time'].to_f) |
||||
|
%td.form |
||||
|
= admin_update_form do |
||||
|
= hidden_field_tag :meal, time |
||||
|
= button_tag :delete, value: :delete, class: [:small, :delete] |
||||
|
= admin_update_form do |
||||
|
%h3=_'articles.admin.locations.headings.add_meal', :t |
||||
|
.flex-inputs |
||||
|
= location_select nil, small: true, stretch: true |
||||
|
= day_select nil, small: true, format: :weekday |
||||
|
= hour_select nil, small: true |
||||
|
= textfield :title, nil, required: true, big: true, help: 'articles.admin.locations.paragraphs.meal_title' |
||||
|
= textfield :info, nil, help: 'articles.admin.locations.paragraphs.meal_info' |
||||
|
.actions.next-prev |
||||
|
= button_tag :add_meal, value: :add_meal |
||||
|
- else |
||||
|
.warning-info=_'articles.admin.meals.no_locations_warning' |
@ -0,0 +1,6 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= form_tag administration_update_path(@this_conference.slug, @admin_step) do |
||||
|
= translate_textarea :payment_message, @this_conference, default: 'articles.conference_registration.paragraphs.Payment', help: 'articles.conference_registration.paragraphs.admin.payment.message', edit_on: :focus, short: true |
||||
|
|
||||
|
.actions.right |
||||
|
= button_tag :save, value: :save |
@ -0,0 +1,8 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= form_tag administration_update_path(@this_conference.slug, @admin_step) do |
||||
|
= emailfield :paypal_email_address, @this_conference.paypal_email_address || @this_conference.email_address || (@this_conference.organizations.present? && @this_conference.organizations.first.present? ? @this_conference.organizations.first.email_address : nil) |
||||
|
= textfield :paypal_username, @this_conference.paypal_username |
||||
|
= passwordfield :paypal_password, @this_conference.paypal_password |
||||
|
= textfield :paypal_signature, @this_conference.paypal_signature |
||||
|
.actions.right |
||||
|
= button_tag :save, value: :save |
@ -0,0 +1,5 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= form_tag administration_update_path(@this_conference.slug, :poster), multipart: true do |
||||
|
= filefield :poster, @this_conference.poster, required: true, label: false, preview: true |
||||
|
.actions.left |
||||
|
= button_tag :upload, value: :upload, id: 'upload-file' |
@ -0,0 +1,2 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
TO COME |
@ -0,0 +1,8 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= form_tag administration_update_path(@this_conference.slug, @admin_step) do |
||||
|
- if @this_conference.workshop_schedule_published |
||||
|
%p=_'articles.conference_registration.paragraphs.admin.schedule.published', :p |
||||
|
.actions= button_tag :un_publish, value: :publish, class: :delete |
||||
|
- else |
||||
|
%p=_'articles.conference_registration.paragraphs.admin.schedule.un_published', :p |
||||
|
.actions= button_tag :publish, value: :publish |
@ -0,0 +1,5 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= form_tag administration_update_path(@this_conference.slug, @admin_step) do |
||||
|
= selectfield :registration_status, @this_conference.registration_status || 'closed', registration_status_options_list, inline_label: true |
||||
|
.actions.left |
||||
|
= button_tag :save, value: :save |
@ -0,0 +1,17 @@ |
|||||
|
- add_inline_script :registrations |
||||
|
= columns(medium: 12) do |
||||
|
.goes-fullscreen#registrations-table |
||||
|
.flex-column |
||||
|
= searchfield :search, nil, big: true, stretch: true |
||||
|
%a.button{data: { expands: 'registrations-table' }}='expand' |
||||
|
%a.button.delete{data: { contracts: 'registrations-table' }}='close' |
||||
|
%a.button.modify{data: { 'opens-modal': 'new-registration' }}='+' |
||||
|
.table-scroller |
||||
|
= html_table @excel_data, registrations_table_options |
||||
|
= admin_update_form id: 'new-registration', class: 'modal-edit' do |
||||
|
.modal-edit-overlay{data: { 'closes-modal': 'new-registration' }} |
||||
|
.modal-edit-content |
||||
|
= html_edit_table @excel_data, registrations_edit_table_options |
||||
|
.actions.right |
||||
|
%a.button.subdued{data: { 'closes-modal': 'new-registration' }}='Cancel' |
||||
|
= button_tag :save, value: :save, class: :modify |
@ -0,0 +1,85 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
- conference = @this_conference || @conference |
||||
|
- if conference.event_locations.blank? && @entire_page |
||||
|
.warning-info=_'articles.admin.schedule.no_locations_warning' |
||||
|
- else |
||||
|
- add_inline_script :schedule if @entire_page |
||||
|
#schedule-preview |
||||
|
- @schedule.each do | day, data | |
||||
|
%h4=date(day, :weekday) |
||||
|
%table.schedule{class: [data[:locations].present? ? 'has-locations' : 'no-locations', "locations-#{data[:num_locations]}"]} |
||||
|
- if data[:locations].present? && data[:locations].values.first != :add |
||||
|
%thead |
||||
|
%tr |
||||
|
%th.corner |
||||
|
- data[:locations].each do | id, location | |
||||
|
%th=location.is_a?(Symbol) ? '' : location.title |
||||
|
%tbody |
||||
|
- data[:times].each do | time, time_data | |
||||
|
%tr |
||||
|
- rowspan = (time_data[:length] * 2).to_i |
||||
|
%th=time(time) |
||||
|
- if time_data[:type] == :workshop |
||||
|
- data[:locations].each do | id, location | |
||||
|
- if time_data[:item][:workshops][id].present? |
||||
|
- workshop = time_data[:item][:workshops][id][:workshop] |
||||
|
- status = time_data[:item][:workshops][id][:status] |
||||
|
- else |
||||
|
- workshop = status = nil |
||||
|
%td{class: [time_data[:type], workshop.present? ? :filled : :open], rowspan: rowspan, data: workshop.present? ? nil : { block: time_data[:item][:block], day: day, location: id }} |
||||
|
- if workshop.present? && workshop.event_location.present? |
||||
|
= link_to view_workshop_path(@conference.slug, workshop.id), class: 'event-detail-link' do |
||||
|
.details |
||||
|
.title=workshop.title |
||||
|
%template.event-details{data: { href: view_workshop_path(@conference.slug, workshop.id) }} |
||||
|
%h1.title=workshop.title |
||||
|
%p.address |
||||
|
= workshop.event_location.title + _!(': ') |
||||
|
= location_link workshop.event_location |
||||
|
.workshop-description= richtext workshop.info, 1 |
||||
|
- if @can_edit |
||||
|
= form_tag administration_update_path(conference.slug, @admin_step), class: 'deschedule-workshop' do |
||||
|
.status |
||||
|
.conflict-score |
||||
|
%span.title Conflicts: |
||||
|
%span.value="#{status[:conflict_score]} / #{workshop.interested.size}" |
||||
|
- if status[:errors].present? |
||||
|
.errors |
||||
|
- status[:errors].each do | error | |
||||
|
.error=_"errors.messages.schedule.#{error[:name].to_s}", vars: error[:i18nVars] |
||||
|
= hidden_field_tag :id, workshop.id |
||||
|
= button_tag :deschedule, value: :deschedule_workshop, class: [:delete, :small] |
||||
|
- elsif @can_edit |
||||
|
.title="Block #{time_data[:item][:block] + 1}" |
||||
|
- elsif time_data[:type] != :nil |
||||
|
%td{class: time_data[:type], rowspan: rowspan, colspan: data[:locations].present? ? data[:locations].size : 1} |
||||
|
- case time_data[:type] |
||||
|
- when :meal |
||||
|
- location = EventLocation.where(id: time_data[:item]['location'].to_i).first |
||||
|
- if location.present? |
||||
|
%a.event-detail-link |
||||
|
.details |
||||
|
.title= time_data[:item]['title'] |
||||
|
.location= location.title |
||||
|
%template.event-details |
||||
|
%h1.title=time_data[:item]['title'] |
||||
|
%p.address |
||||
|
= location.title + _!(': ') |
||||
|
= location_link location |
||||
|
- when :event |
||||
|
- if time_data[:item].event_location.present? |
||||
|
%a.event-detail-link |
||||
|
.details |
||||
|
.title= time_data[:item][:title] |
||||
|
.location= time_data[:item].event_location.title |
||||
|
%template.event-details |
||||
|
%h1.title=time_data[:item][:title] |
||||
|
%p.address |
||||
|
= time_data[:item].event_location.title + _!(': ') |
||||
|
= location_link time_data[:item].event_location |
||||
|
= richtext time_data[:item][:info], 1 |
||||
|
- if @entire_page |
||||
|
#workshop-selector |
||||
|
= form_tag administration_update_path(@this_conference.slug, @admin_step), class: 'workshop-dlg', id: 'workshop-table-form' do |
||||
|
%h3 Select a Workshop |
||||
|
#table |
@ -0,0 +1,46 @@ |
|||||
|
= hidden_field_tag :host, host.id |
||||
|
.host-field |
||||
|
%h4.inline=_'forms.labels.generic.name' |
||||
|
%span.plain-value= host.user.name |
||||
|
.host-field |
||||
|
%h4.inline=_'articles.conference_registration.headings.host.availability' |
||||
|
%span.plain-value= host.housing_data['availability'].present? && host.housing_data['availability'][1].present? ? date_span(host.housing_data['availability'][0].to_date, host.housing_data['availability'][1].to_date) : '' |
||||
|
- if host.housing_data['considerations'].present? |
||||
|
.host-field |
||||
|
%h4.inline=_'articles.conference_registration.headings.host.considerations' |
||||
|
%span.plain-value= (host.housing_data['considerations'].map { | consideration | _"articles.conference_registration.host.considerations.#{consideration}" }).join(', ') |
||||
|
- if sanitize(host.housing_data['notes'], tags: []).present? |
||||
|
.host-field |
||||
|
%h4=_'articles.conference_registration.headings.host.notes' |
||||
|
%blockquote= host.housing_data['notes'].html_safe |
||||
|
%table.guests.admin-edit |
||||
|
%tr |
||||
|
%th.corner |
||||
|
%th=_'forms.labels.generic.city' |
||||
|
%th=_'forms.labels.generic.housing' |
||||
|
%th=_'articles.admin.housing.headings.arrival_departure' |
||||
|
%th=_'articles.conference_registration.headings.companion' |
||||
|
%th=_'forms.labels.generic.food' |
||||
|
%th=_'forms.labels.generic.allergies' |
||||
|
%th=_'forms.labels.generic.other' |
||||
|
- @guests.each do | id, registration | |
||||
|
%tr.selectable{class: get_housing_match(host, registration, space).to_s.gsub('_', '-'), data: {host: host.id, guest: id, space: space}} |
||||
|
%th=registration.user.name |
||||
|
%td=registration.city |
||||
|
%td=registration.housing.present? ? (_"articles.conference_registration.questions.housing.#{registration.housing}") : '' |
||||
|
%td=date_span(registration.arrival.to_date, registration.departure.to_date) |
||||
|
- companion = companion(registration) |
||||
|
%td=companion.present? ? (companion.is_a?(User) ? companion.named_email : (_"articles.conference_registration.terms.registration_status.#{companion}")) : '' |
||||
|
%td=registration.food.present? ? (_"articles.conference_registration.questions.food.#{registration.food}") : '' |
||||
|
%td=registration.allergies |
||||
|
%td |
||||
|
.p=registration.other |
||||
|
|
||||
|
.legend |
||||
|
%h4 Legend |
||||
|
%ul |
||||
|
%li.good-match Good Match |
||||
|
%li.bad-match Poor Match |
||||
|
%li.selected-space Also in this space |
||||
|
%li.other-space Also with this host |
||||
|
%li.other-host Already hosted |
@ -0,0 +1,21 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
.details |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.completed_registrations') do |
||||
|
= (@completed_registrations || 0).to_s |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.incomplete_registrations') do |
||||
|
= ((@registration_count - @completed_registrations) || 0).to_s |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.bikes') do |
||||
|
= (@completed_registrations || 0) > 0 ? "#{@bikes} (#{number_to_percentage(@bikes / @completed_registrations.to_f * 100.0)})" : "0" |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.food.meat') do |
||||
|
= (@food[:all] || 0) > 0 ? "#{@food[:meat]} (#{number_to_percentage(@food[:meat] / @food[:all].to_f * 100.0)})" : "0" |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.food.vegetarian') do |
||||
|
= (@food[:all] || 0) > 0 ? "#{@food[:vegetarian]} (#{number_to_percentage(@food[:vegetarian] / @food[:all].to_f * 100.0)})" : "0" |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.food.vegan') do |
||||
|
= (@food[:all] || 0) > 0 ? "#{@food[:vegan]} (#{number_to_percentage(@food[:vegan] / @food[:all].to_f * 100.0)})" : "0" |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.donation_count') do |
||||
|
= (@completed_registrations || 0) > 0 ? "#{@donation_count} (#{number_to_percentage(@donation_count / @completed_registrations.to_f * 100.0)})" : "0" |
||||
|
= data_set(:h3, 'articles.admin.stats.headings.donation_total') do |
||||
|
= "$#{@donations || 0.00}" |
||||
|
.actions |
||||
|
= link_to (_'links.download.Excel'), administration_step_path(@this_conference.slug, :stats, :format => :xlsx), class: [:button, :download] |
||||
|
= link_to (_'links.download.Organizations_Excel'), administration_step_path(@this_conference.slug, :organizations, :format => :xlsx), class: [:button, :download, :subdued] |
@ -0,0 +1,8 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
= form_tag administration_update_path(@this_conference.slug, @admin_step) do |
||||
|
= fieldset :payment_amounts, label: false do |
||||
|
- payment_amounts = @this_conference.payment_amounts.present? ? @this_conference.payment_amounts : Conference.default_payment_amounts |
||||
|
- for i in 1..5 do |
||||
|
= numberfield "payment_amounts[#{i - 1}]", payment_amounts[i - 1], step: 0.01, min: 0.00, label: false |
||||
|
.actions.right |
||||
|
= button_tag :save, value: :save |
@ -0,0 +1,19 @@ |
|||||
|
= columns(medium: 12) do |
||||
|
.table.workshop-blocks |
||||
|
.table-tr.header |
||||
|
.table-th=_'forms.labels.generic.block_number' |
||||
|
.table-th=_'forms.labels.generic.time' |
||||
|
.table-th=_'forms.labels.generic.length' |
||||
|
.table-th=_'forms.labels.generic.days' |
||||
|
.table-th.form |
||||
|
- @workshop_blocks.each_with_index do | info, block | |
||||
|
- is_new = info['time'].blank? |
||||
|
= form_tag administration_update_path(@this_conference.slug, @admin_step), class: ['table-tr', is_new ? 'new' : 'saved'] do |
||||
|
.table-th.center.big= is_new ? '' : (block + 1) |
||||
|
.table-td=hour_select info['time'], small: true, label: false |
||||
|
.table-td=length_select info['length'], {small: true, label: false}, 0.5, 2 |
||||
|
.table-td=checkboxes :days, @block_days, info['days'].map(&:to_i), 'date.day_names', vertical: true, small: true |
||||
|
.table-td.form |
||||
|
= hidden_field_tag :workshop_block, block |
||||
|
= button_tag :delete_block, value: :delete_block, class: [:small, :delete] if block == @workshop_blocks.length - 2 |
||||
|
= button_tag (is_new ? :add_block : :update_block), value: :save_block, class: [:small, :add] |
@ -0,0 +1,27 @@ |
|||||
|
- body_class 'banner-bottom' unless @this_conference.poster.present? |
||||
|
- content_for :banner do |
||||
|
= render :partial => 'application/header', :locals => { page_group: :administration, page_key: 'Administration', image_file: @this_conference.poster_url || 'admin.jpg'} |
||||
|
|
||||
|
%article |
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
= columns(medium: 12, id: :conferences, class: 'list-view') do |
||||
|
%h2=@this_conference.title |
||||
|
%p=_'articles.admin.paragraphs.administration', :p |
||||
|
%ul.break |
||||
|
- administration_steps.each do | step, actions | |
||||
|
%li |
||||
|
.info |
||||
|
%h3=_"articles.admin.#{step}.heading", :t |
||||
|
.help |
||||
|
%p=_"articles.admin.#{step}.description", :p |
||||
|
|
||||
|
.actions.figures |
||||
|
- actions.each do | action | |
||||
|
- action_text = (_"articles.admin.#{step}.headings.#{action}", :t) |
||||
|
.figure |
||||
|
= link_to administration_step_path(@this_conference.slug, action.to_s) do |
||||
|
%header= action_text |
||||
|
.body |
||||
|
= svg "admin/#{action.to_s}", action_text |
||||
|
.description=(_"articles.admin.#{step}.descriptions.#{action}", :s) |
@ -0,0 +1,38 @@ |
|||||
|
- body_class 'banner-bottom' unless @this_conference.poster.present? |
||||
|
- content_for :banner do |
||||
|
= render :partial => 'application/header', :locals => { page_group: :administration, page_key: 'Administration', image_file: @this_conference.poster_url || 'admin.jpg'} |
||||
|
|
||||
|
%article{id: "admin-#{@admin_step}"} |
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
%h2.floating=(_"articles.admin.#{@admin_group}.headings.#{@admin_step}", :t) |
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
%nav.sub-nav |
||||
|
%ul |
||||
|
%li=link_to (_'articles.admin.headings.back'), administrate_conference_path(@this_conference.slug) |
||||
|
- administration_steps[@admin_group].each do | step | |
||||
|
%li |
||||
|
- title = (_"articles.admin.#{@admin_group}.headings.#{step}", :t) |
||||
|
- if step == @admin_step.to_sym |
||||
|
= title |
||||
|
- else |
||||
|
= link_to title, administration_step_path(@this_conference.slug, step.to_s) |
||||
|
- if @success_message.present? |
||||
|
= row do |
||||
|
= columns(class: 'info-messages') do |
||||
|
.success-info.info-message=_"success.messages.admin.#{@success_message}", :s |
||||
|
- if @error_message.present? |
||||
|
= row do |
||||
|
= columns(class: 'info-messages') do |
||||
|
.error-info.info-message=_"errors.messages.admin.#{@error_message}", :s |
||||
|
- if @warnings.present? |
||||
|
= row class: 'warnings', tag: :ul do |
||||
|
- @warnings.each do | warning | |
||||
|
= columns tag: :li, class: 'warning-info info-message' do |
||||
|
= warning |
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
%p=((_"articles.admin.#{@admin_group}.descriptions.#{@admin_step}", :s)) unless @hide_description === true |
||||
|
= row do |
||||
|
= render @admin_step |
@ -0,0 +1,34 @@ |
|||||
|
- links ||= [ :register ] |
||||
|
- sections ||= [ :info ] |
||||
|
%article |
||||
|
= row(tag: :header) do |
||||
|
= columns(class: 'conference-banner') do |
||||
|
.title |
||||
|
%h1=_!conference.title |
||||
|
.details |
||||
|
%h2.primary=location(conference.city || conference.location) if conference.city_name.present? |
||||
|
- if conference.start_date.present? && conference.end_date.present? |
||||
|
.secondary |
||||
|
= date_span(conference.start_date.to_date, conference.end_date.to_date) |
||||
|
- if conference.poster.present? |
||||
|
%img{src: conference.poster.full.url || image_path('default_poster.jpg'), role: :presentation, alt: (_'images.conference.poster', vars: { conference_title: conference.title })} |
||||
|
|
||||
|
= row(class: 'conference-details') do |
||||
|
= columns(medium: 10, push: {medium: 1}) do |
||||
|
%h2=_!conference.title if conference.poster.present? |
||||
|
= richtext conference.info |
||||
|
- if conference.registration_status == :open && sections.include?(:workshops) |
||||
|
- if conference.workshop_schedule_published |
||||
|
- add_inline_script :home_schedule |
||||
|
%h3=_'articles.workshops.headings.Schedule' |
||||
|
= render 'conferences/admin/schedule' |
||||
|
- else |
||||
|
%h3=_'articles.workshops.headings.Proposed_Workshops' |
||||
|
%p=_'articles.workshops.paragraphs.Proposed_Workshops' |
||||
|
= render 'workshops/workshop_previews', :workshops => (conference.workshops.sort { |a, b| a.title.downcase <=> b.title.downcase }) |
||||
|
.links |
||||
|
= (link_to (_'forms.actions.generic.register'), register_path(conference.slug), class: [:button, :register]) if links.include?(:register) && conference.registration_status == :open |
||||
|
= (link_to (_'articles.workshops.info.read_more'), conference_path(conference.slug), class: :button) if links.include?(:read_more) |
||||
|
= (link_to (_'forms.actions.generic.administrate'), administrate_conference_path(conference.slug), class: [:button]) if links.include?(:administrate) |
||||
|
= (link_to (_'forms.actions.generic.edit'), edit_conference_path(conference.slug), class: [:button, :subdued]) if links.include?(:edit) |
||||
|
|
@ -1,10 +1,10 @@ |
|||||
- content_for :banner do |
- content_for :banner do |
||||
.title |
.title |
||||
%h1=_!@conference.title |
%h1=_!@this_conference.title |
||||
.details |
.details |
||||
%h2.primary=location(@conference.organizations.first.locations.first) |
%h2.primary=location(@this_conference.city) |
||||
.secondary |
.secondary |
||||
= date_span(@conference.start_date.to_date, @conference.end_date.to_date) |
= date_span(@this_conference.start_date.to_date, @this_conference.end_date.to_date) |
||||
%img{src: @conference.poster.full.url || image_path('default_poster.jpg'), role: :presentation, alt: (_'images.conference.poster', vars: { conference_title: @conference.title })} |
%img{src: @this_conference.poster.full.url || image_path('default_poster.jpg'), role: :presentation, alt: (_'images.conference.poster', vars: { conference_title: @this_conference.title })} |
||||
- content_for :og_image do |
- content_for :og_image do |
||||
= @conference.poster.full.url || image_path('default_poster.jpg') |
= @this_conference.poster.full.url || image_path('default_poster.jpg') |
||||
|
@ -1 +1 @@ |
|||||
= render :partial => 'application/header', :locals => {:page_group => :conferences, :page_key => page_key, :image_file => @conference.poster_url} |
= render :partial => 'application/header', :locals => {:page_group => :conferences, :page_key => page_key, :image_file => @this_conference.poster_url} |
||||
|
@ -1,22 +0,0 @@ |
|||||
= form_tag administration_update_path(@this_conference.slug, :broadcast) do |
|
||||
- if @broadcast_step == :preview || @broadcast_step == :test |
|
||||
= hidden_field_tag :subject, @subject |
|
||||
= hidden_field_tag :body, @body |
|
||||
= hidden_field_tag :send_to, @send_to |
|
||||
- if @broadcast_step == :preview |
|
||||
%p= _'articles.conference_registration.paragraphs.admin.broadcast.test', vars: { send_to_count: "<strong>#{(@send_to_count || 0)}</strong>".html_safe } |
|
||||
- else |
|
||||
.warning-info.make-room= _'articles.conference_registration.paragraphs.admin.broadcast.preview', vars: { send_to_count: "<strong>#{(@send_to_count || 0)}</strong>".html_safe } |
|
||||
.test-preview |
|
||||
%h4=@subject |
|
||||
= richtext @body, 4 |
|
||||
.actions.right |
|
||||
= button_tag :test, value: :test, class: :secondary if @broadcast_step == :preview |
|
||||
= button_with_confirmation :send, (_'modals.admin.broadcast.confirm', vars: { number: "<strong>#{(@send_to_count || 0)}</strong>".html_safe }), value: :send, class: :delete if @broadcast_step == :test |
|
||||
= button_tag :edit, value: :edit |
|
||||
- else |
|
||||
= selectfield :send_to, nil, broadcast_options, full: true |
|
||||
= textfield :subject, @subject, required: true, big: true |
|
||||
= textarea :body, @body, lang: @this_conference.locale, edit_on: :focus |
|
||||
.actions.right |
|
||||
= button_tag :preview, value: :preview |
|