diff --git a/Gemfile b/Gemfile index e5947040..979634b1 100644 --- a/Gemfile +++ b/Gemfile @@ -32,6 +32,7 @@ gem 'devise_simply_stored' gem 'rqrcode' gem 'mini_magick' +gem 'kaminari-bootstrap' #gem "less-rails-bootstrap-devise", :git => 'git://github.com/bigbento/less-rails-bootstrap-devise.git' # To use ActiveModel has_secure_password diff --git a/Gemfile.lock b/Gemfile.lock index 8ce3c83f..4299d29c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -105,6 +105,13 @@ GEM railties (>= 3.1.0, < 5.0) thor (~> 0.14) json (1.6.7) + kaminari (0.13.0) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + railties (>= 3.0.0) + kaminari-bootstrap (0.1.2) + kaminari + rails less (2.2.1) commonjs (~> 0.2.6) less-rails (2.2.3) @@ -235,6 +242,7 @@ DEPENDENCIES factory_girl_rails haml-rails jquery-rails + kaminari-bootstrap mini_magick pry rails (= 3.2.8) diff --git a/app/assets/images/.DS_Store b/app/assets/images/.DS_Store index 5b14cfb5..d6cb3b95 100644 Binary files a/app/assets/images/.DS_Store and b/app/assets/images/.DS_Store differ diff --git a/app/models/list.rb b/app/models/list.rb index cba92324..381a4624 100644 --- a/app/models/list.rb +++ b/app/models/list.rb @@ -34,6 +34,10 @@ class List list end + def self.of_user(user, options = {}) + database.view(association_list_has_and_belongs_to_many_users({startkey: [user.id], endkey: ["#{user.id}\u9999"], include_docs: true, reduce: false}.merge(options))) + end + def close! orders.map(&:close!) self.state = 'closed' diff --git a/app/views/user/home.html.slim b/app/views/user/home.html.slim index 1eb03e76..6a52d051 100644 --- a/app/views/user/home.html.slim +++ b/app/views/user/home.html.slim @@ -1,7 +1,6 @@ ul.nav.nav-tabs.nav-stacked li - button.btn.btn-primary onClick="QMobile.scanQr()" Scan Qr + button.btn.btn-primary onClick="QMobile.scanQr()" = t('user.home.scan_qr') - if list_open? - li= link_to 'Place order', user_list_products_path - li= link_to 'Show active list', user_active_list_path - li= link_to 'Subscribe to list', '#' + li= link_to t('user.home.show_active_list_products'), user_list_products_path + li= link_to t('user.home.show_active_list'), user_active_list_path diff --git a/config/locales/en.yml b/config/locales/en.yml index 4e30997d..78a95ace 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -79,5 +79,9 @@ en: title: This table is occupied join_this_table: Join this table show_the_products: Show me the menu + home: + scan_qr: Scan qr code + show_active_list: Show my orders + show_active_list_products: Go to the menu section: first_section_title: Room diff --git a/stories b/stories index 163afae5..7ee8ef2a 100644 --- a/stories +++ b/stories @@ -32,6 +32,8 @@ Person actions: Alleen restaurant kan rekening afsluiten, als dit nog niet is gebeurd voor een tafel kan een nieuwe persoon geen lijst openen. Alert melding bij restaurant als iemand dit probeert Eén lijst tegelijk actief? (wel handig en duidelijk!!!) +paginated history + /user/list_products_for_table if occupied @@ -76,4 +78,6 @@ Scan qr button (see mindmap Qr code.mm for actual version of this schema): * If table is occupied: ** Offer to Join - +Nadelen: +* Systeem ligt plat als er geen internet is +