First steps of new features.

This commit is contained in:
Martin Edenhofer 2015-09-29 07:54:58 +02:00
parent db89f942c6
commit 72919122cb
2 changed files with 58 additions and 6 deletions

View file

@ -9,8 +9,7 @@ class Index extends App.ControllerTabs
{
name: 'Time Based',
target: 'c-time-based',
controller: App.SettingsArea,
params: { area: 'Email::Base' },
controller: App.TriggerTime,
},
{
name: 'Event Based',
@ -34,4 +33,57 @@ class Index extends App.ControllerTabs
@render()
App.Config.set( 'Trigger', { prio: 3000, name: 'Trigger', parent: '#manage', target: '#manage/triggers', controller: Index, role: ['Admin'] }, 'NavBarAdmin' )
App.Config.set( 'Trigger', { prio: 3000, name: 'Trigger', parent: '#manage', target: '#manage/triggers', controller: Index, role: ['Admin'] }, 'NavBarAdmin' )
class App.TriggerTime extends App.Controller
events:
'click .js-new': 'new'
#'click .js-edit': 'edit'
'click .js-delete': 'delete'
constructor: ->
super
@interval(@load, 30000)
#@load()
load: =>
@ajax(
id: 'trigger_time_index'
type: 'GET'
url: @apiPath + '/jobs'
processData: true
success: (data, status, xhr) =>
# load assets
#App.Collection.loadAssets(data.assets)
@render(data)
)
render: (data = {}) =>
@html App.view('trigger/time/index')(
triggers: []
)
delete: (e) =>
e.preventDefault()
id = $(e.target).closest('.action').data('id')
item = App.Channel.find(id)
new App.ControllerGenericDestroyConfirm(
item: item
container: @el.closest('.content')
callback: @load
)
new: (e) =>
e.preventDefault()
channel_id = $(e.target).closest('.action').data('id')
new App.ControllerGenericNew(
pageData:
object: 'Jobs'
genericObject: 'Job'
container: @el.closest('.content')
callback: @load
)

View file

@ -4,9 +4,9 @@ class App.Job extends App.Model
@url: @apiPath + '/jobs'
@configure_attributes = [
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false },
{ name: 'timeplan', display: 'The times where the job should run.', tag: 'timeplan', null: true },
{ name: 'condition', display: 'Conditions for matching objects.', tag: 'ticket_attribute_selection', null: true },
{ name: 'execute', display: 'Execute changes on objects.', tag: 'ticket_attribute_set', null: true },
# { name: 'timeplan', display: 'The times where the job should run.', tag: 'timeplan', null: true },
{ name: 'condition', display: 'Conditions for matching objects.', tag: 'ticket_selector', null: true },
{ name: 'execute', display: 'Execute changes on objects.', tag: 'ticket_perform_action', null: true },
{ name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, null: true },
{ name: 'active', display: 'Active', tag: 'active', default: true },
{ name: 'matching', display: 'Matching', readonly: 1 },