Add cmtool to Qwaiter
This commit is contained in:
@@ -37,6 +37,7 @@ gem 'devise', '2.0.4'
|
|||||||
gem 'devise_simply_stored'
|
gem 'devise_simply_stored'
|
||||||
gem 'simple_form'
|
gem 'simple_form'
|
||||||
gem 'draper'
|
gem 'draper'
|
||||||
|
gem 'cmtool', github: 'bterkuile/cmtool'
|
||||||
|
|
||||||
gem 'rqrcode'
|
gem 'rqrcode'
|
||||||
gem 'mini_magick'
|
gem 'mini_magick'
|
||||||
|
|||||||
+66
-33
@@ -1,11 +1,29 @@
|
|||||||
|
GIT
|
||||||
|
remote: git://github.com/bterkuile/cmtool.git
|
||||||
|
revision: 370aa0369e1885dacaac57c911ebd6aded808eee
|
||||||
|
specs:
|
||||||
|
cmtool (0.5.0)
|
||||||
|
bourbon
|
||||||
|
coffee-script
|
||||||
|
devise (= 2.0.4)
|
||||||
|
devise_simply_stored
|
||||||
|
email_validator
|
||||||
|
haml-rails
|
||||||
|
jquery-rails
|
||||||
|
paperclip
|
||||||
|
rails (~> 3.2.2)
|
||||||
|
sass-rails
|
||||||
|
slim-rails
|
||||||
|
tinymce-rails
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/bterkuile/couch_potato.git
|
remote: git://github.com/bterkuile/couch_potato.git
|
||||||
revision: ff7505c432cabfccb55cfa732a548d9449d8250c
|
revision: 7712a8d12c319f2e165733800795acbb599638d2
|
||||||
specs:
|
specs:
|
||||||
couch_potato (0.7.0.pre.1)
|
couch_potato (0.7.1)
|
||||||
activemodel
|
activemodel
|
||||||
couchrest (>= 1.0.1)
|
couchrest (>= 1.0.1)
|
||||||
json (~> 1.6.0)
|
json (~> 1.6)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/bterkuile/simply_stored.git
|
remote: git://github.com/bterkuile/simply_stored.git
|
||||||
@@ -46,10 +64,10 @@ GEM
|
|||||||
activesupport (3.2.11)
|
activesupport (3.2.11)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
addressable (2.3.2)
|
addressable (2.3.3)
|
||||||
arel (3.0.2)
|
arel (3.0.2)
|
||||||
bcrypt-ruby (3.0.1)
|
bcrypt-ruby (3.0.1)
|
||||||
bootstrap-sass (2.3.0.0)
|
bootstrap-sass (2.3.0.1)
|
||||||
sass (~> 3.2)
|
sass (~> 3.2)
|
||||||
bourbon (3.1.1)
|
bourbon (3.1.1)
|
||||||
sass (>= 3.2.0)
|
sass (>= 3.2.0)
|
||||||
@@ -62,17 +80,21 @@ GEM
|
|||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
selenium-webdriver (~> 2.0)
|
selenium-webdriver (~> 2.0)
|
||||||
xpath (~> 1.0.0)
|
xpath (~> 1.0.0)
|
||||||
childprocess (0.3.8)
|
childprocess (0.3.9)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
chunky_png (1.2.7)
|
chunky_png (1.2.7)
|
||||||
coderay (1.0.8)
|
climate_control (0.0.3)
|
||||||
|
activesupport (>= 3.0)
|
||||||
|
cocaine (0.5.1)
|
||||||
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
|
coderay (1.0.9)
|
||||||
coffee-rails (3.2.2)
|
coffee-rails (3.2.2)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.2.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.4.0)
|
coffee-script-source (1.5.0)
|
||||||
compass (0.12.2)
|
compass (0.12.2)
|
||||||
chunky_png (~> 1.2)
|
chunky_png (~> 1.2)
|
||||||
fssm (>= 0.2.7)
|
fssm (>= 0.2.7)
|
||||||
@@ -91,13 +113,15 @@ GEM
|
|||||||
warden (~> 1.1.1)
|
warden (~> 1.1.1)
|
||||||
devise_simply_stored (0.0.3)
|
devise_simply_stored (0.0.3)
|
||||||
devise
|
devise
|
||||||
diff-lcs (1.1.3)
|
diff-lcs (1.2.1)
|
||||||
draper (1.1.0)
|
draper (1.1.0)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
request_store (~> 1.0.3)
|
request_store (~> 1.0.3)
|
||||||
|
email_validator (1.3.0)
|
||||||
|
activemodel
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (1.0.0)
|
eventmachine (1.0.1)
|
||||||
execjs (1.4.0)
|
execjs (1.4.0)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
factory_girl (4.2.0)
|
factory_girl (4.2.0)
|
||||||
@@ -124,12 +148,12 @@ GEM
|
|||||||
haml (>= 3.1, < 4.1)
|
haml (>= 3.1, < 4.1)
|
||||||
railties (>= 3.1, < 4.1)
|
railties (>= 3.1, < 4.1)
|
||||||
hike (1.2.1)
|
hike (1.2.1)
|
||||||
i18n (0.6.1)
|
i18n (0.6.4)
|
||||||
journey (1.0.4)
|
journey (1.0.4)
|
||||||
jquery-rails (2.2.1)
|
jquery-rails (2.2.1)
|
||||||
railties (>= 3.0, < 5.0)
|
railties (>= 3.0, < 5.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.6.7)
|
json (1.7.7)
|
||||||
kaminari (0.14.1)
|
kaminari (0.14.1)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
@@ -140,7 +164,7 @@ GEM
|
|||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
letter_opener (1.1.0)
|
letter_opener (1.1.0)
|
||||||
launchy (~> 2.2.0)
|
launchy (~> 2.2.0)
|
||||||
listen (0.7.2)
|
listen (0.7.3)
|
||||||
lumberjack (1.0.2)
|
lumberjack (1.0.2)
|
||||||
mail (2.4.4)
|
mail (2.4.4)
|
||||||
i18n (>= 0.4.0)
|
i18n (>= 0.4.0)
|
||||||
@@ -150,17 +174,23 @@ GEM
|
|||||||
mime-types (1.21)
|
mime-types (1.21)
|
||||||
mini_magick (3.5.0)
|
mini_magick (3.5.0)
|
||||||
subexec (~> 0.2.1)
|
subexec (~> 0.2.1)
|
||||||
multi_json (1.5.0)
|
multi_json (1.6.1)
|
||||||
mustache (0.99.4)
|
mustache (0.99.4)
|
||||||
nokogiri (1.5.6)
|
nokogiri (1.5.6)
|
||||||
orm_adapter (0.0.7)
|
orm_adapter (0.0.7)
|
||||||
|
paperclip (3.4.1)
|
||||||
|
activemodel (>= 3.0.0)
|
||||||
|
activerecord (>= 3.0.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
|
cocaine (~> 0.5.0)
|
||||||
|
mime-types
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.3)
|
||||||
pry (0.9.12)
|
pry (0.9.12)
|
||||||
coderay (~> 1.0.5)
|
coderay (~> 1.0.5)
|
||||||
method_source (~> 0.8)
|
method_source (~> 0.8)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
quiet_assets (1.0.1)
|
quiet_assets (1.0.2)
|
||||||
railties (~> 3.1)
|
railties (>= 3.1, < 5.0)
|
||||||
rack (1.4.5)
|
rack (1.4.5)
|
||||||
rack-cache (1.2)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
@@ -187,40 +217,40 @@ GEM
|
|||||||
thor (>= 0.14.6, < 2.0)
|
thor (>= 0.14.6, < 2.0)
|
||||||
rake (10.0.3)
|
rake (10.0.3)
|
||||||
rb-fsevent (0.9.3)
|
rb-fsevent (0.9.3)
|
||||||
rdoc (3.12.1)
|
rdoc (3.12.2)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
request_store (1.0.5)
|
request_store (1.0.5)
|
||||||
rest-client (1.6.7)
|
rest-client (1.6.7)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
rqrcode (0.4.2)
|
rqrcode (0.4.2)
|
||||||
rspec (2.12.0)
|
rspec (2.13.0)
|
||||||
rspec-core (~> 2.12.0)
|
rspec-core (~> 2.13.0)
|
||||||
rspec-expectations (~> 2.12.0)
|
rspec-expectations (~> 2.13.0)
|
||||||
rspec-mocks (~> 2.12.0)
|
rspec-mocks (~> 2.13.0)
|
||||||
rspec-core (2.12.2)
|
rspec-core (2.13.0)
|
||||||
rspec-expectations (2.12.1)
|
rspec-expectations (2.13.0)
|
||||||
diff-lcs (~> 1.1.3)
|
diff-lcs (>= 1.1.3, < 2.0)
|
||||||
rspec-mocks (2.12.2)
|
rspec-mocks (2.13.0)
|
||||||
rspec-rails (2.12.2)
|
rspec-rails (2.13.0)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
rspec-core (~> 2.12.0)
|
rspec-core (~> 2.13.0)
|
||||||
rspec-expectations (~> 2.12.0)
|
rspec-expectations (~> 2.13.0)
|
||||||
rspec-mocks (~> 2.12.0)
|
rspec-mocks (~> 2.13.0)
|
||||||
ruby_gntp (0.3.4)
|
ruby_gntp (0.3.4)
|
||||||
rubyzip (0.9.9)
|
rubyzip (0.9.9)
|
||||||
sass (3.2.5)
|
sass (3.2.6)
|
||||||
sass-rails (3.2.6)
|
sass-rails (3.2.6)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
sass (>= 3.1.10)
|
sass (>= 3.1.10)
|
||||||
tilt (~> 1.3)
|
tilt (~> 1.3)
|
||||||
selenium-webdriver (2.29.0)
|
selenium-webdriver (2.31.0)
|
||||||
childprocess (>= 0.2.5)
|
childprocess (>= 0.2.5)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rubyzip
|
rubyzip
|
||||||
websocket (~> 1.0.4)
|
websocket (~> 1.0.4)
|
||||||
simple_form (2.0.4)
|
simple_form (2.1.0)
|
||||||
actionpack (~> 3.0)
|
actionpack (~> 3.0)
|
||||||
activemodel (~> 3.0)
|
activemodel (~> 3.0)
|
||||||
slim (1.3.6)
|
slim (1.3.6)
|
||||||
@@ -248,7 +278,9 @@ GEM
|
|||||||
eventmachine (>= 0.12.6)
|
eventmachine (>= 0.12.6)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
thor (0.17.0)
|
thor (0.17.0)
|
||||||
tilt (1.3.3)
|
tilt (1.3.4)
|
||||||
|
tinymce-rails (3.5.8.1)
|
||||||
|
railties (>= 3.1.1)
|
||||||
treetop (1.4.12)
|
treetop (1.4.12)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
@@ -268,6 +300,7 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bootstrap-sass
|
bootstrap-sass
|
||||||
bourbon
|
bourbon
|
||||||
|
cmtool!
|
||||||
coffee-rails (~> 3.2.1)
|
coffee-rails (~> 3.2.1)
|
||||||
compass-rails
|
compass-rails
|
||||||
couch_potato!
|
couch_potato!
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ class ApplicationController < ActionController::Base
|
|||||||
rescue_from SimplyStored::RecordNotFound, with: :show_404
|
rescue_from SimplyStored::RecordNotFound, with: :show_404
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def authorize_cmtool
|
||||||
|
redirect_to '/', alert: t('general.unauthorized') unless current_user.present? && current_user.admin?
|
||||||
|
end
|
||||||
|
|
||||||
def broadcast_user(uid, event, data = {})
|
def broadcast_user(uid, event, data = {})
|
||||||
message = {channel: "/user/#{uid}", data: {event: event, data: data}}
|
message = {channel: "/user/#{uid}", data: {event: event, data: data}}
|
||||||
uri = URI.parse(event_host)
|
uri = URI.parse(event_host)
|
||||||
|
|||||||
@@ -1,17 +1,5 @@
|
|||||||
class DashboardController < ApplicationController
|
class DashboardController < ApplicationController
|
||||||
layout 'theme1'
|
layout 'theme1'
|
||||||
def home
|
|
||||||
render layout: 'theme1-home'
|
|
||||||
end
|
|
||||||
|
|
||||||
def contact
|
|
||||||
end
|
|
||||||
def bars_restaurants
|
|
||||||
end
|
|
||||||
|
|
||||||
def clients
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def demo_both
|
def demo_both
|
||||||
render layout: 'demo-both'
|
render layout: 'demo-both'
|
||||||
@@ -47,9 +35,4 @@ class DashboardController < ApplicationController
|
|||||||
format.svg { render qrcode: code, level: :h, unit: 10, size: 7}
|
format.svg { render qrcode: code, level: :h, unit: 10, size: 7}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def scan
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
class PagesController < ApplicationController
|
||||||
|
include Cmtool::Includes::PagesController
|
||||||
|
end
|
||||||
@@ -22,7 +22,7 @@ module ApplicationHelper
|
|||||||
super(*args)
|
super(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def are_you_sure?
|
def are_you_sure?(record)
|
||||||
t('helpers.links.are_you_sure')
|
t('helpers.links.are_you_sure')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
class Page
|
||||||
|
include Cmtool::Includes::Page
|
||||||
|
def self.layouts
|
||||||
|
%w[theme1 theme1-home]
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -4,6 +4,7 @@ class User
|
|||||||
|
|
||||||
property :name
|
property :name
|
||||||
property :active_list_id
|
property :active_list_id
|
||||||
|
property :admin, type: :boolean, default: false
|
||||||
|
|
||||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :token_authenticatable # , :registerable
|
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :token_authenticatable # , :registerable
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
= yield :footer
|
= yield :footer
|
||||||
= link_to 'disclaimer', '#'
|
= link_to 'disclaimer', page_path('disclaimer')
|
||||||
'
|
'
|
||||||
= link_to 'privacy', '#'
|
= link_to 'privacy', page_path('privacy')
|
||||||
'
|
'
|
||||||
= link_to 'kernwaarden', '#'
|
= link_to 'kernwaarden', page_path('values')
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ html lang="en"
|
|||||||
.alert.alert-success
|
.alert.alert-success
|
||||||
a.close data-dismiss="alert" ×
|
a.close data-dismiss="alert" ×
|
||||||
div= flash[:notice]
|
div= flash[:notice]
|
||||||
= yield :page_title
|
- if @page && @page.title.present?
|
||||||
|
h1.page-title= @page.title
|
||||||
= yield
|
= yield
|
||||||
#footer-wrap
|
#footer-wrap
|
||||||
.footer-shadow
|
.footer-shadow
|
||||||
|
|||||||
@@ -5,11 +5,9 @@
|
|||||||
span.icon-bar
|
span.icon-bar
|
||||||
|
|
||||||
ul.nav
|
ul.nav
|
||||||
li[class=(current_page?(controller: '/dashboard', action: 'home') ? :active : nil)]= link_to t('menu.home'), root_path
|
li[class=(current_page?(controller: '/pages', action: 'home') ? :active : nil)]= link_to t('menu.home'), root_path
|
||||||
li[class=(current_page?(controller: '/dashboard', action: 'about') ? :active : nil)]= link_to t('menu.about'), about_path
|
li[class=(current_page?(controller: '/pages', action: 'show', name: 'about') ? :active : nil)]= link_to t('menu.about'), page_path('about')
|
||||||
.nav-collapse.collapse
|
.nav-collapse.collapse
|
||||||
ul.nav
|
ul.nav
|
||||||
li[class=(current_page?(controller: '/dashboard', action: 'clients') ? :active : nil)]= link_to t('menu.clients'), clients_path
|
- Page.top_menu.each do |page|
|
||||||
li[class=(current_page?(controller: '/dashboard', action: 'bars_restaurants') ? :active : nil)]= link_to t('menu.bars_restaurants'), bars_restaurants_path
|
li[class=(current_page?(controller: '/pages', action: 'show', name: page.name) ? :active : nil)]= link_to page.menu_text, page_path(page.name)
|
||||||
li[class=(current_page?(controller: '/dashboard', action: 'cartoon') ? :active : nil)]= link_to t('menu.cartoon'), cartoon_path
|
|
||||||
li[class=(current_page?(controller: '/dashboard', action: 'contact') ? :active : nil)]= link_to t('menu.contact'), contact_path
|
|
||||||
|
|||||||
@@ -16,6 +16,17 @@ if defined?(Bundler)
|
|||||||
# Bundler.require(:default, :assets, Rails.env)
|
# Bundler.require(:default, :assets, Rails.env)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Ugly fix for the updated json gem changes
|
||||||
|
module JSON
|
||||||
|
class << self
|
||||||
|
alias :old_parse :parse
|
||||||
|
def parse(json, args = {})
|
||||||
|
args[:create_additions] = true
|
||||||
|
old_parse(json, args)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module Qwaiter
|
module Qwaiter
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
|
|||||||
+13
-8
@@ -61,13 +61,13 @@ Qwaiter::Application.routes.draw do
|
|||||||
|
|
||||||
#match '/show_products' => 'dashboard#show_products', as: :user_products
|
#match '/show_products' => 'dashboard#show_products', as: :user_products
|
||||||
# GENERAL
|
# GENERAL
|
||||||
get '/about' => 'dashboard#about'
|
#get '/about' => 'dashboard#about'
|
||||||
get '/enquete' => 'dashboard#enquete'
|
#get '/enquete' => 'dashboard#enquete'
|
||||||
get '/cartoon' => 'dashboard#cartoon'
|
#get '/cartoon' => 'dashboard#cartoon'
|
||||||
get '/bars-restaurants' => 'dashboard#bars_restaurants', as: :bars_restaurants
|
#get '/bars-restaurants' => 'dashboard#bars_restaurants', as: :bars_restaurants
|
||||||
get '/clients' => 'dashboard#clients'
|
#get '/clients' => 'dashboard#clients'
|
||||||
get '/contact' => 'dashboard#contact'
|
#get '/contact' => 'dashboard#contact'
|
||||||
get '/s' => 'dashboard#scan', as: :scan
|
get '/s' => redirect('/scan'), as: :scan
|
||||||
|
|
||||||
# DEVELOPMENT ONLY
|
# DEVELOPMENT ONLY
|
||||||
get '/qr' => 'dashboard#qr'
|
get '/qr' => 'dashboard#qr'
|
||||||
@@ -100,6 +100,8 @@ Qwaiter::Application.routes.draw do
|
|||||||
#DEMO & DEVELOPMENT
|
#DEMO & DEVELOPMENT
|
||||||
get '/select_qrcode' => 'dashboard#select_qrcode'
|
get '/select_qrcode' => 'dashboard#select_qrcode'
|
||||||
get '/table_qr_image' => 'dashboard#table_qr_image', as: :table_qr_image
|
get '/table_qr_image' => 'dashboard#table_qr_image', as: :table_qr_image
|
||||||
|
|
||||||
|
mount Cmtool::Engine => '/cmtool'
|
||||||
#match "/:action", controller: 'dashboard'
|
#match "/:action", controller: 'dashboard'
|
||||||
|
|
||||||
# The priority is based upon order of creation:
|
# The priority is based upon order of creation:
|
||||||
@@ -151,7 +153,10 @@ Qwaiter::Application.routes.draw do
|
|||||||
|
|
||||||
# You can have the root of your site routed with "root"
|
# You can have the root of your site routed with "root"
|
||||||
# just remember to delete public/index.html.
|
# just remember to delete public/index.html.
|
||||||
root :to => 'dashboard#home'
|
#
|
||||||
|
#root :to => 'dashboard#home'
|
||||||
|
root :to => 'pages#home'
|
||||||
|
get "/:name" => "pages#show", constraints: {name: /.*/}, as: :page
|
||||||
|
|
||||||
# See how all your routes lay out with "rake routes"
|
# See how all your routes lay out with "rake routes"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user