Add cmtool to Qwaiter

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