Prepare some things for production phase
This commit is contained in:
parent
0a1747246e
commit
e91e3213d7
7 changed files with 23 additions and 16 deletions
|
@ -20,7 +20,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.warning {
|
.guest {
|
||||||
border: 2px solid;
|
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,9 @@ class WelcomeController < ApplicationController
|
||||||
if user_signed_in? || params[:token] != Rails.application.secrets.koelkast_token
|
if user_signed_in? || params[:token] != Rails.application.secrets.koelkast_token
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
return
|
return
|
||||||
else
|
end
|
||||||
koelkast = User.find_by(name: "koelkast")
|
|
||||||
|
koelkast = User.koelkast
|
||||||
sign_in_and_redirect koelkast
|
sign_in_and_redirect koelkast
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Product < ActiveRecord::Base
|
||||||
include Avatarable
|
include Avatarable
|
||||||
|
|
||||||
has_many :order_items
|
has_many :order_items
|
||||||
has_many :barcodes
|
has_many :barcodes, dependent: :destroy
|
||||||
accepts_nested_attributes_for :barcodes
|
accepts_nested_attributes_for :barcodes
|
||||||
|
|
||||||
enum category: %w(food beverages other)
|
enum category: %w(food beverages other)
|
||||||
|
|
|
@ -56,6 +56,8 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Static Users
|
||||||
|
|
||||||
def self.guest
|
def self.guest
|
||||||
@guest || find_or_create_by(name: "Guest") do |user|
|
@guest || find_or_create_by(name: "Guest") do |user|
|
||||||
user.avatar = File.new(File.join("app", "assets", "images", "guest.png"))
|
user.avatar = File.new(File.join("app", "assets", "images", "guest.png"))
|
||||||
|
@ -65,4 +67,11 @@ class User < ActiveRecord::Base
|
||||||
def guest?
|
def guest?
|
||||||
self == User.guest
|
self == User.guest
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.koelkast
|
||||||
|
@koelkast || find_or_create_by(name: "Koelkast") do |user|
|
||||||
|
user.avatar = File.new(File.join("app", "assets", "images", "logo.png"))
|
||||||
|
user.koelkast = true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
.warning.center
|
|
||||||
%h1 TESTFASE | GELIEVE STREEPJES TE BLIJVEN ZETTEN | TESTFASE
|
|
||||||
.row
|
.row
|
||||||
.col-md-1
|
.col-md-1
|
||||||
|
- unless @last.empty?
|
||||||
%h5 Recent
|
%h5 Recent
|
||||||
#last
|
#last
|
||||||
- @last.each do |user|
|
- @last.each do |user|
|
||||||
= image_tag user.avatar(:small), class: "img-responsive img-circle img-thumbnail"
|
= image_tag user.avatar(:small), class: "img-responsive img-circle img-thumbnail"
|
||||||
.col-md-11
|
.col-md-11
|
||||||
.row.text-center
|
.row.text-center.guest
|
||||||
=link_to "Not a Zeus Account? Order as a guest.", new_guest_order_path, class: "btn btn-primary btn-lg"
|
=link_to "Not a Zeus Account? Order as a guest.", new_guest_order_path, class: "btn btn-default btn-lg"
|
||||||
.row
|
.row
|
||||||
= render @users
|
= render @users
|
||||||
|
|
Loading…
Reference in a new issue