Better cmtool integration
This commit is contained in:
+3
-3
@@ -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)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//= require_self
|
||||
//= require_directory .
|
||||
@import 'foundation_and_overrides'
|
||||
@import ./components/*
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
table
|
||||
&.table
|
||||
width: 100%
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
.theme-button
|
||||
+theme-button
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -12,13 +12,11 @@ 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
|
||||
|
||||
- if defined?(Cmtool)
|
||||
= render 'cmtool/application/menu'
|
||||
- else
|
||||
nav.top-bar
|
||||
ul.title-area
|
||||
li.name: h4= link_to application_title, admin_root_path
|
||||
@@ -47,7 +45,6 @@ html lang="en"
|
||||
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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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|
|
||||
|
||||
@@ -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" ×
|
||||
@@ -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
|
||||
|
||||
+17
-2
@@ -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)
|
||||
|
||||
|
||||
+7
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user