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
@@ -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)