Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_material_ui

This commit is contained in:
Aung Myo
2017-11-08 09:32:25 +06:30
36 changed files with 611 additions and 107 deletions

View File

@@ -0,0 +1,458 @@
if (typeof jQuery === "undefined") {
throw new Error("jQuery plugins need to be before this file");
}
$.AdminBSB = {};
$.AdminBSB.options = {
colors: {
red: '#F44336',
pink: '#E91E63',
purple: '#9C27B0',
deepPurple: '#673AB7',
indigo: '#3F51B5',
blue: '#2196F3',
lightBlue: '#03A9F4',
cyan: '#00BCD4',
teal: '#009688',
green: '#4CAF50',
lightGreen: '#8BC34A',
lime: '#CDDC39',
yellow: '#ffe821',
amber: '#FFC107',
orange: '#FF9800',
deepOrange: '#FF5722',
brown: '#795548',
grey: '#9E9E9E',
blueGrey: '#607D8B',
black: '#000000',
white: '#ffffff'
},
leftSideBar: {
scrollColor: 'rgba(0,0,0,0.5)',
scrollWidth: '4px',
scrollAlwaysVisible: false,
scrollBorderRadius: '0',
scrollRailBorderRadius: '0',
scrollActiveItemWhenPageLoad: true,
breakpointWidth: 2230 //1170
},
dropdownMenu: {
effectIn: 'fadeIn',
effectOut: 'fadeOut'
}
}
/* Left Sidebar - Function =================================================================================================
* You can manage the left sidebar menu options
*
*/
$.AdminBSB.leftSideBar = {
activate: function () {
var _this = this;
var $body = $('body');
var $overlay = $('.overlay');
//Close sidebar
$(window).click(function (e) {
var $target = $(e.target);
if (e.target.nodeName.toLowerCase() === 'i') { $target = $(e.target).parent(); }
if (!$target.hasClass('bars') && _this.isOpen() && $target.parents('#leftsidebar').length === 0) {
if (!$target.hasClass('js-right-sidebar')) $overlay.fadeOut();
$body.removeClass('overlay-open');
}
});
$.each($('.menu-toggle.toggled'), function (i, val) {
$(val).next().slideToggle(0);
});
//When page load
$.each($('.menu .list li.active'), function (i, val) {
var $activeAnchors = $(val).find('a:eq(0)');
$activeAnchors.addClass('toggled');
$activeAnchors.next().show();
});
//Collapse or Expand Menu
$('.menu-toggle').on('click', function (e) {
var $this = $(this);
var $content = $this.next();
if ($($this.parents('ul')[0]).hasClass('list')) {
var $not = $(e.target).hasClass('menu-toggle') ? e.target : $(e.target).parents('.menu-toggle');
$.each($('.menu-toggle.toggled').not($not).next(), function (i, val) {
if ($(val).is(':visible')) {
$(val).prev().toggleClass('toggled');
$(val).slideUp();
}
});
}
$this.toggleClass('toggled');
$content.slideToggle(320);
});
//Set menu height
_this.setMenuHeight();
_this.checkStatuForResize(true);
$(window).resize(function () {
_this.setMenuHeight();
_this.checkStatuForResize(false);
});
//Set Waves
Waves.attach('.menu .list a', ['waves-block']);
Waves.init();
},
setMenuHeight: function (isFirstTime) {
if (typeof $.fn.slimScroll != 'undefined') {
var configs = $.AdminBSB.options.leftSideBar;
var height = ($(window).height() - ($('.legal').outerHeight() + $('.user-info').outerHeight() + $('.navbar').innerHeight()));
var $el = $('.list');
$el.slimscroll({
height: height + "px",
color: configs.scrollColor,
size: configs.scrollWidth,
alwaysVisible: configs.scrollAlwaysVisible,
borderRadius: configs.scrollBorderRadius,
railBorderRadius: configs.scrollRailBorderRadius
});
//Scroll active menu item when page load, if option set = true
if ($.AdminBSB.options.leftSideBar.scrollActiveItemWhenPageLoad) {
var activeItemOffsetTop = $('.menu .list li.active')[0].offsetTop
if (activeItemOffsetTop > 150) $el.slimscroll({ scrollTo: activeItemOffsetTop + 'px' });
}
}
},
checkStatuForResize: function (firstTime) {
var $body = $('body');
var $openCloseBar = $('.navbar .navbar-header .bars');
var width = $body.width();
if (firstTime) {
$body.find('.content, .sidebar').addClass('no-animate').delay(1000).queue(function () {
$(this).removeClass('no-animate').dequeue();
});
}
if (width < $.AdminBSB.options.leftSideBar.breakpointWidth) {
$body.addClass('ls-closed');
$openCloseBar.fadeIn();
}
else {
$body.removeClass('ls-closed');
$openCloseBar.fadeOut();
}
},
isOpen: function () {
return $('body').hasClass('overlay-open');
}
};
//==========================================================================================================================
/* Right Sidebar - Function ================================================================================================
* You can manage the right sidebar menu options
*
*/
$.AdminBSB.rightSideBar = {
activate: function () {
var _this = this;
var $sidebar = $('#rightsidebar');
var $overlay = $('.overlay');
//Close sidebar
$(window).click(function (e) {
var $target = $(e.target);
if (e.target.nodeName.toLowerCase() === 'i') { $target = $(e.target).parent(); }
if (!$target.hasClass('js-right-sidebar') && _this.isOpen() && $target.parents('#rightsidebar').length === 0) {
if (!$target.hasClass('bars')) $overlay.fadeOut();
$sidebar.removeClass('open');
}
});
$('.js-right-sidebar').on('click', function () {
$sidebar.toggleClass('open');
if (_this.isOpen()) { $overlay.fadeIn(); } else { $overlay.fadeOut(); }
});
},
isOpen: function () {
return $('.right-sidebar').hasClass('open');
}
}
//==========================================================================================================================
/* Searchbar - Function ================================================================================================
* You can manage the search bar
*
*/
var $searchBar = $('.search-bar');
$.AdminBSB.search = {
activate: function () {
var _this = this;
//Search button click event
$('.js-search').on('click', function () {
_this.showSearchBar();
});
//Close search click event
$searchBar.find('.close-search').on('click', function () {
_this.hideSearchBar();
});
//ESC key on pressed
$searchBar.find('input[type="text"]').on('keyup', function (e) {
if (e.keyCode == 27) {
_this.hideSearchBar();
}
});
},
showSearchBar: function () {
$searchBar.addClass('open');
$searchBar.find('input[type="text"]').focus();
},
hideSearchBar: function () {
$searchBar.removeClass('open');
$searchBar.find('input[type="text"]').val('');
}
}
//==========================================================================================================================
/* Navbar - Function =======================================================================================================
* You can manage the navbar
*
*/
$.AdminBSB.navbar = {
activate: function () {
var $body = $('body');
var $overlay = $('.overlay');
//Open left sidebar panel
$('.bars').on('click', function () {
$body.toggleClass('overlay-open');
if ($body.hasClass('overlay-open')) { $overlay.fadeIn(); } else { $overlay.fadeOut(); }
});
//Close collapse bar on click event
$('.nav [data-close="true"]').on('click', function () {
var isVisible = $('.navbar-toggle').is(':visible');
var $navbarCollapse = $('.navbar-collapse');
if (isVisible) {
$navbarCollapse.slideUp(function () {
$navbarCollapse.removeClass('in').removeAttr('style');
});
}
});
}
}
//==========================================================================================================================
/* Input - Function ========================================================================================================
* You can manage the inputs(also textareas) with name of class 'form-control'
*
*/
$.AdminBSB.input = {
activate: function () {
//On focus event
$('.form-control').focus(function () {
$(this).parent().addClass('focused');
});
//On focusout event
$('.form-control').focusout(function () {
var $this = $(this);
if ($this.parents('.form-group').hasClass('form-float')) {
if ($this.val() == '') { $this.parents('.form-line').removeClass('focused'); }
}
else {
$this.parents('.form-line').removeClass('focused');
}
});
//On label click
$('body').on('click', '.form-float .form-line .form-label', function () {
$(this).parent().find('input').focus();
});
//Not blank form
$('.form-control').each(function () {
if ($(this).val() !== '') {
$(this).parents('.form-line').addClass('focused');
}
});
}
}
//==========================================================================================================================
/* Form - Select - Function ================================================================================================
* You can manage the 'select' of form elements
*
*/
$.AdminBSB.select = {
activate: function () {
if ($.fn.selectpicker) { $('select:not(.ms)').selectpicker(); }
}
}
//==========================================================================================================================
/* DropdownMenu - Function =================================================================================================
* You can manage the dropdown menu
*
*/
$.AdminBSB.dropdownMenu = {
activate: function () {
var _this = this;
$('.dropdown, .dropup, .btn-group').on({
"show.bs.dropdown": function () {
var dropdown = _this.dropdownEffect(this);
_this.dropdownEffectStart(dropdown, dropdown.effectIn);
},
"shown.bs.dropdown": function () {
var dropdown = _this.dropdownEffect(this);
if (dropdown.effectIn && dropdown.effectOut) {
_this.dropdownEffectEnd(dropdown, function () { });
}
},
"hide.bs.dropdown": function (e) {
var dropdown = _this.dropdownEffect(this);
if (dropdown.effectOut) {
e.preventDefault();
_this.dropdownEffectStart(dropdown, dropdown.effectOut);
_this.dropdownEffectEnd(dropdown, function () {
dropdown.dropdown.removeClass('open');
});
}
}
});
//Set Waves
Waves.attach('.dropdown-menu li a', ['waves-block']);
Waves.init();
},
dropdownEffect: function (target) {
var effectIn = $.AdminBSB.options.dropdownMenu.effectIn, effectOut = $.AdminBSB.options.dropdownMenu.effectOut;
var dropdown = $(target), dropdownMenu = $('.dropdown-menu', target);
if (dropdown.length > 0) {
var udEffectIn = dropdown.data('effect-in');
var udEffectOut = dropdown.data('effect-out');
if (udEffectIn !== undefined) { effectIn = udEffectIn; }
if (udEffectOut !== undefined) { effectOut = udEffectOut; }
}
return {
target: target,
dropdown: dropdown,
dropdownMenu: dropdownMenu,
effectIn: effectIn,
effectOut: effectOut
};
},
dropdownEffectStart: function (data, effectToStart) {
if (effectToStart) {
data.dropdown.addClass('dropdown-animating');
data.dropdownMenu.addClass('animated dropdown-animated');
data.dropdownMenu.addClass(effectToStart);
}
},
dropdownEffectEnd: function (data, callback) {
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
data.dropdown.one(animationEnd, function () {
data.dropdown.removeClass('dropdown-animating');
data.dropdownMenu.removeClass('animated dropdown-animated');
data.dropdownMenu.removeClass(data.effectIn);
data.dropdownMenu.removeClass(data.effectOut);
if (typeof callback == 'function') {
callback();
}
});
}
}
//==========================================================================================================================
/* Browser - Function ======================================================================================================
* You can manage browser
*
*/
var edge = 'Microsoft Edge';
var ie10 = 'Internet Explorer 10';
var ie11 = 'Internet Explorer 11';
var opera = 'Opera';
var firefox = 'Mozilla Firefox';
var chrome = 'Google Chrome';
var safari = 'Safari';
$.AdminBSB.browser = {
activate: function () {
var _this = this;
var className = _this.getClassName();
if (className !== '') $('html').addClass(_this.getClassName());
},
getBrowser: function () {
var userAgent = navigator.userAgent.toLowerCase();
if (/edge/i.test(userAgent)) {
return edge;
} else if (/rv:11/i.test(userAgent)) {
return ie11;
} else if (/msie 10/i.test(userAgent)) {
return ie10;
} else if (/opr/i.test(userAgent)) {
return opera;
} else if (/chrome/i.test(userAgent)) {
return chrome;
} else if (/firefox/i.test(userAgent)) {
return firefox;
} else if (!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)) {
return safari;
}
return undefined;
},
getClassName: function () {
var browser = this.getBrowser();
if (browser === edge) {
return 'edge';
} else if (browser === ie11) {
return 'ie11';
} else if (browser === ie10) {
return 'ie10';
} else if (browser === opera) {
return 'opera';
} else if (browser === chrome) {
return 'chrome';
} else if (browser === firefox) {
return 'firefox';
} else if (browser === safari) {
return 'safari';
} else {
return '';
}
}
}
//==========================================================================================================================
$(document).on('turbolinks:load', function() {
$.AdminBSB.browser.activate();
$.AdminBSB.leftSideBar.activate();
$.AdminBSB.rightSideBar.activate();
$.AdminBSB.navbar.activate();
$.AdminBSB.dropdownMenu.activate();
$.AdminBSB.input.activate();
$.AdminBSB.select.activate();
$.AdminBSB.search.activate();
setTimeout(function () { $('.page-loader-wrapper').fadeOut(); }, 50);
});

View File

@@ -22,7 +22,7 @@
//= require bootstrap-notify/bootstrap-notify.js
//= require node-waves/waves.js
//= require sweetalert/sweetalert.min.js
//= require BSBMaterial/admin.js
//= require BSBMaterial/turbolink_admin.js
//= require BSBMaterial/demo.js
//= require custom.js

View File

@@ -20,7 +20,7 @@
//= require jquery-slimscroll/jquery.slimscroll.js
//= require node-waves/waves.js
//= require sweetalert/sweetalert.min.js
//= require BSBMaterial/admin.js
//= require BSBMaterial/turbolink_admin.js
//= require BSBMaterial/demo.js
//= require custom.js

View File

@@ -38,8 +38,7 @@ $(document).ready(function() {
$.ajax({
type: method,
url: url ,
success: function(data) {
console.log(data.url);
success: function(data) {
location.href = data.url;
}
});

View File

@@ -7,6 +7,6 @@
//= require jquery-slimscroll/jquery.slimscroll.js
//= require node-waves/waves.js
//= require sweetalert/sweetalert.min.js
//= require BSBMaterial/admin.js
//= require BSBMaterial/turbolink_admin.js
//= require BSBMaterial/demo.js
//= require custom.js

View File

@@ -11,7 +11,7 @@
//= require sweetalert/sweetalert.min.js
//= require cable
//= require turbolinks
//= require BSBMaterial/admin.js
//= require BSBMaterial/turbolink_admin.js
//= require BSBMaterial/demo.js
//= require custom.js

View File

@@ -55,10 +55,12 @@ class Settings::AccountsController < ApplicationController
# DELETE /settings/accounts/1.json
def destroy
@settings_account.destroy
respond_to do |format|
format.html { redirect_to settings_accounts_url, notice: 'Account was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Account was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_accounts_url }.to_json
# respond_to do |format|
# format.html { redirect_to settings_accounts_url, notice: 'Account was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -56,10 +56,12 @@ class Settings::CashierTerminalsController < ApplicationController
# DELETE /settings/cashier_terminals/1.json
def destroy
@settings_cashier_terminal.destroy
respond_to do |format|
format.html { redirect_to settings_cashier_terminals_path, notice: 'Cashier terminal was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Cashier terminal was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_cashier_terminals_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_cashier_terminals_path, notice: 'Cashier terminal was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -63,10 +63,12 @@ class Settings::CommissionersController < ApplicationController
# DELETE /commissioners/1.json
def destroy
@commissioner.destroy
respond_to do |format|
format.html {redirect_to settings_commissioners_path, notice: 'Commissioner was successfully destroyed.'}
format.json {head :no_content}
end
flash[:notice] = 'Commissioner was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_commissioners_path }.to_json
# respond_to do |format|
# format.html {redirect_to settings_commissioners_path, notice: 'Commissioner was successfully destroyed.'}
# format.json {head :no_content}
# end
end
def get_transaction_by_commissioner

View File

@@ -60,10 +60,12 @@ class Settings::CommissionsController < ApplicationController
# DELETE /commissions/1.json
def destroy
@commission.destroy
respond_to do |format|
format.html {redirect_to settings_commissions_path, notice: 'Commission was successfully destroyed.'}
format.json {head :no_content}
end
flash[:notice] = 'Commission was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_commissions_path }.to_json
# respond_to do |format|
# format.html {redirect_to settings_commissions_path, notice: 'Commission was successfully destroyed.'}
# format.json {head :no_content}
# end
end
private

View File

@@ -72,10 +72,12 @@ class Settings::DiningChargesController < ApplicationController
# DELETE /dining_charges/1.json
def destroy
@dining_charge.destroy
respond_to do |format|
format.html { redirect_to dining_charges_url, notice: 'Dining charge was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Dining charge was successfully destroyed.'
render :json => {:status=> "Success", :url => dining_charges_url }.to_json
# respond_to do |format|
# format.html { redirect_to dining_charges_url, notice: 'Dining charge was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -53,9 +53,11 @@ class Settings::EmployeesController < ApplicationController
# DELETE /employees/1.json
def destroy
@employee.destroy
respond_to do |format|
format.html { redirect_to settings_employees_url, notice: 'Employee was successfully destroyed.' }
end
flash[:notice] = 'Employee was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_employees_url }.to_json
# respond_to do |format|
# format.html { redirect_to settings_employees_url, notice: 'Employee was successfully destroyed.' }
# end
end
private

View File

@@ -55,10 +55,12 @@ class Settings::ItemSetsController < ApplicationController
# DELETE /settings/item_sets/1.json
def destroy
@settings_item_set.destroy
respond_to do |format|
format.html { redirect_to settings_item_sets_url, notice: 'Item set was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Item set was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_item_sets_url }.to_json
# respond_to do |format|
# format.html { redirect_to settings_item_sets_url, notice: 'Item set was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -56,10 +56,12 @@ class Settings::MembershipActionsController < ApplicationController
# DELETE /settings/membership_actions/1.json
def destroy
@settings_membership_action.destroy
respond_to do |format|
format.html { redirect_to settings_membership_actions_url, notice: 'Membership action was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Membership action was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_membership_actions_url }.to_json
# respond_to do |format|
# format.html { redirect_to settings_membership_actions_url, notice: 'Membership action was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -56,10 +56,12 @@ class Settings::MembershipSettingsController < ApplicationController
# DELETE /settings/membership_settings/1.json
def destroy
@settings_membership_setting.destroy
respond_to do |format|
format.html { redirect_to settings_membership_settings_path, notice: 'Membership setting was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Membership setting was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_membership_settings_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_membership_settings_path, notice: 'Membership setting was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -72,10 +72,12 @@ class Settings::MenuCategoriesController < ApplicationController
# @settings_menu_category.destroy
abc = MenuCategory.destroyCategory(@settings_menu_category)
respond_to do |format|
format.html { redirect_to settings_menu_categories_path, notice: 'Menu category was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Menu category was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_menu_categories_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_menu_categories_path, notice: 'Menu category was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -56,10 +56,12 @@ class Settings::MenuItemAttributesController < ApplicationController
# DELETE /settings/menu_item_attributes/1.json
def destroy
@settings_menu_item_attribute.destroy
respond_to do |format|
format.html { redirect_to settings_menu_item_attributes_path, notice: 'Menu item attribute was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Menu item attribute was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_menu_item_attributes_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_menu_item_attributes_path, notice: 'Menu item attribute was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -134,8 +134,9 @@ class Settings::MenuItemInstancesController < ApplicationController
item = MenuItem.find(catID.menu_item_id)
category = MenuCategory.find(item.menu_category_id)
end
flash[:notice] = 'Menu item instance was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_item_path(category,catID) }.to_json
# respond_to do |format|
# respond_to do |format|
# format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully destroyed.' }
# format.json { head :no_content }
# end

View File

@@ -56,10 +56,12 @@ class Settings::MenuItemOptionsController < ApplicationController
# DELETE /settings/menu_item_options/1.json
def destroy
@settings_menu_item_option.destroy
respond_to do |format|
format.html { redirect_to settings_menu_item_options_path, notice: 'Menu item option was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Menu item option was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_menu_item_options_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_menu_item_options_path, notice: 'Menu item option was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -55,10 +55,12 @@ class Settings::MenuItemSetsController < ApplicationController
# DELETE /settings/menu_item_sets/1.json
def destroy
@settings_menu_item_set.destroy
respond_to do |format|
format.html { redirect_to settings_menu_item_sets_url, notice: 'Menu item set was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Menu item set was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_menu_item_sets_url }.to_json
# respond_to do |format|
# format.html { redirect_to settings_menu_item_sets_url, notice: 'Menu item set was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -58,10 +58,13 @@ class Settings::MenusController < ApplicationController
def destroy
# @settings_menu.destroy
abc = Menu.destroyMenu(@settings_menu)
respond_to do |format|
format.html { redirect_to settings_menus_path, notice: 'Menu was successfully destroyed.' }
format.json { head :no_content }
end
@settings_menu_item_set.destroy
flash[:notice] = 'Menu was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_menus_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_menus_path, notice: 'Menu was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -59,10 +59,12 @@ class Settings::OrderQueueStationsController < ApplicationController
# DELETE /settings/order_queue_stations/1.json
def destroy
@settings_order_queue_station.destroy
respond_to do |format|
format.html { redirect_to settings_order_queue_stations_url, notice: 'Order queue station was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Order queue station was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_order_queue_stations_url }.to_json
# respond_to do |format|
# format.html { redirect_to settings_order_queue_stations_url, notice: 'Order queue station was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -56,10 +56,12 @@ class Settings::PaymentMethodSettingsController < ApplicationController
# DELETE /settings/payment_method_settings/1.json
def destroy
@settings_payment_method_setting.destroy
respond_to do |format|
format.html { redirect_to settings_payment_method_settings_path, notice: 'Payment method setting was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Payment method setting was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_payment_method_settings_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_payment_method_settings_path, notice: 'Payment method setting was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -57,10 +57,12 @@ load_and_authorize_resource except: [:create]
# DELETE /settings/products/1.json
def destroy
@settings_product.destroy
respond_to do |format|
format.html { redirect_to settings_products_path, notice: 'Product was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Product was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_products_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_products_path, notice: 'Product was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -55,10 +55,12 @@ class Settings::PromotionProductsController < ApplicationController
# DELETE /promotion_products/1.json
def destroy
@promotion_product.destroy
respond_to do |format|
format.html { redirect_to edit_settings_promotion_path(@promotion) , notice: 'PromotionProduct was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Promotion Product was successfully destroyed.'
render :json => {:status=> "Success", :url => edit_settings_promotion_path(@promotion) }.to_json
# respond_to do |format|
# format.html { redirect_to edit_settings_promotion_path(@promotion) , notice: 'PromotionProduct was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -74,10 +74,12 @@ class Settings::PromotionsController < ApplicationController
pp.destroy
end
@promotion.destroy
respond_to do |format|
format.html { redirect_to settings_promotions_path, notice: 'Promotion was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Promotion was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_promotions_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_promotions_path, notice: 'Promotion was successfully destroyed.' }
# format.json { head :no_content }
# end
end
def find_item_instance

View File

@@ -60,10 +60,12 @@ class Settings::RoomsController < ApplicationController
# DELETE /settings/rooms/1.json
def destroy
@settings_room.destroy
respond_to do |format|
format.html { redirect_to settings_zone_path(@zone), notice: 'Room was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Room was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_zone_path(@zone) }.to_json
# respond_to do |format|
# format.html { redirect_to settings_zone_path(@zone), notice: 'Room was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -112,6 +112,7 @@ class Settings::SetMenuItemsController < ApplicationController
File.delete(path_to_file) if File.exist?(path_to_file)
abc = MenuItem.deleteRecursive(@settings_menu_item)
flash[:notice] = 'Menu item was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_items_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_menu_category_set_menu_items_path(category_id,item_id), notice: 'Menu item was successfully destroyed.' }

View File

@@ -59,10 +59,12 @@ class Settings::TablesController < ApplicationController
# DELETE /settings/tables/1.json
def destroy
@settings_table.destroy
respond_to do |format|
format.html { redirect_to settings_zone_path(@zone), notice: 'Table was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Table was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_zone_path(@zone) }.to_json
# respond_to do |format|
# format.html { redirect_to settings_zone_path(@zone), notice: 'Table was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -57,10 +57,12 @@ class Settings::TaxProfilesController < ApplicationController
# DELETE /settings/tax_profiles/1.json
def destroy
@settings_tax_profile.destroy
respond_to do |format|
format.html { redirect_to settings_tax_profiles_url, notice: 'Tax profile was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Tax profile was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_tax_profiles_url }.to_json
# respond_to do |format|
# format.html { redirect_to settings_tax_profiles_url, notice: 'Tax profile was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -61,10 +61,12 @@ class Settings::ZonesController < ApplicationController
@settings_zone.rooms.destroy
@settings_zone.tables.destroy
@settings_zone.destroy
respond_to do |format|
format.html { redirect_to settings_zones_path, notice: 'Zone was successfully destroyed.' }
format.json { head :no_content }
end
flash[:notice] = 'Zone was successfully destroyed.'
render :json => {:status=> "Success", :url => settings_zones_path }.to_json
# respond_to do |format|
# format.html { redirect_to settings_zones_path, notice: 'Zone was successfully destroyed.' }
# format.json { head :no_content }
# end
end
private

View File

@@ -49,7 +49,7 @@
<!-- tabs - End -->
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<%= link_to t("views.btn.new"),new_crm_dining_queue_path,:class => 'btn bg-green btn-block btn-lg btn-block' %>
<%= link_to t("views.btn.new"),new_crm_dining_queue_path,:class => 'btn bg-green btn-block btn-lg btn-block', 'data-no-turbolink' => true %>
<hr>
<button type="button" id="assign" class="btn btn-primary btn-block btn-lg waves-effect" disabled>Assign</button>

View File

@@ -30,7 +30,7 @@
<ul class="dropdown-menu">
<li>
<%if current_login_employee.role !="waiter" %>
<p class="delete waves-effect waves-block" style="padding:0.5rem 1rem; margin-bottom: 0rem;" data-ref="<%=logout_path%>" data-method="delete">Logout</p>
<p class="delete waves-effect waves-block" style="padding:0.5rem 1rem; margin-bottom: 0rem;" data-ref="<%=logout_path%>" data-method="delete">Logout</p>
<span class="hidden" id="delete_text">
<h6>Are you sure you want to Logout ?</h6>
<!-- <h6>This action can't be undo. </h6> -->

View File

@@ -124,7 +124,6 @@
<script>
$(document).ready(function(){
$(".tables").on('click', function(){
console.log("hi");
var dining_id = $(this).attr("data-id");
window.location.href = '/origami/table/' + dining_id;
});

View File

@@ -402,10 +402,9 @@
if (sale) {
var sale_id = sale
} else {
var sale_id = $('.tables').attr("data-id");;
var sale_id = "<%= @dining.id %>";
}
//var table_id = $('.tables').attr("data-id");
//var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/surveys"
});

View File

@@ -1,12 +1,12 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= origami_path(1) %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= '/origami/table/@dining_facility.id' %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.survey") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), origami_root_path %>
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/table/'+@dining_facility.id.to_s %>
</span>
</ol>
</div>
<%= render 'form', survey: @survey %>
<%= render 'form', survey: @survey %>