Merge branch 'master' into org-name-in-conf
This commit is contained in:
commit
747a2e1288
8 changed files with 44 additions and 5 deletions
|
|
@ -55,7 +55,6 @@ $(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function draw_line_chart(animation, $canvas){
|
function draw_line_chart(animation, $canvas){
|
||||||
var options = get_animation({}, animation);
|
|
||||||
var chart_data = create_dataset($canvas);
|
var chart_data = create_dataset($canvas);
|
||||||
var weeks = $canvas.parent().data('weeks');
|
var weeks = $canvas.parent().data('weeks');
|
||||||
var data = {
|
var data = {
|
||||||
|
|
@ -63,10 +62,27 @@ $(function() {
|
||||||
datasets : chart_data
|
datasets : chart_data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var options = get_animation(wholeNumberAxisFix(data), animation);
|
||||||
var ctx = $canvas.get(0).getContext("2d");
|
var ctx = $canvas.get(0).getContext("2d");
|
||||||
new Chart(ctx).Line(data, options);
|
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){
|
function create_dataset($canvas){
|
||||||
var selected = getSelectedConferences($canvas);
|
var selected = getSelectedConferences($canvas);
|
||||||
var chart_data = $canvas.parent().data('chart');
|
var chart_data = $canvas.parent().data('chart');
|
||||||
|
|
|
||||||
|
|
@ -94,3 +94,13 @@ p.comment-body {
|
||||||
.box{
|
.box{
|
||||||
height: 230px;
|
height: 230px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* sidebar hamburger btn */
|
||||||
|
.side-nav-btn{
|
||||||
|
margin-left: 10px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-image{
|
||||||
|
margin-left: 120px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ class PhysicalTicketController < ApplicationController
|
||||||
@file_name = "ticket_for_#{@conference.short_title}"
|
@file_name = "ticket_for_#{@conference.short_title}"
|
||||||
@user = @physical_ticket.user
|
@user = @physical_ticket.user
|
||||||
@ticket_layout = @conference.ticket_layout.to_sym
|
@ticket_layout = @conference.ticket_layout.to_sym
|
||||||
|
@qrcode_image = RQRCode::QRCode.new(@physical_ticket.token).as_png(size: 180, border_modules: 0)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.pdf do
|
format.pdf do
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ class TicketPurchasesController < ApplicationController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
load_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
authorize_resource :conference_registrations, class: Registration
|
authorize_resource :conference_registrations, class: Registration
|
||||||
|
authorize_resource
|
||||||
|
|
||||||
def create
|
def create
|
||||||
current_user.ticket_purchases.by_conference(@conference).unpaid.destroy_all
|
current_user.ticket_purchases.by_conference(@conference).unpaid.destroy_all
|
||||||
|
|
|
||||||
|
|
@ -77,5 +77,9 @@ class TicketPdf < Prawn::Document
|
||||||
move_up 180
|
move_up 180
|
||||||
end
|
end
|
||||||
|
|
||||||
def draw_fourth_square; end
|
def draw_fourth_square
|
||||||
|
x = @mid_horizontal + (@right - @mid_horizontal - 180) / 2
|
||||||
|
y = cursor - (bounds.top - @mid_vertical - 180) / 2
|
||||||
|
print_qr_code(@physical_ticket.token, pos: [x, y], extent: 180, stroke: false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%ul.nav.nav-stacked.nav-pills.mySidebar
|
%ul.nav.nav-stacked.nav-pills.mySidebar.collapse.navbar-collapse#side-nav
|
||||||
.btn-group
|
.btn-group
|
||||||
%button{type:'button', class: 'btn btn-default btn-link dropdown-toggle', 'data-toggle'=>'dropdown'}
|
%button{type:'button', class: 'btn btn-default btn-link dropdown-toggle', 'data-toggle'=>'dropdown'}
|
||||||
%span.fa.fa-cog
|
%span.fa.fa-cog
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
.navbar.navbar-default.navbar-fixed-top.nav-osem{role: 'navigation'}
|
.navbar.navbar-default.navbar-fixed-top.nav-osem{role: 'navigation'}
|
||||||
.container
|
.container
|
||||||
.navbar-header
|
.navbar-header
|
||||||
%button{"data-target"=>".navbar-collapse", "data-toggle"=>"collapse", class: 'navbar-toggle', type: 'button'}
|
- if @conference && @conference.short_title.present?
|
||||||
|
%button{ "data-target"=>"#side-nav", "data-toggle"=>"collapse", class: 'navbar-toggle side-nav-btn', type: 'button' }
|
||||||
|
%span.sr-only Toggle navigation
|
||||||
|
%span.icon-bar
|
||||||
|
%span.icon-bar
|
||||||
|
%span.icon-bar
|
||||||
|
%button{"data-target"=>"#main-nav", "data-toggle"=>"collapse", class: 'navbar-toggle', type: 'button'}
|
||||||
%span.sr-only
|
%span.sr-only
|
||||||
Toggle navigation
|
Toggle navigation
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
|
|
@ -11,7 +17,7 @@
|
||||||
= link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager'
|
= link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager'
|
||||||
- else
|
- else
|
||||||
= link_to conference.organization.name, organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager'
|
= link_to conference.organization.name, organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager'
|
||||||
.collapse.navbar-collapse
|
.collapse.navbar-collapse#main-nav
|
||||||
- if content_for :splash_nav
|
- if content_for :splash_nav
|
||||||
%ul.nav.navbar-nav#splash-nav
|
%ul.nav.navbar-nav#splash-nav
|
||||||
= content_for :splash_nav
|
= content_for :splash_nav
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
= @physical_ticket.ticket_purchase.id
|
= @physical_ticket.ticket_purchase.id
|
||||||
%br
|
%br
|
||||||
.col-md-5.col-md-offset-2.box.well
|
.col-md-5.col-md-offset-2.box.well
|
||||||
|
= image_tag(@qrcode_image.to_data_url, class: 'img-responsive qr-image')
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%p.text-left
|
%p.text-left
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue