Add cmtool to Qwaiter
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
class PagesController < ApplicationController
|
||||
include Cmtool::Includes::PagesController
|
||||
end
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 :active_list_id
|
||||
property :admin, type: :boolean, default: false
|
||||
|
||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :token_authenticatable # , :registerable
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -47,7 +47,8 @@ html lang="en"
|
||||
.alert.alert-success
|
||||
a.close data-dismiss="alert" ×
|
||||
div= flash[:notice]
|
||||
= yield :page_title
|
||||
- if @page && @page.title.present?
|
||||
h1.page-title= @page.title
|
||||
= yield
|
||||
#footer-wrap
|
||||
.footer-shadow
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user