Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _createRowDelivery: function(index, address, carrier, price, anonymous, self_pickup, use_own_carrier, hold_at_depot, sample){
  2. var tb = this.get('deliveryLines');
  3. var tr = $('<tr/>', {'class': 'expandable shown','colspan': '4','id': 'delivery_'+index}).on('click', {'self': this}, this._displayDelivery);
  4. var th = $('<tr/>',{'id': 'deliveryLine_'+index+'_head'}).append($('<td/>', {'html': _t('Address'), 'colspan': '','class': 'tableShow'})).append($('<td/>', {'html': _t('Product'), 'colspan': '2', 'class': 'tableShow'})).append($('<td/>',{'html': _t('Quantity'),'class': 'centered tableShow'})).append($('<td/>',{'class': 'tableShow'}));
  5. tb.append(th);
  6.     if (self_pickup){
  7.         tr.append($('<tr/>')).append($('<td/>', {'html': _t('Self Pickup'), 'colspan': '4', 'class': 'centered'}));
  8.         }
  9.     else{
  10.         address_text = address.id == 0 ? _t('Address not available at the moment') : address.complete_address.replace(/\n/g,'<br/>');
  11.         tr.append($('<tr/>')).append($('<td/>', {'html': (hold_at_depot ? _t("Hold At Depot")+" " : "")+address_text, 'colspan': ''})).append($('<tr/>', {'html': carrier.name+' ('+(use_own_carrier ? _t('own') : _t('company'))+')', 'colspan': ''}));
  12.         }
  13.     tb.append(th);
  14.     var vCheck = {
  15.             'type': 'checkbox',
  16.             'name': 'anonymous',
  17.             'id': 'anonymous_'+index+'_'+this.id,
  18.             };
  19.             var aCheck = $('<input/>', vCheck).on('click', {'self': this, 'index': index}, this._anonymousClick);
  20.             if (anonymous){
  21.                 vCheck['checked'] = true;
  22.             }
  23.     var iButton = $('<button/>', {
  24.             'class': 'button-display',
  25.             'id': 'removeDelivery_'+index+'_0_'+(sample ? 'S' : 'P')+'_'+this.id,
  26.             'name': 'removeDelivery',
  27.             'html': 'cancella spedizione',
  28.             }).on('click', {'self': this}, this._removeDelivery);
  29.         tr.append($('<tr/>', {'id': 'deliveryLine_'+index+'_service','class': 'colorstrip'})).append($('<td/>', {'class': ''}).append(aCheck).append($('<label/>', {'html': _t('Anonymous Box'), 'for': 'anonymous_'+index+'_'+this.id, 'class': 'control-label'}))).append($('<tr/>',{'colspan': '3'}).append(iButton));
  30.     return tb;
  31.         },
  32. _createRowDetDelivery: function(tbody, index, product, quantity, sample){
  33.     var iButton = $('<button/>', {
  34.             'class': 'btn-icon-small',
  35.             'id': 'removeDelivery_'+index+'_'+product.id+'_'+(sample ? 'S' : 'P')+'_'+this.id,
  36.             'name': 'removeDelivery',
  37.             'html': 'd',
  38.         }).on('click', {'self': this}, this._removeDelivery);
  39.     tbody.append($('<tr/>',{'id': 'deliveryLine_'+index+'_'+product.id,'class':'colors', 'colspan': '4'}).append($('<td/>',{'class': 'arrow','colspan': '2','html': product.name+(sample ? ' '+_t('(SAMPLE)') : '')})).append($('<td/>', {'id': 'quantityDelivery_'+index+'_'+product.id+'_'+this.id, 'html': quantity, 'class':'centered'})).append($('<td/>').append(iButton)));
  40.         },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement