mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 22:21:11 +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
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