end of day commit
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
.page-header= title 'Home'
|
||||
ul.nav.nav-tabs.nav-stacked
|
||||
- if list_open?
|
||||
li.active= link_to '€ 23,45'.html_safe, '#'
|
||||
li= link_to 'Place order', '/show_products?supplier_id=' + active_list.supplier.id
|
||||
li= link_to 'Active list', '#'
|
||||
li= link_to 'Active list', view_active_list_path
|
||||
li= link_to 'Request bill', '#'
|
||||
li= link_to 'I have a question', '#'
|
||||
- else
|
||||
li= link_to 'Place order', '/select_qrcode'
|
||||
li= link_to 'Subscribe to list', '#'
|
||||
li= link_to 'Check out menu', '#'
|
||||
|
||||
ul.nav.nav-tabs.nav-stacked
|
||||
li= link_to 'View history', '#'
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
button onClick='Qrammer.build_product_list()' class='btn btn-inverse'Lijst
|
||||
table#products-table.table.table-striped.table-hover
|
||||
tbody
|
||||
- content_for :sidebar do
|
||||
table#active-order-table.table.hide
|
||||
thead
|
||||
tr
|
||||
th Product
|
||||
th #
|
||||
th.currency Total
|
||||
th
|
||||
tbody
|
||||
tfoot
|
||||
tr
|
||||
td colspan=2
|
||||
button class="btn btn-primary" onClick="Qrammer.order_active_list('/order_active_list')" Bestellen
|
||||
|
|
||||
button class="btn btn btn-warning" onClick="Qrammer.clear_active_list()" Clear
|
||||
td.currency
|
||||
strong#active-order-total
|
||||
td
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
@@ -8,12 +26,12 @@ table#products-table.table.table-striped.table-hover
|
||||
window.products = res
|
||||
body = $('#products-table tbody')
|
||||
for(var category in window.products){
|
||||
body.append('<tr><td colspan="3"><h3>'+category+'<h3></td></tr>');
|
||||
body.append('<tr><td colspan="3"><h4>'+category+'<h4></td></tr>');
|
||||
var category_ref = window.products[category];
|
||||
for(var iproduct = 0; iproduct < window.products[category].length; iproduct++){
|
||||
var product_index = iproduct;
|
||||
row = $('<tr></tr>');
|
||||
button = $('<button class="btn btn-primary">Add</button>');
|
||||
button = $('<button class="btn btn-mini btn-primary">Add</button>');
|
||||
var callback = (function(ref){
|
||||
return function(){ Qrammer.add_product(ref[product_index]) }
|
||||
})(category_ref)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
.page-header
|
||||
h1 List overview
|
||||
table#active-list-table.table
|
||||
thead
|
||||
tr
|
||||
th Order
|
||||
th.currency Price
|
||||
tbody
|
||||
tfoot
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
$.get('#{current_list_path(session[:active_list_id], format: :json).html_safe}', function(res){
|
||||
var body = $('#active-list-table tbody');
|
||||
var foot = $('#active-list-table tfoot');
|
||||
if(!res.orders && !res.orders.length){
|
||||
alert('No orders in list');
|
||||
return;
|
||||
}
|
||||
for(var iorder = 0; iorder < res.orders.length; iorder++){
|
||||
var order_txts = [];
|
||||
var order = res.orders[iorder];
|
||||
var row = $('<tr></tr>').appendTo(body);
|
||||
row.addClass(order.state);
|
||||
//if(order.state == 'placed') row.addClass('info');
|
||||
//if(order.state == 'delivered') row.addClass('success');
|
||||
if(order.state == 'cancelled') row.addClass('error');
|
||||
for(var iproduct = 0; iproduct < order.products.length; iproduct++){
|
||||
var product = order.products[iproduct];
|
||||
order_txts.push(product.name + ' (' + product['number'] + ')')
|
||||
}
|
||||
row.append($('<td></td>').text(order_txts.join(', ')));
|
||||
row.append($('<td class="currency"></td>').html(Qrammer.currency(res.orders[iorder].total_amount)))
|
||||
}
|
||||
foot.append('<tr><td></td><td class="currency"><strong>'+Qrammer.currency(res.total_amount)+'</strong></td></tr>');
|
||||
})
|
||||
})
|
||||
@@ -16,6 +16,8 @@ html lang="en"
|
||||
link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72"
|
||||
link href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed"
|
||||
link href="images/favicon.ico" rel="shortcut icon"
|
||||
javascript:
|
||||
var active_list_id = #{session[:active_list_id] ? "'#{session[:active_list_id]}'" : 'null'};
|
||||
|
||||
body
|
||||
.navbar.navbar-fixed-top
|
||||
@@ -56,6 +58,7 @@ html lang="en"
|
||||
li.nav-header Links
|
||||
li= link_to "Home", root_path
|
||||
li= link_to "Companytools", 'http://www.companytools.nl/'
|
||||
= yield :sidebar
|
||||
|
||||
footer
|
||||
p © Companytools 2012
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
= form_for @order, html: {class: 'form-horizontal' } do |f|
|
||||
= render 'error_messages', target: @order
|
||||
.control-group class=(@order.errors[:state].any? ? 'error' : nil)
|
||||
= f.label :state, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :state, class: 'text_field'
|
||||
.control-group class=(@order.errors[:supplier_id].any? ? 'error' : nil)
|
||||
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
|
||||
.controls
|
||||
= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
|
||||
.form-actions
|
||||
= f.submit nil, class: 'btn btn-primary'
|
||||
'
|
||||
= link_to t("helpers.links.cancel"), orders_path, class: 'btn'
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = Order
|
||||
.page-header
|
||||
= title :edit, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,24 @@
|
||||
- model_class = Order
|
||||
div.page-header= title :index, model_class
|
||||
- if @orders.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th= model_class.human_attribute_name(:state)
|
||||
th= Supplier.model_name.human
|
||||
th= model_class.human_attribute_name(:created_at)
|
||||
th=t 'helpers.actions'
|
||||
tbody
|
||||
- @orders.each do |order|
|
||||
tr
|
||||
td= link_to order.state, order
|
||||
td= link_to_if order.supplier.present?, order.supplier.try(:name), order.supplier
|
||||
td=l order.created_at, format: :short
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, order], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), order, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||
- else
|
||||
= no_content_given model_class
|
||||
= link_to t("helpers.links.new"), new_order_path, class: 'btn btn-primary'
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = Order
|
||||
.page-header
|
||||
= title :new, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,16 @@
|
||||
- model_class = Order
|
||||
.page-header= title :show, @order
|
||||
|
||||
dl.dl-horizontal.show-list
|
||||
dt= model_class.human_attribute_name(:state)
|
||||
dd= @order.state
|
||||
- if @order.supplier.present?
|
||||
dt= Supplier.model_name.human
|
||||
dd= link_to @order.supplier.name, @order.supplier
|
||||
|
||||
.form-actions
|
||||
= link_to t("helpers.links.back"), orders_path, class: 'btn'
|
||||
'
|
||||
= link_to t('helpers.links.edit'), [:edit, @order], class: 'btn'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), @order, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
|
||||
@@ -0,0 +1,15 @@
|
||||
.page-header= title 'Active lists'
|
||||
table#active-lists-table.table
|
||||
thead
|
||||
tr
|
||||
th.number Table number
|
||||
th.currency Price
|
||||
th.actions
|
||||
tbody
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
Qrammer.load_active_lists('#{@supplier.id}')
|
||||
setInterval( "Qrammer.load_active_lists('#{@supplier.id}')", 7500);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
.page-header= title 'Active orders'
|
||||
table#active-orders-table.table
|
||||
thead
|
||||
tr
|
||||
th Order
|
||||
th.number Table number
|
||||
th.currency Price
|
||||
th.actions
|
||||
tbody
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
Qrammer.load_active_order_list('#{@supplier.id}')
|
||||
setInterval( "Qrammer.load_active_order_list('#{@supplier.id}')", 7500);
|
||||
});
|
||||
|
||||
@@ -1,41 +1,42 @@
|
||||
= form_for @user, html: {class: 'form-horizontal' } do |f|
|
||||
.control-group
|
||||
= render 'error_messages', target: @user
|
||||
.control-group class=(@user.errors[:email].any? ? 'error' : nil)
|
||||
= f.label :email, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :email, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:encrypted_password].any? ? 'error' : nil)
|
||||
= f.label :encrypted_password, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :encrypted_password, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:remember_token].any? ? 'error' : nil)
|
||||
= f.label :remember_token, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :remember_token, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:remember_created_at].any? ? 'error' : nil)
|
||||
= f.label :remember_created_at, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :remember_created_at, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:reset_password_token].any? ? 'error' : nil)
|
||||
= f.label :reset_password_token, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :reset_password_token, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:sign_in_count].any? ? 'error' : nil)
|
||||
= f.label :sign_in_count, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :sign_in_count, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:current_sign_in_at].any? ? 'error' : nil)
|
||||
= f.label :current_sign_in_at, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :current_sign_in_at, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:last_sign_in_at].any? ? 'error' : nil)
|
||||
= f.label :last_sign_in_at, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :last_sign_in_at, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:current_sign_in_ip].any? ? 'error' : nil)
|
||||
= f.label :current_sign_in_ip, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :current_sign_in_ip, class: 'text_field'
|
||||
.control-group
|
||||
.control-group class=(@user.errors[:last_sign_in_ip].any? ? 'error' : nil)
|
||||
= f.label :last_sign_in_ip, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :last_sign_in_ip, class: 'text_field'
|
||||
|
||||
@@ -1,38 +1,22 @@
|
||||
- model_class = User
|
||||
div class="page-header"= title :index, model_class
|
||||
table class="table table-striped"
|
||||
thead
|
||||
tr
|
||||
th= model_class.human_attribute_name(:email)
|
||||
th= model_class.human_attribute_name(:encrypted_password)
|
||||
th= model_class.human_attribute_name(:remember_token)
|
||||
th= model_class.human_attribute_name(:remember_created_at)
|
||||
th= model_class.human_attribute_name(:reset_password_token)
|
||||
th= model_class.human_attribute_name(:sign_in_count)
|
||||
th= model_class.human_attribute_name(:current_sign_in_at)
|
||||
th= model_class.human_attribute_name(:last_sign_in_at)
|
||||
th= model_class.human_attribute_name(:current_sign_in_ip)
|
||||
th= model_class.human_attribute_name(:last_sign_in_ip)
|
||||
th= model_class.human_attribute_name(:created_at)
|
||||
th=t 'helpers.actions'
|
||||
tbody
|
||||
- @users.each do |user|
|
||||
div.page-header= title :index, model_class
|
||||
- if @users.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
td= link_to user.email, user
|
||||
td= user.encrypted_password
|
||||
td= user.remember_token
|
||||
td= user.remember_created_at
|
||||
td= user.reset_password_token
|
||||
td= user.sign_in_count
|
||||
td= user.current_sign_in_at
|
||||
td= user.last_sign_in_at
|
||||
td= user.current_sign_in_ip
|
||||
td= user.last_sign_in_ip
|
||||
td=l user.created_at, format: :short
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, user], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), user, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||
|
||||
th= model_class.human_attribute_name(:email)
|
||||
th= model_class.human_attribute_name(:created_at)
|
||||
th=t 'helpers.actions'
|
||||
tbody
|
||||
- @users.each do |user|
|
||||
tr
|
||||
td= link_to user.email, user
|
||||
td=l user.created_at, format: :short
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, user], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), user, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||
- else
|
||||
= no_content_given model_class
|
||||
= link_to t("helpers.links.new"), new_user_path, class: 'btn btn-primary'
|
||||
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
- model_class = User
|
||||
.page-header
|
||||
= title :show, @user
|
||||
.page-header= title :show, @user
|
||||
|
||||
dl.dl-horizontal.show-list
|
||||
dt= model_class.human_attribute_name(:email) + ':'
|
||||
dt= model_class.human_attribute_name(:email)
|
||||
dd= @user.email
|
||||
dt= model_class.human_attribute_name(:encrypted_password) + ':'
|
||||
dt= model_class.human_attribute_name(:encrypted_password)
|
||||
dd= @user.encrypted_password
|
||||
dt= model_class.human_attribute_name(:remember_token) + ':'
|
||||
dt= model_class.human_attribute_name(:remember_token)
|
||||
dd= @user.remember_token
|
||||
dt= model_class.human_attribute_name(:remember_created_at) + ':'
|
||||
dt= model_class.human_attribute_name(:remember_created_at)
|
||||
dd= @user.remember_created_at
|
||||
dt= model_class.human_attribute_name(:reset_password_token) + ':'
|
||||
dt= model_class.human_attribute_name(:reset_password_token)
|
||||
dd= @user.reset_password_token
|
||||
dt= model_class.human_attribute_name(:sign_in_count) + ':'
|
||||
dt= model_class.human_attribute_name(:sign_in_count)
|
||||
dd= @user.sign_in_count
|
||||
dt= model_class.human_attribute_name(:current_sign_in_at) + ':'
|
||||
dt= model_class.human_attribute_name(:current_sign_in_at)
|
||||
dd= @user.current_sign_in_at
|
||||
dt= model_class.human_attribute_name(:last_sign_in_at) + ':'
|
||||
dt= model_class.human_attribute_name(:last_sign_in_at)
|
||||
dd= @user.last_sign_in_at
|
||||
dt= model_class.human_attribute_name(:current_sign_in_ip) + ':'
|
||||
dt= model_class.human_attribute_name(:current_sign_in_ip)
|
||||
dd= @user.current_sign_in_ip
|
||||
dt= model_class.human_attribute_name(:last_sign_in_ip) + ':'
|
||||
dt= model_class.human_attribute_name(:last_sign_in_ip)
|
||||
dd= @user.last_sign_in_ip
|
||||
|
||||
.form-actions
|
||||
|
||||
Reference in New Issue
Block a user