diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png new file mode 100644 index 00000000..578d16f7 Binary files /dev/null and b/app/assets/images/logo.png differ diff --git a/app/assets/javascripts/origami/addorders.coffee b/app/assets/javascripts/origami/addorders.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/origami/addorders.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 0139f1d0..10e2b319 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -268,4 +268,3 @@ tr.discount-item-row:hover { -moz-opacity: 1; /* mozilla */ } - diff --git a/app/assets/stylesheets/origami/addorders.scss b/app/assets/stylesheets/origami/addorders.scss new file mode 100644 index 00000000..f45d06f3 --- /dev/null +++ b/app/assets/stylesheets/origami/addorders.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the origami/addorders controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/api/restaurant/menu_categories.rb b/app/controllers/api/restaurant/menu_categories_controller.rb similarity index 63% rename from app/controllers/api/restaurant/menu_categories.rb rename to app/controllers/api/restaurant/menu_categories_controller.rb index fe7983ea..f1f3e6d0 100644 --- a/app/controllers/api/restaurant/menu_categories.rb +++ b/app/controllers/api/restaurant/menu_categories_controller.rb @@ -1,11 +1,11 @@ -class Api::Restaurant::MenuController < Api::ApiController - +class Api::Restaurant::MenuCategoriesController < Api::ApiController + skip_before_action :authenticate #Description # Pull the default menu details and also other available (active) menus # Input Params - order_id def index - @menus = Menu.all - @current_menu = Menu.current_menu + @menus = MenuCategory.all + @current_menu = MenuCategory.current_menu end @@ -21,10 +21,10 @@ class Api::Restaurant::MenuController < Api::ApiController def menu_detail (menu_id) if (menu_id) #Pull this menu - menu = Menu.find_by_id(menu_id) + menu = MenuCategory.find_by_id(menu_id) return menu else - Menu.current_menu + MenuCategory.current_menu end end diff --git a/app/controllers/api/restaurant/menu_controller.rb b/app/controllers/api/restaurant/menu_controller.rb index f6f2902b..b45e1189 100644 --- a/app/controllers/api/restaurant/menu_controller.rb +++ b/app/controllers/api/restaurant/menu_controller.rb @@ -1,5 +1,5 @@ class Api::Restaurant::MenuController < Api::ApiController - + skip_before_action :authenticate #Description # Pull the default menu details and also other available (active) menus # Input Params - order_id diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb new file mode 100644 index 00000000..e65b24b7 --- /dev/null +++ b/app/controllers/origami/addorders_controller.rb @@ -0,0 +1,22 @@ +class Origami::AddordersController < BaseOrigamiController + before_action :set_dining, only: [:show] + + def index + @tables = Table.all.active.order('zone_id asc').group("zone_id") + @rooms = Room.all.active.order('zone_id asc').group("zone_id") + @all_table = Table.all.active.order('status desc') + @all_room = Room.all.active.order('status desc') + end + + def show + @menu = MenuCategory.all + @table_id = params[:id] + end + + private + + def set_dining + @dining = DiningFacility.find(params[:id]) + end + +end diff --git a/app/helpers/origami/addorders_helper.rb b/app/helpers/origami/addorders_helper.rb new file mode 100644 index 00000000..c90e5344 --- /dev/null +++ b/app/helpers/origami/addorders_helper.rb @@ -0,0 +1,2 @@ +module Origami::AddordersHelper +end diff --git a/app/views/api/restaurant/menu/_menu_item.json.jbuilder b/app/views/api/restaurant/menu/_menu_item.json.jbuilder index f0b790b7..ffad3dc2 100644 --- a/app/views/api/restaurant/menu/_menu_item.json.jbuilder +++ b/app/views/api/restaurant/menu/_menu_item.json.jbuilder @@ -38,9 +38,10 @@ json.options item.item_options # end end + #Child Menu items # if (item.children) then # json.set_items item.children.each do |item| # json.partial! 'api/restaurant/menu/menu_item', item: item # end -# end +# end \ No newline at end of file diff --git a/app/views/api/restaurant/menu_categories/show.json.jbuilder b/app/views/api/restaurant/menu_categories/show.json.jbuilder new file mode 100644 index 00000000..f48f6c77 --- /dev/null +++ b/app/views/api/restaurant/menu_categories/show.json.jbuilder @@ -0,0 +1,43 @@ +if @menu.menu_items + json.menu_items @menu.menu_items do |item| + #Menu Item Information + json.item_code item.item_code + json.name item.name + json.alt_name item.alt_name + json.type item.type + json.min_qty item.min_qty + # json.min_selectable_item item.min_selectable_item + # json.max_selectable_item item.max_selectable_item + + #Item instance + if item.menu_item_instances.count == 1 then + + item_instance = item.menu_item_instances[0] + json.price item_instance.price + json.is_available item_instance.is_available + json.is_on_promotion item_instance.is_on_promotion + json.promotion_price item_instance.promotion_price + json.item_attributes item_instance.item_attributes + + elsif item.menu_item_instances.count > 1 then + + json.item_instances item.menu_item_instances do |is| + json.item_instance_item_code is.item_instance_code + json.item_instance_name is.item_instance_name + json.price is.price + json.is_available is.is_available + json.is_on_promotion is.is_on_promotion + json.promotion_price is.promotion_price + json.item_attributes is.item_attributes + end + + end + #Child Menu items + if (item.menu_item_sets) then + json.set_items item.menu_item_sets.each do |item| + json.partial! 'api/restaurant/menu/menu_item', item: item + end + + end + end +end diff --git a/app/views/origami/addorders/index.html.erb b/app/views/origami/addorders/index.html.erb new file mode 100644 index 00000000..50e52d3e --- /dev/null +++ b/app/views/origami/addorders/index.html.erb @@ -0,0 +1,108 @@ +
<%= table.status %>
+<%= table.name %>
+Seat : <%= table.seater %>
+<%= room.status %>
+<%= room.name %>
+Seat : <%= room.seater %>
+| # | +Items | +QTY | +Price | +
|---|