event based table join system

This commit is contained in:
2012-12-02 19:53:19 +01:00
parent 926be8ec48
commit e3dc6a7c68
8 changed files with 131 additions and 76 deletions
+1
View File
@@ -77,6 +77,7 @@ html lang="en"
= yield
= javascript_include_tag "user/application"
script#alert-template[type="text/html"]= render 'user/alert.mustache'
script#join-request-template[type="text/html"]= render 'user/join_request.mustache'
= yield :footer
javascript:
jQuery(function(){#{onload_javascript}});
+2 -10
View File
@@ -3,16 +3,8 @@
.form-actions
= link_to t('user.join_occupied_table.back'), user_root_path, class: :btn
'
= link_to t('user.join_occupied_table.show_the_products'), user_root_path(message: 'cannot_identify_table'), class: [:btn, 'btn-primary'], id: 'join_table_products'
button.btn.btn-primary onclick="Quser.show_table_products()" = t('user.join_occupied_table.show_the_products')
'
button.btn.btn-warning{onClick="Quser.join_occupied_table()"} = t('user.join_occupied_table.join_this_table')
#join-occupied-table-progress-container
- content_for :footer do
javascript:
$(function(){
var list_products_for_table_base = '#{raw user_list_products_for_table_path}';
var match = window.document.URL.toString().match('table_id=([0-9a-zA-Z]+)');
if(match){
$('#join_table_products').attr('href', list_products_for_table_base + '?table_id=' + match[1]);
}
});
- onload_javascript 'Quser.watch_events()'