change ui for delete backend
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.' }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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> -->
|
||||
|
||||
Reference in New Issue
Block a user