Progress commit
This commit is contained in:
@@ -63,7 +63,7 @@ class SvgElementClass
|
|||||||
else
|
else
|
||||||
results.text(window.compiledJS)
|
results.text(window.compiledJS)
|
||||||
results.removeClass 'error'
|
results.removeClass 'error'
|
||||||
window.evaluator = new SnapDsl(window.compiledJS, target: @target)
|
window.evaluator = new SnapDsl(window.compiledJS, target: @target, width: @box_width.val(), height: @box_height.val())
|
||||||
evaluator.result()
|
evaluator.result()
|
||||||
$('.minibutton.run').removeClass 'error'
|
$('.minibutton.run').removeClass 'error'
|
||||||
catch {location, message}
|
catch {location, message}
|
||||||
@@ -76,8 +76,8 @@ class SnapDsl
|
|||||||
@js_code = code
|
@js_code = code
|
||||||
@options = options
|
@options = options
|
||||||
@t = $(options.target)
|
@t = $(options.target)
|
||||||
@width = @t.width()
|
@width = options.width
|
||||||
@height = @t.height()
|
@height = options.height
|
||||||
$(options.target).html('')
|
$(options.target).html('')
|
||||||
result: ->
|
result: ->
|
||||||
@snap = Snap(@options.target)
|
@snap = Snap(@options.target)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ App.SectionController = Ember.ObjectController.extend
|
|||||||
@get('model').save()
|
@get('model').save()
|
||||||
@get('model.section_elements').forEach (section_element) -> section_element.save()
|
@get('model.section_elements').forEach (section_element) -> section_element.save()
|
||||||
rollbackEditable: ->
|
rollbackEditable: ->
|
||||||
@get('model').rollback().then =>
|
@get('model').rollback()
|
||||||
@get('model.section_elements').forEach (section_element) ->
|
@get('model.section_elements').forEach (section_element) ->
|
||||||
if section_element.get('id')
|
if section_element.get('id')
|
||||||
section_element.rollback()
|
section_element.rollback()
|
||||||
@@ -36,6 +36,7 @@ App.SectionController = Ember.ObjectController.extend
|
|||||||
@modal 'add_section_element',
|
@modal 'add_section_element',
|
||||||
model: @get('model')
|
model: @get('model')
|
||||||
ok: => @send 'makeEditable'
|
ok: => @send 'makeEditable'
|
||||||
|
removeSectionElement: (section_element)-> section_element.destroy()
|
||||||
textures: ['wood1', 'wood2']
|
textures: ['wood1', 'wood2']
|
||||||
|
|
||||||
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Ember.Handlebars.helper 'svg', (content, options)->
|
Ember.Handlebars.helper 'svg', (content, options)->
|
||||||
width = options.hash.width8 || '100%'
|
width = options.hash.width8 || '100%'
|
||||||
height = options.hash.height8 || '100%'
|
height = options.hash.height8 || '100%'
|
||||||
"<svg width='#{width}' height='#{height}' viewBox='0 0 155 310'><g transform=''>#{content}</g></svg>".htmlSafe()
|
#"<svg width='#{width}' height='#{height}'>#{content}</svg>".htmlSafe()
|
||||||
|
"<svg width='#{width}' height='#{height}' viewBox='0 0 #{options.hash.width} #{options.hash.height}'><g transform=''>#{content}</g></svg>".htmlSafe()
|
||||||
|
|||||||
@@ -94,6 +94,14 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
markSupplierOpen: ->
|
markSupplierOpen: ->
|
||||||
return unless supplier = @controllerFor('application').get('supplier')
|
return unless supplier = @controllerFor('application').get('supplier')
|
||||||
supplier.open_the_place()
|
supplier.open_the_place()
|
||||||
|
rotateLeft: (record)->
|
||||||
|
new_rotation = -90 + record.get('rotation')
|
||||||
|
new_rotation += 360 if new_rotation < 0
|
||||||
|
record.set 'rotation', new_rotation
|
||||||
|
rotateRight: (record)->
|
||||||
|
new_rotation = 90 + record.get('rotation')
|
||||||
|
new_rotation -= 360 if new_rotation >= 360
|
||||||
|
record.set 'rotation', new_rotation
|
||||||
events:
|
events:
|
||||||
list_needs_help: (data) ->
|
list_needs_help: (data) ->
|
||||||
if list = @store.getById('list', data.id)
|
if list = @store.getById('list', data.id)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
li: a{action "addTables"}: span.section-add-tables-icon=t 'section.add_tables.button_label'
|
li: a{action "addTables"}: span.section-add-tables-icon=t 'section.add_tables.button_label'
|
||||||
li: a{action "arrangeTables"}: span.section-arrange-tables-icon=t 'section.arrange_tables.modal.title'
|
li: a{action "arrangeTables"}: span.section-arrange-tables-icon=t 'section.arrange_tables.modal.title'
|
||||||
li: a href="{{route 'qr_codes_suppliers_tables_path' section_id=id}}" target="_blank": span.qr-icon=t 'table.print_qr_codes'
|
li: a href="{{route 'qr_codes_suppliers_tables_path' section_id=id}}" target="_blank": span.qr-icon=t 'table.print_qr_codes'
|
||||||
li: a{action "addSectionElement"}: span.section-add-section-element-icon= t 'section_element.add_butoon'
|
li: a{action "addSectionElement"}: span.section-add-section-element-icon= t 'section_element.add_button'
|
||||||
li: a.section-destroy{action "destroySection"}: span.section-remove-icon=t 'helpers.links.destroy'
|
li: a.section-destroy{action "destroySection"}: span.section-remove-icon=t 'helpers.links.destroy'
|
||||||
a.section-edit-mode-button{ action "makeEditable" }: span
|
a.section-edit-mode-button{ action "makeEditable" }: span
|
||||||
= view "section-tables" contentBinding="tables"
|
= view "section-tables" contentBinding="tables"
|
||||||
|
|||||||
@@ -1 +1,6 @@
|
|||||||
= svg view.content.svg width=view.content.box_width height=view.content.box_height
|
= svg view.content.svg width=view.content.box_width height=view.content.box_height
|
||||||
|
if view.showHandles
|
||||||
|
.section-element-handles
|
||||||
|
a.rotate-left{action "rotateLeft" view.content bubbles=false}: span.icon
|
||||||
|
a.rotate-right{action "rotateRight" view.content bubbles=false}: span.icon
|
||||||
|
a.remove-section-element{action "removeSectionElement" view.content bubbles=false}: span.icon
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ App.SectionElementView = Ember.View.extend DragNDrop.Draggable,
|
|||||||
templateName: 'section/section-element'
|
templateName: 'section/section-element'
|
||||||
classNames: ['section-element']
|
classNames: ['section-element']
|
||||||
attributeBindings: ['style']
|
attributeBindings: ['style']
|
||||||
|
show_handles: false
|
||||||
classNameBindings: [
|
classNameBindings: [
|
||||||
'uniqueClass'
|
'uniqueClass'
|
||||||
]
|
]
|
||||||
@@ -32,8 +33,5 @@ App.SectionElementView = Ember.View.extend DragNDrop.Draggable,
|
|||||||
@get('content').setProperties
|
@get('content').setProperties
|
||||||
position_x: Math.round(10 * position.left / dpm ) / 10
|
position_x: Math.round(10 * position.left / dpm ) / 10
|
||||||
position_y: Math.round(10 * position.top / dpm ) / 10
|
position_y: Math.round(10 * position.top / dpm ) / 10
|
||||||
click: ->
|
click: -> @toggleProperty('show_handles')
|
||||||
return unless @get('controller.editmode')
|
showHandles: Ember.computed.and 'show_handles', 'controller.editmode'
|
||||||
new_rotation = 90 + @get('content.rotation')
|
|
||||||
new_rotation -= 360 if new_rotation >= 360
|
|
||||||
@set 'content.rotation', new_rotation
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() +
|
|||||||
window.time_zones = <%= ActiveSupport::TimeZone.all.map{|tz| {name: tz.name, formatted: "GMT#{tz.formatted_offset} #{tz.name}"}}.to_json.html_safe %>;
|
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 %>;
|
window.countries = <%= IsoCountryCodes.all.map{|cc| {name: cc.name}}.to_json.html_safe %>;
|
||||||
|
|
||||||
|
|
||||||
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',
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
# <span data-t="models.table">Tafel</span>
|
# <span data-t="models.table">Tafel</span>
|
||||||
@tspan = (path, vars={}) -> "<span data-t='#{path}' data-t-attributes='#{JSON.stringify(vars)}'>#{t(path, vars)}</span>"
|
@tspan = (path, vars={}) -> "<span data-t='#{path}' data-t-attributes='#{JSON.stringify(vars)}'>#{t(path, vars)}</span>"
|
||||||
|
|
||||||
|
|
||||||
@t = (path, vars={}) ->
|
@t = (path, vars={}) ->
|
||||||
#result = undefined
|
#result = undefined
|
||||||
#m = undefined
|
#m = undefined
|
||||||
|
|||||||
@@ -52,17 +52,21 @@
|
|||||||
span.section-add-tables-icon
|
span.section-add-tables-icon
|
||||||
@extend .fa
|
@extend .fa
|
||||||
@extend .fa-plus-square
|
@extend .fa-plus-square
|
||||||
margin-right: $icon-right-margin
|
span
|
||||||
|
padding-left: 7px
|
||||||
span.section-arrange-tables-icon
|
span.section-arrange-tables-icon
|
||||||
@extend .fa
|
@extend .fa
|
||||||
@extend .fa-th
|
@extend .fa-th
|
||||||
margin-right: $icon-right-margin
|
span
|
||||||
|
padding-left: 7px
|
||||||
span.section-remove-icon
|
span.section-remove-icon
|
||||||
@extend .fa, .fa-trash-o
|
@extend .fa, .fa-trash-o
|
||||||
margin-right: $icon-right-margin
|
span
|
||||||
|
padding-left: 7px
|
||||||
span.section-add-section-element-icon
|
span.section-add-section-element-icon
|
||||||
@extend .fa, .fa-image
|
@extend .fa, .fa-image
|
||||||
margin-right: $icon-right-margin
|
span
|
||||||
|
padding-left: 7px
|
||||||
input
|
input
|
||||||
height: auto
|
height: auto
|
||||||
padding-top: 4px
|
padding-top: 4px
|
||||||
|
|||||||
@@ -9,3 +9,26 @@
|
|||||||
border: 2px outset #aaa
|
border: 2px outset #aaa
|
||||||
&:hover
|
&:hover
|
||||||
border-color: $active-color
|
border-color: $active-color
|
||||||
|
.section-element-handles
|
||||||
|
width: 80px
|
||||||
|
height: 22px
|
||||||
|
position: absolute
|
||||||
|
top: -22px
|
||||||
|
.rotate-left
|
||||||
|
+button($bg: $secondary-color, $padding: $button-tny)
|
||||||
|
+button-icon-only
|
||||||
|
margin-right: 4px
|
||||||
|
span
|
||||||
|
@extend .fa, .fa-lg, .fa-rotate-left
|
||||||
|
.rotate-right
|
||||||
|
+button($bg: $secondary-color, $padding: $button-tny)
|
||||||
|
+button-icon-only
|
||||||
|
margin-right: 4px
|
||||||
|
span
|
||||||
|
@extend .fa, .fa-lg, .fa-rotate-right
|
||||||
|
.remove-section-element
|
||||||
|
+button($bg: $alert-color, $padding: $button-tny)
|
||||||
|
+button-icon-only
|
||||||
|
span
|
||||||
|
@extend .fa, .fa-lg, .fa-times
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
.small-6.columns.attribute-info
|
.small-6.columns.attribute-info
|
||||||
= f.row :svg
|
= f.row :svg
|
||||||
.form-label= f.label :svg
|
.form-label= f.label :svg
|
||||||
.form-field= f.text_area :svg
|
.form-field.full= f.text_area :svg
|
||||||
= f.row :snap_code
|
= f.row :snap_code
|
||||||
.form-label= f.label :snap_code
|
.form-label= f.label :snap_code
|
||||||
.row: .small-12.columns= f.text_area :snap_code, rows: 20, class: ['snap-code-editor'], data: {target: '#svg-preview', preview: '#javascript-preview'}
|
.row: .small-12.columns= f.text_area :snap_code, rows: 20, class: ['snap-code-editor'], data: {target: '#svg-preview', preview: '#javascript-preview'}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ en:
|
|||||||
user_feedback: User feedback
|
user_feedback: User feedback
|
||||||
employee: Employee
|
employee: Employee
|
||||||
employee_shift: Shift
|
employee_shift: Shift
|
||||||
|
section_element: Section element
|
||||||
svg_element: Svg element
|
svg_element: Svg element
|
||||||
plural:
|
plural:
|
||||||
user: Users
|
user: Users
|
||||||
@@ -29,6 +30,7 @@ en:
|
|||||||
user_feedback: User feedbacks
|
user_feedback: User feedbacks
|
||||||
employee: Employees
|
employee: Employees
|
||||||
employee_shift: Shifts
|
employee_shift: Shifts
|
||||||
|
section_element: Section elements
|
||||||
svg_element: Svg elements
|
svg_element: Svg elements
|
||||||
attributes:
|
attributes:
|
||||||
product_category:
|
product_category:
|
||||||
@@ -98,3 +100,18 @@ en:
|
|||||||
female: "Ms."
|
female: "Ms."
|
||||||
svg_element:
|
svg_element:
|
||||||
name: Name
|
name: Name
|
||||||
|
svg: SVG
|
||||||
|
dpm: Dots per meter
|
||||||
|
box_width: Box width
|
||||||
|
box_height: Box height
|
||||||
|
snap_code: Snap code
|
||||||
|
section_element:
|
||||||
|
name: Name
|
||||||
|
svg: SVG
|
||||||
|
dpm: Dots per meter
|
||||||
|
box_width: Box width
|
||||||
|
box_height: Box height
|
||||||
|
snap_code: Snap code
|
||||||
|
position_x: X
|
||||||
|
position_y: Y
|
||||||
|
rotation: Angle
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ nl:
|
|||||||
join_request: Deelname verzoek
|
join_request: Deelname verzoek
|
||||||
employee: Werknemer
|
employee: Werknemer
|
||||||
employee_shift: Shift
|
employee_shift: Shift
|
||||||
|
section_element: Ruimte element
|
||||||
|
svg_element: Svg element
|
||||||
plural:
|
plural:
|
||||||
user: Gebruikers
|
user: Gebruikers
|
||||||
supplier: Restaurants
|
supplier: Restaurants
|
||||||
@@ -26,6 +28,8 @@ nl:
|
|||||||
join_request: Deelname verzoeken
|
join_request: Deelname verzoeken
|
||||||
employee: Werknemers
|
employee: Werknemers
|
||||||
employee_shift: Shifts
|
employee_shift: Shifts
|
||||||
|
section_element: Ruimte elementen
|
||||||
|
svg_element: Svg element
|
||||||
attributes:
|
attributes:
|
||||||
product_category:
|
product_category:
|
||||||
name: Naam
|
name: Naam
|
||||||
@@ -93,3 +97,20 @@ nl:
|
|||||||
email: "E-mail:*"
|
email: "E-mail:*"
|
||||||
male: "Dhr."
|
male: "Dhr."
|
||||||
female: "Mvr."
|
female: "Mvr."
|
||||||
|
svg_element:
|
||||||
|
name: Name
|
||||||
|
svg: SVG
|
||||||
|
dpm: Dots per meter
|
||||||
|
box_width: Box width
|
||||||
|
box_height: Box height
|
||||||
|
snap_code: Snap code
|
||||||
|
section_element:
|
||||||
|
name: Name
|
||||||
|
svg: SVG
|
||||||
|
dpm: Dots per meter
|
||||||
|
box_width: Box width
|
||||||
|
box_height: Box height
|
||||||
|
snap_code: Snap code
|
||||||
|
position_x: X
|
||||||
|
position_y: Y
|
||||||
|
rotation: Angle
|
||||||
|
|||||||
@@ -213,3 +213,7 @@ nl:
|
|||||||
destroy_confirmation: 'Weet je zeker dat je de ${models.employee_shift} wilt verwijderen?'
|
destroy_confirmation: 'Weet je zeker dat je de ${models.employee_shift} wilt verwijderen?'
|
||||||
suppliers_switcher:
|
suppliers_switcher:
|
||||||
switch_to_button: Switch to %{name}
|
switch_to_button: Switch to %{name}
|
||||||
|
section_element:
|
||||||
|
add_button: ${models.section_element} toevoegen
|
||||||
|
modal:
|
||||||
|
title: ${models.section_element} toevoegen
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ Release
|
|||||||
Supplier
|
Supplier
|
||||||
--------
|
--------
|
||||||
|
|
||||||
- Fix employee creation
|
- Fix section element positioning
|
||||||
- Fix add manager functionality
|
- Add active toggle to svg elements
|
||||||
- Link employee to orders
|
- Link employee to orders
|
||||||
- Employee personal schedule
|
- Employee personal schedule
|
||||||
- english emails
|
- english emails
|
||||||
|
|||||||
Reference in New Issue
Block a user