From abe409ad944e03978583250674638abf8be0cda8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 1 Oct 2012 21:09:51 +0200 Subject: [PATCH] Added signature model. --- .../javascripts/app/models/signature.js.coffee | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/assets/javascripts/app/models/signature.js.coffee diff --git a/app/assets/javascripts/app/models/signature.js.coffee b/app/assets/javascripts/app/models/signature.js.coffee new file mode 100644 index 000000000..46c0db807 --- /dev/null +++ b/app/assets/javascripts/app/models/signature.js.coffee @@ -0,0 +1,15 @@ +class App.Signature extends App.Model + @configure 'Signature', 'name', 'body', 'note', 'active' + @extend Spine.Model.Ajax + @url: '/api/signatures' + + @configure_attributes = [ + { name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' }, + { name: 'body', display: 'Text', tag: 'textarea', limit: 250, 'null': true, 'class': 'span4' }, + { name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, 'null': true, 'class': 'span4' }, + { name: 'updated_at', display: 'Updated', type: 'time', readonly: 1 }, + { name: 'active', display: 'Active', tag: 'boolean', type: 'boolean', 'default': true, 'null': false, 'class': 'span4' }, + ] + @configure_overview = [ + 'name', + ]