mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Refactoring Tickets
- Tickets now independent from registration - Implemented money gem #419
This commit is contained in:
parent
5485fe0e7f
commit
5f8a8ac6d9
63 changed files with 1581 additions and 573 deletions
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
} );
|
||||
|
|
|
|||
25
app/assets/javascripts/osem-tickets.js
Normal file
25
app/assets/javascripts/osem-tickets.js
Normal 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));
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue