diff --git a/Gemfile b/Gemfile index 2e785cf0..f792b268 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ group :assets do gem 'compass-rails' # See https://github.com/sstephenson/execjs#readme for more supported runtimes - # gem 'therubyracer', :platforms => :ruby + gem 'therubyracer', :platforms => :ruby gem 'uglifier', '>= 1.0.3' end @@ -26,6 +26,7 @@ end gem 'jquery-rails' gem 'haml-rails' gem 'slim-rails' +gem 'less-rails' gem 'couch_potato' , :git => 'git://github.com/bterkuile/couch_potato.git' gem 'simply_stored' , :git => 'git://github.com/bterkuile/simply_stored.git' diff --git a/Gemfile.lock b/Gemfile.lock index 86f54d20..46be1878 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,7 @@ GIT GIT remote: git://github.com/bterkuile/simply_stored.git - revision: ad8c6af0d845a8eb3d1caeb47ede1e607f94e854 + revision: 955a484c4046b3343f07fd0d783342d01bf26f66 specs: simply_stored (1.0.0) activesupport @@ -50,25 +50,25 @@ GEM ansi (1.4.3) arel (3.0.2) bcrypt-ruby (3.0.1) - builder (3.0.3) - capybara (1.1.2) + builder (3.0.4) + capybara (1.1.3) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (~> 2.0) xpath (~> 0.1.4) - childprocess (0.3.5) + childprocess (0.3.6) ffi (~> 1.0, >= 1.0.6) chunky_png (1.2.6) - coderay (1.0.7) + coderay (1.0.8) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.3.3) + coffee-script-source (1.4.0) commonjs (0.2.6) compass (0.12.2) chunky_png (~> 1.2) @@ -109,7 +109,7 @@ GEM hike (1.2.1) i18n (0.6.1) journey (1.0.4) - jquery-rails (2.1.2) + jquery-rails (2.1.3) railties (>= 3.1.0, < 5.0) thor (~> 0.14) json (1.6.7) @@ -121,7 +121,7 @@ GEM rails less (2.2.2) commonjs (~> 0.2.6) - less-rails (2.2.3) + less-rails (2.2.6) actionpack (>= 3.1) less (~> 2.2.0) libv8 (3.3.10.4) @@ -131,11 +131,11 @@ GEM i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) - method_source (0.8) + method_source (0.8.1) mime-types (1.19) mini_magick (3.4) subexec (~> 0.2.1) - multi_json (1.3.6) + multi_json (1.3.7) nokogiri (1.5.5) orm_adapter (0.0.7) polyglot (0.3.3) @@ -150,7 +150,7 @@ GEM rack rack-ssl (1.3.2) rack - rack-test (0.6.1) + rack-test (0.6.2) rack (>= 1.0) rails (3.2.8) actionmailer (= 3.2.8) @@ -180,25 +180,25 @@ GEM rspec-core (2.11.1) rspec-expectations (2.11.3) diff-lcs (~> 1.1.3) - rspec-mocks (2.11.2) - rspec-rails (2.11.0) + rspec-mocks (2.11.3) + rspec-rails (2.11.4) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) rspec (~> 2.11.0) rubyzip (0.9.9) - sass (3.2.1) + sass (3.2.2) sass-rails (3.2.5) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - selenium-webdriver (2.25.0) + selenium-webdriver (2.26.0) childprocess (>= 0.2.5) libwebsocket (~> 0.1.3) multi_json (~> 1.0) rubyzip - slim (1.3.0) - temple (~> 0.4.1) + slim (1.3.3) + temple (~> 0.5.5) tilt (~> 1.3.3) slim-rails (1.0.3) actionpack (~> 3.0) @@ -211,26 +211,25 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) subexec (0.2.2) - temple (0.4.1) + temple (0.5.5) therubyracer (0.10.2) libv8 (~> 3.3.10) - thin (1.4.1) + thin (1.5.0) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) thor (0.16.0) tilt (1.3.3) - treetop (1.4.10) + treetop (1.4.12) polyglot polyglot (>= 0.3.1) turn (0.9.6) ansi - twitter-bootstrap-rails (2.1.3) + twitter-bootstrap-rails (2.1.6) actionpack (>= 3.1) - less-rails (~> 2.2.3) + execjs railties (>= 3.1) - therubyracer (~> 0.10.2) - tzinfo (0.3.33) + tzinfo (0.3.35) uglifier (1.3.0) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) @@ -253,6 +252,7 @@ DEPENDENCIES haml-rails jquery-rails kaminari-bootstrap + less-rails mini_magick pry rack-cors @@ -263,6 +263,7 @@ DEPENDENCIES selenium-webdriver simply_stored! slim-rails + therubyracer thin turn twitter-bootstrap-rails diff --git a/app/assets/images/.DS_Store b/app/assets/images/.DS_Store index d82591a5..77cd8866 100644 Binary files a/app/assets/images/.DS_Store and b/app/assets/images/.DS_Store differ diff --git a/app/assets/images/theme1/banner-bg.png b/app/assets/images/theme1/banner-bg.png new file mode 100644 index 00000000..c279585d Binary files /dev/null and b/app/assets/images/theme1/banner-bg.png differ diff --git a/app/assets/images/theme1/banner-tall.jpg b/app/assets/images/theme1/banner-tall.jpg new file mode 100644 index 00000000..2a434e8b Binary files /dev/null and b/app/assets/images/theme1/banner-tall.jpg differ diff --git a/app/assets/images/theme1/ceiling-center.jpg b/app/assets/images/theme1/ceiling-center.jpg new file mode 100644 index 00000000..3713e62c Binary files /dev/null and b/app/assets/images/theme1/ceiling-center.jpg differ diff --git a/app/assets/images/theme1/ceiling-left.jpg b/app/assets/images/theme1/ceiling-left.jpg new file mode 100644 index 00000000..6a2a1626 Binary files /dev/null and b/app/assets/images/theme1/ceiling-left.jpg differ diff --git a/app/assets/images/theme1/ceiling-right.jpg b/app/assets/images/theme1/ceiling-right.jpg new file mode 100644 index 00000000..fb626d5a Binary files /dev/null and b/app/assets/images/theme1/ceiling-right.jpg differ diff --git a/app/assets/images/theme1/content-bg.png b/app/assets/images/theme1/content-bg.png new file mode 100644 index 00000000..28f566a3 Binary files /dev/null and b/app/assets/images/theme1/content-bg.png differ diff --git a/app/assets/images/theme1/content-top.jpg b/app/assets/images/theme1/content-top.jpg new file mode 100644 index 00000000..61dc7cbf Binary files /dev/null and b/app/assets/images/theme1/content-top.jpg differ diff --git a/app/assets/images/theme1/floor-center.jpg b/app/assets/images/theme1/floor-center.jpg new file mode 100644 index 00000000..c94407a8 Binary files /dev/null and b/app/assets/images/theme1/floor-center.jpg differ diff --git a/app/assets/images/theme1/floor-left.jpg b/app/assets/images/theme1/floor-left.jpg new file mode 100644 index 00000000..2a7a7837 Binary files /dev/null and b/app/assets/images/theme1/floor-left.jpg differ diff --git a/app/assets/images/theme1/floor-right.jpg b/app/assets/images/theme1/floor-right.jpg new file mode 100644 index 00000000..965539a3 Binary files /dev/null and b/app/assets/images/theme1/floor-right.jpg differ diff --git a/app/assets/images/theme1/footer-bg.jpg b/app/assets/images/theme1/footer-bg.jpg new file mode 100644 index 00000000..887767da Binary files /dev/null and b/app/assets/images/theme1/footer-bg.jpg differ diff --git a/app/assets/images/theme1/footer-bottom.png b/app/assets/images/theme1/footer-bottom.png new file mode 100644 index 00000000..25ee4e1c Binary files /dev/null and b/app/assets/images/theme1/footer-bottom.png differ diff --git a/app/assets/images/theme1/footer-top-shadow.png b/app/assets/images/theme1/footer-top-shadow.png new file mode 100644 index 00000000..c15d662d Binary files /dev/null and b/app/assets/images/theme1/footer-top-shadow.png differ diff --git a/app/assets/images/theme1/footer-top.png b/app/assets/images/theme1/footer-top.png new file mode 100644 index 00000000..2258cb68 Binary files /dev/null and b/app/assets/images/theme1/footer-top.png differ diff --git a/app/assets/images/theme1/header.jpg b/app/assets/images/theme1/header.jpg new file mode 100644 index 00000000..4843a8e0 Binary files /dev/null and b/app/assets/images/theme1/header.jpg differ diff --git a/app/assets/images/theme1/light-1.jpg b/app/assets/images/theme1/light-1.jpg new file mode 100644 index 00000000..c92c6498 Binary files /dev/null and b/app/assets/images/theme1/light-1.jpg differ diff --git a/app/assets/images/theme1/light-2.jpg b/app/assets/images/theme1/light-2.jpg new file mode 100644 index 00000000..9146be75 Binary files /dev/null and b/app/assets/images/theme1/light-2.jpg differ diff --git a/app/assets/images/theme1/light-3.jpg b/app/assets/images/theme1/light-3.jpg new file mode 100644 index 00000000..9b1abf31 Binary files /dev/null and b/app/assets/images/theme1/light-3.jpg differ diff --git a/app/assets/images/theme1/nav-bar.png b/app/assets/images/theme1/nav-bar.png new file mode 100644 index 00000000..f6d34e00 Binary files /dev/null and b/app/assets/images/theme1/nav-bar.png differ diff --git a/app/assets/images/theme1/wall-bg.jpg b/app/assets/images/theme1/wall-bg.jpg new file mode 100644 index 00000000..a0061393 Binary files /dev/null and b/app/assets/images/theme1/wall-bg.jpg differ diff --git a/app/assets/javascripts/supplier/qsupplier.js.coffee b/app/assets/javascripts/supplier/qsupplier.js.coffee index 0d3261ae..b8fbadec 100644 --- a/app/assets/javascripts/supplier/qsupplier.js.coffee +++ b/app/assets/javascripts/supplier/qsupplier.js.coffee @@ -5,7 +5,7 @@ root.Qsupplier= table_container = $('#section-table-'+table_id) section_container = $('.section-tables-active') section_container.append(table_container) - Qsupplier.position_table_in_active_section(section_container, table_container) + Qsupplier.position_table_in_active_section(section_container, table_container, true) # Set the section id of the table in the database $.ajax( @@ -165,3 +165,6 @@ root.Qsupplier= if table.needs_help then to.addClass('needs_help') else to.removeClass('needs_help') if table.needs_payment then to.addClass('needs_payment') else to.removeClass('needs_payment') ) + add_tables_to_active_section: -> + number_start = $('#add-tables-number-start') + number_end = $('#add-tables-number-end') diff --git a/app/assets/javascripts/user/application.js.erb b/app/assets/javascripts/user/application.js.erb index 63c7c024..cfab7a9a 100644 --- a/app/assets/javascripts/user/application.js.erb +++ b/app/assets/javascripts/user/application.js.erb @@ -126,6 +126,7 @@ function t(path, vars){ } catch(err){ result = parts[parts.length - 1].capitalize(); } + if(!result) return parts[parts.length - 1].capitalize(); $.each(vars, function(v, value){ result = result.replace('%{'+v+'}', value)}); return result; } @@ -147,7 +148,9 @@ function getUrlVars() { $(function(){ if(getUrlVars().message){ var container = $('.alert-success'); - container.find('div').text($translations[$locale]['messages'][getUrlVars().message] || ('Message ' + getUrlVars().message + ' not found')); + // Prepend messages. if there is no path/period specified + var message = t((getUrlVars().message.indexOf('.') > -1 ? '' : 'messages.' ) + getUrlVars().message ) + container.find('div').text(message); container.show(); } if(getUrlVars().list_closed){ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 62ed3bea..9f70a62e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -10,5 +10,6 @@ * *= require_self *= require_directory . + *= require 'theme1/application' * require 'bootstrap-devise-rails' */ diff --git a/app/assets/stylesheets/supplier/application.css b/app/assets/stylesheets/supplier/application.css index d68297cb..8f468b1e 100644 --- a/app/assets/stylesheets/supplier/application.css +++ b/app/assets/stylesheets/supplier/application.css @@ -1,6 +1,6 @@ /* - *= require 'bootstrap_and_overrides' - *= require 'bootstrap_overrides' + *= require 'twitter-bootstrap/bootstrap_and_overrides' + *= require 'twitter-bootstrap/bootstrap_overrides' *= require 'jquery-ui-1.8.23.custom.css' *= require 'general' *= require_directory . diff --git a/app/assets/stylesheets/supplier/section_tables.css.sass b/app/assets/stylesheets/supplier/section_tables.css.sass index aee6723a..844232c6 100644 --- a/app/assets/stylesheets/supplier/section_tables.css.sass +++ b/app/assets/stylesheets/supplier/section_tables.css.sass @@ -1,7 +1,10 @@ $table-width: 75px +.section-title + font-size: 24px + padding: 4px 0px .section-tables-container - .section-title - font-size: 24px + .section-manage-tables + margin: -26px 6px 4px 6px .section-table background-color: #ccc height: 44px @@ -14,6 +17,7 @@ $table-width: 75px .table-link margin-top: -45px .table-number + color: black position: absolute top: 0 line-height: 44px @@ -44,6 +48,7 @@ $table-width: 75px text-decoration: none &.section-tables-inactive .section-table + position: relative margin-top: 10px margin-bottom: 30px float: left diff --git a/app/assets/stylesheets/theme1/application.css b/app/assets/stylesheets/theme1/application.css new file mode 100644 index 00000000..62ed3bea --- /dev/null +++ b/app/assets/stylesheets/theme1/application.css @@ -0,0 +1,14 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_directory . + * require 'bootstrap-devise-rails' + */ diff --git a/app/assets/stylesheets/theme1/theme1.css.sass b/app/assets/stylesheets/theme1/theme1.css.sass new file mode 100644 index 00000000..87b0dd71 --- /dev/null +++ b/app/assets/stylesheets/theme1/theme1.css.sass @@ -0,0 +1,214 @@ +body + background-color: #333 + margin: 0 + padding: 0 + background-image: image-url('theme1/footer-bg.jpg') + background-position: center top + .header-nav-banner + background-image: image-url('theme1/header.jpg') + background-position: center 25px + #header-wrap + #ceiling + position: relative + width: 100% + background-image: image-url('theme1/ceiling-center.jpg') + background-position: top center + background-repeat: no-repeat + .left + background-image: image-url('theme1/ceiling-left.jpg') + background-position: right top + background-repeat: repeat-x + height: 25px + position: absolute + left: 0 + width: 50% + .right + background-image: image-url('theme1/ceiling-right.jpg') + background-position: left top + background-repeat: repeat-x + height: 25px + position: absolute + right: 0 + width: 50% + .lights + position: absolute + height: 140px + width: 990px + left: 50% + margin-left: -495px + div + position: relative + background-repeat: no-repeat + width: 315px + height: 140px + float: left + z-index: 2 + &.light1 + background-image: image-url('theme1/light-1.jpg') + margin-left: 15px + margin-right: 2px + &.light2 + background-image: image-url('theme1/light-2.jpg') + margin-right: 3px + &.light3 + background-image: image-url('theme1/light-3.jpg') + .container + width: 960px + padding-top: 60px + position: relative + z-index: 4 + margin: 0 auto + #header + margin-bottom: 20px + height: 74px + a + margin: 20px + #nav-wrap + .container + clear: both + overflow: hidden + z-index: 100 + width: 900px + height: 48px + padding: 11px 25px 24px 25px + background-image: image-url('theme1/nav-bar.png') + background-repeat: no-repeat + background-position: 0 0 + margin: 0 auto + ul.nav + float: left + margin: 0 + padding: 0 + list-style: none + li + position: relative + float: left + list-style: none + a + border: 0 + color: white + display: block + float: left + font-family: 'Pacifico',serif + font-size: 18px + height: 46px + line-height: 46px + margin: 0 10px + padding: 0 20px + text-shadow: 0 2px 2px rgba(0, 0, 0, 0.5) + #banner-wrap + z-index: 2 + position: relative + .left + position: absolute + bottom: 0 + left: 0 + background-image: image-url('theme1/floor-left.jpg') + background-position: right + height: 48px + width: 50% + .right + position: absolute + bottom: 0 + right: 0 + background-image: image-url('theme1/floor-right.jpg') + background-position: left + height: 48px + width: 50% + .container + background-image: image-url('theme1/floor-center.jpg') + background-position: center bottom + background-repeat: no-repeat + margin: 0 auto + width: 982px + #banner + background-image: image-url('theme1/banner-bg.png') + background-position: 2px bottom + background-repeat: no-repeat + padding-bottom: 38px + position: relative + width: 982px + .wsite-header + border: 10px solid white + margin-left: 61px + width: 840px + height: 260px + background-image: image-url('theme1/banner-tall.jpg') + #main-wrap + font-size: 14px + font-family: Georgia, serif + line-height: 1.5 + color: #848585 + h1 + font-size: 28px + padding: 0.5em 0 0.2em 0 + line-height: 1.4 + font-family: 'Pacifico', serif + color: #AE571F + h2 + font-size: 24px + padding: 0.5em 0 0.2em 0 + line-height: 1.2 + font-family: 'Pacifico', serif + color: #AE571F + + + background-image: image-url('theme1/wall-bg.jpg') + background-position: center + overflow: visible + z-index: 2 + position: relative + .container + background-image: image-url('theme1/content-bg.png') + background-position: 2px + min-height: 400px + margin: 0 auto + width: 974px + .content-top + width: 960px + height: 30px + margin-left: 9px + background-image: image-url('theme1/content-top.jpg') + .main-inner + width: 894px + padding: 0 40px 30px 40px + #wsite-content + #footer-wrap + color: white + background-image: image-url('theme1/footer-bg.jpg') + background-position: center + text-align: right + overflow: visible + .footer-shadow + height: 72px + width: 100% + background-image: image-url('theme1/footer-top-shadow.png') + background-repeat: repeat-x + position: relative + z-index: 4 + .container + background-color: #420F03 + width: 838px + padding: 72px 30px 20px 30px + position: relative + top: -72px + z-index: 3 + overflow: visible + margin: 0 auto + .footer-top + width: 974px + height: 4px + position: relative + top: -72px + left: -60px + overflow: visible + background-image: image-url('theme1/footer-top.png') + .bottom + background-image: image-url('theme1/footer-bottom.png') + width: 898px + height: 35px + position: relative + bottom: -35px + left: -30px + overflow: visible + diff --git a/app/assets/stylesheets/twitter-bootstrap/application.css b/app/assets/stylesheets/twitter-bootstrap/application.css new file mode 100644 index 00000000..62ed3bea --- /dev/null +++ b/app/assets/stylesheets/twitter-bootstrap/application.css @@ -0,0 +1,14 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_directory . + * require 'bootstrap-devise-rails' + */ diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/twitter-bootstrap/bootstrap_and_overrides.css.less similarity index 100% rename from app/assets/stylesheets/bootstrap_and_overrides.css.less rename to app/assets/stylesheets/twitter-bootstrap/bootstrap_and_overrides.css.less diff --git a/app/assets/stylesheets/bootstrap_overrides.css.sass b/app/assets/stylesheets/twitter-bootstrap/bootstrap_overrides.css.sass similarity index 100% rename from app/assets/stylesheets/bootstrap_overrides.css.sass rename to app/assets/stylesheets/twitter-bootstrap/bootstrap_overrides.css.sass diff --git a/app/assets/stylesheets/user/application.css b/app/assets/stylesheets/user/application.css index 7e128833..f6daff02 100644 --- a/app/assets/stylesheets/user/application.css +++ b/app/assets/stylesheets/user/application.css @@ -8,8 +8,8 @@ * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * - *= require 'bootstrap_and_overrides' - *= require 'bootstrap_overrides' + *= require 'twitter-bootstrap/bootstrap_and_overrides' + *= require 'twitter-bootstrap/bootstrap_overrides' *= require 'general' *= require_directory . *= require_self diff --git a/app/controllers/suppliers/lists_controller.rb b/app/controllers/suppliers/lists_controller.rb index 5868a539..2868099d 100644 --- a/app/controllers/suppliers/lists_controller.rb +++ b/app/controllers/suppliers/lists_controller.rb @@ -11,7 +11,7 @@ module Suppliers @start_time += current_supplier.night_offset.to_f.hours @end_time += current_supplier.night_offset.to_f.hours end - @lists = List.for_user_created_at current_user, @start_time..@end_time + @lists = List.for_supplier_created_at current_supplier, @start_time..@end_time respond_to do |format| format.html # index.html.erb diff --git a/app/models/list.rb b/app/models/list.rb index 8d48925d..cb513a70 100644 --- a/app/models/list.rb +++ b/app/models/list.rb @@ -19,6 +19,8 @@ class List validates :supplier_id, presence: true view :by_supplier_id_and_id, key: [:supplier_id, :_id] + view :by_supplier_id, key: :supplier_id + view :for_supplier_view, key: [:supplier_id, :created_at] view :active_by_table_id_view, type: :custom, map_function: %|function(doc){ if(doc.ruby_class == 'List' && doc.state == 'active'){ @@ -83,6 +85,10 @@ class List database.view(for_user_view({startkey: [user.id, range.last], endkey: [user.id, range.first], include_docs: true, reduce: false, descending: true}.merge(options))) end + def self.for_supplier_created_at(supplier, range, options = {}) + database.view(for_supplier_view({startkey: [supplier.id, range.last], endkey: [supplier.id, range.first], include_docs: true, reduce: false, descending: true}.merge(options))) + end + def close! orders.include_relation(:product_orders) set_price diff --git a/app/views/dashboard/home.html.slim b/app/views/dashboard/home.html.slim index 4e24d673..b507f899 100644 --- a/app/views/dashboard/home.html.slim +++ b/app/views/dashboard/home.html.slim @@ -1,5 +1,3 @@ -.page-header - h1 Qwaiter p = image_tag 'qr.png', class: 'home-qr' |Welcome on the Qwaiter homepage. Qwaiter is an application that lets you place orders by simply scanning a code from a table on a terrace or a restaurant. Then directly the menu appears and you can place your order. See the progress while you wait for your drinks! diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index c869959e..1360fa81 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -11,28 +11,48 @@ html lang="en" /[if lt IE 9] = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js" = stylesheet_link_tag "application", :media => "all" - link href="/images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144" - link href="/images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114" - 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="/favicon.ico" rel="shortcut icon" + link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css' body - .container - - .navbar - .navbar-inner + .header-nav-banner + #header-wrap + #ceiling + .left + .right + .lights + .light1 + .light2 + .light3 .container - a.btn.btn-navbar data-target=".nav-collapse" data-toggle="collapse" - span.icon-bar - span.icon-bar - span.icon-bar - a.brand href=root_path = image_tag 'icons/logo-small.png', alt: application_title - .container.nav-collapse - ul.nav - li= link_to User.model_name.human_plural, user_root_path - li= link_to Supplier.model_name.human_plural, supplier_root_path - + #header + = link_to image_tag('icons/logo-small.png', alt: application_title), root_path + #nav-wrap + .container + ul.nav + li= link_to User.model_name.human_plural, user_root_path + li= link_to Supplier.model_name.human_plural, supplier_root_path + #banner-wrap + .left + .right + .container + #banner + .wsite-header + .clearing + #main-wrap + .container + .content-top + .main-inner + #wsite-content.wsite-not-footer= yield + #footer-wrap + .footer-shadow + .container + .footer-top + .bottom + p © Companytools 2012 + = yield :footer + + .content - if flash[:alert].present? .alert.alert-error @@ -42,23 +62,4 @@ html lang="en" .alert.alert-success a.close data-dismiss="alert" × div= flash[:notice] - .row - .span9 - = yield - .span3 - .well.sidebar-nav - h3= application_title - ul.nav.nav-list - li.nav-header Links - li= link_to "Home", root_path - li= link_to "Companytools", 'http://www.companytools.nl/' - = yield :sidebar - - footer - p © Companytools 2012 - /! - Javascripts - \================================================== - /! Placed at the end of the document so the pages load faster = javascript_include_tag "application" - = yield :footer diff --git a/app/views/layouts/phone.html.slim b/app/views/layouts/phone.html.slim index 8201c953..e8b46123 100644 --- a/app/views/layouts/phone.html.slim +++ b/app/views/layouts/phone.html.slim @@ -17,8 +17,8 @@ html lang="en" link href="/images/apple-touch-icon.png" rel="apple-touch-icon-precomposed" link href="/favicon.ico" rel="shortcut icon" javascript: - var data_host = 'http://data.qwaiter.com'; - //var data_host = 'http://localhost:3000'; + //var data_host = 'http://data.qwaiter.com'; + var data_host = 'http://localhost:3000'; //var data_host = 'http://192.168.1.74:3000'; var $locale = '#{I18n.locale}'; var $url_vars = null; diff --git a/app/views/layouts/twitter-bootstrap.html.slim b/app/views/layouts/twitter-bootstrap.html.slim new file mode 100644 index 00000000..c869959e --- /dev/null +++ b/app/views/layouts/twitter-bootstrap.html.slim @@ -0,0 +1,64 @@ +doctype html +html lang="en" + head + meta charset="utf-8" + meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" + meta name="viewport" content="width=device-width, initial-scale=1.0" + title= content_for?(:title) ? yield(:title) : application_title + = csrf_meta_tags + + /! Le HTML5 shim, for IE6-8 support of HTML elements + /[if lt IE 9] + = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js" + = stylesheet_link_tag "application", :media => "all" + link href="/images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144" + link href="/images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114" + 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="/favicon.ico" rel="shortcut icon" + + body + .container + + .navbar + .navbar-inner + .container + a.btn.btn-navbar data-target=".nav-collapse" data-toggle="collapse" + span.icon-bar + span.icon-bar + span.icon-bar + a.brand href=root_path = image_tag 'icons/logo-small.png', alt: application_title + .container.nav-collapse + ul.nav + li= link_to User.model_name.human_plural, user_root_path + li= link_to Supplier.model_name.human_plural, supplier_root_path + + .content + - if flash[:alert].present? + .alert.alert-error + a.close data-dismiss="alert" × + div= flash[:alert] + - if flash[:notice].present? + .alert.alert-success + a.close data-dismiss="alert" × + div= flash[:notice] + .row + .span9 + = yield + .span3 + .well.sidebar-nav + h3= application_title + ul.nav.nav-list + li.nav-header Links + li= link_to "Home", root_path + li= link_to "Companytools", 'http://www.companytools.nl/' + = yield :sidebar + + footer + p © Companytools 2012 + /! + Javascripts + \================================================== + /! Placed at the end of the document so the pages load faster + = javascript_include_tag "application" + = yield :footer diff --git a/app/views/suppliers/sections/manage_tables.html.slim b/app/views/suppliers/sections/manage_tables.html.slim index 3bde4d9d..17ee73b3 100644 --- a/app/views/suppliers/sections/manage_tables.html.slim +++ b/app/views/suppliers/sections/manage_tables.html.slim @@ -21,6 +21,18 @@ = link_to :i, [:suppliers, table], class: 'btn btn-mini table-link' .table-number = table.number .clearfix +.form-actions + = link_to t("helpers.links.back"), suppliers_sections_path, class: 'btn' + ' + = link_to t('helpers.links.edit'), [:edit, :suppliers, @section], class: 'btn' + ' + = link_to t('supplier.section.tables_view'), [:tables_view, :suppliers, @section], class: [:btn, 'btn-info'] + ' + a.btn href='#add-tables-modal' role='button' data-toggle='modal'= t('supplier.section.add_tables.button_label') + ' + a.btn href='#arrange-tables-modal' role='button' data-toggle='modal'= t('supplier.section.arrange_tables.button_label') + ' + = link_to t("helpers.links.destroy"), [:suppliers, @section], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger' - content_for :footer do javascript: var current_section_id = '#{@section.id}'; @@ -34,3 +46,22 @@ Qsupplier.position_table_in_active_section(active_section_container, $(this), true); }); }); +#add-tables-modal.modal.hide.fade tabindex=-1 role=:dialog aria-labeledby='add-tables-modal-label' aria-hidden=true + .modal-header + button.close type=:button data-dismiss=:modal aria-hidden=true x + h3#add-tables-modal-label= t('supplier.section.add_tables.modal.title') + .modal-body + p= t('supplier.section.add_tables.modal.body_header') + form.form-horizontal + .control-group + label.control-label for='add-tables-number-start' = t('supplier.section.add_tables.modal.number_start') + .controls + input.input-mini#add-tables-number-start type=:number value=100 + .control-group + label.control-label for='add-tables-number-end' = t('supplier.section.add_tables.modal.number_end') + .controls + input.input-mini#add-tables-number-end type=:number value=120 + .modal-footer + a.btn href='#' Close + a.btn.btn-primary href='#' onclick=%|Qsupplier.add_tables_to_active_section()| Add + diff --git a/app/views/suppliers/sections/show.html.slim b/app/views/suppliers/sections/show.html.slim index 4cd46089..6f97a119 100644 --- a/app/views/suppliers/sections/show.html.slim +++ b/app/views/suppliers/sections/show.html.slim @@ -1,6 +1,14 @@ - model_class = Section .page-header= title :show, @section - +dl.dl-horizontal.show-list + dt= model_class.human_attribute_name(:title) + dd= @section.title +dl.dl-horizontal.show-list + dt= model_class.human_attribute_name(:width) + dd= @section.width +dl.dl-horizontal.show-list + dt= model_class.human_attribute_name(:height) + dd= @section.height .form-actions = link_to t("helpers.links.back"), suppliers_sections_path, class: 'btn' ' diff --git a/app/views/suppliers/sections/tables_view.html.slim b/app/views/suppliers/sections/tables_view.html.slim index 8fda7ac4..5a683b94 100644 --- a/app/views/suppliers/sections/tables_view.html.slim +++ b/app/views/suppliers/sections/tables_view.html.slim @@ -1,8 +1,9 @@ - model_class = Section - content_for :row do + .span12.section-title= @section.title .span12 .well.section-tables-container.section-tables-active - .section-title.pull-right= @section.title + .section-manage-tables.pull-right= link_to '', manage_tables_suppliers_section_path(@section), class: 'icon-pencil btn' - for table in @section.tables .section-table.hide{ id="section-table-#{table.id}" data-position-x=table.position_x data-position-y=table.position_y data-table-id=table.id} .table-number = link_to table.number, suppliers_table_path(table) diff --git a/config/locales/en.yml b/config/locales/en.yml index c4ef7670..50fd965d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -65,6 +65,10 @@ en: price: Price list: created_at: Created + state: Status + needs_help: Needs attention + needs_payment: Wants to pay + closed_at: Closed at supplier: menu: active_lists: Active %{lists} @@ -84,6 +88,16 @@ en: lists: show: title: Show %{list} + section: + tables_view: Tables view + add_tables: + button_label: Add tables + modal: + title: Add tables + arrange_tables: + button_label: Arrange tables + modal: + title: Arrange tables user: active_list: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index fe7b10e6..c75ca530 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -64,6 +64,15 @@ nl: price: Prijs list: created_at: Aangemaakt + state: Status + needs_help: Vraag actief + needs_payment: Rekening gevraagd + closed_at: Afgesloten op + price: Prijs + section: + title: Titel + width: Breedte + height: Lengte supplier: menu: active_lists: Actieve %{lists} @@ -83,6 +92,20 @@ nl: lists: show: title: "%{list} tonen" + section: + tables_view: Tafel overzicht + add_tables: + button_label: Voeg tafels toe + modal: + title: Voeg tafels toe + body_header: "" + number_start: Vanaf nummer + number_end: Tot nummer + arrange_tables: + button_label: Positioneer tafels + modal: + title: Positioneer tafels + body_header: "" user: active_list: