This commit is contained in:
2013-01-08 10:15:28 +01:00
parent 63cb3593ed
commit e36263b153
13 changed files with 35 additions and 16 deletions
+1
View File
@@ -15,6 +15,7 @@
/tmp /tmp
.sass-cache/ .sass-cache/
*.swp *.swp
.idea
*~ *~
db/xapian_db db/xapian_db
company_logo* company_logo*
+2 -2
View File
@@ -101,7 +101,7 @@ GEM
factory_girl_rails (4.1.0) factory_girl_rails (4.1.0)
factory_girl (~> 4.1.0) factory_girl (~> 4.1.0)
railties (>= 3.0.0) railties (>= 3.0.0)
ffi (1.2.0) ffi (1.1.5)
fssm (0.2.9) fssm (0.2.9)
guard (1.5.4) guard (1.5.4)
listen (>= 0.4.2) listen (>= 0.4.2)
@@ -143,7 +143,7 @@ GEM
mime-types (1.19) mime-types (1.19)
mini_magick (3.4) mini_magick (3.4)
subexec (~> 0.2.1) subexec (~> 0.2.1)
multi_json (1.4.0) multi_json (1.5.0)
mustache (0.99.4) mustache (0.99.4)
nokogiri (1.5.5) nokogiri (1.5.5)
orm_adapter (0.0.7) orm_adapter (0.0.7)
@@ -8,5 +8,12 @@ class List
needs_payment: -> @attributes.needs_payment needs_payment: -> @attributes.needs_payment
active: -> @attributes.state == 'active' active: -> @attributes.state == 'active'
products: -> @attributes.products || [] products: -> @attributes.products || []
supplier_name: -> @attributes.supplier_name
created_at: -> @attributes.created_at
display: ->
txt = @supplier_name()
txt += ' - '
txt += Quser.format_date(@created_at())
txt
@List = List @List = List
@@ -28,6 +28,7 @@
//= require bootstrap //= require bootstrap
//= require qwaiter //= require qwaiter
//= require supplier/order //= require supplier/order
//= require supplier/list
//= require mustache //= require mustache
//= require faye //= require faye
//= require_directory . //= require_directory .
+2 -8
View File
@@ -95,7 +95,7 @@ class Quser
$('.table-number').text(response.table_number) if response.table_number $('.table-number').text(response.table_number) if response.table_number
$('.supplier-name').text(response.supplier_name) if response.supplier_name $('.supplier-name').text(response.supplier_name) if response.supplier_name
if response.not_present || response.list_active == false then $('.home-link').hide() else $('.home-link').show() if response.not_present || response.list_active == false then $('.home-link').removeClass('active') else $('.home-link').addClass('active')
@list_needs_payment_default_action(response) @list_needs_payment_default_action(response)
@list_needs_help_default_action(response) @list_needs_help_default_action(response)
@@ -209,13 +209,7 @@ class Quser
@paginate(res, @load_list_history) @paginate(res, @load_list_history)
container = $('#list-history-container').html('') container = $('#list-history-container').html('')
for list in res.lists for list in res.lists
li = $('<li></li>').appendTo(container) container.append @mustache('#list-history-template', new List(list) )
link = $('<a href="#"></a>').appendTo(li)
link.click(-> redirect_to 'history_list', list_id: list._id)
txt = list.supplier_name
txt += ' - '
txt += @format_date(list.created_at)
link.text(txt)
) )
paginate: (wrapper, callback) -> paginate: (wrapper, callback) ->
container = $('nav.pagination') container = $('nav.pagination')
@@ -3,3 +3,4 @@
#products-table #products-table
.order-product-button .order-product-button
+wood-button +wood-button
color: white
@@ -37,14 +37,22 @@ body
margin-left: auto margin-left: auto
margin-right: auto margin-right: auto
width: 262px width: 262px
text-align: center
a a
+user-button +user-button
float: none
display: none
width: 34px
height: 34px
&.active
display: inline-block
span span
display: block display: block
width: 28px width: 28px
height: 26px height: 26px
background-repeat: no-repeat background-repeat: no-repeat
background-position: center center background-position: center center
margin: 4px auto auto auto
&.home-list-link &.home-list-link
span span
background-image: image-url('icons/list.png') background-image: image-url('icons/list.png')
+1 -1
View File
@@ -1,6 +1,6 @@
class UserController < ApplicationController class UserController < ApplicationController
before_filter :allow_mobile before_filter :allow_mobile
before_filter :user_authentication, except: :obtain_token before_filter :user_authentication, except: [:obtain_token, :index]
layout 'phone' layout 'phone'
def user_authentication def user_authentication
@@ -0,0 +1,3 @@
<li>
<a href="#" onclick="redirect_to('history_list', {list_id: '{{id}}'})">{{display}}</a>
</li>
+1 -1
View File
@@ -33,7 +33,7 @@ html lang="en"
var $asset_path = '/assets/'; var $asset_path = '/assets/';
var Qstorage = localStorage; var Qstorage = localStorage;
#{Rails.env.production? ? '' : "data_host = 'http://qwaiter.dev';"} #{Rails.env.production? ? '' : "data_host = 'http://qwaiter.dev';"}
//var data_host = 'http://localhost:3000'; var data_host = 'http://localhost:3000';
QMobile || (QMobile = { QMobile || (QMobile = {
scanQr: function(){window.location = '/select_qrcode'}, scanQr: function(){window.location = '/select_qrcode'},
activateRotation: function(){}, activateRotation: function(){},
+2 -3
View File
@@ -4,12 +4,11 @@
a href="#" onClick="QMobile.scanQr()" = image_tag 'scan-logo.png' a href="#" onClick="QMobile.scanQr()" = image_tag 'scan-logo.png'
.home-footer .home-footer
.home-footer-content .home-footer-content
= link_to content_tag(:span, 'P'), user_list_products_path, class: [:hide, 'home-link', 'home-menu-link'] = link_to content_tag(:span, 'P'), user_list_products_path, class: ['home-link', 'home-menu-link']
= link_to content_tag(:span, 'L'), user_active_list_path, class: [:hide, 'home-link', 'home-list-link'] = link_to content_tag(:span, 'L'), user_active_list_path, class: ['home-link', 'home-list-link']
- content_for :footer do - content_for :footer do
javascript: javascript:
$(function(){ $(function(){
Quser.watch_events(); Quser.watch_events();
Quser.home_loader(); Quser.home_loader();
//setInterval("Quser.home_loader()", 7500);
}); });
+1
View File
@@ -2,4 +2,5 @@
span span
nav.pagination nav.pagination
ul#list-history-container ul#list-history-container
script#list-history-template[type="text/html"]= mustache_template 'list-history'
- onload_javascript "Qstorage.page = 1; Quser.load_list_history()" - onload_javascript "Qstorage.page = 1; Quser.load_list_history()"
+5 -1
View File
@@ -3,11 +3,15 @@
.table-number .table-number
.supplier-name .supplier-name
.action-buttons .action-buttons
= link_to content_tag(:span, t('helpers.links.show_active_list'), list: List.model_name.human), user_active_list_path, class: ['user-top-button'], id: 'show-active-list' = link_to user_active_list_path, class: ['user-top-button'], id: 'show-active-list' do
span= t('helpers.links.show_active_list', list: List.model_name.human)
span#list-needs-payment-button.user-top-button span#list-needs-payment-button.user-top-button
span span
span#list-needs-help-button.user-top-button span#list-needs-help-button.user-top-button
span span
span
.well .well
table#products-table.table table#products-table.table
tbody tbody