license flash msg and add set Item price
This commit is contained in:
@@ -38,11 +38,11 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
else
|
||||
# check for license file
|
||||
# if check_license
|
||||
# current_license(ENV["SX_PROVISION_URL"])
|
||||
# else
|
||||
# redirect_to activate_path
|
||||
# end
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -22,14 +22,14 @@ class SymControlController < BaseController
|
||||
stop_sym = system("service SymmetricDS stop")
|
||||
run_sym = system("service SymmetricDS start")
|
||||
if run_sym
|
||||
render :text => "<h1>Success!</h1>"
|
||||
flash[:notice] = 'Success!'
|
||||
end
|
||||
else
|
||||
render :text => "<h1>Sym Sql file not found!</h1>"
|
||||
flash[:notice] = 'Sym Sql file not found!'
|
||||
end
|
||||
end
|
||||
else
|
||||
render :text => "<h1>Sym not running!</h1>"
|
||||
flash[:notice] = "Sym not running!"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,9 +37,9 @@ class SymControlController < BaseController
|
||||
license = License.new(ENV["SX_PROVISION_URL"])
|
||||
status = license.get_key
|
||||
if status
|
||||
render :text => "<h1>Success!</h1>"
|
||||
flash[:notice] = "Success!"
|
||||
else
|
||||
render :text => "<h1>Not Get!</h1>"
|
||||
flash[:notice] = "Not Get!"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class License
|
||||
redis = Redis.new
|
||||
cache_license = redis.get(cache_key)
|
||||
|
||||
# Rails.logger.info "Cache key - " + cache_key.to_s
|
||||
Rails.logger.info "Cache key - " + cache_key.to_s
|
||||
|
||||
if cache_license.nil?
|
||||
cache = {"shop" => @activate["shop_name"], "key" => aes_key, "iv" => @activate["iv_key"], "renewable_date" => @activate["renewable_date"] }
|
||||
@@ -114,7 +114,7 @@ class License
|
||||
redis.set(cache_key, Marshal.dump(cache))
|
||||
end
|
||||
|
||||
# Rails.logger.info "License - " + response.parsed_response.to_s
|
||||
Rails.logger.info "License - " + response.parsed_response.to_s
|
||||
|
||||
response = create_license_file(@activate)
|
||||
if(response[:status])
|
||||
@@ -136,9 +136,9 @@ class License
|
||||
response = self.class.get("/verify", @params)
|
||||
@varified = response.parsed_response
|
||||
|
||||
# Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
||||
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
||||
if (@varified["status"])
|
||||
if (!check_expired(@varified["plan_next_renewal_date"]))
|
||||
if (!check_expired(@varified["renewable_date"]))
|
||||
return true
|
||||
end
|
||||
else
|
||||
@@ -247,10 +247,10 @@ class License
|
||||
redis = Redis.new
|
||||
cache_license = redis.get(cache_key)
|
||||
|
||||
# Rails.logger.info "Cache key - " + cache_key.to_s
|
||||
Rails.logger.info "Cache key - " + cache_key.to_s
|
||||
|
||||
if cache_license.nil?
|
||||
cache = {"shop" => shop_name, "key" => @data["secret_key"], "iv" => @data["iv_key"], "renewable_date" => @data["plan_next_renewable_date"] }
|
||||
cache = {"shop" => shop_name, "key" => @data["secret_key"], "iv" => @data["iv_key"], "renewable_date" => @data["renewable_date"] }
|
||||
redis = Redis.new
|
||||
redis.set(cache_key, Marshal.dump(cache))
|
||||
end
|
||||
@@ -358,7 +358,7 @@ class License
|
||||
f.write("db.user=#{dbusername}\n")
|
||||
f.write("db.password=#{dbpassword}\n")
|
||||
f.write("registration.url=http://#{db_host}:31415/sync/sx\n")
|
||||
f.write("group.id=store\n")
|
||||
f.write("group.id=cloud\n")
|
||||
f.write("external.id=001\n")
|
||||
f.write("job.routing.period.time.ms=5000\n")
|
||||
f.write("job.push.period.time.ms=10000\n")
|
||||
|
||||
@@ -137,13 +137,13 @@ class Order < ApplicationRecord
|
||||
Rails.logger.debug menu_item
|
||||
set_order_items = Array.new
|
||||
##If menu Item set item - must add child items to order as well, where price is only take from menu_item
|
||||
# if (menu_item[:type] == "SetMenuItem")
|
||||
# set_order_items =
|
||||
# end
|
||||
|
||||
if (item.include? 'sub_items') || (item.include? :sub_items)
|
||||
item[:sub_items].each do |si|
|
||||
set_order_items.push({"item_instance_code"=>si[:item_instance_code], "quantity"=>si[:quantity]})
|
||||
if (menu_item[:type] == "SetMenuItem")
|
||||
if (item.include? 'sub_items') || (item.include? :sub_items)
|
||||
item[:sub_items].each do |si|
|
||||
# Retrive instance's Price
|
||||
set_item = MenuItem.search_by_item_code(si[:item_instance_code])
|
||||
set_order_items.push({"item_instance_code"=>si[:item_instance_code], "quantity"=>si[:quantity]}, "price"=>set_item[:price])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -29,9 +29,21 @@
|
||||
</head>
|
||||
|
||||
<body class="page">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if type == "notice"
|
||||
color = "alert-success"
|
||||
elsif type == "error"
|
||||
color = "alert-danger"
|
||||
else
|
||||
color = "bg-black"
|
||||
end %>
|
||||
|
||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<div class="box">
|
||||
<%= yield %>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user