From 1f84a8908355cec8edf6c762cd8cbf1debbf5cd6 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Wed, 30 Oct 2013 17:28:33 +0100 Subject: [PATCH] Demo milestone --- .../javascripts/supplier/app/templates/section.emblem | 4 ++-- app/assets/javascripts/supplier/application.js | 2 +- .../users/omniauth_callbacks_controller.rb | 5 +++-- app/views/layouts/tablet.html.slim | 4 ---- app/views/suppliers/sections/index.html.slim | 11 +---------- app/views/user/obtain_token.html.slim | 7 ++++++- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/app/assets/javascripts/supplier/app/templates/section.emblem b/app/assets/javascripts/supplier/app/templates/section.emblem index 31a80d38..a06f090d 100644 --- a/app/assets/javascripts/supplier/app/templates/section.emblem +++ b/app/assets/javascripts/supplier/app/templates/section.emblem @@ -1,7 +1,7 @@ .section-manage-tables.pull-right if editmode .btn-group - a.btn.dropdown-toggle data-toggle="dropdown" href="#section-background" + /a.btn.dropdown-toggle data-toggle="dropdown" href="#section-background" span Background span.caret ul#section-background.dropdown-menu @@ -9,7 +9,7 @@ li a{ action setTexture texture } {{texture}} .btn-group - a.btn.dropdown-toggle data-toggle="dropdown" href="#section-actions" + button.btn.dropdown-toggle data-toggle="dropdown" span Action span.caret ul#section-actions.dropdown-menu diff --git a/app/assets/javascripts/supplier/application.js b/app/assets/javascripts/supplier/application.js index d405a1f4..059a4cc4 100644 --- a/app/assets/javascripts/supplier/application.js +++ b/app/assets/javascripts/supplier/application.js @@ -16,7 +16,7 @@ // require bootstrap-tooltip // require bootstrap-popover // require bootstrap-typeahead -// require bootstrap +//= require bootstrap //= require js-routes //= require qwaiter //= require ./qsupplier diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 8ba1d5c4..2211104a 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -10,7 +10,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" - binding.pry + sign_in @user redirect_to user_root_path, :event => :authentication, :current_user => @user else session["devise.facebook_data"] = request.env["omniauth.auth"] @@ -19,6 +19,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController end def failure(env = {}) - binding.pry + #binding.pry + show_404 end end diff --git a/app/views/layouts/tablet.html.slim b/app/views/layouts/tablet.html.slim index 061e8b4e..3d80d7b7 100644 --- a/app/views/layouts/tablet.html.slim +++ b/app/views/layouts/tablet.html.slim @@ -11,10 +11,6 @@ html lang="en" /[if lt IE 9] = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js" = stylesheet_link_tag "supplier/application", :media => "all" - link href="/images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144" - link href="/images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114" - link href="/images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72" - link href="/images/apple-touch-icon.png" rel="apple-touch-icon-precomposed" link href="/favicon.ico" rel="shortcut icon" = render 'suppliers/application/head' = javascript_include_tag "supplier/application" diff --git a/app/views/suppliers/sections/index.html.slim b/app/views/suppliers/sections/index.html.slim index 35963be4..767a291c 100644 --- a/app/views/suppliers/sections/index.html.slim +++ b/app/views/suppliers/sections/index.html.slim @@ -9,7 +9,6 @@ th.table-info data-t='models.plural.table' = Table.model_name.human_plural th.numeric data-t='attributes.section.width' = model_class.human_attribute_name(:width) th.numeric data-t='attributes.section.height' = model_class.human_attribute_name(:height) - th.timestamp data-t='attributes.section.created_at' = model_class.human_attribute_name(:created_at) th.actions data-t='helpers.actions.title' = t 'helpers.actions.title' tbody - @sections.each do |section| @@ -20,15 +19,7 @@ span.active-table-count= (@active_table_ids & section.tables.map(&:id)).size td.numeric= section.width td.numeric= section.height - td.timestamp=l section.created_at, format: :short - td.actions - = link_to t('supplier.section.tables_view.link'), [:tables_view, :suppliers, section], class: 'btn btn-mini btn-info', data: {t: 'section.tables_view.link'} - ' - = link_to t('supplier.section.manage_tables.link'), [:manage_tables, :suppliers, section], class: 'btn btn-mini btn-warning', data: {t: 'section.manage_tables.link'} - ' - = link_to t('helpers.links.edit'), [:edit, :suppliers, section], class: 'btn btn-mini', data: {t: 'helpers.links.edit'} - ' - = link_to t("helpers.links.destroy"), [:suppliers, section], method: :delete, data: {confirm: are_you_sure?, t: 'helpers.links.destroy'}, class: 'btn btn-mini btn-danger' + td.actions = link_to t("helpers.links.destroy"), [:suppliers, section], method: :delete, data: {confirm: are_you_sure?, t: 'helpers.links.destroy'}, class: 'btn btn-mini btn-danger' - else = no_content_given model_class .form-actions diff --git a/app/views/user/obtain_token.html.slim b/app/views/user/obtain_token.html.slim index faca970f..8c09b0a8 100644 --- a/app/views/user/obtain_token.html.slim +++ b/app/views/user/obtain_token.html.slim @@ -1,6 +1,6 @@ = top_bar title: 'obtain_token.title' do span - + .well .alert.alert-warming.user-alert.hide form.form-horizontal @@ -15,3 +15,8 @@ .control-group .controls button.btn.btn-primary data-t="obtain_token.obtain" onclick="Quser.authenticate_user(); return false" +- unless current_user.blank? || ENV['QWAITER_MOBILE_EXPORT']=='yes' + javascript: + Qstorage.setItem('auth_token', '#{current_user.authentication_token}'); + Qstorage.setItem('user_id', '#{current_user.id}'); + window.location = '#{user_root_path}';