|
@@ -25,18 +25,22 @@ swal({{
|
|
|
showCancelButton: true,
|
|
|
inputPlaceholder: "Table number (e.g., 6A)",
|
|
|
preConfirm: function(text){{
|
|
|
- return new Promise(function(resolve, reject) {{
|
|
|
- if (text === false) reject('no');
|
|
|
- else if (text === "") {{
|
|
|
- reject("You need to write something!");
|
|
|
- }}else{{
|
|
|
+ return new Promise(function(resolve) {{
|
|
|
+ if (text === false){{
|
|
|
+ swal.showValidationError('no.');
|
|
|
+ }}
|
|
|
+ else if (text === "") {{
|
|
|
+ swal.showValidationError('You need to write something!');
|
|
|
+ }}
|
|
|
resolve();
|
|
|
- }}}});
|
|
|
+ }});
|
|
|
}}
|
|
|
}}).then(function(text) {{
|
|
|
- queue.set('location', text);
|
|
|
- ''' + addtoqueue + '''
|
|
|
- queue.set('_visible', true);
|
|
|
+ if(typeof text.value !== 'undefined'){{
|
|
|
+ queue.set('location', text.value);
|
|
|
+ ''' + addtoqueue + '''
|
|
|
+ queue.set('_visible', true);
|
|
|
+ }}
|
|
|
}}) : (''' + addtoqueue + ''', queue.set('_visible', true))'''
|
|
|
|
|
|
def queue_buttons(qtype, context):
|
|
@@ -45,6 +49,7 @@ def queue_buttons(qtype, context):
|
|
|
buttons['id'] = '{}_queue_buttons'.format(context['csq_name'])
|
|
|
|
|
|
button = soup.new_tag('button')
|
|
|
+ button['class'] = ['btn', 'btn-catsoop']
|
|
|
button.string = 'Ask for Help'
|
|
|
button['onclick'] = tablenumber_modal.format(
|
|
|
type = 'help',
|
|
@@ -55,6 +60,7 @@ def queue_buttons(qtype, context):
|
|
|
|
|
|
if qtype['qtype'] == 'checkoff':
|
|
|
button = soup.new_tag('button')
|
|
|
+ button['class'] = ['btn', 'btn-catsoop']
|
|
|
button.string = 'Ask for Checkoff'
|
|
|
button['onclick'] = tablenumber_modal.format(
|
|
|
type = 'checkoff',
|