End of week commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
Ember.Handlebars.registerBoundHelper 'boolean', (truefalse, options={})->
|
||||||
|
classname = if truefalse then 'boolean-true' else 'boolean-false'
|
||||||
|
new Handlebars.SafeString("<span class=\"#{classname}\"></span>")
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Ember.Handlebars.registerBoundHelper 'state', (subject, state, options={})->
|
||||||
|
path = "state.#{subject}.#{state}"
|
||||||
|
new Handlebars.SafeString("<span data-t=\"#{path}\">#{t(path)}</span>")
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Qsupplier.App.ListsController = Ember.ArrayController.extend
|
||||||
|
dateChanged: (->
|
||||||
|
@set('model', @store.find('list', date: @get('date')))
|
||||||
|
).observes('date')
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
Qsupplier.App.SectionController = Ember.ObjectController.extend
|
Qsupplier.App.SectionController = Ember.ObjectController.extend
|
||||||
needs: ['application']
|
needs: ['application', 'sections', 'section'] #wtf? section, otherwise an Ember error
|
||||||
editmode: false
|
editmode: false
|
||||||
makeEditable: -> @set('editmode', true)
|
makeEditable: -> @set('editmode', true)
|
||||||
finishEditable: ->
|
finishEditable: ->
|
||||||
@@ -14,3 +14,4 @@ Qsupplier.App.SectionController = Ember.ObjectController.extend
|
|||||||
closeList: (list)-> list.close() if list
|
closeList: (list)-> list.close() if list
|
||||||
textures: ['wood1', 'wood2']
|
textures: ['wood1', 'wood2']
|
||||||
|
|
||||||
|
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
Qsupplier.App.SectionsController = Ember.ArrayController.extend
|
Qsupplier.App.SectionsController = Ember.ArrayController.extend
|
||||||
needs: ['application', 'section']
|
needs: ['application']
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
Qsupplier.App.SectionsIndexController = Ember.ArrayController.extend
|
||||||
|
needs: ['application', 'sections']
|
||||||
|
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
||||||
|
sectionQrCodesUrl: ((a,b,c)->
|
||||||
|
debugger
|
||||||
|
Routes.qr_codes_suppliers_tables_path()
|
||||||
|
).property()
|
||||||
|
newPath: Routes.new_suppliers_section_path()
|
||||||
|
qrPath: (section_id)->
|
||||||
|
Routes.qr_codes_suppliers_tables_path section_id: section_id
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
Ember.Handlebars.registerHelper 'path', (route, params..., options)->
|
||||||
|
route_method = Routes["#{route}_path"]
|
||||||
|
throw "Route #{route} cannout be found" unless route_method
|
||||||
|
|
||||||
|
mapped_options = {}
|
||||||
|
|
||||||
|
for k, v of options.hash
|
||||||
|
mapped_options[k] = Ember.Handlebars.get(this, v, options) || v
|
||||||
|
params.push mapped_options
|
||||||
|
|
||||||
|
path = route_method.apply(this, params)
|
||||||
|
new Handlebars.SafeString("href='#{path}'")
|
||||||
@@ -7,6 +7,7 @@ Qsupplier.App.List = DS.Model.extend
|
|||||||
is_paid: attr 'boolean'
|
is_paid: attr 'boolean'
|
||||||
has_active_orders: attr 'boolean'
|
has_active_orders: attr 'boolean'
|
||||||
price: attr 'number'
|
price: attr 'number'
|
||||||
|
closed_at: DS.attr('date')
|
||||||
table_number: attr 'number'
|
table_number: attr 'number'
|
||||||
table: DS.belongsTo('table', inverse: 'active_list')
|
table: DS.belongsTo('table', inverse: 'active_list')
|
||||||
#users: DS.hasMany('user', inverse: 'active_list')
|
#users: DS.hasMany('user', inverse: 'active_list')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
DS.Model.reopen
|
DS.Model.reopen
|
||||||
created_at: DS.attr('string')
|
created_at: DS.attr('date')
|
||||||
updated_at: DS.attr('string')
|
updated_at: DS.attr('date')
|
||||||
DS.Model.reopenClass
|
DS.Model.reopenClass
|
||||||
findCached: (id)->
|
findCached: (id)->
|
||||||
return null unless id
|
return null unless id
|
||||||
|
|||||||
@@ -8,4 +8,6 @@ Qsupplier.App.Router.map ->
|
|||||||
@route '/', queryParams: ['section_id']
|
@route '/', queryParams: ['section_id']
|
||||||
@resource 'sections', ->
|
@resource 'sections', ->
|
||||||
@resource 'section', path: ':section_id'
|
@resource 'section', path: ':section_id'
|
||||||
|
@resource 'lists', ->
|
||||||
|
@resource 'list', path: ':list_id'
|
||||||
#@resource 'lists', queryParams: ['state']
|
#@resource 'lists', queryParams: ['state']
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Qsupplier.App.ListsRoute = Ember.Route.extend
|
||||||
|
#model: -> @store.find 'list'
|
||||||
|
setupController: (controller, model)->
|
||||||
|
controller.set 'date', (new Date()).toISOString().substr(0,10)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
h1=t 'models.plural.list'
|
||||||
|
Qsupplier.App.ListDisplayDateSelector valueBinding=date
|
||||||
|
if controller.model
|
||||||
|
table.table
|
||||||
|
thead
|
||||||
|
tr
|
||||||
|
th.state=t 'attributes.list.state'
|
||||||
|
th.boolean=t 'attributes.list.needs_help'
|
||||||
|
th.boolean=t 'attributes.list.needs_payment'
|
||||||
|
th.timestamp=t 'attributes.list.closed_at'
|
||||||
|
th.table_number=t 'models.table'
|
||||||
|
th.currentcy=t 'attributes.list.price'
|
||||||
|
th.timestamp=t 'attributes.list.created_at'
|
||||||
|
tbody
|
||||||
|
each list in controller
|
||||||
|
tr
|
||||||
|
td.state=state 'list' list.state
|
||||||
|
td.boolean.needs_help=boolean list.needs_help
|
||||||
|
td.boolean.needs_payment=boolean list.needs_payment
|
||||||
|
td.timestamp=time list.closed_at
|
||||||
|
td.table_number 7
|
||||||
|
td.currency=currency list.price
|
||||||
|
td.timestamp=time list.created_at
|
||||||
|
else
|
||||||
|
.row
|
||||||
|
.panel=t 'list.none_found'
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
.section-tabs-container
|
||||||
|
link-to 'sections' | b
|
||||||
|
each section in sections
|
||||||
|
view Qsupplier.App.SectionTabHeaderView context=section
|
||||||
.section-manage-tables.pull-right
|
.section-manage-tables.pull-right
|
||||||
if editmode
|
if editmode
|
||||||
.btn-group
|
.btn-group
|
||||||
|
|||||||
@@ -1,4 +1 @@
|
|||||||
.section-tabs-container
|
|
||||||
each section in controller
|
|
||||||
view Qsupplier.App.SectionTabHeaderView context=section
|
|
||||||
= outlet
|
= outlet
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
h1=t 'models.plural.section'
|
||||||
|
if sections
|
||||||
|
table.table
|
||||||
|
thead
|
||||||
|
tr
|
||||||
|
th=t 'attributes.section.title'
|
||||||
|
th=t 'models.plural.table'
|
||||||
|
th.numeric=t 'attributes.section.width'
|
||||||
|
th.numeric=t 'attributes.section.height'
|
||||||
|
/th.boolean=t 'attributes.list.needs_help'
|
||||||
|
/th.boolean=t 'attributes.list.needs_payment'
|
||||||
|
/th.timestamp=t 'attributes.list.closed_at'
|
||||||
|
/th.table_number=t 'models.table'
|
||||||
|
/th.currentcy=t 'attributes.list.price'
|
||||||
|
/th.timestamp=t 'attributes.list.created_at'
|
||||||
|
th.actions=t 'helpers.actions.title'
|
||||||
|
tbody
|
||||||
|
each section in sections
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
link-to 'section' section
|
||||||
|
=section.title
|
||||||
|
td
|
||||||
|
span.table-count= section.tables.length
|
||||||
|
td.numeric= section.width
|
||||||
|
td.numeric= section.height
|
||||||
|
/td.boolean.needs_help=boolean list.needs_help
|
||||||
|
/td.boolean.needs_payment=boolean list.needs_payment
|
||||||
|
/td.timestamp=time list.closed_at
|
||||||
|
/td.table_number 7
|
||||||
|
/td.currency=currency list.price
|
||||||
|
/td.timestamp=time list.created_at
|
||||||
|
td.actions
|
||||||
|
a.table-qr-codes{path qr_codes_suppliers_tables section_id=section.id}
|
||||||
|
span
|
||||||
|
else
|
||||||
|
.row
|
||||||
|
.panel=t 'section.none_found'
|
||||||
|
.form-actions
|
||||||
|
a.form-action-new{path new_suppliers_section}=t 'helpers.links.new'
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Qsupplier.App.ListDisplayDateSelector = Ember.TextField.extend
|
||||||
|
classNames: 'datepicker'
|
||||||
|
didInsertElement: ->
|
||||||
|
setTranslations @$().hide()
|
||||||
@@ -17,9 +17,11 @@ var Qstorage = localStorage;
|
|||||||
|
|
||||||
$.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
|
$.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
|
||||||
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
|
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
|
||||||
|
|
||||||
String.prototype.capitalize = function() {
|
String.prototype.capitalize = function() {
|
||||||
return this.charAt(0).toUpperCase() + this.slice(1);
|
return this.charAt(0).toUpperCase() + this.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var path_mapping = {
|
var path_mapping = {
|
||||||
user_root: '/user',
|
user_root: '/user',
|
||||||
join_occupied_table: '/user/join_occupied_table',
|
join_occupied_table: '/user/join_occupied_table',
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ $ ->
|
|||||||
menu.show().animate left: 0
|
menu.show().animate left: 0
|
||||||
toggle.animate left: 222 - 30, -> $(@).addClass('open')
|
toggle.animate left: 222 - 30, -> $(@).addClass('open')
|
||||||
|
|
||||||
|
$('[data-boolean]').each ->
|
||||||
|
$(@).addClass(if $(@).data('boolean') then 'boolean-true' else 'boolean-false')
|
||||||
|
|
||||||
# Hide alert boxes on click
|
# Hide alert boxes on click
|
||||||
$(document).on 'click', '.general-alerts .alert-box', -> $(@).slideUp()
|
$(document).on 'click', '.general-alerts .alert-box', -> $(@).slideUp()
|
||||||
|
|
||||||
|
|||||||
@@ -75,12 +75,19 @@
|
|||||||
$("*[data-time]").each ->
|
$("*[data-time]").each ->
|
||||||
$(this).text moment($(this).data("time")).format($(this).data("timeFormat") or "dd D MMM HH:MM")
|
$(this).text moment($(this).data("time")).format($(this).data("timeFormat") or "dd D MMM HH:MM")
|
||||||
|
|
||||||
|
# jQuery UI datepicker support
|
||||||
$(".datepicker").datepicker "option", $.datepicker.regional[locale] if $.fn.datepicker
|
$(".datepicker").datepicker "option", $.datepicker.regional[locale] if $.fn.datepicker
|
||||||
|
|
||||||
|
# pickadate support
|
||||||
if $.fn.pickadate
|
if $.fn.pickadate
|
||||||
datepicker_object = $('.datepicker')
|
if selector.hasClass('datepicker')
|
||||||
|
datepicker_object = selector
|
||||||
|
selector.siblings('.pickadate-display').remove()
|
||||||
|
else
|
||||||
|
datepicker_object = selector.find('.datepicker')
|
||||||
|
selector.find('.pickadate-display').remove()
|
||||||
datepicker_object.pickadate('stop') if datepicker_object.data('pickadate')
|
datepicker_object.pickadate('stop') if datepicker_object.data('pickadate')
|
||||||
$.extend( $.fn.pickadate.defaults, $pickadate_translations[locale] )
|
$.extend( $.fn.pickadate.defaults, $pickadate_translations[locale] )
|
||||||
$('.pickadate-display').remove()
|
|
||||||
window.pickadate_options ||= {}
|
window.pickadate_options ||= {}
|
||||||
datepicker_object.pickadate(window.pickadate_options)
|
datepicker_object.pickadate(window.pickadate_options)
|
||||||
datepicker_object.change()
|
datepicker_object.change()
|
||||||
@@ -89,16 +96,20 @@
|
|||||||
@setupTranslations = (options = {})->
|
@setupTranslations = (options = {})->
|
||||||
locale = options.locale || Qstorage.getItem('locale') || 'en'
|
locale = options.locale || Qstorage.getItem('locale') || 'en'
|
||||||
if $.fn.pickadate
|
if $.fn.pickadate
|
||||||
$('.datepicker').change ->
|
$(document).on 'change', '.datepicker', ->
|
||||||
input = $(@)
|
input = $(@)
|
||||||
input.next().remove() if input.next().hasClass('pickadate-display')
|
input.next().remove() if input.next().hasClass('pickadate-display')
|
||||||
display_format = $pickadate_translations[$locale].displayFormat
|
if input.data('pickadate')
|
||||||
display_date = input.data('pickadate').get('select', display_format)
|
if input.val()
|
||||||
display_date = ' '+display_date # add space between the icon and the date
|
display_format = $pickadate_translations[$locale].displayFormat
|
||||||
display_tag = $('<span></span>').addClass('pickadate-display').append('<span class="fa fa-calendar fa-lg"></span>').append($('<span></span>').text(display_date))
|
display_date = input.data('pickadate').get('select', display_format)
|
||||||
#display_tag.click (e)->(e.preventDefault();input.click().focus();false )
|
display_date = $('<span></span>').text(' '+display_date) # add space between the icon and the date
|
||||||
display_tag.click (e)->(e.preventDefault();input.pickadate('open');false )
|
else
|
||||||
$(@).after(display_tag)
|
display_date = $('<span></span>').data('t', 'datepicker.no_date').text(t('datepicker.no_date'))
|
||||||
|
display_tag = $('<span></span>').addClass('pickadate-display').append('<span class="fa fa-calendar fa-lg"></span>').append(display_date)
|
||||||
|
#display_tag.click (e)->(e.preventDefault();input.click().focus();false )
|
||||||
|
display_tag.click (e)->(e.preventDefault();input.pickadate('open');false )
|
||||||
|
$(@).after(display_tag)
|
||||||
setLocale(locale)
|
setLocale(locale)
|
||||||
$('.datepicker').change().hide()
|
$('.datepicker').change().hide()
|
||||||
$transformation_mappings =
|
$transformation_mappings =
|
||||||
|
|||||||
@@ -19,3 +19,19 @@
|
|||||||
&.full
|
&.full
|
||||||
@media #{$large-up}
|
@media #{$large-up}
|
||||||
+grid-column($columns: 9, $last-column:true)
|
+grid-column($columns: 9, $last-column:true)
|
||||||
|
body
|
||||||
|
label
|
||||||
|
&.number
|
||||||
|
display: inline-block
|
||||||
|
padding: 4px 10px
|
||||||
|
input
|
||||||
|
&.number
|
||||||
|
width: 60px
|
||||||
|
display: inline-block
|
||||||
|
.apply-filter
|
||||||
|
+button($bg: $primary-color, $padding: $button-tny)
|
||||||
|
.error
|
||||||
|
input, textarea
|
||||||
|
border-color: $alert-color
|
||||||
|
input[type="number"]
|
||||||
|
text-align: right
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
@import font-awesome
|
||||||
|
@import ./foundation_and_overrides
|
||||||
|
td.boolean
|
||||||
|
+table-fit
|
||||||
|
&.needs_help
|
||||||
|
.boolean-true
|
||||||
|
@extend .fa
|
||||||
|
@extend .fa-exclamation
|
||||||
|
&.needs_payment
|
||||||
|
.boolean-true
|
||||||
|
@extend .fa
|
||||||
|
@extend .fa-money
|
||||||
@@ -8,7 +8,7 @@ header.top-menu
|
|||||||
background-position: left bottom, right bottom
|
background-position: left bottom, right bottom
|
||||||
background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png')
|
background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png')
|
||||||
color: $green
|
color: $green
|
||||||
padding-left: 49px
|
padding-left: 48px
|
||||||
padding-right: 52px
|
padding-right: 52px
|
||||||
.menu-content
|
.menu-content
|
||||||
background-color: white
|
background-color: white
|
||||||
|
|||||||
@@ -1,15 +1,7 @@
|
|||||||
$side-spacing: 0px
|
$side-spacing: 0px
|
||||||
@import constants
|
@import constants
|
||||||
@import ./foundation_and_overrides
|
@import ./foundation_and_overrides
|
||||||
html
|
@import font-awesome
|
||||||
body
|
|
||||||
label
|
|
||||||
&.number
|
|
||||||
display: inline
|
|
||||||
padding: 4px 10px
|
|
||||||
input
|
|
||||||
&.number
|
|
||||||
width: 40px
|
|
||||||
.supplier-is-closed
|
.supplier-is-closed
|
||||||
+alert($bg: $secondary-color)
|
+alert($bg: $secondary-color)
|
||||||
.close
|
.close
|
||||||
|
|||||||
@@ -10,12 +10,23 @@ table
|
|||||||
+table-fit
|
+table-fit
|
||||||
th.status-icons, td.status-icons
|
th.status-icons, td.status-icons
|
||||||
+table-fit
|
+table-fit
|
||||||
|
td
|
||||||
|
&.boolean
|
||||||
|
text-align: center
|
||||||
|
&.currency
|
||||||
|
text-align: right
|
||||||
.table-edit
|
.table-edit
|
||||||
+button($bg: $secondary-color)
|
+button($bg: $secondary-color)
|
||||||
+button-icon-only
|
+button-icon-only
|
||||||
span
|
span
|
||||||
@extend .fa
|
@extend .fa
|
||||||
@extend .fa-pencil
|
@extend .fa-pencil
|
||||||
|
.table-qr-codes
|
||||||
|
+button($bg: $secondary-color)
|
||||||
|
+button-icon-only
|
||||||
|
span
|
||||||
|
@extend .fa
|
||||||
|
@extend .fa-qrcode
|
||||||
.table-destroy
|
.table-destroy
|
||||||
+button($bg: $secondary-color)
|
+button($bg: $secondary-color)
|
||||||
+button-icon-only
|
+button-icon-only
|
||||||
|
|||||||
@@ -3,7 +3,20 @@ module Suppliers
|
|||||||
# GET /lists
|
# GET /lists
|
||||||
# GET /lists.json
|
# GET /lists.json
|
||||||
def index
|
def index
|
||||||
@lists = List.for_supplier(current_supplier, page: params[:page], per_page: params[:per_page] || 25)
|
if params[:date].present?
|
||||||
|
@date = params[:date].present? ? (Date.parse(params[:date]) rescue Date.today) : Date.today
|
||||||
|
@time = @date.to_time(:utc)
|
||||||
|
@start_time = @time.beginning_of_day
|
||||||
|
@end_time = @time.end_of_day
|
||||||
|
if current_supplier.night_offset.present?
|
||||||
|
@start_time += current_supplier.night_offset.to_f.hours
|
||||||
|
@end_time += current_supplier.night_offset.to_f.hours
|
||||||
|
end
|
||||||
|
@lists = List.for_supplier_created_at current_supplier, @start_time..@end_time
|
||||||
|
@lists.include_relation(:table) # for number
|
||||||
|
else
|
||||||
|
@lists = List.for_supplier(current_supplier, page: params[:page], per_page: params[:per_page] || 25)
|
||||||
|
end
|
||||||
@lists.include_relation(:table)
|
@lists.include_relation(:table)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class ListSerializer < Qwaiter::Serializer
|
class ListSerializer < Qwaiter::Serializer
|
||||||
# user ids for facebook pictures
|
# user ids for facebook pictures
|
||||||
#embed :ids
|
#embed :ids
|
||||||
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_id #, :has_active_orders
|
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_id, :closed_at #, :has_active_orders
|
||||||
|
|
||||||
#def has_active_orders
|
#def has_active_orders
|
||||||
#object.has_active_orders?
|
#object.has_active_orders?
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class UserExtendedListSerializer < Qwaiter::Serializer
|
|||||||
self.root = :list
|
self.root = :list
|
||||||
embed :ids, include: true
|
embed :ids, include: true
|
||||||
attributes :extended_version, :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price,
|
attributes :extended_version, :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price,
|
||||||
:table_id, :table_number, :section_id, :user_ids, :supplier_id
|
:table_id, :table_number, :section_id, :user_ids, :supplier_id, :closed_at
|
||||||
#:supplier_orders_in_process_count, :supplier_orders_placed_count
|
#:supplier_orders_in_process_count, :supplier_orders_placed_count
|
||||||
|
|
||||||
def has_active_orders
|
def has_active_orders
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class UserListSerializer < Qwaiter::Serializer
|
class UserListSerializer < Qwaiter::Serializer
|
||||||
# user ids for facebook pictures
|
# user ids for facebook pictures
|
||||||
#embed :ids
|
#embed :ids
|
||||||
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_name
|
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_name, :closed_at
|
||||||
|
|
||||||
#def has_active_orders
|
#def has_active_orders
|
||||||
#object.has_active_orders?
|
#object.has_active_orders?
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
-if target.errors.any?
|
-if target.errors.any?
|
||||||
.alert.alert-error
|
.alert.alert-error.alert-box.alert
|
||||||
button type="button" class="close" data-dismiss="alert" ×
|
|
||||||
h4 data-t="helpers.forms.errors.title" data-t-attributes=%[{"count":#{target.errors.count}}] = t('helpers.forms.errors.title', :count => target.errors.count)
|
h4 data-t="helpers.forms.errors.title" data-t-attributes=%[{"count":#{target.errors.count}}] = t('helpers.forms.errors.title', :count => target.errors.count)
|
||||||
ul
|
ul
|
||||||
- for message in target.errors.full_messages
|
- for message in target.errors.full_messages
|
||||||
|
|||||||
@@ -13,13 +13,16 @@ table.table
|
|||||||
- lists.each do |list|
|
- lists.each do |list|
|
||||||
tr
|
tr
|
||||||
td= link_to list.state, [:suppliers, list]
|
td= link_to list.state, [:suppliers, list]
|
||||||
td=show_boolean list.needs_help
|
td.boolean.needs_help
|
||||||
td=show_boolean list.needs_payment
|
span data-boolean=list.needs_help.to_s
|
||||||
|
td.boolean.needs_payment
|
||||||
|
span data-boolean=list.needs_payment.to_s
|
||||||
td.timestamp data-time=list.closed_at.try(:utc).try(:iso8601)
|
td.timestamp data-time=list.closed_at.try(:utc).try(:iso8601)
|
||||||
td= link_to_if list.table.present?, list.table_number, [:suppliers, list.table]
|
td= link_to_if list.table.present?, list.table_number, [:suppliers, list.table]
|
||||||
td.currency= list.price.present? ? currency(list.price) : '...'
|
td.currency= list.price.present? ? currency(list.price) : '...'
|
||||||
td.timestamp data-time=list.created_at.utc.iso8601
|
td.timestamp data-time=list.created_at.utc.iso8601
|
||||||
td.actions
|
td.actions
|
||||||
= link_to t('helpers.links.edit'), [:edit, :suppliers, list], class: 'btn btn-mini', data: {t: 'helpers.links.edit'}
|
= link_to [:edit, :suppliers, list], class: 'table-edit' do
|
||||||
'
|
span data-title="helpers.links.edit"
|
||||||
= link_to t("helpers.links.destroy"), [:suppliers, list], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger', data: {t: 'helpers.links.destroy'}
|
= link_to [:suppliers, list], method: :delete, data: {confirm: are_you_sure? }, class: 'table-destroy' do
|
||||||
|
span data-title="helpers.links.destroy"
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
div.page-header= title :index, List
|
- content_for :head do
|
||||||
.well
|
= javascript_include_tag 'supplier/app/application'
|
||||||
|
/div.page-header= title :index, List
|
||||||
|
/.well
|
||||||
- if @lists.any?
|
- if @lists.any?
|
||||||
= paginate @lists
|
= paginate @lists
|
||||||
= render 'lists_table', lists: @lists
|
= render 'lists_table', lists: @lists
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ dl.dl-horizontal
|
|||||||
dd= l @list.created_at, format: :short
|
dd= l @list.created_at, format: :short
|
||||||
dt= t('supplier.lists.show.users')
|
dt= t('supplier.lists.show.users')
|
||||||
dd= @list.users.map(&:supplier_name).join(', ')
|
dd= @list.users.map(&:supplier_name).join(', ')
|
||||||
|
.display-row
|
||||||
|
.display-label
|
||||||
|
span data-t='attributes.list.created_at'
|
||||||
|
.display-field
|
||||||
|
span data-time=@list.created_at.iso8601
|
||||||
.well
|
.well
|
||||||
table#list-table.table.list-table
|
table#list-table.table.list-table
|
||||||
thead
|
thead
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
- model_class = Product
|
- model_class = Product
|
||||||
.page-header= title :show, @product
|
.page-header= title :show, @product
|
||||||
|
|
||||||
dl.dl-horizontal.show-list
|
.display-row
|
||||||
dt= model_class.human_attribute_name(:name)
|
.display-label
|
||||||
dd= @product.name
|
span data-t='attributes.product.name'
|
||||||
dt= model_class.human_attribute_name(:code)
|
.display-field
|
||||||
dd= @product.code
|
span= @product.name
|
||||||
dt= model_class.human_attribute_name(:price)
|
.display-row
|
||||||
dd=currency @product.price
|
.display-label
|
||||||
dt= ProductCategory.model_name.human_plural
|
span data-t='attributes.product.code'
|
||||||
dd= @product.category_links(namespace: :suppliers)
|
.display-field
|
||||||
|
span= @product.code
|
||||||
|
.display-row
|
||||||
|
.display-label
|
||||||
|
span data-t='attributes.product.price'
|
||||||
|
.display-field
|
||||||
|
span=currency @product.price
|
||||||
|
.display-row
|
||||||
|
.display-label
|
||||||
|
span data-t='models.plural.product_category'
|
||||||
|
.display-field
|
||||||
|
span= @product.category_links(namespace: :suppliers)
|
||||||
|
|
||||||
.form-actions
|
= supplier_form_actions :index, :edit, :destroy, object: @product, for: :products
|
||||||
= link_to t("helpers.links.back"), suppliers_products_path, class: 'btn'
|
|
||||||
'
|
|
||||||
= link_to t('helpers.links.edit'), [:edit, :suppliers, @product], class: 'btn'
|
|
||||||
'
|
|
||||||
= link_to t("helpers.links.destroy"), [:suppliers, @product], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
|
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
-# DEPRICATED
|
-# DEPRICATED
|
||||||
= form_for [:suppliers, @section], html: {class: 'form-horizontal' } do |f|
|
= form_for [:suppliers, @section], html: {class: 'form-horizontal' } do |f|
|
||||||
= render 'error_messages', target: @section
|
= render 'error_messages', target: @section
|
||||||
.control-group class=(@section.errors[:title].any? ? 'error' : nil)
|
.form-row class=(@section.errors[:title].any? ? 'error' : nil)
|
||||||
= f.label :title, class: 'control-label'
|
.form-label
|
||||||
.controls
|
= f.label :title
|
||||||
= f.text_field :title, class: 'text_field'
|
.form-field
|
||||||
.control-group class=(@section.errors[:width].any? ? 'error' : nil)
|
= f.text_field :title
|
||||||
= f.label :width, class: 'control-label'
|
.form-row class=(@section.errors[:width].any? ? 'error' : nil)
|
||||||
.controls
|
.form-label
|
||||||
= f.text_field :width, class: ['text_field', :numeric]
|
= f.label :width
|
||||||
.control-group class=(@section.errors[:height].any? ? 'error' : nil)
|
.form-field
|
||||||
= f.label :height, class: 'control-label'
|
= f.number_field :width
|
||||||
.controls
|
.form-row class=(@section.errors[:height].any? ? 'error' : nil)
|
||||||
= f.text_field :height, class: ['text_field', :numeric]
|
.form-label
|
||||||
|
= f.label :height
|
||||||
|
.form-field
|
||||||
|
= f.number_field :height
|
||||||
= f.supplier_form_actions
|
= f.supplier_form_actions
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
- model_class = Section
|
/- model_class = Section
|
||||||
.page-header= title :index, model_class
|
/.page-header= title :index, model_class
|
||||||
- if @sections.any?
|
- content_for :head do
|
||||||
|
= javascript_include_tag 'supplier/app/application'
|
||||||
|
/- if @sections.any?
|
||||||
table.table
|
table.table
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
@@ -19,9 +21,10 @@
|
|||||||
td.numeric= section.width
|
td.numeric= section.width
|
||||||
td.numeric= section.height
|
td.numeric= section.height
|
||||||
td.actions
|
td.actions
|
||||||
= link_to t('supplier.tables.qr_codes.link'), qr_codes_suppliers_tables_path(section_id: section.id), class: 'btn btn-mini btn-info', data: {t: 'tables.qr_codes.link'}
|
= link_to polymorphic_path([:qr_codes, :suppliers, :tables], section_id: section.id), class: 'table-qr-codes' do
|
||||||
'
|
span data-title="helpers.links.qr_codes"
|
||||||
= link_to t("helpers.links.destroy"), [:suppliers, section], method: :delete, data: {confirm: are_you_sure?, t: 'helpers.links.destroy'}, class: 'btn btn-mini btn-danger'
|
= link_to [:suppliers, section], method: :delete, data: {confirm: are_you_sure? }, class: 'table-destroy' do
|
||||||
- else
|
span data-title="helpers.links.destroy"
|
||||||
|
/- else
|
||||||
= no_content_given model_class
|
= no_content_given model_class
|
||||||
= supplier_form_actions :new, for: :sections
|
/= supplier_form_actions :new, for: :sections
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
= form_for [:suppliers, @table], html: {class: 'form-horizontal' } do |f|
|
= form_for [:suppliers, @table], html: {class: 'form-horizontal' } do |f|
|
||||||
= render 'error_messages', target: @table
|
= render 'error_messages', target: @table
|
||||||
.control-group class=(@table.errors[:number].any? ? 'error' : nil)
|
.form-row class=(@table.errors[:number].any? ? 'error' : nil)
|
||||||
= f.label :number, class: 'control-label', data: {t: 'attributes.table.number'}
|
.form-label
|
||||||
.controls
|
= f.label :number
|
||||||
= f.text_field :number, class: 'text_field'
|
.form-field
|
||||||
.control-group class=(@table.errors[:section_id].any? ? 'error' : nil)
|
= f.number_field :number
|
||||||
= f.label :section_id, Section.model_name.human, class: 'control-label', data: {t: 'models.section'}
|
.form-row class=(@table.errors[:section_id].any? ? 'error' : nil)
|
||||||
.controls
|
.form-label
|
||||||
|
= f.label :section_id, Section.model_name.human, class: 'control-label', data: {t: 'models.section'}
|
||||||
|
.form-field
|
||||||
= f.collection_select :section_id, current_supplier.sections, :id, :title, include_blank: "[#{t('supplier.tables.has_no_section')}]"
|
= f.collection_select :section_id, current_supplier.sections, :id, :title, include_blank: "[#{t('supplier.tables.has_no_section')}]"
|
||||||
= f.supplier_form_actions
|
= f.supplier_form_actions
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ div.page-header= title :index, model_class
|
|||||||
label.number for="filter-to_number" data-t="attributes.table.to_number"
|
label.number for="filter-to_number" data-t="attributes.table.to_number"
|
||||||
input#filter-to_number.number type="number" size=4 value=params[:to_number] name="to_number"
|
input#filter-to_number.number type="number" size=4 value=params[:to_number] name="to_number"
|
||||||
'
|
'
|
||||||
= submit_tag 'Filter'
|
= submit_tag 'Filter', class: 'apply-filter'
|
||||||
- if @tables.any?
|
- if @tables.any?
|
||||||
= paginate @tables
|
= paginate @tables
|
||||||
table.table
|
table.table
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
- model_class = Table
|
|
||||||
.page-header= title :show, @table
|
.page-header= title :show, @table
|
||||||
|
.display-row
|
||||||
dl.dl-horizontal.show-list
|
.display-label
|
||||||
dt= model_class.human_attribute_name(:number)
|
span data-t='attributes.table.number'
|
||||||
dd= @table.number
|
.display-field
|
||||||
- if @table.section.present?
|
span= @table.number
|
||||||
dt= Section.model_name.human
|
- if @table.section.present?
|
||||||
dd= link_to @table.section.title, [:suppliers, @table.section]
|
.display-row
|
||||||
|
.display-label
|
||||||
|
span data-t='models.section'
|
||||||
|
.display-field
|
||||||
|
span= link_to @table.section.title, [:suppliers, @table.section]
|
||||||
= supplier_form_actions :index, :edit, :destroy, object: @table, for: :tables
|
= supplier_form_actions :index, :edit, :destroy, object: @table, for: :tables
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ en:
|
|||||||
destroy: Delete
|
destroy: Delete
|
||||||
back: Back
|
back: Back
|
||||||
cancel: Cancel
|
cancel: Cancel
|
||||||
|
index: Overview
|
||||||
forms:
|
forms:
|
||||||
errors:
|
errors:
|
||||||
title: There are problems found during saving (%{count})
|
title: There are problems found during saving (%{count})
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ nl:
|
|||||||
destroy: Verwijder
|
destroy: Verwijder
|
||||||
back: Terug
|
back: Terug
|
||||||
cancel: Terug
|
cancel: Terug
|
||||||
|
index: Overzicht
|
||||||
forms:
|
forms:
|
||||||
errors:
|
errors:
|
||||||
title: 'De actie kon niet worden uitgevoerd. %{count} fout(en)'
|
title: 'De actie kon niet worden uitgevoerd. %{count} fout(en)'
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ en:
|
|||||||
list:
|
list:
|
||||||
is_helped_button: Question answered!
|
is_helped_button: Question answered!
|
||||||
close_list: Close!
|
close_list: Close!
|
||||||
|
none_found: 'No ${models.plural.list|downcase}'
|
||||||
order:
|
order:
|
||||||
being_processed: 'In process!'
|
being_processed: 'In process!'
|
||||||
being_served: 'Is delivered!'
|
being_served: 'Is delivered!'
|
||||||
@@ -89,3 +90,9 @@ en:
|
|||||||
preview:
|
preview:
|
||||||
header: 'Select moment to preview products'
|
header: 'Select moment to preview products'
|
||||||
description: 'Products visible to customers at chosen moment:'
|
description: 'Products visible to customers at chosen moment:'
|
||||||
|
state:
|
||||||
|
list:
|
||||||
|
active: 'Active'
|
||||||
|
closed: 'Closed'
|
||||||
|
datepicker:
|
||||||
|
no_date: 'Pick a date'
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ nl:
|
|||||||
list:
|
list:
|
||||||
is_helped_button: Vraag beantwoord!
|
is_helped_button: Vraag beantwoord!
|
||||||
close_list: Afsluiten!
|
close_list: Afsluiten!
|
||||||
|
none_found: 'Geen ${models.plural.list|downcase}'
|
||||||
order:
|
order:
|
||||||
being_processed: 'Ben bezig!'
|
being_processed: 'Ben bezig!'
|
||||||
being_served: 'Ik kom het brengen!'
|
being_served: 'Ik kom het brengen!'
|
||||||
@@ -89,3 +90,9 @@ nl:
|
|||||||
preview:
|
preview:
|
||||||
header: 'Selecteer tijdstip voor voorbeeld'
|
header: 'Selecteer tijdstip voor voorbeeld'
|
||||||
description: 'Producten op gekozen tijdstip:'
|
description: 'Producten op gekozen tijdstip:'
|
||||||
|
state:
|
||||||
|
list:
|
||||||
|
active: 'Actief'
|
||||||
|
closed: 'Afgesloten'
|
||||||
|
datepicker:
|
||||||
|
no_date: 'Selecteer een datum'
|
||||||
|
|||||||
Reference in New Issue
Block a user