Refactoring Tickets

- Tickets now independent from registration
- Implemented money gem
#419
This commit is contained in:
Chrisbr 2014-08-28 15:21:05 +02:00
parent 5485fe0e7f
commit 5f8a8ac6d9
63 changed files with 1581 additions and 573 deletions

View file

@ -29,6 +29,7 @@
//= require bootstrap-datetimepicker
//= require osem-datepickers
//= require osem-datatables
//= require osem-tickets
$(document).ready(function() {
$('a[disabled=disabled]').click(function(event){

View file

@ -1,11 +1,14 @@
$(function () {
$(document).ready(function() {
$('#registrations-datatable').dataTable();
} );
});
$(document).ready(function() {
$('#users-datatable').dataTable();
} );
});
$(document).ready(function() {
$('#events-datatable').dataTable();
} );
});
$(document).ready(function() {
$('#buyers-datatable').dataTable();
});
} );

View file

@ -0,0 +1,25 @@
function update_price($this){
var id = $this.data('id');
// Calculate price for row
var value = $this.val();
var price = $('#price_' + id).text();
$('#total_row_' + id).text(value * price);
// Calculate total price
var total = 0;
$('.total_row').each(function( index ) {
total += parseInt($(this).text());
});
$('#total_price').text(total);
}
$( document ).ready(function() {
$('.quantity').each(function() {
update_price($(this));
});
$('.quantity').change(function() {
update_price($(this));
});
});