Add supplier info popup
This commit is contained in:
@@ -24,3 +24,7 @@ App.ApplicationController = Ember.Controller.extend
|
||||
markSupplierOpen: ->
|
||||
return unless supplier = @get('supplier')
|
||||
supplier.open_the_place()
|
||||
showSupplierStatusInfo: ->
|
||||
@modal 'supplier_status_info',
|
||||
model: @get('supplier')
|
||||
title_path: 'supplier_status_info.title'
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
translation_params = {}
|
||||
if model = @get('model')
|
||||
translation_params = model.serialize() if model.serialize
|
||||
return new Ember.Handlebars.SafeString(tspan(@title_path, translation_params)) if @title_path
|
||||
|
||||
return tspan(@title_path, translation_params).htmlSafe() if @title_path
|
||||
# return translated title_path if directly set by options
|
||||
return new Ember.Handlebars.SafeString(tspan(@get('modal_options.title_path'), translation_params)) if @get('modal_options.title_path')
|
||||
return tspan(@get('modal_options.title_path'), translation_params).htmlSafe() if @get('modal_options.title_path')
|
||||
# infer title path based on controller name App.modals.AddSectionController => add_section
|
||||
underscored = `this.constructor.toString().substr(11).replace(/Controller$/, '').underscore()`
|
||||
# find translated title or humanize the controller name
|
||||
if convention_translation = ttry("modal.#{underscored}.title", translation_params)
|
||||
new Ember.Handlebars.SafeString(tspan(@get("modal.#{underscored}.title"), translation_params))
|
||||
tspan(@get("modal.#{underscored}.title"), translation_params).htmlSafe()
|
||||
else
|
||||
underscored.capitalize().replace(/_/, ' ')
|
||||
).property('model.id')
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
= partial "global/top_menu"
|
||||
= partial "global/side_menu"
|
||||
.main-section= outlet
|
||||
= view flash_message
|
||||
= outlet modal
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
aside.side-menu
|
||||
ul
|
||||
li.title: h3 Menu
|
||||
li.supplier-name= supplier.name
|
||||
if supplier.open
|
||||
li: a.supplier-close-shop{action "markSupplierClosed"}= t 'supplier.close_for_orders'
|
||||
else
|
||||
li: a.supplier-open-shop{action "markSupplierOpen"}= t 'supplier.open_for_orders'
|
||||
= link-to "settings" class="supplier-settings-link"
|
||||
= t 'supplier.settings'
|
||||
li class="supplier-sign-out-link": a{action "signOut"}= t 'supplier.sign_out'
|
||||
@@ -13,7 +13,7 @@ header.top-menu
|
||||
= t 'models.plural.table'
|
||||
= link-to "lists" class="top-menu-lists"
|
||||
= t 'models.plural.list'
|
||||
.extra-info
|
||||
.extra-info{action "showSupplierStatusInfo"}
|
||||
.supplier-info-row
|
||||
.counter.supplier-orders-placed-count
|
||||
span.supplier-orders-placed-count-number= supplier.orders_placed_count
|
||||
@@ -22,14 +22,3 @@ header.top-menu
|
||||
.counter.supplier-orders-in-process-count
|
||||
span.supplier-orders-in-process-count-number= supplier.orders_in_process_count
|
||||
span.orders-in-process-count-icon
|
||||
aside.side-menu
|
||||
ul
|
||||
li.title: h3 Menu
|
||||
li.supplier-name= supplier.name
|
||||
if supplier.open
|
||||
li: a.supplier-close-shop{action "markSupplierClosed"}= t 'supplier.close_for_orders'
|
||||
else
|
||||
li: a.supplier-open-shop{action "markSupplierOpen"}= t 'supplier.open_for_orders'
|
||||
= link-to "settings" class="supplier-settings-link"
|
||||
= t 'supplier.settings'
|
||||
li class="supplier-sign-out-link": a{action "signOut"}= t 'supplier.sign_out'
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
p== t 'supplier_status_info.header'
|
||||
.row: .small-12.columns
|
||||
.counter.supplier-orders-placed-count
|
||||
= model.orders_placed_count
|
||||
span.orders-placed-count-icon
|
||||
= t 'supplier_status_info.orders_placed_count_explanation' count=model.orders_placed_count
|
||||
.row: .small-12.columns
|
||||
.counter.supplier-orders-in-process-count
|
||||
= model.orders_in_process_count
|
||||
span.orders-in-process-count-icon
|
||||
= t 'supplier_status_info.orders_in_process_count_explanation' count=model.orders_in_process_count
|
||||
hr
|
||||
button.modal-confirm.right{action "close"}= t 'supplier_status_info.close'
|
||||
@@ -6,7 +6,7 @@
|
||||
tr
|
||||
th=t 'attributes.table.number'
|
||||
th.link=t 'models.section'
|
||||
th.timestamp= t 'attributes.table.created_at'
|
||||
/th.timestamp= t 'attributes.table.created_at'
|
||||
th.actions=t 'helpers.actions.title'
|
||||
tbody
|
||||
each table in tables
|
||||
@@ -16,8 +16,11 @@
|
||||
if table.section
|
||||
= link-to 'section' table.section
|
||||
= table.section.title
|
||||
td.numeric=time table.created_at
|
||||
/td.timestamp=time table.created_at
|
||||
td.actions
|
||||
a.table-edit{ action 'editTable' table }: span
|
||||
a.table-destroy{ action 'destroyTable' table }: span
|
||||
a.button.new-table-button{action "newTable"}= t 'table.new_button'
|
||||
a.table-qr-codes{path qr_codes_suppliers_tables}
|
||||
span
|
||||
= t 'table.print_qr_codes'
|
||||
|
||||
@@ -21,6 +21,7 @@ $.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
|
||||
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
|
||||
|
||||
String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); }
|
||||
|
||||
window.time_zones = <%= ActiveSupport::TimeZone.all.map{|tz| {name: tz.name, formatted: "GMT#{tz.formatted_offset} #{tz.name}"}}.to_json.html_safe %>;
|
||||
window.countries = <%= IsoCountryCodes.all.map{|cc| {name: cc.name}}.to_json.html_safe %>;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
selector = $( selector || document)
|
||||
selector.find(".locale-select").show()
|
||||
selector.find(".locale-select-" + locale).hide()
|
||||
moment.lang locale
|
||||
moment.locale locale
|
||||
if selector
|
||||
selector.find("[data-t]").each ->
|
||||
$(this).html t($(this).data("t"), $(this).data("tAttributes"))
|
||||
|
||||
@@ -1,74 +1,5 @@
|
||||
.top-menu
|
||||
.top-menu-bar
|
||||
.menu-content
|
||||
section.main-buttons
|
||||
if list.id
|
||||
link-to 'index' class="top-menu-logo with-list"
|
||||
= image_tag 'user/logo-small.png'
|
||||
= view "menu-item" route="active_list"
|
||||
= view "menu-item" route="table" route_param=list.table.id
|
||||
= view "menu-item-list-needs-help"
|
||||
= view "menu-item-list-needs-payment"
|
||||
else
|
||||
link-to 'index' class="top-menu-logo without-list"
|
||||
= image_tag 'user/logo-small.png'
|
||||
= view "menu-item-scan-qr"
|
||||
= view "menu-item-product-orders"
|
||||
if list
|
||||
.extra-info{action "showSupplierStatusInfo"}
|
||||
.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
|
||||
.supplier-info-row
|
||||
.counter.supplier-orders-in-process-count
|
||||
= list.supplier.orders_in_process_count
|
||||
span.orders-in-process-count-icon
|
||||
.side-menu
|
||||
.toggle-side-menu: span
|
||||
ul
|
||||
li.title: h3 Menu
|
||||
li
|
||||
= link-to 'index'
|
||||
span Home
|
||||
li
|
||||
a{action "scanQr" bubbles=false}
|
||||
span.scan-qr-icon
|
||||
span Scan QR
|
||||
if list.id
|
||||
li
|
||||
=link-to 'table' list.table.id class="side-menu-list-products"
|
||||
span.fa.fa-cutlery
|
||||
span.fa.fa-glass
|
||||
= t 'list_products.title'
|
||||
li
|
||||
=link-to 'active_list' class="side-menu-active-list"
|
||||
span.active-list-icon
|
||||
span= t 'active_list.title'
|
||||
if list.join_requests
|
||||
li
|
||||
=link-to 'join_requests'
|
||||
span= t 'models.plural.join_request'
|
||||
li
|
||||
=link-to 'lists' class="side-menu-lists"
|
||||
span= t 'models.plural.list'
|
||||
li
|
||||
=link-to 'settings'
|
||||
span.settings-icon
|
||||
span= t 'settings.title'
|
||||
li
|
||||
=link-to 'about' class="side-menu-about"
|
||||
span.about-mozo-icon
|
||||
span=t 'about.title'
|
||||
li.hide
|
||||
a{action "openDebugger"}
|
||||
span.fa.fa-wrench.fa-lg
|
||||
span Debugger
|
||||
= partial "global/top_menu"
|
||||
= partial "global/side_menu"
|
||||
.main-section
|
||||
.main-section-content
|
||||
if notice
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
.side-menu
|
||||
.toggle-side-menu: span
|
||||
ul
|
||||
li.title: h3 Menu
|
||||
li
|
||||
= link-to 'index'
|
||||
span Home
|
||||
li
|
||||
a{action "scanQr" bubbles=false}
|
||||
span.scan-qr-icon
|
||||
span Scan QR
|
||||
if list.id
|
||||
li
|
||||
=link-to 'table' list.table.id class="side-menu-list-products"
|
||||
span.fa.fa-cutlery
|
||||
span.fa.fa-glass
|
||||
= t 'list_products.title'
|
||||
li
|
||||
=link-to 'active_list' class="side-menu-active-list"
|
||||
span.active-list-icon
|
||||
span= t 'active_list.title'
|
||||
if list.join_requests
|
||||
li
|
||||
=link-to 'join_requests'
|
||||
span= t 'models.plural.join_request'
|
||||
li
|
||||
=link-to 'lists' class="side-menu-lists"
|
||||
span= t 'models.plural.list'
|
||||
li
|
||||
=link-to 'settings'
|
||||
span.settings-icon
|
||||
span= t 'settings.title'
|
||||
li
|
||||
=link-to 'about' class="side-menu-about"
|
||||
span.about-mozo-icon
|
||||
span=t 'about.title'
|
||||
li.hide
|
||||
a{action "openDebugger"}
|
||||
span.fa.fa-wrench.fa-lg
|
||||
span Debugger
|
||||
@@ -0,0 +1,31 @@
|
||||
.top-menu
|
||||
.top-menu-bar
|
||||
.menu-content
|
||||
section.main-buttons
|
||||
if list.id
|
||||
link-to 'index' class="top-menu-logo with-list"
|
||||
= image_tag 'user/logo-small.png'
|
||||
= view "menu-item" route="active_list"
|
||||
= view "menu-item" route="table" route_param=list.table.id
|
||||
= view "menu-item-list-needs-help"
|
||||
= view "menu-item-list-needs-payment"
|
||||
else
|
||||
link-to 'index' class="top-menu-logo without-list"
|
||||
= image_tag 'user/logo-small.png'
|
||||
= view "menu-item-scan-qr"
|
||||
= view "menu-item-product-orders"
|
||||
if list
|
||||
.extra-info{action "showSupplierStatusInfo"}
|
||||
.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
|
||||
.supplier-info-row
|
||||
.counter.supplier-orders-in-process-count
|
||||
= list.supplier.orders_in_process_count
|
||||
span.orders-in-process-count-icon
|
||||
@@ -16,6 +16,8 @@ table
|
||||
text-align: right
|
||||
&.date
|
||||
text-align: right
|
||||
a.table-qr-codes
|
||||
+button-icon-only
|
||||
.table-edit
|
||||
+button($bg: $secondary-color)
|
||||
+button-icon-only
|
||||
@@ -24,7 +26,6 @@ table
|
||||
@extend .fa-pencil
|
||||
a.table-qr-codes
|
||||
+button($bg: $secondary-color)
|
||||
+button-icon-only
|
||||
span
|
||||
@extend .fa
|
||||
@extend .fa-qrcode
|
||||
|
||||
Reference in New Issue
Block a user