From 6f57bb8a7952c080d46de2a74883def37f82da4a Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 13 Jul 2017 11:12:02 +0630 Subject: [PATCH] adding shift sale summary --- app/assets/stylesheets/origami.scss | 12 ++++++----- app/controllers/origami/shifts_controller.rb | 5 +++++ app/views/origami/home/index.html.erb | 21 ++++++++++++++------ config/routes.rb | 1 + 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 7935b50e..a7b25b7a 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -10,7 +10,8 @@ // padding-top: 4.5rem; // } .card-columns { - font-size: 18px !important;} + font-size: 18px !important; +} .others-payment{ line-height:100px; @@ -53,7 +54,8 @@ .payment{ height:70px;line-height:70px; - align:center;color:white; + align:center; + color:white; font-size:16px; margin-top:5px; } @@ -161,15 +163,15 @@ } .green{ - background-color: #009900 + background-color: #009900; } .orange{ - background-color: #FF8C00 + background-color: #FF8C00; } .blue{ - background-color: blue + background-color: blue; } /* End Colors */ diff --git a/app/controllers/origami/shifts_controller.rb b/app/controllers/origami/shifts_controller.rb index 92f174ae..1f085ac8 100644 --- a/app/controllers/origami/shifts_controller.rb +++ b/app/controllers/origami/shifts_controller.rb @@ -48,4 +48,9 @@ class Origami::ShiftsController < BaseOrigamiController def edit end + def sale_summary + @shift = ShiftSale.current_open_shift(current_user.id) + + end + end diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index 6bdadd85..3afea88d 100644 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -105,9 +105,10 @@
- - - + + + +
@@ -116,20 +117,28 @@ $(document).ready(function(){ $(".tables").on('click', function(){ var dining_id = $(this).attr("data-id"); window.location.href = '/origami/table/' + dining_id; - }) + }); + $(".sales").on('click',function(){ var sale_id = $(this).attr("data-id"); window.location.href = '/origami/sale/' + sale_id; - }) + }); + $(".rooms").on('click', function(){ var dining_id = $(this).attr("data-id"); window.location.href = '/origami/room/' + dining_id; - }) + }); + $(".orders").on('click',function(){ var order_id = $(this).attr("data-id"); window.location.href = '/origami/order/' + order_id; + }); + + $('#sale_summary').on('click',function(){ + window.location.href = '/origami/shift/sale_summary'; }) }); + $(function() { var timer; diff --git a/config/routes.rb b/config/routes.rb index b9549c06..d285cc2e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -114,6 +114,7 @@ Rails.application.routes.draw do resources :shifts, only: [:index, :new, :create, :edit] post 'close_shift' => 'shifts#update_shift' get 'shift/close' => 'shifts#show' + get 'shift/sale_summary' => 'shifts#sale_summary' #shift - index (open/close shift landing page) #shift - show (sales summary display) #shift - new (open shift)