Merge master
This commit is contained in:
commit
7586112f72
217 changed files with 2853 additions and 3035 deletions
|
|
@ -20,8 +20,9 @@
|
|||
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
|
||||
//= require cocoon
|
||||
//= require bootstrap
|
||||
//= require Chart.bundle
|
||||
//= require chartkick
|
||||
//= require osem
|
||||
//= require osem-dashboard
|
||||
//= require jquery-smooth-scroll
|
||||
//= require trianglify
|
||||
//= require tinycolor
|
||||
|
|
|
|||
|
|
@ -1,146 +0,0 @@
|
|||
$(function() {
|
||||
var t;
|
||||
function size(animate){
|
||||
if (animate == undefined){
|
||||
animate = false;
|
||||
}
|
||||
clearTimeout(t);
|
||||
t = setTimeout(function(){
|
||||
$("canvas").each(function(i,el){
|
||||
$(el).attr({
|
||||
"width":$(el).parent().width()
|
||||
});
|
||||
});
|
||||
|
||||
$(".line_chart").each(function(){
|
||||
draw_line_chart(animate, $(this));
|
||||
});
|
||||
|
||||
$(".doughnut_chart").each(function(){
|
||||
if($(this).is(":visible")){
|
||||
draw_doughnut_chart(animate, $(this));
|
||||
}
|
||||
});
|
||||
|
||||
}, 30);
|
||||
}
|
||||
|
||||
function draw_doughnut_chart(animation, $this){
|
||||
var options = get_animation({}, animation);
|
||||
var tmp = $this.data('chart');
|
||||
|
||||
if(jQuery.isEmptyObject(tmp)){
|
||||
// Append error message if there is no data
|
||||
$this.parent().append("<h4 class=\"text-warning\">No data!</h4>");
|
||||
// Remove canvas
|
||||
$this.remove();
|
||||
}else{
|
||||
var data = [];
|
||||
for (var key in tmp) {
|
||||
data.push(tmp[key]);
|
||||
}
|
||||
|
||||
var ctx = $this.get(0).getContext("2d");
|
||||
new Chart(ctx).Doughnut(data, options);
|
||||
}
|
||||
}
|
||||
|
||||
function get_animation(options, animation){
|
||||
if (!animation){
|
||||
options.animation = false;
|
||||
} else {
|
||||
options.animation = true;
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
function draw_line_chart(animation, $canvas){
|
||||
var chart_data = create_dataset($canvas);
|
||||
var weeks = $canvas.parent().data('weeks');
|
||||
var data = {
|
||||
labels : weeks,
|
||||
datasets : chart_data
|
||||
}
|
||||
|
||||
var options = get_animation(wholeNumberAxisFix(data), animation);
|
||||
var ctx = $canvas.get(0).getContext("2d");
|
||||
new Chart(ctx).Line(data, options);
|
||||
}
|
||||
|
||||
function wholeNumberAxisFix(data){
|
||||
var maxValue = false;
|
||||
for(datasetIndex = 0; datasetIndex < data.datasets.length; ++datasetIndex){
|
||||
var setMax = Math.max.apply(null, data.datasets[datasetIndex].data);
|
||||
if (maxValue === false || setMax > maxValue) maxValue = setMax;
|
||||
}
|
||||
|
||||
var steps = maxValue;
|
||||
var stepWidth = 1;
|
||||
if (maxValue > 10) {
|
||||
stepWidth = Math.floor(maxValue / 10);
|
||||
steps = Math.ceil(maxValue / stepWidth);
|
||||
}
|
||||
return { scaleOverride: true, scaleSteps: steps, scaleStepWidth: stepWidth, scaleStartValue: 0 };
|
||||
}
|
||||
|
||||
function create_dataset($canvas){
|
||||
var selected = getSelectedConferences($canvas);
|
||||
var chart_data = $canvas.parent().data('chart');
|
||||
var conferences = $canvas.parent().data('conferences');
|
||||
var result = [];
|
||||
|
||||
for(var i in conferences){
|
||||
if(selected.indexOf(conferences[i].short_title) >= 0){
|
||||
var options = {};
|
||||
options.fillColor = "rgba(255,255,255,0.0)";
|
||||
options.strokeColor = conferences[i].color;
|
||||
options.data = chart_data[conferences[i].short_title];
|
||||
if(options.data == null || options.data.length == 0){
|
||||
options.data = [0];
|
||||
}
|
||||
result.push(options)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
function getSelectedConferences($canvas){
|
||||
var name = $canvas.data('name');
|
||||
var id = '#' + name + 'Checkboxes'
|
||||
var selected = [];
|
||||
var $checkboxes = $(id + ' input');
|
||||
// If there are checkboxes -> get selected
|
||||
// Else -> use the active conference
|
||||
if($checkboxes.length){
|
||||
$(id + ' input').each(function(){
|
||||
if($(this).is(":checked")) {
|
||||
selected.push($(this).attr('name'));
|
||||
}
|
||||
});
|
||||
}else{
|
||||
var active = $canvas.parent().data('active');
|
||||
for(i in active){
|
||||
selected.push(active[i].short_title)
|
||||
}
|
||||
}
|
||||
return selected;
|
||||
}
|
||||
|
||||
$('.conferenceCheckboxes input').change(function(){
|
||||
var chart_name = $(this).parent().data('chart');
|
||||
var $canvas = $('#line_chart_' + chart_name);
|
||||
draw_line_chart(false, $canvas);
|
||||
});
|
||||
|
||||
$(window).on('resize', function(){
|
||||
size(false);
|
||||
});
|
||||
|
||||
$('#doughnut_tabs a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
size(false);
|
||||
});
|
||||
|
||||
size(true);
|
||||
});
|
||||
|
|
@ -2,114 +2,104 @@
|
|||
var today = new Date().toISOString().slice(0, 10);
|
||||
$(function () {
|
||||
$("input[id^='datetimepicker']").datetimepicker({
|
||||
pickTime: true,
|
||||
useCurrent: false,
|
||||
sideBySide: true,
|
||||
autoclose: true,
|
||||
format: 'YYYY-MM-DD HH:mm'
|
||||
});
|
||||
|
||||
$('.datetimepicker').datetimepicker({
|
||||
pickTime: true,
|
||||
useCurrent: false,
|
||||
sideBySide: true,
|
||||
format: 'YYYY-MM-DD HH:mm'
|
||||
});
|
||||
|
||||
$("#registration-arrival-datepicker").datetimepicker({
|
||||
pickTime: true,
|
||||
useCurrent: false,
|
||||
minuteStepping: 15,
|
||||
stepping: 15,
|
||||
sideBySide: true,
|
||||
format: "YYYY-MM-DD HH:mm",
|
||||
// current_date <= arrival_date <= end_date
|
||||
maxDate : $("#registration-arrival-datepicker").attr('end_date'),
|
||||
minDate : today,
|
||||
minDate : today
|
||||
});
|
||||
|
||||
$("#registration-departure-datepicker").datetimepicker({
|
||||
pickTime: true,
|
||||
useCurrent: false,
|
||||
minuteStepping: 15,
|
||||
stepping: 15,
|
||||
sideBySide: true,
|
||||
format: "YYYY-MM-DD HH:mm",
|
||||
// departure_date > start_date
|
||||
minDate : $("#registration-arrival-datepicker").attr('start_date'),
|
||||
minDate : $("#registration-arrival-datepicker").attr('start_date')
|
||||
});
|
||||
|
||||
$("#registration-arrival-datepicker").on("dp.change",function (e) {
|
||||
// departure_date > start_date,arrival_date
|
||||
if ((new Date(e.date).getTime()) > (new Date($("#registration-arrival-datepicker").attr('start_date')).getTime())){
|
||||
$('#registration-departure-datepicker').data("DateTimePicker").setMinDate(e.date);
|
||||
$('#registration-departure-datepicker').data("DateTimePicker").minDate(e.date);
|
||||
}
|
||||
else{
|
||||
$('#registration-departure-datepicker').data("DateTimePicker").setMinDate($("#registration-arrival-datepicker").attr('start_date'));
|
||||
$('#registration-departure-datepicker').data("DateTimePicker").minDate($("#registration-arrival-datepicker").attr('start_date'));
|
||||
}
|
||||
});
|
||||
|
||||
// departure_date >= arrival_date
|
||||
$("#registration-departure-datepicker").on("dp.change",function (e) {
|
||||
$('#registration-arrival-datepicker').data("DateTimePicker").setMaxDate(e.date);
|
||||
$('#registration-arrival-datepicker').data("DateTimePicker").maxDate(e.date);
|
||||
});
|
||||
|
||||
$("#conference-start-datepicker").datetimepicker({
|
||||
pickTime: false,
|
||||
useCurrent: false,
|
||||
format: "YYYY-MM-DD",
|
||||
// conference-start-day >= Current_date
|
||||
minDate : today ,
|
||||
minDate : today
|
||||
});
|
||||
|
||||
$("#conference-end-datepicker").datetimepicker({
|
||||
pickTime: false,
|
||||
useCurrent: false,
|
||||
format: "YYYY-MM-DD",
|
||||
format: "YYYY-MM-DD"
|
||||
});
|
||||
|
||||
// end_date_conference >= registration-period-Start_date >= Current_date
|
||||
// registration-period-Start_date <= registration-period-End_date <= End_date (of conference)
|
||||
$("#registration-period-start-datepicker").datetimepicker({
|
||||
pickTime: false,
|
||||
useCurrent: false,
|
||||
format: "YYYY-MM-DD",
|
||||
// today <= start_registration <= end_registration <= end_conference
|
||||
var end_conference = $('form').data('end-conference');
|
||||
|
||||
$('#registration-period-start-datepicker').datetimepicker({
|
||||
format: 'YYYY-MM-DD',
|
||||
minDate : today,
|
||||
maxDate : $("#registration-period-start-datepicker").attr('end_date'),
|
||||
maxDate : end_conference
|
||||
});
|
||||
|
||||
$("#registration-period-end-datepicker").datetimepicker({
|
||||
pickTime: false,
|
||||
useCurrent: false,
|
||||
format: "YYYY-MM-DD",
|
||||
minDate: today,
|
||||
maxDate : $("#registration-period-start-datepicker").attr('end_date'),
|
||||
$('#registration-period-end-datepicker').datetimepicker({
|
||||
format: 'YYYY-MM-DD',
|
||||
minDate : today,
|
||||
maxDate : end_conference
|
||||
});
|
||||
|
||||
$("#conference-start-datepicker").on("dp.change",function (e) {
|
||||
$('#conference-end-datepicker').data("DateTimePicker").setMinDate(e.date);
|
||||
$('#conference-end-datepicker').data("DateTimePicker").minDate(e.date);
|
||||
if (!$('#conference-end-datepicker').val()) {
|
||||
$('#conference-end-datepicker').data("DateTimePicker").setDate(e.date);
|
||||
$('#conference-end-datepicker').data("DateTimePicker").date(e.date);
|
||||
}
|
||||
});
|
||||
|
||||
$("#conference-start-datepicker").change(function (e) {
|
||||
$('#conference-start-datepicker').val()?$('#conference-end-datepicker').data("DateTimePicker").setMinDate(e.date):$('#conference-end-datepicker').data("DateTimePicker").setMinDate(null);
|
||||
$('#conference-start-datepicker').val()?$('#conference-end-datepicker').data("DateTimePicker").minDate(e.date):$('#conference-end-datepicker').data("DateTimePicker").minDate(null);
|
||||
});
|
||||
|
||||
$("#conference-end-datepicker").on("dp.change",function (e) {
|
||||
$('#conference-start-datepicker').data("DateTimePicker").setMaxDate(e.date);
|
||||
$('#conference-start-datepicker').data("DateTimePicker").maxDate(e.date);
|
||||
});
|
||||
|
||||
$("#conference-end-datepicker").change(function (e) {
|
||||
$('#conference-end-datepicker').val()?$('#conference-start-datepicker').data("DateTimePicker").setMaxDate(e.date):$('#conference-start-datepicker').data("DateTimePicker").setMaxDate(null);
|
||||
$('#conference-end-datepicker').val()?$('#conference-start-datepicker').data("DateTimePicker").maxDate(e.date):$('#conference-start-datepicker').data("DateTimePicker").maxDate(null);
|
||||
});
|
||||
|
||||
$("#registration-period-start-datepicker").on("dp.change",function (e) {
|
||||
$('#registration-period-end-datepicker').data("DateTimePicker").setMinDate(e.date);
|
||||
$('#registration-period-end-datepicker').data("DateTimePicker").minDate(e.date);
|
||||
if (!$('#registration-period-end-datepicker').val()) {
|
||||
$('#registration-period-end-datepicker').data("DateTimePicker").setDate(e.date);
|
||||
$('#registration-period-end-datepicker').data("DateTimePicker").date(e.date);
|
||||
}
|
||||
});
|
||||
$("#registration-period-end-datepicker").on("dp.change",function (e) {
|
||||
$('#registration-period-start-datepicker').data("DateTimePicker").setMaxDate(e.date);
|
||||
$('#registration-period-start-datepicker').data("DateTimePicker").maxDate(e.date);
|
||||
});
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -18,13 +18,11 @@ var Schedule = {
|
|||
if(event_schedule_id != null){
|
||||
var my_url = url + '/' + event_schedule_id;
|
||||
var success_callback = function(data) {
|
||||
console.log(data);
|
||||
e.attr("event_schedule_id", null);
|
||||
e.appendTo($(".unscheduled-events"));
|
||||
e.find(".schedule-event-delete-button").hide();
|
||||
}
|
||||
var error_callback = function(data) {
|
||||
console.log(data);
|
||||
showError($.parseJSON(data.responseText).errors);
|
||||
}
|
||||
$.ajax({
|
||||
|
|
@ -57,12 +55,10 @@ var Schedule = {
|
|||
params['event_schedule']['schedule_id'] = schedule_id;
|
||||
}
|
||||
var success_callback = function(data) {
|
||||
console.log(data);
|
||||
event.attr("event_schedule_id", data.event_schedule_id);
|
||||
event.find(".schedule-event-delete-button").show();
|
||||
}
|
||||
var error_callback = function(data) {
|
||||
console.log(data);
|
||||
showError($.parseJSON(data.responseText).errors);
|
||||
event.appendTo(previous_parent);
|
||||
}
|
||||
|
|
@ -87,7 +83,6 @@ $(document).ready( function() {
|
|||
snap: '.schedule-room-slot',
|
||||
revertDuration: 200,
|
||||
revert: function (event, ui) {
|
||||
console.log(event.attr);
|
||||
return !event;
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
|
|
@ -96,7 +91,8 @@ $(document).ready( function() {
|
|||
},
|
||||
opacity: 0.7,
|
||||
snapMode: "inner",
|
||||
zIndex: 2
|
||||
zIndex: 2,
|
||||
scroll: true
|
||||
});
|
||||
|
||||
// set room cells as droppable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,12 @@
|
|||
#schedule-content .carousel-control{
|
||||
width: 12%;
|
||||
}
|
||||
|
||||
@media (min-width: 768px){
|
||||
#schedule-content .carousel-control{
|
||||
width: 5%;
|
||||
}
|
||||
}
|
||||
|
||||
.room-name{
|
||||
font-weight: bold;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ module Admin
|
|||
load_and_authorize_resource through: :conference
|
||||
|
||||
def index
|
||||
@file_name = "booths_for_#{@conference.short_title}"
|
||||
@file_name = "#{(t 'booth').pluralize}_for_#{@conference.short_title}"
|
||||
@booth_export_option = params[:booth_export_option]
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
@ -14,12 +14,12 @@ module Admin
|
|||
format.json { render json: Booth.where(state: :confirmed, program: @program).to_json }
|
||||
format.xlsx do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.xlsx\""
|
||||
render 'booths'
|
||||
render 'booths', layout: false
|
||||
end
|
||||
format.pdf { render 'booths' }
|
||||
format.pdf { render 'booths', layout: false }
|
||||
format.csv do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.csv\""
|
||||
render 'booths'
|
||||
render 'booths', layout: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -39,9 +39,9 @@ module Admin
|
|||
|
||||
if @booth.save
|
||||
redirect_to admin_conference_booths_path,
|
||||
notice: 'Booth successfully created.'
|
||||
notice: "#{(t 'booth').capitalize} successfully created."
|
||||
else
|
||||
flash.now[:error] = "Creating booth failed. #{@booth.errors.full_messages.to_sentence}."
|
||||
flash.now[:error] = "Creating #{t 'booth'} failed. #{@booth.errors.full_messages.to_sentence}."
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
|
@ -57,9 +57,9 @@ module Admin
|
|||
|
||||
if @booth.save
|
||||
redirect_to admin_conference_booths_path,
|
||||
notice: "Successfully updated booth for #{@booth.title}."
|
||||
notice: "Successfully updated #{t 'booth'} for #{@booth.title}."
|
||||
else
|
||||
flash.now[:error] = "An error prohibited the Booth for #{@booth.title} "\
|
||||
flash.now[:error] = "An error prohibited the #{t'booth'} for #{@booth.title} "\
|
||||
"#{@booth.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
end
|
||||
|
|
@ -70,47 +70,49 @@ module Admin
|
|||
|
||||
if @booth.save
|
||||
if @conference.email_settings.send_on_booths_acceptance
|
||||
Mailbot.conference_booths_acceptance_mail(@booth).deliver
|
||||
Mailbot.conference_booths_acceptance_mail(@booth).deliver_later
|
||||
end
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title),
|
||||
notice: 'Booth successfully accepted!'
|
||||
notice: "#{(t'booth').capitalize} successfully accepted!"
|
||||
else
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title)
|
||||
flash[:error] = "Booth could not be accepted. #{@booth.errors.full_messages.to_sentence}."
|
||||
flash[:error] = "#{(t 'booth').capitalize} could not be accepted. #{@booth.errors.full_messages.to_sentence}."
|
||||
end
|
||||
end
|
||||
|
||||
def to_accept
|
||||
update_state(:to_accept, 'Booth to accept')
|
||||
update_state(:to_accept, "#{(t'booth').capitalize} to accept")
|
||||
end
|
||||
|
||||
def to_reject
|
||||
update_state(:to_reject, 'Booth to reject')
|
||||
update_state(:to_reject, "#{(t'booth').capitalize} to reject")
|
||||
end
|
||||
|
||||
def reject
|
||||
@booth.reject!
|
||||
|
||||
if @booth.save
|
||||
Mailbot.conference_booths_rejection_mail(@booth).deliver
|
||||
if @conference.email_settings.send_on_booths_rejection
|
||||
Mailbot.conference_booths_rejection_mail(@booth).deliver_later
|
||||
end
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title),
|
||||
notice: 'Booth successfully rejected.'
|
||||
notice: "#{(t'booth').capitalize} successfully rejected."
|
||||
else
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title)
|
||||
flash[:error] = "Booth could not be rejected. #{@booth.errors.full_messages.to_sentence}."
|
||||
flash[:error] = "#{(t 'booth').capitalize} could not be rejected. #{@booth.errors.full_messages.to_sentence}."
|
||||
end
|
||||
end
|
||||
|
||||
def restart
|
||||
update_state(:restart, 'Booth is submitted')
|
||||
update_state(:restart, "#{(t 'booth').capitalize} is submitted")
|
||||
end
|
||||
|
||||
def cancel
|
||||
update_state(:cancel, 'Booth is canceled')
|
||||
update_state(:cancel, "#{(t 'booth').capitalize} is canceled")
|
||||
end
|
||||
|
||||
def confirm
|
||||
update_state(:confirm, 'Booth successfully confirmed')
|
||||
update_state(:confirm, "#{(t 'booth').capitalize} successfully confirmed")
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ module Admin
|
|||
def render_commercial
|
||||
result = Commercial.render_from_url(params[:url])
|
||||
if result[:error]
|
||||
render text: result[:error], status: 400
|
||||
render plain: result[:error], status: 400
|
||||
else
|
||||
render text: result[:html]
|
||||
render plain: result[:html]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ module Admin
|
|||
|
||||
flash[:error] = errors_text
|
||||
end
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -37,43 +37,33 @@ module Admin
|
|||
|
||||
@top_submitter = Conference.get_top_submitter
|
||||
|
||||
@submissions = {}
|
||||
@cfp_weeks = [0]
|
||||
|
||||
@registrations = {}
|
||||
@registration_weeks = [0]
|
||||
|
||||
@tickets = {}
|
||||
@ticket_weeks = [0]
|
||||
@registrations = []
|
||||
@submissions = []
|
||||
@tickets = []
|
||||
|
||||
@conferences.each do |c|
|
||||
# Event submissions over time chart
|
||||
@submissions[c.short_title] = c.get_submissions_per_week
|
||||
@cfp_weeks.push(@submissions[c.short_title].length)
|
||||
|
||||
# Conference registrations over time chart
|
||||
@registrations[c.short_title] = c.get_registrations_per_week
|
||||
@registration_weeks.push(@registrations[c.short_title].length)
|
||||
|
||||
@registrations << {
|
||||
name: c.short_title,
|
||||
data: c.get_registrations_per_week
|
||||
}
|
||||
# Event submissions over time chart
|
||||
@submissions << {
|
||||
name: c.short_title,
|
||||
data: c.get_submissions_per_week
|
||||
}
|
||||
# Tickets sold over time chart
|
||||
@tickets[c.short_title] = c.get_tickets_sold_per_week
|
||||
@ticket_weeks.push(@tickets[c.short_title].length)
|
||||
@tickets << {
|
||||
name: c.short_title,
|
||||
data: c.get_tickets_sold_per_week
|
||||
}
|
||||
end
|
||||
|
||||
@cfp_weeks = @cfp_weeks.max
|
||||
@submissions = normalize_array_length(@submissions, @cfp_weeks)
|
||||
@cfp_weeks = @cfp_weeks > 0 ? (1..@cfp_weeks).to_a : 1
|
||||
|
||||
@registration_weeks = @registration_weeks.max
|
||||
@registrations = normalize_array_length(@registrations, @registration_weeks)
|
||||
@registration_weeks = @registration_weeks > 0 ? (1..@registration_weeks).to_a : 1
|
||||
|
||||
@ticket_weeks = @ticket_weeks.max
|
||||
@tickets = normalize_array_length(@tickets, @ticket_weeks)
|
||||
@ticket_weeks = @ticket_weeks > 0 ? (1..@ticket_weeks).to_a : 1
|
||||
|
||||
@event_distribution = Conference.event_distribution
|
||||
@user_distribution = Conference.user_distribution
|
||||
@event_distribution_colors = Event::COLORS.values
|
||||
|
||||
@user_distribution = User.distribution
|
||||
@user_distribution_colors = User::DISTRIBUTION_COLORS.values
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
@ -138,35 +128,9 @@ module Admin
|
|||
@conference_progress = @conference.get_status
|
||||
|
||||
# Line charts
|
||||
@registrations = {@conference.short_title => @conference.get_registrations_per_week}
|
||||
@registration_weeks = [0]
|
||||
@registration_weeks.push(@registrations[@conference.short_title].length)
|
||||
|
||||
@registration_weeks = @registration_weeks.max
|
||||
@registrations = normalize_array_length(@registrations, @registration_weeks)
|
||||
@registration_weeks = @registration_weeks > 0 ? (1..@registration_weeks).to_a : 1
|
||||
|
||||
@submissions = Conference.get_event_state_line_colors
|
||||
|
||||
@submissions_data = @conference.get_submissions_data
|
||||
@cfp_weeks = 0
|
||||
if @submissions_data['Weeks']
|
||||
@cfp_weeks = @submissions_data['Weeks']
|
||||
@submissions_data = @submissions_data.except('Weeks')
|
||||
end
|
||||
|
||||
@tickets_data = @conference.get_tickets_data
|
||||
@ticket_weeks = 0
|
||||
if @tickets_data['Weeks']
|
||||
@ticket_weeks = @tickets_data['Weeks']
|
||||
@tickets_data = @tickets_data.except('Weeks')
|
||||
end
|
||||
|
||||
# Set line color using a hash function
|
||||
@tickets = []
|
||||
@tickets_data.each_key do |title|
|
||||
@tickets.append(short_title: title, color: "\##{Digest::MD5.hexdigest(title)[0..5]}")
|
||||
end
|
||||
@registrations = @conference.get_registrations_per_week
|
||||
@submissions = @conference.get_submissions_data
|
||||
@tickets = @conference.get_tickets_data
|
||||
|
||||
# Doughnut charts
|
||||
@event_type_distribution = @conference.event_type_distribution
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
module Admin
|
||||
class EventSchedulesController < Admin::BaseController
|
||||
load_and_authorize_resource :event_schedule
|
||||
skip_before_action :verify_authenticity_token
|
||||
|
||||
def create
|
||||
if @event_schedule.save
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ module Admin
|
|||
@event_types = @program.event_types
|
||||
@tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed)
|
||||
@event_distribution = @conference.event_distribution
|
||||
@event_distribution_colors = Event::COLORS.values
|
||||
@scheduled_event_distribution = @conference.scheduled_event_distribution
|
||||
@file_name = "events_for_#{@conference.short_title}"
|
||||
@event_export_option = params[:event_export_option]
|
||||
|
|
@ -27,12 +28,12 @@ module Admin
|
|||
format.json { render json: Event.where(state: :confirmed, program: @program).to_json }
|
||||
format.xlsx do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.xlsx\""
|
||||
render 'events'
|
||||
render 'events', layout: false
|
||||
end
|
||||
format.pdf { render 'events' }
|
||||
format.pdf { render 'events', layout: false }
|
||||
format.csv do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.csv\""
|
||||
render 'events'
|
||||
render 'events', layout: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,12 +23,6 @@ module Admin
|
|||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
@registration_period.assign_attributes(registration_period_params)
|
||||
send_mail_on_reg_update = @conference.notify_on_registration_dates_changed?
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ module Admin
|
|||
@registration_distribution = @conference.registration_distribution
|
||||
@affiliation_distribution = @conference.affiliation_distribution
|
||||
@code_of_conduct = @conference.code_of_conduct.present?
|
||||
@file_name = "registrations_for_#{@conference.short_title}"
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json do
|
||||
render json: RegistrationDatatable.new(view_context, conference: @conference)
|
||||
end
|
||||
format.pdf { render 'index', layout: false }
|
||||
format.xlsx do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.xlsx\""
|
||||
render 'index', layout: false
|
||||
end
|
||||
format.csv do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.csv\""
|
||||
render 'index', layout: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,9 @@ module Admin
|
|||
|
||||
attended_registrants_ids = @conference.registrations.where(attended: true).pluck(:user_id)
|
||||
@missing_event_speakers = EventUser.joins(:event)
|
||||
.where('event_role = ? and program_id = ?', 'submitter', @program.id)
|
||||
.where('event_role = ? and program_id = ?', 'speaker', @program.id)
|
||||
.where.not(user_id: attended_registrants_ids)
|
||||
.where(event_id: @events.pluck(:id))
|
||||
.includes(:user, :event)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ module Admin
|
|||
if @survey.save
|
||||
redirect_to new_admin_conference_survey_survey_question_path(@conference.short_title, @survey), notice: 'Successfully created survey'
|
||||
else
|
||||
redirect_to new_admin_conference_survey_survey_question_path(@conference.short_title, @survey), error: 'Could not create survey.' + @survey.errors.full_messages.to_sentence
|
||||
redirect_to new_admin_conference_survey_path(@conference.short_title, survey: { surveyable_type: survey_params['surveyable_type'], surveyable_id: survey_params['surveyable_id'] }), error: 'Could not create survey.' + @survey.errors.full_messages.to_sentence
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ module Admin
|
|||
format.json { render json: Track.where(state: :confirmed, program: @program).to_json }
|
||||
format.xlsx do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.xlsx\""
|
||||
render 'tracks'
|
||||
render 'tracks', layout: false
|
||||
end
|
||||
format.pdf { render 'tracks' }
|
||||
format.pdf { render 'tracks', layout: false }
|
||||
format.csv do
|
||||
response.headers['Content-Disposition'] = "attachment; filename=\"#{@file_name}.csv\""
|
||||
render 'tracks'
|
||||
render 'tracks', layout: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ module Admin
|
|||
def render_commercial
|
||||
result = Commercial.render_from_url(params[:url])
|
||||
if result[:error]
|
||||
render text: result[:error], status: 400
|
||||
render plain: result[:error], status: 400
|
||||
else
|
||||
render text: result[:html]
|
||||
render plain: result[:html]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ class BoothsController < ApplicationController
|
|||
|
||||
if @booth.save
|
||||
redirect_to conference_booths_path,
|
||||
notice: 'Booth successfully created.'
|
||||
notice: "#{(t 'booth').capitalize} successfully created."
|
||||
else
|
||||
flash.now[:error] = "Creating booth failed. #{@booth.errors.full_messages.to_sentence}."
|
||||
flash.now[:error] = "Creating #{t 'booth'} failed. #{@booth.errors.full_messages.to_sentence}."
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
|
@ -43,6 +43,7 @@ class BoothsController < ApplicationController
|
|||
notice: 'Booth successfully updated!'
|
||||
else
|
||||
flash.now[:error] = "Booth could not be updated. #{@booth.errors.full_messages.to_sentence}."
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ class CommercialsController < ApplicationController
|
|||
load_resource :conference, find_by: :short_title
|
||||
before_action :set_event
|
||||
load_and_authorize_resource through: :event
|
||||
skip_before_action :verify_authenticity_token
|
||||
|
||||
def create
|
||||
@commercial = @event.commercials.build(commercial_params)
|
||||
|
|
@ -37,9 +38,9 @@ class CommercialsController < ApplicationController
|
|||
def render_commercial
|
||||
result = Commercial.render_from_url(params[:url])
|
||||
if result[:error]
|
||||
render text: result[:error], status: 400
|
||||
render plain: result[:error], status: 400
|
||||
else
|
||||
render text: result[:html]
|
||||
render plain: result[:html]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ class ConferencesController < ApplicationController
|
|||
load_and_authorize_resource find_by: :short_title, except: :show
|
||||
|
||||
def index
|
||||
@current, @antiquated = Conference.reorder(start_date: :asc).all.partition do |conference|
|
||||
conference.end_date >= Date.current
|
||||
end
|
||||
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
|
||||
@antiquated = Conference.where('end_date < ?', Date.current)
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ class OpenidsController < ApplicationController
|
|||
|
||||
def destroy
|
||||
@openid.destroy
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class ProposalsController < ApplicationController
|
|||
@event.event_schedules.destroy_all
|
||||
end
|
||||
rescue Transitions::InvalidTransition
|
||||
redirect_to :back, error: "Event can't be withdrawn"
|
||||
redirect_back(fallback_location: root_path, error: "Event can't be withdrawn")
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ class ProposalsController < ApplicationController
|
|||
begin
|
||||
@event.confirm
|
||||
rescue Transitions::InvalidTransition
|
||||
redirect_to :back, error: "Event can't be confirmed"
|
||||
redirect_back(fallback_location: root_path, error: "Event can't be confirmed")
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
class SchedulesController < ApplicationController
|
||||
load_and_authorize_resource
|
||||
protect_from_forgery with: :null_session
|
||||
before_action :respond_to_options
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
|
|
@ -61,6 +60,10 @@ class SchedulesController < ApplicationController
|
|||
@tag = day.strftime('%Y-%m-%d') if day
|
||||
end
|
||||
|
||||
def app
|
||||
@qr_code = RQRCode::QRCode.new(conference_schedule_url).as_svg(offset: 20, color: '000', shape_rendering: 'crispEdges', module_size: 11)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def respond_to_options
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@ class SurveysController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,9 +16,11 @@ class TicketPurchasesController < ApplicationController
|
|||
elsif current_user.ticket_purchases.by_conference(@conference).paid.any?
|
||||
redirect_to conference_physical_tickets_path,
|
||||
notice: 'You have free tickets for the conference.'
|
||||
else
|
||||
elsif @conference.tickets.for_registration.any?
|
||||
redirect_to conference_tickets_path(@conference.short_title),
|
||||
error: 'Please get at least one ticket to continue.'
|
||||
else
|
||||
redirect_to conference_conference_registration_path(@conference.short_title)
|
||||
end
|
||||
else
|
||||
redirect_to conference_tickets_path(@conference.short_title),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
module Users
|
||||
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
skip_before_filter :verify_authenticity_token
|
||||
skip_before_action :verify_authenticity_token
|
||||
skip_authorization_check
|
||||
|
||||
User.omniauth_providers.each do |provider|
|
||||
|
|
@ -35,8 +35,7 @@ module Users
|
|||
openid.save!
|
||||
|
||||
sign_in user
|
||||
redirect_to request.env['omniauth.origin'] || root_path,
|
||||
notice: "#{user.email} signed in successfully with #{provider}"
|
||||
redirect_to root_path, notice: "#{user.email} signed in successfully with #{provider}"
|
||||
rescue => e
|
||||
flash[:error] = e.message
|
||||
redirect_back_or_to new_user_registration_path
|
||||
|
|
|
|||
|
|
@ -88,10 +88,9 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
# Same as redirect_to(:back) if there is a valid HTTP referer, otherwise redirect_to()
|
||||
def redirect_back_or_to(options = {}, response_status = {})
|
||||
if request.env['HTTP_REFERER']
|
||||
redirect_to :back
|
||||
redirect_back(fallback_location: root_path)
|
||||
else
|
||||
redirect_to options, response_status
|
||||
end
|
||||
|
|
@ -121,19 +120,19 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def speaker_selector_input(form)
|
||||
user_selector_input(:speakers, form, '', false)
|
||||
user_selector_input(:speakers, form, '', true)
|
||||
end
|
||||
|
||||
def responsibles_selector_input(form)
|
||||
user_selector_input(
|
||||
:responsibles,
|
||||
form,
|
||||
'The people responsible for the booth. You can only select existing users.'
|
||||
"The people responsible for the #{t 'booth'}. You can only select existing users."
|
||||
)
|
||||
end
|
||||
|
||||
def user_selector_input(field, form, hint = '', multiple = true)
|
||||
users = User.active.pluck(:id, :name, :username, :email).map { |user| [user[0], user[1].blank? ? user[2] : user[1], user[2], user[3]] }.sort_by { |user| user[1].downcase }
|
||||
users = User.where(is_disabled: false).pluck(:id, :name, :username, :email).map { |user| [user[0], user[1].blank? ? user[2] : user[1], user[2], user[3]] }.sort_by { |user| user[1].downcase }
|
||||
form.input(
|
||||
field,
|
||||
as: :select,
|
||||
|
|
|
|||
17
app/helpers/chart_helper.rb
Normal file
17
app/helpers/chart_helper.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ChartHelper
|
||||
def chart_values(distribution_hash)
|
||||
Hash[
|
||||
distribution_hash.collect do |key, data|
|
||||
[key, data['value']]
|
||||
end
|
||||
]
|
||||
end
|
||||
|
||||
def chart_colors(distribution_hash)
|
||||
distribution_hash.collect do |_key, data|
|
||||
data['color']
|
||||
end
|
||||
end
|
||||
end
|
||||
BIN
app/models/.lodging.rb.swp
Normal file
BIN
app/models/.lodging.rb.swp
Normal file
Binary file not shown.
|
|
@ -31,10 +31,23 @@ class Ability
|
|||
event.state == 'confirmed'
|
||||
end
|
||||
|
||||
can [:show, :events, :app], Schedule do |schedule|
|
||||
schedule.program.schedule_public
|
||||
end
|
||||
|
||||
# can view Commercials of confirmed Events
|
||||
can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id)
|
||||
can :show, Commercial, commercialable: Event.where(state: 'confirmed')
|
||||
can [:show, :create], User
|
||||
unless ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||
|
||||
can [:index, :show], Survey, surveyable_type: 'Conference'
|
||||
|
||||
# Things that are possible without ichain enabled that are **not*+ possible with ichain mode enabled.
|
||||
if ENV['OSEM_ICHAIN_ENABLED'] != 'true'
|
||||
# There is no reliable way for this workflow (enable not logged in users to fill out a form, then telling
|
||||
# them to sign up once they submit) in ichain. So enable it only without ichain.
|
||||
|
||||
# FIXME: The following abilities need to be checked. Are they about the type of workflow mentioned above? Or are
|
||||
# they just here because they worked in development mode (without ichain). We are suspicious that it's the latter!
|
||||
can :show, Registration do |registration|
|
||||
registration.new_record?
|
||||
end
|
||||
|
|
@ -51,12 +64,6 @@ class Ability
|
|||
can [:new, :create], Event do |event|
|
||||
event.program.cfp_open? && event.new_record?
|
||||
end
|
||||
|
||||
can [:show, :events], Schedule do |schedule|
|
||||
schedule.program.schedule_public
|
||||
end
|
||||
|
||||
can [:index, :show], Survey, surveyable_type: 'Conference'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -117,10 +117,7 @@ class AdminAbility
|
|||
can :manage, Commercial, commercialable_type: 'Conference',
|
||||
commercialable_id: conf_ids
|
||||
can :manage, Registration, conference_id: conf_ids
|
||||
can :manage, RegistrationPeriod do |registration_period|
|
||||
conference = registration_period.conference
|
||||
conf_ids.include?(conference.id) && conference.tickets.for_registration.any?
|
||||
end
|
||||
can :manage, RegistrationPeriod, conference_id: conf_ids
|
||||
can :manage, Booth, conference_id: conf_ids
|
||||
can :manage, Question, conference_id: conf_ids
|
||||
can :manage, Question do |question|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class Cfp < ApplicationRecord
|
|||
in: TYPES
|
||||
},
|
||||
uniqueness: {
|
||||
scope: :program,
|
||||
scope: :program_id,
|
||||
case_sensitive: false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,7 @@ class Conference < ApplicationRecord
|
|||
has_many :ticket_purchases, dependent: :destroy
|
||||
has_many :payments, dependent: :destroy
|
||||
has_many :supporters, through: :ticket_purchases, source: :user
|
||||
has_many :tickets, dependent: :destroy do
|
||||
def for_registration
|
||||
where(registration_ticket: true)
|
||||
end
|
||||
end
|
||||
has_many :tickets, dependent: :destroy
|
||||
has_many :resources, dependent: :destroy
|
||||
has_many :booths, dependent: :destroy
|
||||
has_many :confirmed_booths, -> { where(state: 'confirmed') }, class_name: 'Booth'
|
||||
|
|
@ -84,7 +80,8 @@ class Conference < ApplicationRecord
|
|||
:start_hour,
|
||||
:end_hour,
|
||||
:ticket_layout,
|
||||
:organization, presence: true
|
||||
:organization,
|
||||
:timezone, presence: true
|
||||
|
||||
validates :short_title, uniqueness: true
|
||||
validates :short_title, format: { with: /\A[a-zA-Z0-9_-]*\z/ }
|
||||
|
|
@ -118,7 +115,7 @@ class Conference < ApplicationRecord
|
|||
# Delete all EventSchedules that are not in the hours range
|
||||
# After the conference has been successfully updated
|
||||
def delete_event_schedules
|
||||
if start_hour_changed? || end_hour_changed?
|
||||
if saved_change_to_start_hour? || saved_change_to_end_hour?
|
||||
event_schedules = program.event_schedules.select do |event_schedule|
|
||||
event_schedule.start_time.hour < start_hour ||
|
||||
event_schedule.end_time.hour > end_hour ||
|
||||
|
|
@ -176,24 +173,22 @@ class Conference < ApplicationRecord
|
|||
# ====Returns
|
||||
# * +Array+ -> e.g. 'Submitted' => [0, 3, 3, 5] -> first week 0 events, second week 3 events.
|
||||
def get_submissions_data
|
||||
result = {}
|
||||
if program&.cfp && program&.events
|
||||
result = get_events_per_week_by_state
|
||||
return [] unless program&.cfp && program&.events
|
||||
|
||||
start_week = program.cfp.start_week
|
||||
end_week = end_date.strftime('%W').to_i
|
||||
weeks = weeks(start_week, end_week)
|
||||
|
||||
result.each do |state, values|
|
||||
if state == 'Submitted'
|
||||
result['Submitted'] = pad_array_left_kumulative(start_week, values)
|
||||
else
|
||||
result[state] = pad_array_left_not_kumulative(start_week, values)
|
||||
end
|
||||
start_week = program.cfp.start_week
|
||||
get_events_per_week_by_state.collect do |state, values|
|
||||
if state == 'Submitted'
|
||||
{
|
||||
name: 'Submitted',
|
||||
data: add_week_indices(pad_array_left_kumulative(start_week, values))
|
||||
}
|
||||
else
|
||||
{
|
||||
name: state,
|
||||
data: add_week_indices(pad_array_left_not_kumulative(start_week, values))
|
||||
}
|
||||
end
|
||||
result['Weeks'] = weeks > 0 ? (1..weeks).to_a : 0
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -202,19 +197,15 @@ class Conference < ApplicationRecord
|
|||
# ====Returns
|
||||
# * +Array+ -> e.g. [0, 3, 3, 5] -> first week 0, second week 3 registrations
|
||||
def get_registrations_per_week
|
||||
result = []
|
||||
return [] unless registrations &&
|
||||
registration_period &&
|
||||
registration_period.start_date &&
|
||||
registration_period.end_date
|
||||
|
||||
if registrations &&
|
||||
registration_period &&
|
||||
registration_period.start_date &&
|
||||
registration_period.end_date
|
||||
|
||||
reg = registrations.group(:week).order(:week).count
|
||||
start_week = get_registration_start_week
|
||||
weeks = registration_weeks
|
||||
result = calculate_items_per_week(start_week, weeks, reg)
|
||||
end
|
||||
result
|
||||
reg = registrations.group(:week).order(:week).count
|
||||
start_week = get_registration_start_week
|
||||
weeks = registration_weeks
|
||||
calculate_items_per_week(start_week, weeks, reg)
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -223,15 +214,12 @@ class Conference < ApplicationRecord
|
|||
# ====Returns
|
||||
# * +Array+ -> e.g. [0, 3, 3, 5] -> first week 0, second week 3 tickets sold
|
||||
def get_tickets_sold_per_week
|
||||
result = []
|
||||
return [] unless tickets && ticket_purchases && registration_period
|
||||
|
||||
if tickets && ticket_purchases && registration_period
|
||||
tickets_sold = ticket_purchases.paid.group(:week).sum(:quantity)
|
||||
start_week = get_registration_start_week
|
||||
weeks = registration_weeks
|
||||
result = calculate_items_per_week(start_week, weeks, tickets_sold)
|
||||
end
|
||||
result
|
||||
tickets_sold = ticket_purchases.paid.group(:week).sum(:quantity)
|
||||
start_week = get_registration_start_week
|
||||
weeks = registration_weeks
|
||||
calculate_items_per_week(start_week, weeks, tickets_sold)
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -241,33 +229,32 @@ class Conference < ApplicationRecord
|
|||
# ====Returns
|
||||
# * +Array+ -> e.g. 'Free Access' => [0, 3, 3, 5] -> first week 0 tickets sold, second week 3 tickets sold.
|
||||
def get_tickets_data
|
||||
result = {}
|
||||
if tickets && ticket_purchases && registration_period
|
||||
tickets_per_ticket_id_and_week = ticket_purchases.paid.group(:ticket_id, :week).sum(:quantity)
|
||||
return [] unless tickets && ticket_purchases && registration_period
|
||||
|
||||
start_week = get_registration_start_week
|
||||
weeks = registration_weeks
|
||||
tickets_per_ticket_id_and_week = ticket_purchases.paid.group(:ticket_id, :week).sum(:quantity)
|
||||
|
||||
tickets_by_id_per_week = {}
|
||||
start_week = get_registration_start_week
|
||||
weeks = registration_weeks
|
||||
|
||||
tickets.each do |ticket|
|
||||
tickets_by_id_per_week[ticket.id] = {}
|
||||
(start_week...(start_week + weeks)).each do |week|
|
||||
tickets_by_id_per_week[ticket.id][week] = 0
|
||||
end
|
||||
tickets_by_id_per_week = {}
|
||||
|
||||
tickets.each do |ticket|
|
||||
tickets_by_id_per_week[ticket.id] = {}
|
||||
(start_week...(start_week + weeks)).each do |week|
|
||||
tickets_by_id_per_week[ticket.id][week] = 0
|
||||
end
|
||||
|
||||
tickets_per_ticket_id_and_week.each do |ticket_week, value|
|
||||
tickets_by_id_per_week[ticket_week[0]][ticket_week[1]] = value
|
||||
end
|
||||
|
||||
tickets_by_id_per_week.each do |ticket, values|
|
||||
result[Ticket.find(ticket).title] = pad_array_left_not_kumulative(start_week, values)
|
||||
end
|
||||
|
||||
result['Weeks'] = weeks > 0 ? (1..weeks).to_a : 0
|
||||
end
|
||||
result
|
||||
|
||||
tickets_per_ticket_id_and_week.each do |ticket_week, value|
|
||||
tickets_by_id_per_week[ticket_week[0]][ticket_week[1]] = value
|
||||
end
|
||||
|
||||
tickets_by_id_per_week.collect do |ticket, values|
|
||||
{
|
||||
name: Ticket.find(ticket).title,
|
||||
data: add_week_indices(pad_array_left_not_kumulative(start_week, values))
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -400,7 +387,9 @@ class Conference < ApplicationRecord
|
|||
# ====Returns
|
||||
# * +hash+ -> hash
|
||||
def event_distribution
|
||||
Conference.calculate_event_distribution_hash(program.events.select(:state).group(:state).count)
|
||||
Conference.calculate_event_distribution_hash(
|
||||
program.events.select(:state).group(:state).count
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -465,22 +454,6 @@ class Conference < ApplicationRecord
|
|||
result
|
||||
end
|
||||
|
||||
##
|
||||
# Returns a hash with user distribution => {value: count of user state, color: color}
|
||||
# active: signed in during the last 3 months
|
||||
# unconfirmed: registered but not confirmed
|
||||
# dead: not signed in during the last year
|
||||
#
|
||||
# ====Returns
|
||||
# * +hash+ -> hash
|
||||
def self.user_distribution
|
||||
active_user = User.where('last_sign_in_at > ?', Date.today - 3.months).count
|
||||
unconfirmed_user = User.where('confirmed_at IS NULL').count
|
||||
dead_user = User.where('last_sign_in_at < ?', Date.today - 1.year).count
|
||||
|
||||
calculate_user_distribution_hash(active_user, unconfirmed_user, dead_user)
|
||||
end
|
||||
|
||||
##
|
||||
# Returns a hash with per ticket sales => { "Title" => { value: number of tickets sold,
|
||||
# color: generated from the title using a hash function }, ...}
|
||||
|
|
@ -669,7 +642,7 @@ class Conference < ApplicationRecord
|
|||
def notify_on_dates_changed?
|
||||
return false unless email_settings.send_on_conference_dates_updated
|
||||
# do not notify unless one of the dates changed
|
||||
return false unless start_date_changed? || end_date_changed?
|
||||
return false unless saved_change_to_start_date? || saved_change_to_end_date?
|
||||
|
||||
# do not notify unless the mail content is set up
|
||||
(email_settings.conference_dates_updated_subject.present? && email_settings.conference_dates_updated_body.present?)
|
||||
|
|
@ -686,7 +659,7 @@ class Conference < ApplicationRecord
|
|||
# do not notify unless we allow a registration
|
||||
return false unless registration_period
|
||||
# do not notify unless one of the dates changed
|
||||
return false unless registration_period.start_date_changed? || registration_period.end_date_changed?
|
||||
return false unless registration_period.saved_change_to_start_date? || registration_period.saved_change_to_end_date?
|
||||
|
||||
# do not notify unless the mail content is set up
|
||||
(email_settings.conference_registration_dates_updated_subject.present? && email_settings.conference_registration_dates_updated_body.present?)
|
||||
|
|
@ -1110,20 +1083,19 @@ class Conference < ApplicationRecord
|
|||
end
|
||||
|
||||
##
|
||||
# Helper method. Calculates hash with corresponding colors of event state distribution.
|
||||
# Helper method. Calculates hash of all event states in a consistent order.
|
||||
#
|
||||
# ====Returns
|
||||
# * +hash+ -> hash
|
||||
def self.calculate_event_distribution_hash(states)
|
||||
result = {}
|
||||
states.each do |key, value|
|
||||
result[key.capitalize] =
|
||||
{
|
||||
'value' => value,
|
||||
'color' => Event.get_state_color(key)
|
||||
}
|
||||
end
|
||||
result
|
||||
def self.calculate_event_distribution_hash(counts)
|
||||
return {} if counts.values.sum == 0
|
||||
|
||||
Hash[
|
||||
Event.state_machine.states.collect do |state|
|
||||
state_name = state.name.to_s
|
||||
[state_name.capitalize, counts[state_name] || 0]
|
||||
end
|
||||
]
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -1148,7 +1120,6 @@ class Conference < ApplicationRecord
|
|||
#
|
||||
def create_email_settings
|
||||
build_email_settings
|
||||
true
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -1211,6 +1182,12 @@ class Conference < ApplicationRecord
|
|||
result += Array.new(weeks - result.length, sum)
|
||||
end
|
||||
|
||||
result
|
||||
add_week_indices(result)
|
||||
end
|
||||
|
||||
def add_week_indices(values)
|
||||
Hash[
|
||||
values.collect.with_index { |value, index| ["Wk #{index + 1}", value] }
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ class Event < ApplicationRecord
|
|||
validates :abstract, presence: true
|
||||
validates :event_type, presence: true
|
||||
validates :program, presence: true
|
||||
validates :speakers, presence: true
|
||||
validates :max_attendees, numericality: { only_integer: true, greater_than_or_equal_to: 1, allow_nil: true }
|
||||
|
||||
validate :max_attendees_no_more_than_room_size
|
||||
|
|
@ -83,6 +82,15 @@ class Event < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
COLORS = {
|
||||
new: '#0000FF', # blue
|
||||
withdrawn: '#FF8000', # orange
|
||||
unconfirmed: '#FFFF00', # yellow
|
||||
confirmed: '#00FF00', # green
|
||||
canceled: '#848484', # grey
|
||||
rejected: '#FF0000' # red
|
||||
}.freeze
|
||||
|
||||
##
|
||||
# Checkes if the event has a start_time and a room for the selected schedule if there is any
|
||||
# ====Returns
|
||||
|
|
@ -176,16 +184,7 @@ class Event < ApplicationRecord
|
|||
end
|
||||
|
||||
def self.get_state_color(state)
|
||||
color = {
|
||||
new: '#0000FF', # blue
|
||||
withdrawn: '#FF8000', # orange
|
||||
confirmed: '#00FF00', # green
|
||||
unconfirmed: '#FFFF00', # yellow
|
||||
rejected: '#FF0000', # red
|
||||
canceled: '#848484' # grey
|
||||
}[state.to_sym]
|
||||
|
||||
color || '#00FFFF' # azure
|
||||
COLORS[state.to_sym] || '#00FFFF' # azure
|
||||
end
|
||||
|
||||
def update_state(transition, mail = false, subject = false, send_mail = false, send_mail_param)
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ class Program < ApplicationRecord
|
|||
|
||||
after_create :create_event_types
|
||||
after_create :create_difficulty_levels
|
||||
after_save :unschedule_unfit_events, if: :schedule_interval_changed?
|
||||
after_save :normalize_event_types_length, if: :schedule_interval_changed?
|
||||
after_save :unschedule_unfit_events, if: :saved_change_to_schedule_interval?
|
||||
after_save :normalize_event_types_length, if: :saved_change_to_schedule_interval?
|
||||
validate :check_languages_format
|
||||
|
||||
# Returns all event_schedules for the selected schedule ordered by start_time
|
||||
|
|
@ -211,7 +211,6 @@ class Program < ApplicationRecord
|
|||
EventType.create(title: 'Workshop', length: 60, color: '#0000FF', description: 'Interactive hands-on practice',
|
||||
minimum_abstract_length: 0,
|
||||
maximum_abstract_length: 500, program_id: id)
|
||||
true
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -227,7 +226,6 @@ class Program < ApplicationRecord
|
|||
DifficultyLevel.create(title: 'Hard',
|
||||
description: 'Events require expert knowledge of the topic.',
|
||||
color: '#EF6E69', program_id: id)
|
||||
true
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Registration < ApplicationRecord
|
|||
validate :registration_to_events_only_if_present
|
||||
|
||||
validates :accepted_code_of_conduct, acceptance: {
|
||||
if: -> { conference.code_of_conduct.present? }
|
||||
if: -> { conference.try(:code_of_conduct).present? }
|
||||
}
|
||||
|
||||
after_create :set_week, :subscribe_to_conference, :send_registration_mail
|
||||
|
|
@ -76,7 +76,7 @@ class Registration < ApplicationRecord
|
|||
end
|
||||
|
||||
def registration_limit_not_exceed
|
||||
if conference.registration_limit > 0 && conference.registrations(:reload).count >= conference.registration_limit
|
||||
if conference.registration_limit > 0 && conference.registrations.count >= conference.registration_limit
|
||||
errors.add(:base, 'Registration limit exceeded')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ class Role < ApplicationRecord
|
|||
|
||||
# Needed to ensure that removing all user from role doesn't remove role.
|
||||
def cancel
|
||||
false
|
||||
throw(:abort)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class SurveyQuestion < ActiveRecord::Base
|
|||
ICONS = { boolean: 'dot-circle-o', choice: 'check-square-o', string: 'edit', text: 'align-left', datetime: 'clock-o', numeric: 'slack' }.freeze
|
||||
|
||||
validates :title, presence: true
|
||||
validates :possible_answers, :max_choices, :min_choices, presence: true, if: 'choice?'
|
||||
validates :possible_answers, :max_choices, :min_choices, presence: true, if: :choice?
|
||||
validates :min_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true
|
||||
validates :max_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ class Ticket < ApplicationRecord
|
|||
|
||||
monetize :price_cents, with_model_currency: :price_currency
|
||||
|
||||
scope :for_registration, -> { where(registration_ticket: true) }
|
||||
|
||||
# This validation is for the sake of simplicity.
|
||||
# If we would allow different currencies per conference we also have to handle convertions between currencies!
|
||||
validate :tickets_of_conference_have_same_currency
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class Track < ApplicationRecord
|
|||
scope :cfp_active, -> { where(cfp_active: true) }
|
||||
scope :self_organized, -> { where.not(submitter: nil) }
|
||||
|
||||
state_machine initial: :pending do
|
||||
state_machine initial: :new do
|
||||
state :new
|
||||
state :to_accept
|
||||
state :accepted
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class User < ApplicationRecord
|
|||
# prevent N+1 queries with has_cached_role? by preloading roles *always*
|
||||
default_scope { preload(:roles) }
|
||||
|
||||
has_many :ticket_purchases, dependent: :destroy
|
||||
has_many :physical_tickets, through: :ticket_purchases do
|
||||
def by_conference(conference)
|
||||
where('ticket_purchases.conference_id = ?', conference)
|
||||
|
|
@ -32,6 +33,13 @@ class User < ApplicationRecord
|
|||
# add scope
|
||||
scope :comment_notifiable, ->(conference) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference.id)}
|
||||
|
||||
# scopes for user distributions
|
||||
scope :recent, lambda {
|
||||
where('last_sign_in_at > ?', Date.today - 3.months).where(is_disabled: false)
|
||||
}
|
||||
scope :unconfirmed, -> { where('confirmed_at IS NULL') }
|
||||
scope :dead, -> { where('last_sign_in_at < ?', Date.today - 1.year) }
|
||||
|
||||
# Include default devise modules. Others available are:
|
||||
# :token_authenticatable, :confirmable,
|
||||
# :lockable, :timeoutable and :omniauthable
|
||||
|
|
@ -60,7 +68,6 @@ class User < ApplicationRecord
|
|||
end
|
||||
end
|
||||
has_many :events_registrations, through: :registrations
|
||||
has_many :ticket_purchases, dependent: :destroy
|
||||
has_many :payments, dependent: :destroy
|
||||
has_many :tickets, through: :ticket_purchases, source: :ticket do
|
||||
def for_registration conference
|
||||
|
|
@ -79,7 +86,9 @@ class User < ApplicationRecord
|
|||
accepts_nested_attributes_for :roles
|
||||
|
||||
scope :admin, -> { where(is_admin: true) }
|
||||
scope :active, -> { where(is_disabled: false) }
|
||||
scope :active, lambda {
|
||||
where(is_disabled: false)
|
||||
}
|
||||
|
||||
validates :email, presence: true
|
||||
|
||||
|
|
@ -91,6 +100,12 @@ class User < ApplicationRecord
|
|||
|
||||
validate :biography_limit
|
||||
|
||||
DISTRIBUTION_COLORS = {
|
||||
'Active' => 'green',
|
||||
'Unconfirmed' => 'red',
|
||||
'Dead' => 'black'
|
||||
}.freeze
|
||||
|
||||
##
|
||||
# Checkes if the user attended the event
|
||||
# This is used for events that require registration
|
||||
|
|
@ -152,6 +167,22 @@ class User < ApplicationRecord
|
|||
user
|
||||
end
|
||||
|
||||
##
|
||||
# Returns a hash with user distribution => {value: count of user state, color: color}
|
||||
# active: signed in during the last 3 months
|
||||
# unconfirmed: registered but not confirmed
|
||||
# dead: not signed in during the last year
|
||||
#
|
||||
# ====Returns
|
||||
# * +hash+ -> hash
|
||||
def self.distribution
|
||||
{
|
||||
'Active' => User.recent.count,
|
||||
'Unconfirmed' => User.unconfirmed.count,
|
||||
'Dead' => User.dead.count
|
||||
}
|
||||
end
|
||||
|
||||
def self.find_for_database_authentication(warden_conditions)
|
||||
conditions = warden_conditions.dup
|
||||
login = conditions.delete(:login)
|
||||
|
|
@ -237,12 +268,14 @@ class User < ApplicationRecord
|
|||
proposals(conference).count
|
||||
end
|
||||
|
||||
def self.empty?
|
||||
User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def setup_role
|
||||
if User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
||||
self.is_admin = true
|
||||
end
|
||||
self.is_admin = true if User.empty?
|
||||
end
|
||||
|
||||
def touch_events
|
||||
|
|
@ -257,4 +290,8 @@ class User < ApplicationRecord
|
|||
errors.add(:biography, 'is limited to 150 words.') if biography.split.length > 150
|
||||
end
|
||||
end
|
||||
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.send(notification, self, *args).deliver_later
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class Venue < ApplicationRecord
|
|||
def notify_on_venue_changed?
|
||||
return false unless conference.try(:email_settings).try(:send_on_venue_updated)
|
||||
# do not notify unless the address changed
|
||||
return false unless name_changed? || street_changed? || city_changed? || country_changed?
|
||||
return false unless saved_change_to_name? || saved_change_to_street? || saved_change_to_city? || saved_change_to_country?
|
||||
|
||||
# do not notify unless the mail content is set up
|
||||
(!conference.email_settings.venue_updated_subject.blank? && !conference.email_settings.venue_updated_body.blank?)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
- headers = ['Booth ID',
|
||||
- headers = ["#{(t'booth').capitalize } ID",
|
||||
'Title',
|
||||
'Description',
|
||||
'Reasoning',
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
'Submitter Relationship',
|
||||
'Website Url',
|
||||
'State']
|
||||
= CSV.generate_line ['All booths']
|
||||
= CSV.generate_line ["All #{(t'booth').pluralize}"]
|
||||
= CSV.generate_line headers
|
||||
- @booths.each do |booth|
|
||||
= CSV.generate_line([booth.id,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
prawn_document(force_download: true, filename: "#{@file_name}.pdf", page_layout: :landscape) do |pdf|
|
||||
booths_array = []
|
||||
header_array = ['Booth ID',
|
||||
header_array = ["#{(t'booth').capitalize } ID",
|
||||
'Title',
|
||||
'Description',
|
||||
'Reasoning',
|
||||
|
|
@ -21,6 +21,6 @@ prawn_document(force_download: true, filename: "#{@file_name}.pdf", page_layout:
|
|||
row << booth.state
|
||||
booths_array << row
|
||||
end
|
||||
pdf.text "#{@conference.short_title} booths", font_size: 25, align: :center
|
||||
pdf.text "#{@conference.short_title} #{(t'booth').pluralize}", font_size: 25, align: :center
|
||||
pdf.table booths_array, header: true, cell_style: {size: 8, border_width: 1},column_widths: [45,70,153,152,70,80,105,45]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
wb.add_worksheet(name: 'all booths') do |sheet|
|
||||
wb.add_worksheet(name: "all #{(t 'booth').pluralize}") do |sheet|
|
||||
bold_style = wb.styles.add_style(b: true)
|
||||
wrap_text = wb.styles.add_style alignment: {wrap_text: true}
|
||||
row = ['Booth ID',
|
||||
row = ["#{(t 'booth').capitalize} ID",
|
||||
'Title',
|
||||
'Description',
|
||||
'Reasoning',
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
- if booth.transition_possible? :accept
|
||||
- if can? :accept, booth
|
||||
- if @conference.booth_limit > 0
|
||||
- confirm_message = ' You are able to accept '+ pluralize(@conference.booth_limit - (@conference.booths.accepted.count + @conference.booths.confirmed.count), 'more booth') + " (booth limit set to #{@conference.booth_limit}). Are you sure you want to accept this one?"
|
||||
- confirm_message = ' You are able to accept '+ pluralize(@conference.booth_limit - (@conference.booths.accepted.count + @conference.booths.confirmed.count), "more #{t'booth'}") + " (#{t'booth'} limit set to #{@conference.booth_limit}). Are you sure you want to accept this one?"
|
||||
- if @conference.email_settings.send_on_booths_acceptance
|
||||
- link = 'Accept with email'
|
||||
- confirm_message = "By accepting this booth, an email will be sent informing the submitter for the acceptance. You may change the state to \'To accept\' until you are completely sure." + confirm_message
|
||||
- confirm_message = "By accepting this #{t'booth'}, an email will be sent informing the submitter for the acceptance. You may change the state to \'To accept\' until you are completely sure." + confirm_message
|
||||
- else
|
||||
- link = 'Accept booth'
|
||||
- link = "Accept #{t'booth'}"
|
||||
%li= link_to link,
|
||||
accept_admin_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch ,id: "accept_booth_#{booth.id}",
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
data: (@conference.email_settings.send_on_booths_rejection ? { confirm: 'By rejecting this booth, an email will be sent informing the submitter about the rejection. You may change the state to \'To reject\' until you are completely sure.'} : nil)
|
||||
|
||||
- if booth.transition_possible? :to_reject
|
||||
%li= link_to 'To reject booth',
|
||||
%li= link_to "To reject #{t'booth'}",
|
||||
to_reject_admin_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, id: "to_reject_booth_#{booth.id}"
|
||||
|
||||
|
|
@ -34,16 +34,16 @@
|
|||
method: :patch, id: "restart_booth_#{booth.id}"
|
||||
|
||||
- if booth.transition_possible? :to_accept
|
||||
%li= link_to 'To accept booth',
|
||||
%li= link_to "To accept #{t'booth'}",
|
||||
to_accept_admin_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, id: "to_accept_booth_#{booth.id}"
|
||||
|
||||
- if booth.transition_possible? :cancel
|
||||
%li= link_to 'Cancel booth',
|
||||
%li= link_to "Cancel #{t'booth'}",
|
||||
cancel_admin_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, id: "cancel_booth_#{booth.id}"
|
||||
|
||||
- if booth.transition_possible? :confirm
|
||||
%li= link_to 'Confirm booth',
|
||||
%li= link_to "Confirm #{t'booth'}",
|
||||
confirm_admin_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, id: "confirm_booth_#{booth.id}"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
- headers = ['Booth ID',
|
||||
- headers = ["#{(t'booth').capitalize } ID",
|
||||
'Title',
|
||||
'Description',
|
||||
'Reasoning',
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
'Submitter Relationship',
|
||||
'Website Url',
|
||||
'State']
|
||||
= CSV.generate_line ['All booths']
|
||||
= CSV.generate_line ["All #{(t'booth').pluralize}"]
|
||||
= CSV.generate_line headers
|
||||
- @booths.confirmed.each do |booth|
|
||||
= CSV.generate_line([booth.id,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
prawn_document(force_download: true, filename: "#{@file_name}.pdf", page_layout: :landscape) do |pdf|
|
||||
booths_array = []
|
||||
header_array = ['Booth ID',
|
||||
header_array = ["#{(t'booth').capitalize } ID",
|
||||
'Title',
|
||||
'Description',
|
||||
'Reasoning',
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
wb.add_worksheet(name: 'all booths') do |sheet|
|
||||
wb.add_worksheet(name: "all #{(t 'booth').pluralize}") do |sheet|
|
||||
bold_style = wb.styles.add_style(b: true)
|
||||
wrap_text = wb.styles.add_style alignment: {wrap_text: true}
|
||||
row = ['Booth ID',
|
||||
row = ["#{(t 'booth').capitalize} ID",
|
||||
'Title',
|
||||
'Description',
|
||||
'Reasoning',
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Booths
|
||||
#{(t'booth').pluralize.capitalize }
|
||||
.pull-right
|
||||
- if can? :read, Booth
|
||||
.btn-group
|
||||
|
|
@ -11,8 +11,8 @@
|
|||
Export PDF
|
||||
%span.caret
|
||||
%ul.dropdown-menu{ role: 'menu' }
|
||||
%li= link_to 'All Booths', admin_conference_booths_path(@conference.short_title, format: :pdf, booth_export_option: 'all')
|
||||
%li= link_to 'Confirmed Booths', admin_conference_booths_path(@conference.short_title, format: :pdf, booth_export_option: 'confirmed')
|
||||
%li= link_to "All #{(t'booth').pluralize.capitalize }", admin_conference_booths_path(@conference.short_title, format: :pdf, booth_export_option: 'all')
|
||||
%li= link_to "Confirmed #{(t'booth').pluralize.capitalize }", admin_conference_booths_path(@conference.short_title, format: :pdf, booth_export_option: 'confirmed')
|
||||
.btn-group
|
||||
%button.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown', type: 'button', class: 'btn btn-success' }
|
||||
Export CSV
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
%li= link_to 'Confirmed', admin_conference_booths_path(@conference.short_title, format: :xlsx, booth_export_option: 'confirmed')
|
||||
= "(#{@booths.length})" if @booths.any?
|
||||
%p.text-muted
|
||||
All the booth requests
|
||||
All the #{t'booth'} requests
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
@ -37,21 +37,21 @@
|
|||
- if @conference.booth_limit == 0
|
||||
%p
|
||||
Set the
|
||||
= link_to 'Booth limit', edit_admin_conference_path(@conference.short_title)
|
||||
to make sure you are not accepting more booths than you can accommodate.
|
||||
= link_to "#{(t'booth').capitalize } limit", edit_admin_conference_path(@conference.short_title)
|
||||
to make sure you are not accepting more #{(t'booth').pluralize} than you can accommodate.
|
||||
- elsif !@conference.maximum_accepted_booths?
|
||||
%p
|
||||
You cannot accept more than
|
||||
%b
|
||||
= pluralize(@conference.booth_limit, 'booth')
|
||||
= pluralize(@conference.booth_limit, "#{t'booth'}")
|
||||
(
|
||||
= pluralize(@conference.booths.accepted.count + @conference.booths.confirmed.count, 'accepted booth')
|
||||
= pluralize(@conference.booths.accepted.count + @conference.booths.confirmed.count, "accepted #{t'booth'}")
|
||||
so far)
|
||||
- else
|
||||
%p
|
||||
You have reached the maximum number of accepted booths.
|
||||
You have reached the maximum number of accepted #{(t'booth').pluralize}.
|
||||
(
|
||||
= link_to "#{@conference.booth_limit} booths", edit_admin_conference_path(@conference.short_title)
|
||||
= link_to "#{@conference.booth_limit} #{(t'booth').pluralize}", edit_admin_conference_path(@conference.short_title)
|
||||
)
|
||||
- if @booths.any?
|
||||
%table.datatable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
%h1 New booth
|
||||
%h1 New #{t'booth'}
|
||||
|
||||
= render 'booths/form'
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(cfp, url: cfp_form_url(cfp, conference),
|
||||
html: { multipart: true }) do |f|
|
||||
html: { multipart: true,
|
||||
data: { end_conference: conference.end_date.to_s } }) do |f|
|
||||
= f.input :cfp_type, as: :hidden
|
||||
= f.input :start_date, as: :string,
|
||||
input_html: { id: 'registration-period-start-datepicker',
|
||||
start_date: conference.start_date,
|
||||
end_date: conference.end_date, readonly: 'readonly' }
|
||||
input_html: { class: 'form-control',
|
||||
id: 'registration-period-start-datepicker' }
|
||||
= f.input :end_date, as: :string,
|
||||
input_html: { id: 'registration-period-end-datepicker',
|
||||
readonly: 'readonly' }
|
||||
input_html: { class: 'form-control',
|
||||
id: 'registration-period-end-datepicker' }
|
||||
= f.input :description, hint: markdown_hint,
|
||||
input_html: { rows: 2, data: { provide: 'markdown-editable' } }
|
||||
- if cfp.cfp_type == 'events'
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
.text-center
|
||||
%h4 #{title}
|
||||
%canvas.doughnut_chart{ id: "dough_#{title.parameterize.underscore}", 'data-chart' => data.to_json }
|
||||
- if data
|
||||
- data.each do |key, value|
|
||||
%span{ 'style' => "border-bottom: 3px solid #{value['color']}" } #{key}: #{value['value']}
|
||||
|
||||
:javascript
|
||||
$(document).ready( function(){
|
||||
|
||||
var d = $("#dough_#{title.parameterize.underscore}");
|
||||
var dt = d.get(0).getContext('2d');
|
||||
|
||||
$(window).resize( respondCanvas );
|
||||
|
||||
function respondCanvas(){
|
||||
dt.canvas.width = 150;
|
||||
dt.canvas.height = 150;
|
||||
}
|
||||
|
||||
respondCanvas();
|
||||
|
||||
});
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.text-center
|
||||
%h4
|
||||
= title
|
||||
.row
|
||||
.col-md-12
|
||||
.chart_data{ 'data-chart' => "#{y.to_json}", 'data-conferences' => "#{conferences.to_json}",
|
||||
'data-deactive' => "#{deactive_conferences.to_json}", 'data-weeks' => "#{x.to_json}",
|
||||
'data-active' => "#{active_conferences.to_json}" }
|
||||
%canvas.line_chart{ id: "line_chart_#{name}", 'data-name' => "#{name}" }
|
||||
.row
|
||||
.col-md-12
|
||||
.text-center
|
||||
= unit
|
||||
.row
|
||||
.col-md-12
|
||||
.conferenceCheckboxes{ id: "#{name}Checkboxes", 'data-name' => "#{name}" }
|
||||
- if active_conferences && deactive_conferences && conferences && conferences.length > 1
|
||||
- active_conferences.each do |conference|
|
||||
%div
|
||||
%span{ 'style' => "border-bottom: 3px solid #{conference[:color]};", 'data-chart' => "#{name}" }
|
||||
%input{ 'type' => 'checkbox', 'name' => "#{conference[:short_title]}", 'checked' => 'checked' }
|
||||
#{conference[:short_title]}
|
||||
- deactive_conferences.each do |conference|
|
||||
%div
|
||||
%span{ 'style' => "border-bottom: 3px solid #{conference[:color]};", 'data-chart' => "#{name}" }
|
||||
%input{ 'type' => 'checkbox', 'name' => "#{conference[:short_title]}" }
|
||||
#{conference[:short_title]}
|
||||
|
||||
:javascript
|
||||
$(document).ready( function(){
|
||||
|
||||
var c = $("#line_chart_#{name}");
|
||||
var ct = c.get(0).getContext('2d');
|
||||
var container = $(c).parent();
|
||||
|
||||
$(window).resize( respondCanvas );
|
||||
|
||||
function respondCanvas(){
|
||||
c.attr('width', $(container).width() );
|
||||
c.attr('height', $(container).height() );
|
||||
}
|
||||
|
||||
respondCanvas();
|
||||
|
||||
});
|
||||
|
|
@ -14,10 +14,7 @@
|
|||
%td= link_to user.email, admin_user_path(user.id)
|
||||
%td= user.created_at.strftime('%m/%d/%Y')
|
||||
%td
|
||||
= check_box_tag user.id, user.id, user.confirmed?,
|
||||
url: "/admin/users/#{user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: true
|
||||
= user.confirmed? ? 'Yes' : 'No'
|
||||
- else
|
||||
%h5.text-warning.text-center
|
||||
No sign ups!
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@
|
|||
= f.input :registration_limit, as: :number, in: 0..9999, hint: 'Limit the number of registrations to the conference (0 no limit). Please note that the registration limit doesn\'t apply to speakers of confirmed events (they will still be able to register even if it has been reached). You currently have ' + pluralize(@conference.registrations.count, 'registration')
|
||||
= f.inputs name: 'Booths' do
|
||||
= f.input :booth_limit, as: :number, in: 0..9999,
|
||||
hint: 'Booth limit is the maximum number of booths that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not going to accept more booths than the conference can accommodate. You currently have ' + pluralize(@conference.booths.accepted.count, 'accepted booth') +'.'
|
||||
hint: "#{(t'booth').capitalize } limit is the maximum number of #{(t'booth').pluralize} that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not going to accept more #{(t'booth').pluralize} than the conference can accommodate. You currently have " + pluralize(@conference.booths.accepted.count, "accepted #{t'booth'}") +'.'
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary', data: { confirm: 'Are you sure you want to proceed?' } }
|
||||
|
|
|
|||
|
|
@ -1,52 +1,32 @@
|
|||
= javascript_include_tag 'Chart.min'
|
||||
.row
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "user", subtitle: "User", value: @total_user, delta: @new_user
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "check-square", subtitle: "Registration", value: @total_reg, delta: @new_reg
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "file-text", subtitle: "Submission", value: @total_submissions, delta: @new_submissions
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "archive", subtitle: "Withdrawn", value: @total_withdrawn, delta: @new_withdrawn, reverse: true
|
||||
|
||||
.row#registrations
|
||||
.col-md-8
|
||||
= render partial: 'line_chart', locals: { title: 'Registrations over time',
|
||||
name: 'registrations',
|
||||
conferences: @conferences,
|
||||
active_conferences: @active_conferences,
|
||||
deactive_conferences: @deactive_conferences,
|
||||
y: @registrations,
|
||||
x: @registration_weeks,
|
||||
unit: 'weeks' }
|
||||
= render 'line_chart', title: 'Registrations per week', data: @registrations
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: { title: 'Events', data: @event_distribution }
|
||||
= render 'donut_chart', title: 'Events',
|
||||
data: @event_distribution, colors: @event_distribution_colors
|
||||
.row#submissions
|
||||
.col-md-8
|
||||
= render partial: 'line_chart', locals: { title: 'Submissions over time',
|
||||
name: 'submissions',
|
||||
conferences: @conferences,
|
||||
active_conferences: @active_conferences,
|
||||
deactive_conferences: @deactive_conferences,
|
||||
y: @submissions,
|
||||
x: @cfp_weeks,
|
||||
unit: 'weeks' }
|
||||
= render 'line_chart', title: 'Submissions per week', data: @submissions
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: { title: 'User', data: @user_distribution }
|
||||
= render 'donut_chart', title: 'Users',
|
||||
data: @user_distribution, colors: @user_distribution_colors
|
||||
.row#tickets
|
||||
.col-md-8
|
||||
= render partial: 'line_chart', locals: { title: 'Tickets sold over time',
|
||||
name: 'tickets',
|
||||
conferences: @conferences,
|
||||
active_conferences: @active_conferences,
|
||||
deactive_conferences: @deactive_conferences,
|
||||
y: @tickets,
|
||||
x: @ticket_weeks,
|
||||
unit: 'weeks' }
|
||||
= render 'line_chart', title: 'Tickets sold per week', data: @tickets
|
||||
%br
|
||||
.row
|
||||
.col-md-8
|
||||
|
|
|
|||
|
|
@ -1,21 +1,19 @@
|
|||
= javascript_include_tag 'Chart.min'
|
||||
|
||||
%h1
|
||||
%span.fa.fa-tachometer
|
||||
Dashboard for #{@conference.title}
|
||||
%hr
|
||||
.row
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "user", subtitle: "Registration", value: @total_reg, delta: @new_reg
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "check-square", subtitle: "Submission", value: @total_submissions, delta: @new_submissions
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "file-text", subtitle: "Hour", value: @program_length, delta: @new_program_length
|
||||
.col-sm-3.col-xs-3
|
||||
= render "shared/big_statistic",
|
||||
= render "big_statistic",
|
||||
icon: "archive", subtitle: "Withdrawn", value: @total_withdrawn, delta: @new_withdrawn
|
||||
|
||||
.row
|
||||
|
|
@ -24,37 +22,19 @@
|
|||
.col-md-8
|
||||
.row#registrations
|
||||
.col-md-12
|
||||
= render partial: 'line_chart', locals: { title: 'Registrations over time',
|
||||
name: 'registrations',
|
||||
conferences: [@conference],
|
||||
active_conferences: [@conference],
|
||||
deactive_conferences: [],
|
||||
y: @registrations,
|
||||
x: @registration_weeks,
|
||||
unit: 'weeks' }
|
||||
= render 'line_chart',
|
||||
title: 'Registrations per week', data: @registrations
|
||||
.row#submissions
|
||||
.col-md-12
|
||||
= render partial: 'line_chart', locals: { title: 'Submissions over time',
|
||||
name: 'submissions',
|
||||
conferences: @submissions,
|
||||
active_conferences: @submissions,
|
||||
deactive_conferences: [],
|
||||
y: @submissions_data,
|
||||
x: @cfp_weeks,
|
||||
unit: 'weeks' }
|
||||
= render 'line_chart',
|
||||
title: 'Submissions per week', data: @submissions
|
||||
.col-md-4
|
||||
= render partial: 'todo_list', locals: { conference_progress: @conference_progress,
|
||||
conference: @conference }
|
||||
= render 'todo_list',
|
||||
conference_progress: @conference_progress, conference: @conference
|
||||
.row#tickets
|
||||
.col-md-8
|
||||
= render partial: 'line_chart', locals: { title: 'Tickets sold over time',
|
||||
name: 'tickets',
|
||||
conferences: @tickets,
|
||||
active_conferences: @tickets,
|
||||
deactive_conferences: [],
|
||||
y: @tickets_data,
|
||||
x: @ticket_weeks,
|
||||
unit: 'weeks' }
|
||||
= render 'line_chart',
|
||||
title: 'Tickets sold per week', data: @tickets
|
||||
%br
|
||||
.row
|
||||
.col-md-12#doughnut
|
||||
|
|
@ -75,27 +55,36 @@
|
|||
.tab-pane.active#distribution_all
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Event types', data: @event_type_distribution}
|
||||
= render 'donut_chart', title: 'Event types',
|
||||
combined_data: @event_type_distribution
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Difficulty levels', data: @difficulty_levels_distribution}
|
||||
= render 'donut_chart', title: 'Difficulty levels',
|
||||
combined_data: @difficulty_levels_distribution
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Tracks', data: @tracks_distribution}
|
||||
= render 'donut_chart', title: 'Tracks',
|
||||
combined_data: @tracks_distribution
|
||||
.tab-pane#distribution_confirmed
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Event types', data: @event_type_distribution_confirmed}
|
||||
= render 'donut_chart', title: 'Event types',
|
||||
combined_data: @event_type_distribution_confirmed
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Difficulty levels', data: @difficulty_levels_distribution_confirmed}
|
||||
= render 'donut_chart', title: 'Difficulty levels',
|
||||
combined_data: @difficulty_levels_distribution_confirmed
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Tracks', data: @tracks_distribution_confirmed}
|
||||
= render 'donut_chart', title: 'Tracks',
|
||||
combined_data: @tracks_distribution_confirmed
|
||||
.tab-pane#distribution_withdrawn
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Event types', data: @event_type_distribution_withdrawn}
|
||||
= render 'donut_chart', title: 'Event types',
|
||||
combined_data: @event_type_distribution_withdrawn
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Difficulty levels', data: @difficulty_levels_distribution_withdrawn}
|
||||
= render 'donut_chart', title: 'Difficulty levels',
|
||||
combined_data: @difficulty_levels_distribution_withdrawn
|
||||
.col-md-4
|
||||
= render partial: 'doughnut_chart', locals: {title: 'Tracks', data: @tracks_distribution_withdrawn}
|
||||
= render 'donut_chart', title: 'Tracks',
|
||||
combined_data: @tracks_distribution_withdrawn
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
|
|
|
|||
|
|
@ -114,18 +114,18 @@
|
|||
= f.input :booths_acceptance_subject
|
||||
= f.input :booths_acceptance_body, input_html: { rows:10, cols: 20 }
|
||||
%a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_booths_acceptance_subject',
|
||||
'data-subject-text' => 'Your booth has been accepted!',
|
||||
'data-subject-text' => "Your #{t'booth'} has been accepted!",
|
||||
'data-body-input-id' => 'email_settings_booths_acceptance_body',
|
||||
'data-body-text' => "Dear {name},\n\nWe are pleased to inform you that your booth request {booth_title} has been accepted for the conference {conference}.\nPlease click the confirm button to let us know you can make it as soon as possible!\n\nFeel free to contact us with any questions or concerns.\n\nWe are looking forward to seeing you there.\n\nBest wishes\n\n{conference} Team"} Load Template
|
||||
'data-body-text' => "Dear {name},\n\nWe are pleased to inform you that your #{t'booth'} request {booth_title} has been accepted for the conference {conference}.\nPlease click the confirm button to let us know you can make it as soon as possible!\n\nFeel free to contact us with any questions or concerns.\n\nWe are looking forward to seeing you there.\n\nBest wishes\n\n{conference} Team"} Load Template
|
||||
%a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'booth_acceptance_help' } Show help
|
||||
= render partial: 'help', locals: {id: 'booth_acceptance_help', show_event_variables: false}
|
||||
= f.input :send_on_booths_rejection
|
||||
= f.input :booths_rejection_subject
|
||||
= f.input :booths_rejection_body, input_html: { rows:10, cols:20 }
|
||||
%a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_booths_rejection_subject',
|
||||
'data-subject-text' => 'Your booth request has been rejected',
|
||||
'data-subject-text' => "Your #{t'booth'} request has been rejected",
|
||||
'data-body-input-id' => 'email_settings_booths_rejection_body',
|
||||
'data-body-text' => "Dear {name},\n\nThank you for your booth request {booth_title} for the conference {conference}.\n\nUnfortunately, we are sorry to inform you that your request has been rejected.\n\n\nBest wishes\n\n{conference} Team" } Load Template
|
||||
'data-body-text' => "Dear {name},\n\nThank you for your #{t'booth'} request {booth_title} for the conference {conference}.\n\nUnfortunately, we are sorry to inform you that your request has been rejected.\n\n\nBest wishes\n\n{conference} Team" } Load Template
|
||||
%a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'booth_rejection_help' } Show help
|
||||
= render partial: 'help', locals: {id: 'booth_rejection_help', show_event_variables: false}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,11 +24,15 @@
|
|||
Unknown submitter
|
||||
|
||||
%td
|
||||
- event.speakers_ordered.each do |speaker|
|
||||
.speaker
|
||||
= link_to speaker.name, admin_user_path(speaker)
|
||||
- unless speaker.registrations.for_conference(event.conference)
|
||||
%span.label.label-danger Unregistered
|
||||
- if event.speakers.any?
|
||||
- event.speakers_ordered.each do |speaker|
|
||||
.speaker
|
||||
= link_to speaker.name, admin_user_path(speaker)
|
||||
- unless speaker.registrations.for_conference(event.conference)
|
||||
%span.label.label-danger Unregistered
|
||||
- else
|
||||
.small
|
||||
No Speaker
|
||||
|
||||
- if @program.languages.present?
|
||||
%td
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
= javascript_include_tag 'Chart.min'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
|
|
@ -47,17 +45,14 @@
|
|||
= f.submit 'Add', class: 'btn btn-primary'
|
||||
.row
|
||||
.col-md-4
|
||||
= render 'admin/conferences/doughnut_chart',
|
||||
title: 'Events state',
|
||||
data: @event_distribution
|
||||
= render 'donut_chart', title: 'Events state',
|
||||
data: @event_distribution, colors: @event_distribution_colors
|
||||
.col-md-4
|
||||
= render 'admin/conferences/doughnut_chart',
|
||||
title: 'Confirmed events scheduled',
|
||||
data: @scheduled_event_distribution
|
||||
= render 'donut_chart', title: 'Confirmed events scheduled',
|
||||
combined_data: @scheduled_event_distribution
|
||||
.col-md-4
|
||||
= render 'admin/conferences/doughnut_chart',
|
||||
title: 'Tracks of confirmed events',
|
||||
data: @tracks_distribution_confirmed
|
||||
= render 'donut_chart', title: 'Tracks of confirmed events',
|
||||
combined_data: @tracks_distribution_confirmed
|
||||
.row
|
||||
.col-md-12
|
||||
.margin-event-table
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
for
|
||||
= @event.title
|
||||
|
||||
- if @event.room && (@event_registrations.length > @event.room.size)
|
||||
- if @event.room.try(:size) && (@event_registrations.length > @event.room.size)
|
||||
%b Attention:
|
||||
You have more registrations than the capacity of the room!
|
||||
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
%td= event_registration.email
|
||||
%td= event_registration.created_at
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}/toggle_attendance?events_registration_id=#{event_registration.id}&&event_registration[attended]="
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', url: "#{toggle_attendance_admin_conference_program_event_path(@conference, @event, events_registration_id: event_registration)}&&event_registration[attended]="
|
||||
%td
|
||||
- if event_registration.registration.attended
|
||||
%i.fa.fa-check.text-success
|
||||
|
|
|
|||
|
|
@ -69,9 +69,10 @@
|
|||
%span{ 'class' => [icon_for_todo(progress_status['registered']), 'fa-lg'] }
|
||||
%tr
|
||||
%td
|
||||
- if @event.speakers.count == 1
|
||||
- speakers_count = @event.speakers.count
|
||||
- if speakers_count == 1
|
||||
= link_to 'Fill out speaker\'s biography', edit_admin_user_path(@event.speakers.first)
|
||||
- else
|
||||
- elsif speakers_count > 1
|
||||
Fill out speaker's biography:
|
||||
= speaker_links(@event)
|
||||
%td{ 'class' => class_for_todo(progress_status['biographies']) }
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
- else
|
||||
- if lodging.website_link.present?
|
||||
= link_to(lodging.website_link, class: 'thumbnail') do
|
||||
= image_tag lodging.picture.thumb, class: 'img-responsive img-lodging'
|
||||
= image_tag lodging.picture.thumb.url, class: 'img-responsive img-lodging'
|
||||
- else
|
||||
= image_tag lodging.picture.thumb, class: 'img-responsive img-lodging'
|
||||
= image_tag lodging.picture.thumb.url, class: 'img-responsive img-lodging'
|
||||
.caption
|
||||
%h3.text-center
|
||||
= lodging.name
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
= javascript_include_tag 'Chart.min'
|
||||
|
||||
.container
|
||||
.row
|
||||
.col-md-12.page-header
|
||||
|
|
@ -9,11 +7,11 @@
|
|||
Tickets sold for the conference
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart',
|
||||
locals: { title: 'Tickets sold', data: @tickets_sold_distribution }
|
||||
= render 'donut_chart', title: 'Tickets sold',
|
||||
combined_data: @tickets_sold_distribution
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart',
|
||||
locals: {title: 'Tickets turnover', data: @tickets_turnover_distribution}
|
||||
= render 'donut_chart', title: 'Tickets turnover',
|
||||
combined_data: @tickets_turnover_distribution
|
||||
%br
|
||||
- if @physical_tickets.any?
|
||||
.row
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
= f.input :languages, hint: "Enter the languages allowed for events as values of #{link_to('ISO 639-1', 'http://www.loc.gov/standards/iso639-2/php/code_list.php', target: "_blank")} language codes separated with commas. The first language would be the default language. Leave it blank if you do not want to specify languages.".html_safe
|
||||
= f.input :schedule_interval, input_html: { autofocus: true }, hint: "It is the minimal time interval of your schedule. The value should be 5, 6, 10, 12, 15, 20, 30 or 60. Warning! Some events could be unscheduled when changing this value."
|
||||
= f.input :blind_voting, hint: 'Enable this feature if you do not want to show voting results and voters prior to user submitting a vote. For the feature to work you need to set the voting dates below as well'
|
||||
= f.input :voting_start_date, as: :string, input_html: { id: 'datetimepicker-voting_start_date', readonly: true, value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?) }
|
||||
= f.input :voting_end_date, as: :string, input_html: { id: 'datetimepicker-voting_start_date', readonly: true, value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?) }
|
||||
= f.input :voting_start_date, as: :string, input_html: { id: 'datetimepicker-voting_start_date', value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?) }
|
||||
= f.input :voting_end_date, as: :string, input_html: { id: 'datetimepicker-voting_end_date', value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?) }
|
||||
%p.text-right
|
||||
= f.action :submit, as: :button, button_html: {class: 'btn btn-primary'}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@registration_period, url: admin_conference_registration_period_path(@conference.short_title)) do |f|
|
||||
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker',start_date: @conference.start_date,end_date: @conference.end_date, readonly: 'readonly' }
|
||||
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
|
||||
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date }
|
||||
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker' }
|
||||
%p.text-right
|
||||
= f.submit 'Save Registration Period', class: 'btn btn-primary'
|
||||
|
|
|
|||
|
|
@ -8,29 +8,38 @@
|
|||
.row
|
||||
.col-md-8
|
||||
%dl.dl-horizontal
|
||||
%dt
|
||||
Start Date
|
||||
%dd
|
||||
= @registration_period.start_date
|
||||
%dt
|
||||
End Date
|
||||
%dd
|
||||
= @registration_period.end_date
|
||||
%dt Start Date
|
||||
%dd= @registration_period.start_date
|
||||
%dt End Date
|
||||
%dd= @registration_period.end_date
|
||||
%dt Ticket required?
|
||||
%dd= @conference.tickets.for_registration.any? ? 'Yes' : 'No'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
%p
|
||||
If you would like to require a ticket purchase for registration, at least
|
||||
one
|
||||
= link_to 'ticket', admin_conference_tickets_path(@conference)
|
||||
must be set as a registration ticket, and the registration process
|
||||
will not proceed without the purchase (or selection of a free) single
|
||||
registration ticket.
|
||||
%p
|
||||
To make ticketing optional, do not mark any
|
||||
= link_to 'tickets', admin_conference_tickets_path(@conference)
|
||||
as registration tickets, and registration can proceed without them.
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
- if @registration_period
|
||||
- if can? :update, @registration_period
|
||||
= link_to 'Edit', edit_admin_conference_registration_period_path, class: 'btn btn-primary'
|
||||
- if can? :destroy, @registration_period
|
||||
= link_to 'Delete', admin_conference_registration_period_path,
|
||||
method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
|
||||
- else
|
||||
- if @conference.tickets.for_registration.empty?
|
||||
.h3.text-left
|
||||
No Registration Tickets!
|
||||
%small
|
||||
= link_to 'Create registration tickets', new_admin_conference_ticket_path
|
||||
before creating the registration period.
|
||||
- else
|
||||
- if can? :create, @conference.build_registration_period
|
||||
= link_to 'New Registration Period', new_admin_conference_registration_period_path, class: 'btn btn-primary'
|
||||
.btn-group{ role: 'group' }
|
||||
- if @registration_period
|
||||
- if can? :update, @registration_period
|
||||
= link_to 'Edit', edit_admin_conference_registration_period_path,
|
||||
class: 'btn btn-primary'
|
||||
- if can? :destroy, @registration_period
|
||||
= link_to 'Delete', admin_conference_registration_period_path,
|
||||
method: :delete, data: { confirm: 'Are you sure?' },
|
||||
class: 'btn btn-danger'
|
||||
- elsif can? :create, @conference.build_registration_period
|
||||
= link_to 'New Registration Period',
|
||||
new_admin_conference_registration_period_path,
|
||||
class: 'btn btn-primary'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,16 @@
|
|||
- headers = ['Name', 'Email']
|
||||
- headers = ['Attended',
|
||||
'Name',
|
||||
'Nickname',
|
||||
'Affilιation',
|
||||
'Email',
|
||||
'Arrival',
|
||||
'Departure']
|
||||
= CSV.generate_line headers
|
||||
- @registrations.each do |registration|
|
||||
= CSV.generate_line([registration.name, registration.email])
|
||||
= CSV.generate_line([registration.attended ? 'X' : '',
|
||||
registration.name,
|
||||
registration.nickname,
|
||||
registration.affiliation,
|
||||
registration.email,
|
||||
registration.arrival.to_s,
|
||||
registration.departure.to_s])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
= javascript_include_tag 'Chart.min'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
|
|
@ -14,10 +12,12 @@
|
|||
%p.text-muted
|
||||
All the people who registered to your event
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Affiliation', data: @affiliation_distribution}
|
||||
= render 'donut_chart', title: 'Affiliation',
|
||||
combined_data: @affiliation_distribution
|
||||
- unless @conference.pending?
|
||||
.col-md-4
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Attended registrations', data: @registration_distribution}
|
||||
= render 'donut_chart', title: 'Attended registrations',
|
||||
combined_data: @registration_distribution
|
||||
.row
|
||||
.col-md-12
|
||||
%div.margin-event-table
|
||||
|
|
|
|||
|
|
@ -27,10 +27,14 @@
|
|||
%td
|
||||
= link_to event.title, edit_admin_conference_program_event_path(@conference.short_title, event)
|
||||
%br
|
||||
.small
|
||||
(Presented by
|
||||
= speaker_links(event)
|
||||
)
|
||||
- if(event.speakers.any?)
|
||||
.small
|
||||
(Presented by
|
||||
= speaker_links(event)
|
||||
)
|
||||
- else
|
||||
.small
|
||||
(No speaker)
|
||||
|
||||
- %w(registered biographies commercials subtitle difficulty_level).each do |info|
|
||||
%td{'data-order' => "#{progress_status[info]}"}
|
||||
|
|
|
|||
|
|
@ -18,4 +18,8 @@
|
|||
%td= event.id
|
||||
%td= link_to event.title, edit_admin_conference_program_event_path(@conference.short_title, event)
|
||||
%td
|
||||
= speaker_links(event)
|
||||
- if(event.speakers.any?)
|
||||
= speaker_links(event)
|
||||
- else
|
||||
.small
|
||||
(No speaker)
|
||||
|
|
|
|||
|
|
@ -1,30 +1,29 @@
|
|||
- cache [:admin, @conference, @program, :schedule, event] do
|
||||
- cells_length = event.event_type.length / @program.schedule_interval
|
||||
/ this height fits the room cells
|
||||
- compact_grid = @program.schedule_interval < 15
|
||||
- single_cell_height = compact_grid ? 32 : 58
|
||||
- height = (cells_length * single_cell_height)
|
||||
- height -= 23 unless compact_grid
|
||||
/ subtracting the padding before calculate the number of lines
|
||||
- lines = (height - 7) / 23
|
||||
- color = event.track.try(:color).present? ? event.track.try(:color) : 'FFFFFF'
|
||||
- non_schedulable = event_schedule_id && (EventSchedule.find(event_schedule_id).schedule != @schedule)
|
||||
.schedule-event{ style: "height: #{height}px; background-color: #{color}; color: #{contrast_color(color)}", |
|
||||
id: "event-#{event.id}", |
|
||||
event_id: event.id, |
|
||||
length: cells_length, |
|
||||
event_schedule_id: event_schedule_id, |
|
||||
class: "#{'compact' if compact_grid} #{'non_schedulable' if non_schedulable}" }
|
||||
.schedule-event-text{ style: "-webkit-line-clamp: #{lines}; height: #{lines * 23}px;"}
|
||||
%span.schedule-event-delete-button{ onclick: "Schedule.remove(\'event-#{event.id}\');" } X
|
||||
%b
|
||||
= link_to(event.id, admin_conference_program_event_path(@conference, event))
|
||||
= event.speakers.collect(&:name).to_sentence
|
||||
= ':'
|
||||
= event.title
|
||||
- if event.difficulty_level
|
||||
%span.label.label-default= event.difficulty_level.title
|
||||
- if event.event_type
|
||||
%span.label.label-default= event.event_type.title
|
||||
- if event.track
|
||||
%span.label.label-default= event.track.short_name
|
||||
- cells_length = event.event_type.length / @program.schedule_interval
|
||||
/ this height fits the room cells
|
||||
- compact_grid = @program.schedule_interval < 15
|
||||
- single_cell_height = compact_grid ? 32 : 58
|
||||
- height = (cells_length * single_cell_height)
|
||||
- height -= 23 unless compact_grid
|
||||
/ subtracting the padding before calculate the number of lines
|
||||
- lines = (height - 7) / 23
|
||||
- color = event.track.try(:color).present? ? event.track.try(:color) : 'FFFFFF'
|
||||
- non_schedulable = event_schedule_id && (EventSchedule.find(event_schedule_id).schedule != @schedule)
|
||||
.schedule-event{ style: "height: #{height}px; background-color: #{color}; color: #{contrast_color(color)}", |
|
||||
id: "event-#{event.id}", |
|
||||
event_id: event.id, |
|
||||
length: cells_length, |
|
||||
event_schedule_id: event_schedule_id, |
|
||||
class: "#{'compact' if compact_grid} #{'non_schedulable' if non_schedulable}" }
|
||||
.schedule-event-text{ style: "-webkit-line-clamp: #{lines}; height: #{lines * 23}px;"}
|
||||
%span.schedule-event-delete-button{ onclick: "Schedule.remove(\'event-#{event.id}\');" } X
|
||||
%b
|
||||
= link_to(event.id, admin_conference_program_event_path(@conference, event))
|
||||
= event.speakers.collect(&:name).to_sentence
|
||||
= ':'
|
||||
= event.title
|
||||
- if event.difficulty_level
|
||||
%span.label.label-default= event.difficulty_level.title
|
||||
- if event.event_type
|
||||
%span.label.label-default= event.event_type.title
|
||||
- if event.track
|
||||
%span.label.label-default= event.track.short_name
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
.col-md-12
|
||||
= f.inputs name: 'Components' do
|
||||
%ul.fa-ul
|
||||
%li
|
||||
%th
|
||||
%button.btn.btn-default#select-all{ type: "button" }
|
||||
Select All
|
||||
%th
|
||||
%button.btn.btn-default#unselect-all{ type: "button" }
|
||||
Unselect All
|
||||
%li
|
||||
= f.input :include_cfp, label: 'Display call for papers and call for tracks, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) }
|
||||
%li
|
||||
|
|
@ -17,7 +24,7 @@
|
|||
%li
|
||||
= f.input :include_tracks, label: 'Include confirmed tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) }
|
||||
%li
|
||||
= f.input :include_booths, label: 'Include confirmed booths', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_booths) }
|
||||
= f.input :include_booths, label: "Include confirmed #{(t'booth').pluralize}", input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_booths) }
|
||||
|
||||
%li
|
||||
= f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) }
|
||||
|
|
@ -45,3 +52,15 @@
|
|||
.col-md-12
|
||||
%p.text-right
|
||||
= f.submit 'Save Changes', class: 'btn btn-primary'
|
||||
|
||||
:javascript
|
||||
$(document).ready(function(){
|
||||
$('#select-all').click(function(event) {
|
||||
var parent = $(this).parents('.inputs:last');
|
||||
parent.find('.input.checkbox input[type=checkbox]').prop('checked',true);
|
||||
});
|
||||
$('#unselect-all').click(function(event) {
|
||||
var parent = $(this).parents('.inputs:last');
|
||||
parent.find('.input.checkbox input[type=checkbox]').prop('checked',false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
Include confirmed tracks
|
||||
%li
|
||||
%i{ class: "fa-li #{icon_for_todo @splashpage.include_booths?}" }
|
||||
Include confirmed booths
|
||||
Include confirmed #{(t'booth').pluralize}
|
||||
%li
|
||||
%i{ class: "fa-li #{icon_for_todo @splashpage.include_registrations?}" }
|
||||
Display the registration period
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
.col-md-8
|
||||
= semantic_form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f|
|
||||
= f.input :name, input_html: { autofocus: true }
|
||||
= f.input :description
|
||||
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
|
||||
= image_tag f.object.picture.thumb.url if f.object.picture?
|
||||
= f.input :picture
|
||||
= f.input :website_url
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
%td
|
||||
= sponsor.name
|
||||
%td
|
||||
= truncate(sponsor.description)
|
||||
= truncate(markdown(sponsor.description))
|
||||
%td
|
||||
= sponsor.website_url
|
||||
%td
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
= javascript_include_tag "//www.google.com/jsapi", "chartkick"
|
||||
= javascript_include_tag 'chartkick'
|
||||
|
||||
= bar_chart @survey.survey_questions.map{ |q| [q.title, q.survey_replies.count] }
|
||||
|
||||
- @survey.survey_questions.each.with_index(1) do |survey_question, question_index|
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
= f.input :name, input_html: { autofocus: true }
|
||||
= f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }
|
||||
= f.input :color, input_html: {size: 6, type: 'color'}, required: true
|
||||
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly', required: @track.self_organized_and_accepted_or_confirmed? }
|
||||
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly', required: @track.self_organized_and_accepted_or_confirmed? }
|
||||
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, required: @track.self_organized_and_accepted_or_confirmed? }
|
||||
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', required: @track.self_organized_and_accepted_or_confirmed? }
|
||||
- if @conference.venue.try(:rooms).present?
|
||||
= f.input :room, as: :select, collection: (@conference.venue.rooms).map {|room| ["#{room.name}", room.id]}, include_blank: true, label: 'Room', input_html: { class: 'select-help-toggle', required: @track.self_organized_and_accepted_or_confirmed? }
|
||||
- else
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
Confirmed?
|
||||
- if can? :toggle_confirmation, @user
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: false
|
||||
- else
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: true
|
||||
= f.input :is_admin, hint: 'An admin can create a new conference, manage users and make other users admins.'
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@
|
|||
%td
|
||||
- if can? :toggle_confirmation, @user
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: false
|
||||
- else
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: true
|
||||
- else
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@
|
|||
= link_to (current_or_last_object_state('Event', object.event_id).try(:title) || 'deleted'),
|
||||
admin_conference_program_event_path(conference_short_title, object.event_id)
|
||||
in
|
||||
= link_to "Schedule #{event_schedule.schedule_id}",
|
||||
admin_conference_schedule_path(conference_short_title, event_schedule.schedule_id)
|
||||
= link_to "Schedule #{version.item.schedule_id}",
|
||||
admin_conference_schedule_path(conference_short_title, version.item.schedule_id)
|
||||
|
||||
- when 'Schedule'
|
||||
= link_if_alive version, "Schedule #{version.item_id}",
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
conference
|
||||
|
||||
- when 'Booth'
|
||||
= 'booth'
|
||||
= t 'booth'
|
||||
= link_if_alive version, object.title,
|
||||
admin_conference_booth_path(conference_id: Conference.find(version.conference_id).short_title, id: version.item_id ),
|
||||
conference
|
||||
|
|
|
|||
16
app/views/application/_donut_chart.haml
Normal file
16
app/views/application/_donut_chart.haml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
:ruby
|
||||
combined_data ||= {}
|
||||
data ||= chart_values(combined_data)
|
||||
colors ||= chart_colors(combined_data)
|
||||
|
||||
options = {
|
||||
donut: true,
|
||||
legend: 'bottom',
|
||||
download: true,
|
||||
messages: { empty: 'No data' }
|
||||
}
|
||||
options[:colors] = colors if colors.present?
|
||||
|
||||
.text-center
|
||||
%h4= title
|
||||
= pie_chart data, options
|
||||
15
app/views/application/_line_chart.html.haml
Normal file
15
app/views/application/_line_chart.html.haml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
:ruby
|
||||
options = {
|
||||
legend: 'bottom',
|
||||
download: true,
|
||||
messages: { empty: 'No data' }
|
||||
}
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.text-center
|
||||
%h4
|
||||
= title
|
||||
.row
|
||||
.col-md-12
|
||||
= line_chart data, options
|
||||
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
%p.text-right
|
||||
- if @booth.new_record?
|
||||
= f.submit 'Create Booth Request', class: 'btn btn-success'
|
||||
= f.submit "Create #{(t'booth').capitalize } Request", class: 'btn btn-success'
|
||||
- else
|
||||
= f.submit 'Update Booth Request', class: 'btn btn-success'
|
||||
= f.submit "Update #{(t'booth').capitalize } Request", class: 'btn btn-success'
|
||||
|
||||
:javascript
|
||||
$(document).ready(function() {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
.row
|
||||
.col-md-12.page-header
|
||||
%h1
|
||||
Your booth requests for
|
||||
Your #{t'booth'} requests for
|
||||
= @conference.title
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
@ -48,4 +48,4 @@
|
|||
restart_conference_booth_path(@conference.short_title, booth),
|
||||
method: :patch, class: 'btn btn-mini btn-success', id: "restart_booth_#{booth.id}"
|
||||
.pull-right
|
||||
= link_to 'Add Booth', new_conference_booth_path(@conference.short_title), class: 'button btn btn-primary'
|
||||
= link_to "Add #{(t'booth').capitalize }", new_conference_booth_path(@conference.short_title), class: 'button btn btn-primary'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.container
|
||||
%h1 Request a booth
|
||||
%h1 Request a #{t'booth'}
|
||||
|
||||
= render 'form'
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
|
||||
= f.inputs 'Your Travel Info' do
|
||||
= f.input :arrival, as: :string, label: 'Your arrival time', hint: "Leave blank if not sure", input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker',start_date: @conference.start_date,end_date: @conference.end_date}
|
||||
= f.input :departure, as: :string, label: 'Your departure time', hint: "Leave blank if not sure", input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker'}
|
||||
= f.input :arrival, as: :string, label: 'Your arrival time', hint: "Leave blank if not sure", input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker',start_date: @conference.start_date,end_date: @conference.end_date }
|
||||
= f.input :departure, as: :string, label: 'Your departure time', hint: "Leave blank if not sure", input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker' }
|
||||
|
||||
= render 'conferences/code_of_conduct', organization: @conference.organization
|
||||
|
|
|
|||
|
|
@ -97,37 +97,48 @@
|
|||
- if @conference.tickets.visible.any?
|
||||
.row
|
||||
.col-md-12
|
||||
-if @tickets.any?
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-ticket.fa-stack-1x
|
||||
Ticket Purchases
|
||||
= "(#{@tickets.first.price.symbol}#{humanized_money @total_price})"
|
||||
%ul
|
||||
.col-md-12
|
||||
- @ticket_payments.each_pair do |ticket_id, tickets|
|
||||
%li
|
||||
= @total_quantity[ticket_id]
|
||||
= tickets.first.title
|
||||
= word_pluralize(@total_quantity[ticket_id], 'Ticket')
|
||||
for
|
||||
= tickets.first.price.symbol
|
||||
= humanized_money @total_price_per_ticket[ticket_id]
|
||||
%br
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-ticket.fa-stack-1x
|
||||
Tickets
|
||||
- if @tickets.any?
|
||||
.btn-group
|
||||
= link_to 'View all tickets', conference_physical_tickets_path(@conference.short_title), class: "btn btn-success"
|
||||
= link_to 'Get more tickets', conference_tickets_path(@conference.short_title), class: "btn btn-default"
|
||||
Total Purchased:
|
||||
= "(#{@tickets.first.price.symbol}#{humanized_money @total_price})"
|
||||
%ul
|
||||
.col-md-12
|
||||
- @ticket_payments.each_pair do |ticket_id, tickets|
|
||||
%li
|
||||
= @total_quantity[ticket_id]
|
||||
= tickets.first.title
|
||||
= word_pluralize(@total_quantity[ticket_id], 'Ticket')
|
||||
for
|
||||
= tickets.first.price.symbol
|
||||
= humanized_money @total_price_per_ticket[ticket_id]
|
||||
%br
|
||||
.btn-group{ role: 'group' }
|
||||
= link_to 'View all tickets',
|
||||
conference_physical_tickets_path(@conference.short_title),
|
||||
class: 'btn btn-success'
|
||||
= link_to 'Get more tickets',
|
||||
conference_tickets_path(@conference.short_title),
|
||||
class: 'btn btn-default'
|
||||
- else
|
||||
You haven't bought any tickets.
|
||||
= link_to 'Please get some tickets to support us!', conference_tickets_path(@conference.short_title)
|
||||
%p
|
||||
(Your participation won't be valid without getting a registration ticket)
|
||||
You haven't bought any tickets.
|
||||
= link_to 'Please get some tickets to support us!', conference_tickets_path(@conference.short_title)
|
||||
- if @conference.tickets.for_registration.any?
|
||||
%p
|
||||
%em
|
||||
Your participation won't be valid without getting a
|
||||
registration ticket.
|
||||
= link_to 'Get tickets',
|
||||
conference_tickets_path(@conference.short_title),
|
||||
class: 'btn btn-default'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
-if @registration
|
||||
- if @registration
|
||||
.btn-group-vertical.pull-right
|
||||
= link_to 'Edit your Registration', edit_conference_conference_registration_path(@conference.short_title), class: 'btn btn-success', disabled: @conference.end_date < Date.today
|
||||
- if @tickets.any?
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%h3.text-center Booths
|
||||
%h3.text-center "#{(t'booth').pluralize.capitalize }"
|
||||
.row.row-centered
|
||||
- booths.each do |booth|
|
||||
.col-md-2.col-sm-2.col-centered.col-top.booth
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
- cache [conference_id, call, '#splash#callforbooths'] do
|
||||
.col-md-4.col-sm-4.text-center
|
||||
%h2
|
||||
Call for Booths
|
||||
Call for #{(t'booth').pluralize.capitalize }
|
||||
%p.lead
|
||||
We are now accepting custom booth requests!
|
||||
We are now accepting custom #{t'booth'} requests!
|
||||
%p
|
||||
Would you like to request a new booth?
|
||||
The submission period for booth requests is open
|
||||
Would you like to request a new #{t'booth'}?
|
||||
The submission period for #{t'booth'} requests is open
|
||||
%em
|
||||
= date_string(call.start_date, call.end_date) + '.'
|
||||
%b
|
||||
|
|
@ -14,6 +14,6 @@
|
|||
= pluralize(call.remaining_days, 'day')
|
||||
left!
|
||||
%p.cta-button
|
||||
= link_to("Submit your request for booth",
|
||||
= link_to("Submit your request for #{t'booth'}",
|
||||
new_conference_booth_path(conference_id),
|
||||
class: 'btn btn-success btn-lg text-center')
|
||||
|
|
|
|||
|
|
@ -41,11 +41,12 @@
|
|||
- if !current_user.nil? && current_user.proposal_count(conference) > 0
|
||||
= link_to "My Proposals", conference_program_proposals_path(conference.short_title), class: 'btn btn-default'
|
||||
- elsif can? :new, conference.program.events.new
|
||||
= link_to "Submit Proposal", new_conference_program_proposal_path(conference.short_title), class: 'btn btn-default'
|
||||
- if conference.program.cfp_open?
|
||||
= link_to "Submit Proposal", new_conference_program_proposal_path(conference.short_title), class: 'btn btn-default'
|
||||
- if current_user && current_user.booths.where(conference_id: conference.id).count > 0
|
||||
= link_to 'My Booth Requests', conference_booths_path(conference.short_title), class: 'btn btn-default'
|
||||
= link_to "My #{(t'booth').capitalize } Requests", conference_booths_path(conference.short_title), class: 'btn btn-default'
|
||||
- elsif can? :new, conference.booths.new
|
||||
= link_to 'Request Booth', new_conference_booth_path(conference.short_title), class: 'btn btn-default'
|
||||
= link_to "Request #{(t'booth').capitalize }", new_conference_booth_path(conference.short_title), class: 'btn btn-default'
|
||||
- if current_user.nil? || !current_user.subscribed?(conference)
|
||||
= link_to 'Subscribe', conference_subscriptions_path(conference.short_title), method: :post, class: 'btn btn-default'
|
||||
- else
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@
|
|||
- if object.picture?
|
||||
= image_tag get_logo(object), class: img_classes
|
||||
%p.description
|
||||
= object.description
|
||||
= markdown(object.description)
|
||||
.modal-footer
|
||||
= link_to nil, object.website_url, target: '_blank'
|
||||
|
|
|
|||
21
app/views/conferences/_new_install.html.haml
Normal file
21
app/views/conferences/_new_install.html.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.well
|
||||
%h1
|
||||
Welcome to your new
|
||||
= link_to('https://osem.io') do
|
||||
Open Source Event Manager
|
||||
installation!
|
||||
%p
|
||||
The first user to
|
||||
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||
= link_to(new_ichain_registration_path('user')) do
|
||||
sign up
|
||||
- else
|
||||
= link_to(new_registration_path('user')) do
|
||||
sign up
|
||||
will the be administrator of it.
|
||||
%p
|
||||
We hope you enjoy using OSEM, if you have any question don't hesitate to
|
||||
= link_to('http://osem.io/#contact') do
|
||||
contact us!
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
%h2 Upcoming Conferences
|
||||
- @current.each do |conference|
|
||||
= render '/conferences/conference_details', conference: conference
|
||||
-if @antiquated and @antiquated.any?
|
||||
- if @antiquated and @antiquated.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%p.text-right
|
||||
|
|
@ -18,6 +18,8 @@
|
|||
#antiquated.collapse
|
||||
- @antiquated.each do |conference|
|
||||
= render '/conferences/conference_details', conference: conference
|
||||
- if @antiquated.empty? && @current.empty? && User.empty?
|
||||
= render partial: 'new_install'
|
||||
|
||||
-content_for :script_body do
|
||||
:javascript
|
||||
|
|
|
|||
|
|
@ -64,22 +64,21 @@
|
|||
= render 'social_media', contact: @conference.contact
|
||||
= render 'footer'
|
||||
|
||||
- cache [@conference.color, '#splash#inlinejs'] do
|
||||
- content_for :script_head do
|
||||
:javascript
|
||||
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
|
||||
var triangle_colors = triangle_tcs.map(function(t) {
|
||||
return t.toHexString();
|
||||
});
|
||||
$(function () {
|
||||
$(document).ready(function() {
|
||||
var triangle_width = document.body.clientWidth;
|
||||
var triangle_height = ($( "#banner" ).height() + 200 );
|
||||
var pattern = Trianglify({ width: triangle_width,
|
||||
height: triangle_height,
|
||||
cell_size: 100,
|
||||
x_colors: triangle_colors
|
||||
});
|
||||
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
|
||||
});
|
||||
- content_for :script_head do
|
||||
:javascript
|
||||
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
|
||||
var triangle_colors = triangle_tcs.map(function(t) {
|
||||
return t.toHexString();
|
||||
});
|
||||
$(function () {
|
||||
$(document).ready(function() {
|
||||
var triangle_width = document.body.clientWidth;
|
||||
var triangle_height = ($( "#banner" ).height() + 200 );
|
||||
var pattern = Trianglify({ width: triangle_width,
|
||||
height: triangle_height,
|
||||
cell_size: 100,
|
||||
x_colors: triangle_colors
|
||||
});
|
||||
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
= f.input :username, required: false, input_html: { autocomplete: 'off' }
|
||||
= f.input :email, required: false, input_html: { autocomplete: 'off' }
|
||||
= f.input :email_public,
|
||||
hint: "Do you want to your email address publicly? (On sessions, registration lists, etc.)"
|
||||
hint: "Do you want your email address to appear publicly? (e.g. on sessions, registration lists, etc.)"
|
||||
= f.input :password, hint: "(Leave blank if you don't want to change it)", input_html: { autocomplete: 'off' }
|
||||
= f.input :password_confirmation, input_html: { autocomplete: 'off' }
|
||||
= f.inputs name: 'OpenID' do
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@
|
|||
%li
|
||||
= link_to admin_conference_booths_path(@conference.short_title) do
|
||||
%span.fa.fa-shopping-bag
|
||||
Booths
|
||||
= (t'booth').pluralize.capitalize
|
||||
- if can? :update, @conference.email_settings
|
||||
%li{class: active_nav_li(admin_conference_emails_path(@conference.short_title))}
|
||||
= link_to(admin_conference_emails_path(@conference.short_title)) do
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
%li
|
||||
= link_to (conference_booths_path(@conference.short_title)) do
|
||||
%span.fa.fa-shopping-bag
|
||||
My Booth Requests
|
||||
My #{(t'booth').capitalize } Requests
|
||||
%li
|
||||
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||
= link_to(destroy_user_ichain_session_path, method: 'delete') do
|
||||
|
|
|
|||
|
|
@ -50,4 +50,5 @@
|
|||
Performance data is available on
|
||||
#{link_to "Skylight", ENV["SKYLIGHT_PUBLIC_DASHBOARD_URL"]}.
|
||||
= yield :script_body
|
||||
= yield :charts_js
|
||||
= piwik_tracking_tag
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue