doctype html
html lang="en"
  head
    meta charset="utf-8"
    meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"
    meta name="viewport" content="width=device-width, initial-scale=1.0"
    title Qwaiter
    = stylesheet_link_tag "user/foundation/application"
    = javascript_include_tag "vendor/modernizr"
    = javascript_include_tag 'http://connect.facebook.net/en_US/all.js'
    = javascript_include_tag "user/flat/application"
    - if ENV['QWAITER_MOBILE_EXPORT'] == 'yes'
      javascript:
        var QMobile, Qwaiter, Quser;
        var $data_host = 'http://data.qwaiter.com';
        var $event_host = '#{Qwaiter.event_host}';
        var $asset_path = '##assets_path##';
        var Qstorage = localStorage;
        var $root_url = 'http://www.qwaiter.com/user';
    - else
      javascript:
        var QMobile, Qwaiter, Quser;
        var $event_host = '#{Qwaiter.event_host}';
        var $asset_path = '/assets/';
        var Qstorage = localStorage;
        #{user_dynamic_data_host};
        #{user_dynamic_root_url};
        QMobile || (QMobile = {
          scanQr: function(){window.location = '/select_qrcode'},
          activateRotation: function(){},
          mobile: function(){return false},
          authentication_string: function(){return this.authentication_string_storage || ''},
          authentication_object: function(){return this.authentication_object_storage || '{}'},
          setAuthToken: function(token){
            this.auth_token = token;
            this.authentication_string_storage = 'auth_token='+token;
            this.authentication_object_storage = '{"auth_token": "'+token+'"}'
          },
          root_url: function(){return 'file:///Users/bterkuile/Documents/workspace/Qwaiter/assets/user'},
          $root_url: function(){return '/user'},
          goHome: function(){ redirect_to('user_root')},
          connection_problem: function(){alert('There is a problem connecting to the server')},
          token: function(){return this.auth_token},
          setUserId: function(id){ this.stored_user_id = id},
          user_id: function(){return this.stored_user_id },
          log: function(str){console.log(str)}
        });
  body
    #ember-app-container
