Better employee selection for schedule

This commit is contained in:
2015-03-24 17:49:27 +01:00
parent c5d6252c7a
commit 2193ca56a1
6 changed files with 7 additions and 1 deletions
@@ -1,4 +1,4 @@
p Select employee
p= modal_options.header
ul.select-employees
each employee in employees
li.select-employee
@@ -12,6 +12,7 @@ App.ScheduleView = Ember.View.extend
selectable: true
selectHelper: true
select: (start, end)=>
format = 'dddd h:mm'
controller.modal 'select_employee',
ok: ->
# this context is SelectEmployeeController
@@ -20,6 +21,7 @@ App.ScheduleView = Ember.View.extend
shift.set 'employee', employee
shift.save().then ->
placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
header: t('employee_shift.time_window', start: start.format(format), end: end.format(format))
editable: true
defaultView: 'agendaWeek'
events: events
@@ -23,6 +23,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 %>;
@@ -21,6 +21,7 @@
@ttry = (path, vars={})->
@t(path, $.extend(vars, emptyWhenNotFound: true))
# return translation in the form
# <span data-t="models.table">Tafel</span>
@tspan = (path, vars={}) -> "<span data-t='#{path}' class='translation' data-t-attributes='#{JSON.stringify(vars)}'>#{t(path, vars)}</span>"
+1
View File
@@ -210,6 +210,7 @@ en:
title: Select ${models.employee}
close_button: Close
employee_shift:
time_window: From %{start} to %{end}
modal:
title: Edit ${models.employee_shift}
body_header: ''
+1
View File
@@ -213,6 +213,7 @@ nl:
title: Select ${models.employee}
close_button: Close
employee_shift:
time_window: Van %{start} tot %{end}
modal:
title: ${models.employee_shift} bewerken
body_header: ''