diff --git a/app/assets/javascripts/user/application.js.erb b/app/assets/javascripts/user/application.js.erb index 6866dbcd..7589c2a5 100644 --- a/app/assets/javascripts/user/application.js.erb +++ b/app/assets/javascripts/user/application.js.erb @@ -135,7 +135,7 @@ function redirect_to(mapping, variables){ vars.push(name + '=' +variables[name]); Qstorage.setItem(name, variables[name]); } - window.location = QMobile.root_url() + path_mapping[mapping] + '.html' + window.location.href = QMobile.root_url() + path_mapping[mapping] + '.html' } function direct_to_site(mapping, variables){ variables || (variables = {}); diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 813e2e6a..4d7ad695 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base protect_from_forgery rescue_from SimplyStored::RecordNotFound, with: :show_404 + private def authorize_cmtool @@ -15,11 +16,13 @@ private uri = URI.parse(event_host) Net::HTTP.post_form(uri, :message => message.to_json) end + def broadcast_supplier(sid, event, data = {}) message = {channel: "/supplier/#{sid}", data: {event: event, data: data}} uri = URI.parse(event_host) Net::HTTP.post_form(uri, :message => message.to_json) end + def set_locale I18n.locale = (params[:locale].presence || :nl).to_sym end @@ -31,6 +34,7 @@ private end "theme1" end + def check_active_list_state if current_user.try(:active_list_id) unless active_list.active? @@ -38,7 +42,6 @@ private redirect_to user_root_path, alert: t('messages.the_list_has_been_closed', list: List.model_name.human) end end - end def active_list diff --git a/app/views/user/active_list.html.slim b/app/views/user/active_list.html.slim index 16966741..b7fcefd9 100644 --- a/app/views/user/active_list.html.slim +++ b/app/views/user/active_list.html.slim @@ -22,7 +22,7 @@ td td.currency strong.list-total-amount -script#active-list-order-template[type="text/html"]= render 'active_list_order.mustache' +script#active-list-order-template[type="text/html"]= mustache_template 'active_list_order' - content_for :footer do javascript: jQuery(function(){