From 790771946627303280f2b5211df80b7bd1c9c13c Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Fri, 5 Sep 2014 10:49:51 +0200 Subject: [PATCH] User top menu fixed --- .../lists_index_controller.js.coffee | 3 +- .../user/app/templates/application.emblem | 50 +++++++++---------- .../user/app/templates/lists/index.emblem | 2 +- .../user/foundation/_qconstants.css.sass | 1 + .../user/foundation/_qlists.css.sass | 2 + .../user/foundation/_structure.css.sass | 1 + .../user/foundation/application.css.sass | 2 +- .../foundation/components/_menu_main.css.sass | 26 +++++++--- 8 files changed, 51 insertions(+), 36 deletions(-) diff --git a/app/assets/javascripts/user/app/controllers/lists_index_controller.js.coffee b/app/assets/javascripts/user/app/controllers/lists_index_controller.js.coffee index 57ed4460..0e9d6258 100644 --- a/app/assets/javascripts/user/app/controllers/lists_index_controller.js.coffee +++ b/app/assets/javascripts/user/app/controllers/lists_index_controller.js.coffee @@ -1 +1,2 @@ -App.ListsIndexController = Ember.ArrayController.extend App.PaginationModule +App.ListsIndexController = Ember.ArrayController.extend App.PaginationModule, + lists: (->@get('model').sortBy('created_at').reverse()).property('model.@each') diff --git a/app/assets/javascripts/user/app/templates/application.emblem b/app/assets/javascripts/user/app/templates/application.emblem index 8ddeb267..e34416e9 100644 --- a/app/assets/javascripts/user/app/templates/application.emblem +++ b/app/assets/javascripts/user/app/templates/application.emblem @@ -1,29 +1,29 @@ header.top-menu - .toggle-side-menu - span - .menu-content - section.main-buttons - link-to 'index' class="top-menu-logo" - = image_tag 'user/logo-small.png' - if list.id - App.MenuItemView route="active_list" - App.MenuItemView route='table' route_param=list.table.id - App.MenuItemListNeedsHelpView - App.MenuItemListNeedsPaymentView - section.extra-info - if list - .supplier-info-row - .supplier-name= list.supplier.name - .table-number - |#  - = list.table.number - .supplier-info-row - .counter.supplier-orders-placed-count - = list.supplier.orders_placed_count - span.orders-placed-count-icon - .counter.supplier-orders-in-process-count - = list.supplier.orders_in_process_count - span.orders-in-process-count-icon + .toggle-side-menu: span + .top-menu-bar + .menu-content + section.main-buttons + link-to 'index' class="top-menu-logo" + = image_tag 'user/logo-small.png' + if list.id + App.MenuItemView route="active_list" + App.MenuItemView route='table' route_param=list.table.id + App.MenuItemListNeedsHelpView + App.MenuItemListNeedsPaymentView + section.extra-info + if list + .supplier-info-row + .supplier-name= list.supplier.name + .table-number + |#  + = list.table.number + .supplier-info-row + .counter.supplier-orders-placed-count + = list.supplier.orders_placed_count + span.orders-placed-count-icon + .counter.supplier-orders-in-process-count + = list.supplier.orders_in_process_count + span.orders-in-process-count-icon aside.side-menu ul li.title: h3 Menu diff --git a/app/assets/javascripts/user/app/templates/lists/index.emblem b/app/assets/javascripts/user/app/templates/lists/index.emblem index c1bb56ce..7031fc6c 100644 --- a/app/assets/javascripts/user/app/templates/lists/index.emblem +++ b/app/assets/javascripts/user/app/templates/lists/index.emblem @@ -1,6 +1,6 @@ .row h2=t 'models.plural.list' - each list in controller: App.ListIndexView contentBinding='list' + each list in lists: App.ListIndexView contentBinding='list' .clearfix if hasMore button{action "showMore"}=t 'lists.show_more' diff --git a/app/assets/stylesheets/user/foundation/_qconstants.css.sass b/app/assets/stylesheets/user/foundation/_qconstants.css.sass index b0182b74..c58c3cf1 100644 --- a/app/assets/stylesheets/user/foundation/_qconstants.css.sass +++ b/app/assets/stylesheets/user/foundation/_qconstants.css.sass @@ -7,3 +7,4 @@ $wood: image-url('theme1/wall-bg.jpg') $background-brown: #57351f $current-color: #ff0 $active-color: #f70 +$top-menu-height: 90px diff --git a/app/assets/stylesheets/user/foundation/_qlists.css.sass b/app/assets/stylesheets/user/foundation/_qlists.css.sass index eac92f99..eac976a6 100644 --- a/app/assets/stylesheets/user/foundation/_qlists.css.sass +++ b/app/assets/stylesheets/user/foundation/_qlists.css.sass @@ -1,6 +1,8 @@ .lists-overview-entry +grid-column(12) cursor: pointer + // Transparent border to get same size as active box + border: 1px solid transparent border-bottom: 1px solid #ddd margin-bottom: 12px @media #{$medium-only} diff --git a/app/assets/stylesheets/user/foundation/_structure.css.sass b/app/assets/stylesheets/user/foundation/_structure.css.sass index 58ba9c4a..5a3cc71c 100644 --- a/app/assets/stylesheets/user/foundation/_structure.css.sass +++ b/app/assets/stylesheets/user/foundation/_structure.css.sass @@ -8,6 +8,7 @@ body #ember-app-container background-image: image-url('theme1/wall-bg.jpg') background-repeat: repeat + padding-top: $top-menu-height main.main-section +panel($bg:rgba(200,200,200,0.8)) diff --git a/app/assets/stylesheets/user/foundation/application.css.sass b/app/assets/stylesheets/user/foundation/application.css.sass index a35e3978..c48d7b1e 100644 --- a/app/assets/stylesheets/user/foundation/application.css.sass +++ b/app/assets/stylesheets/user/foundation/application.css.sass @@ -1,7 +1,7 @@ +@import constants @import ./qconstants @import ./foundation_and_overrides @import font-awesome -@import constants @import ./structure @import ./components/* @import ./qmodal diff --git a/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass b/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass index 1f131591..aaf8d29a 100644 --- a/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass +++ b/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass @@ -1,12 +1,22 @@ header.top-menu - height: 90px - background-color: transparent - background-repeat: no-repeat, no-repeat - background-position: left bottom, right bottom - background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png') - color: $green - padding-left: 48px - padding-right: 52px + // Fixed styling rules copied from foundation top-menu fixed + width: 100% + #{$default-float}: 0 + position: fixed + top: 0 + z-index: 99 + + background-image: image-url('theme1/wall-bg.jpg') + height: $top-menu-height + .top-menu-bar + color: $green + height: $top-menu-height + background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png') + background-color: transparent + background-repeat: no-repeat, no-repeat + background-position: left bottom, right bottom + padding-left: 48px + padding-right: 52px .top-menu-logo @media #{$small-only} display: none