diff --git a/Gemfile.lock b/Gemfile.lock index c5f3a5fe..1ec6013c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/bterkuile/cmtool.git - revision: e2f8459960eb4eff12365c6ebd60278d79eaab8f + revision: b0491aa997cca6e791b7352f40e2adf90191a1cd specs: cmtool (1.0.0) bourbon @@ -112,7 +112,7 @@ GEM bcrypt (3.1.10) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bourbon (4.2.0) + bourbon (4.2.1) sass (~> 3.4) thor builder (3.2.2) @@ -376,7 +376,7 @@ GEM ruby-progressbar (1.7.1) rubyzip (1.1.7) safe_yaml (1.0.4) - sass (3.4.11) + sass (3.4.12) sass-rails (5.0.1) railties (>= 4.0.0, < 5.0) sass (~> 3.1) diff --git a/app/assets/stylesheets/admin/application.css.sass b/app/assets/stylesheets/admin/application.css.sass index 63df71fc..117a2731 100644 --- a/app/assets/stylesheets/admin/application.css.sass +++ b/app/assets/stylesheets/admin/application.css.sass @@ -1,4 +1,5 @@ //= require_self //= require_directory . @import 'foundation_and_overrides' +@import ./components/* diff --git a/app/assets/stylesheets/admin/components/_tables.css.sass b/app/assets/stylesheets/admin/components/_tables.css.sass new file mode 100644 index 00000000..88767822 --- /dev/null +++ b/app/assets/stylesheets/admin/components/_tables.css.sass @@ -0,0 +1,3 @@ +table + &.table + width: 100% diff --git a/app/assets/stylesheets/theme1/_mixins.css.sass b/app/assets/stylesheets/theme1/_mixins.css.sass index d4ebd6fa..f2d7e7c2 100644 --- a/app/assets/stylesheets/theme1/_mixins.css.sass +++ b/app/assets/stylesheets/theme1/_mixins.css.sass @@ -18,3 +18,15 @@ .content-container position: relative max-width: $content-max-width +=theme-button + border: none + background: image-url('theme1/button-wood-right.png') 100% 0 no-repeat, image-url('theme1/button-wood-left.png') 0 0 no-repeat, image-url('theme1/button-wood-middle.png') 9px 0 repeat-x + color: white + height: 31px + display: inline-block + padding-left: 8px + padding-right: 8px + line-height: 30px + &:hover + color: white + text-decoration: underline diff --git a/app/assets/stylesheets/theme1/elements/_buttons.css.sass b/app/assets/stylesheets/theme1/elements/_buttons.css.sass new file mode 100644 index 00000000..c25faa89 --- /dev/null +++ b/app/assets/stylesheets/theme1/elements/_buttons.css.sass @@ -0,0 +1,2 @@ +.theme-button + +theme-button diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3a44bf47..6f504392 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -25,6 +25,10 @@ private redirect_to '/', alert: t('general.unauthorized') unless current_user.present? && current_user.admin? end + def cmtool_locale + :en + end + def broadcast_user(uid, event, data = {}) Qwaiter.broadcast_user uid, event, data end @@ -34,7 +38,8 @@ private end def set_locale - I18n.locale = (params[:locale].presence || I18n.default_locale).to_sym + #session[:locale] = (params[:locale].presence || session[:locale] || Rails.configuration.i18n.default_locale).to_sym + I18n.locale = params[:locale].presence.try(:to_sym) || Rails.configuration.i18n.default_locale end def _render_with_renderer_json(resource, options) diff --git a/app/views/admin/suppliers/index.html.slim b/app/views/admin/suppliers/index.html.slim index babe77ca..867e0066 100644 --- a/app/views/admin/suppliers/index.html.slim +++ b/app/views/admin/suppliers/index.html.slim @@ -1,18 +1,16 @@ - model_class = Supplier .page-header= title :index, model_class - if @suppliers.any? - table.table.table-striped.table-hover + table.table thead tr - th= model_class.human_attribute_name(:email) th= model_class.human_attribute_name(:name) th= model_class.human_attribute_name(:created_at) th=t 'helpers.actions.title' tbody - @suppliers.each do |supplier| tr - td= link_to supplier.email, [:admin, supplier] - td= supplier.name + td= link_to supplier.name, [:admin, supplier] td=l supplier.created_at, format: :short td = link_to t('helpers.links.edit'), [:edit, :admin, supplier], class: 'btn btn-mini' diff --git a/app/views/layouts/administrator.html.slim b/app/views/layouts/administrator.html.slim index b9b5f043..f5ce28a2 100644 --- a/app/views/layouts/administrator.html.slim +++ b/app/views/layouts/administrator.html.slim @@ -12,42 +12,39 @@ html lang="en" /[if lt IE 9] = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js" = stylesheet_link_tag "admin/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="images/favicon.ico" rel="shortcut icon" - body - nav.top-bar - ul.title-area - li.name: h4= link_to application_title, admin_root_path - section.top-bar-section - ul.left - li= link_to User.model_name.human_plural, admin_users_path - li= link_to "User Feedback", admin_user_feedbacks_path - li.divider - ul.left - li.has-dropdown.not-click - a href="#" = Supplier.model_name.human_plural - ul.dropdown - li= link_to Supplier.model_name.human_plural, admin_suppliers_path - li= link_to Section.model_name.human_plural, admin_sections_path - li= link_to Table.model_name.human_plural, admin_tables_path - li= link_to Product.model_name.human_plural, admin_products_path - li= link_to List.model_name.human_plural, admin_lists_path - li= link_to Order.model_name.human_plural, admin_orders_path - li= link_to ProductCategory.model_name.human_plural, admin_product_categories_path - li.divider - - if administrator_signed_in? - ul.right - li.divider - li.has-dropdown.not-click - a href="#" = current_administrator.email - ul.dropdown - li.log-out= link_to t('helpers.links.logout'), destroy_administrator_session_path - .container + - if defined?(Cmtool) + = render 'cmtool/application/menu' + - else + nav.top-bar + ul.title-area + li.name: h4= link_to application_title, admin_root_path + section.top-bar-section + ul.left + li= link_to User.model_name.human_plural, admin_users_path + li= link_to "User Feedback", admin_user_feedbacks_path + li.divider + ul.left + li.has-dropdown.not-click + a href="#" = Supplier.model_name.human_plural + ul.dropdown + li= link_to Supplier.model_name.human_plural, admin_suppliers_path + li= link_to Section.model_name.human_plural, admin_sections_path + li= link_to Table.model_name.human_plural, admin_tables_path + li= link_to Product.model_name.human_plural, admin_products_path + li= link_to List.model_name.human_plural, admin_lists_path + li= link_to Order.model_name.human_plural, admin_orders_path + li= link_to ProductCategory.model_name.human_plural, admin_product_categories_path + li.divider + - if administrator_signed_in? + ul.right + li.divider + li.has-dropdown.not-click + a href="#" = current_administrator.email + ul.dropdown + li.log-out= link_to t('helpers.links.logout'), destroy_administrator_session_path + .container .content - if flash[:alert].present? .alert-box.alert @@ -58,10 +55,10 @@ html lang="en" a.close data-dismiss="alert" × div= flash[:notice] .row - .large-9.columns + .small-12.large-9.columns = yield - .large-3.columns - .well.sidebar-nav + .show-for-large-up.large-3.columns + .panel h3= application_title hr ul.side-nav diff --git a/app/views/layouts/theme1-home.html.slim b/app/views/layouts/theme1-home.html.slim index bf0ceeae..a7af0181 100644 --- a/app/views/layouts/theme1-home.html.slim +++ b/app/views/layouts/theme1-home.html.slim @@ -27,15 +27,7 @@ html lang="en" .container .content-top .main-inner - .general-alerts - - if flash[:alert].present? - .flash-box.alert - div= flash[:alert] - a.close data-dismiss="alert" × - - if flash[:notice].present? - .flash-box.notice - div= flash[:notice] - a.close data-dismiss="alert" × + = render 'theme1/alerts' = yield :page_title = yield = render 'theme1/footer' diff --git a/app/views/layouts/theme1.html.slim b/app/views/layouts/theme1.html.slim index 26b63427..24d1a5e9 100644 --- a/app/views/layouts/theme1.html.slim +++ b/app/views/layouts/theme1.html.slim @@ -1,5 +1,5 @@ doctype html -html lang="en" +html lang=I18n.locale head title= site_page_title = render 'meta' @@ -22,14 +22,7 @@ html lang="en" #main-wrap .container .main-inner - - if flash[:alert].present? - .flash-box.alert - div= flash[:alert] - a.close data-dismiss="alert" × - - if flash[:notice].present? - .flash-box.notice - div= flash[:notice] - a.close data-dismiss="alert" × + = render 'theme1/alerts' - if @page && @page.title.present? h1.page-title= @page.title = yield diff --git a/app/views/new_suppliers/new.html.slim b/app/views/new_suppliers/new.html.slim index 7131ab15..79181385 100644 --- a/app/views/new_suppliers/new.html.slim +++ b/app/views/new_suppliers/new.html.slim @@ -1,3 +1,14 @@ +.row + .small-12.columns + ul + li Its free! + li + span To try do the following + ul + li Create and setup a restaurant account + li Open the qr codes page displaying the qr-codes of your created tables + li Download the app on your phone to test as a user + li Scan a qr-code from you restaurant screen with your phone, and you can test ordering products!!! .row .large-7.large-offset-1.columns = form_for @new_supplier do |f| diff --git a/app/views/theme1/_alerts.html.slim b/app/views/theme1/_alerts.html.slim new file mode 100644 index 00000000..f00bd0e6 --- /dev/null +++ b/app/views/theme1/_alerts.html.slim @@ -0,0 +1,8 @@ +- if flash[:alert].present? + .alert-box.warning + = flash[:alert] + a.close data-dismiss="alert" × +- if flash[:notice].present? + .alert-box.info + = flash[:notice] + a.close data-dismiss="alert" × diff --git a/app/views/theme1/_social.html.slim b/app/views/theme1/_social.html.slim index 5a2dd33d..1cf6b9e3 100644 --- a/app/views/theme1/_social.html.slim +++ b/app/views/theme1/_social.html.slim @@ -1,3 +1,4 @@ +a.theme-button Test .social a.wsite-social-facebook href="https://www.facebook.com/mozo.bar" target=:_blank span.wsite-social-inner diff --git a/config/application.rb b/config/application.rb index 663d9acf..15c030b2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -74,8 +74,8 @@ module Qwaiter # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - config.i18n.default_locale = :nl - config.i18n.available_locales = [:nl, :en] + config.i18n.default_locale = :en + config.i18n.available_locales = [:en, :nl] # Configure the default encoding used in templates for Ruby 1.9. config.encoding = "utf-8" @@ -86,6 +86,21 @@ module Qwaiter # Enable escaping HTML in JSON. config.active_support.escape_html_entities_in_json = true + initializer 'mozo.cmtool', after: 'cmtool.build_menu' do + Cmtool::Menu.register do + before :users do + group label: :mozo do # Allow other tools to inject into the mozo menu + title 'Mozo' + resource_link UserFeedback, scope: 'Admin' + resource_link Supplier, scope: 'Admin' + resource_link Section, scope: 'Admin' + resource_link Table, scope: 'Admin' + engine_link Rails.application, title: 'Go to the website', path: '/' + end + end + end + end + config.handlebars.templates_root = %w[supplier/app/templates waiter/app/templates user/app/templates] if defined?(Ember::Rails) && defined?(Handlebars) diff --git a/config/routes.rb b/config/routes.rb index 9d5ac635..95620819 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,4 @@ -ALLOWED_LOCALES = /nl|be|de|fr|en/ +ALLOWED_LOCALES = /nl|de|fr|en|es/ Qwaiter::Application.routes.draw do devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" } #devise_for :suppliers, controllers: { confirmations: 'confirmations', registrations: 'registrations' } @@ -172,12 +172,12 @@ Qwaiter::Application.routes.draw do mount Cmtool::Engine => '/cmtool' - root :to => 'pages#home', defaults: {locale: 'nl'} - get '/:locale' => 'pages#home', constraints: {locale: ALLOWED_LOCALES} - devise_scope :supplier do - get '/:locale/suppliers/sign_up' => 'registrations#new', constraints: {locale: ALLOWED_LOCALES} - end - scope '(/:locale)', constraints: {locale: ALLOWED_LOCALES}, defaults: { locale: 'nl' } do + #get '/:locale' => 'pages#home', constraints: {locale: ALLOWED_LOCALES} + #devise_scope :supplier do + #get '/:locale/suppliers/sign_up' => 'registrations#new', constraints: {locale: ALLOWED_LOCALES} + #end + scope '(/:locale)', constraints: {locale: ALLOWED_LOCALES}, defaults: { locale: 'en' } do + root to: 'pages#home' get "/:name" => "pages#show", constraints: {name: /.*/}, as: :go_to end end