refactor security system
This commit is contained in:
@@ -23,6 +23,7 @@ html lang="en"
|
||||
var event_host = '#{event_host}';
|
||||
var $locale = 'en';
|
||||
var $asset_path = '##assets_path##';
|
||||
var Qstorage = localStorage;
|
||||
- else
|
||||
javascript:
|
||||
var QMobile, Qwaiter, Quser;
|
||||
@@ -30,6 +31,7 @@ html lang="en"
|
||||
var event_host = '#{event_host}';
|
||||
var $locale = 'en';
|
||||
var $asset_path = '/assets/';
|
||||
var Qstorage = localStorage;
|
||||
#{Rails.env.production? ? '' : "data_host = 'http://qwaiter.dev';"}
|
||||
//var data_host = 'http://localhost:3000';
|
||||
QMobile || (QMobile = {
|
||||
@@ -54,7 +56,6 @@ html lang="en"
|
||||
user_id: function(){return this.stored_user_id },
|
||||
log: function(str){console.log(str)}
|
||||
});
|
||||
QMobile.setAuthToken('#{current_user.authentication_token}');QMobile.setUserId('#{current_user.id}');
|
||||
|
||||
body class=action_name
|
||||
- unless ENV['QWAITER_MOBILE_EXPORT'] == 'yes'
|
||||
@@ -82,8 +83,8 @@ html lang="en"
|
||||
.span12
|
||||
= 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'
|
||||
script#alert-template[type="text/html"]= mustache_template 'user/alert'
|
||||
script#join-request-template[type="text/html"]= mustache_template 'user/join_request'
|
||||
= yield :footer
|
||||
javascript:
|
||||
jQuery(function(){#{onload_javascript}});
|
||||
|
||||
@@ -18,12 +18,4 @@
|
||||
script#products-category-template[type="text/html"]= mustache_template 'products_category'
|
||||
script#products-category-for-order-template[type="text/html"]= mustache_template 'products_category_for_order'
|
||||
script#active-order-template[type="text/html"]= mustache_template 'active_order'
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
Quser.handle_active_list(function(){
|
||||
Quser.load_active_list_products();
|
||||
Quser.watch_events();
|
||||
})
|
||||
})
|
||||
|
||||
- onload_javascript 'Quser.handle_active_list(function(){Quser.load_active_list_products();Quser.watch_events()})'
|
||||
|
||||
@@ -8,13 +8,7 @@
|
||||
tr
|
||||
td= slider_image
|
||||
#active-order-container
|
||||
script#products-category-template[type="text/html"]= render 'products_category.mustache'
|
||||
script#products-category-for-order-template[type="text/html"]= render 'products_category_for_order.mustache'
|
||||
script#active-order-template[type="text/html"]= render 'active_order.mustache'
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
Quser.load_table_products();
|
||||
QMobile.activateRotation();
|
||||
})
|
||||
|
||||
script#products-category-template[type="text/html"]= mustache_template 'products_category'
|
||||
script#products-category-for-order-template[type="text/html"]= mustache_template 'products_category_for_order'
|
||||
script#active-order-template[type="text/html"]= mustache_template 'active_order'
|
||||
- onload_javascript 'Quser.load_table_products()'
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
QMobile.setAuthToken('#{current_user.authentication_token}');
|
||||
QMobile.setUserId('#{current_user.id}');
|
||||
QMobile.goHome();
|
||||
= top_bar title: 'obtain_token.title' do
|
||||
span
|
||||
|
||||
.well
|
||||
.alert.alert-warming.user-alert.hide
|
||||
form.form-horizontal
|
||||
.control-group
|
||||
label.control-label data-t='attributes.user.email' Email
|
||||
.controls
|
||||
input#user-email.email type="email" placeholder="Email"
|
||||
.control-group
|
||||
label.control-label data-t='attributes.user.password' Password
|
||||
.controls
|
||||
input#user-password.password type="password" placeholder="Password"
|
||||
.control-group
|
||||
.controls
|
||||
button.btn.btn-primary data-t="obtain_token.obtain" onclick="Quser.authenticate_user(); return false"
|
||||
|
||||
Reference in New Issue
Block a user