Moved to richtext for text modules and signatures.
This commit is contained in:
parent
4438cef46a
commit
a526c47b8a
7 changed files with 18 additions and 10 deletions
|
@ -201,9 +201,7 @@ class App.TicketCreate extends App.Controller
|
||||||
type = @$('[name="formSenderType"]').val()
|
type = @$('[name="formSenderType"]').val()
|
||||||
|
|
||||||
if signature isnt undefined && signature.body && type is 'email-out'
|
if signature isnt undefined && signature.body && type is 'email-out'
|
||||||
signatureFinished = App.Utils.text2html(
|
signatureFinished = App.Utils.replaceTags( signature.body, { user: App.Session.get() } )
|
||||||
App.Utils.replaceTags( signature.body, { user: App.Session.get() } )
|
|
||||||
)
|
|
||||||
|
|
||||||
# get current body
|
# get current body
|
||||||
body = @$('[data-name="body"]').html() || ''
|
body = @$('[data-name="body"]').html() || ''
|
||||||
|
|
|
@ -420,9 +420,8 @@ class App.TicketZoomArticleNew extends App.Controller
|
||||||
@$('[data-name=body] [data-signature="true"]').remove()
|
@$('[data-name=body] [data-signature="true"]').remove()
|
||||||
|
|
||||||
# apply new signature
|
# apply new signature
|
||||||
signatureFinished = App.Utils.text2html(
|
signatureFinished = App.Utils.replaceTags( signature.body, { user: App.Session.get(), ticket: ticketCurrent } )
|
||||||
App.Utils.replaceTags( signature.body, { user: App.Session.get(), ticket: ticketCurrent } )
|
|
||||||
)
|
|
||||||
body = @$('[data-name=body]').html() || ''
|
body = @$('[data-name=body]').html() || ''
|
||||||
if App.Utils.signatureCheck(body, signatureFinished)
|
if App.Utils.signatureCheck(body, signatureFinished)
|
||||||
if !App.Utils.lastLineEmpty(body)
|
if !App.Utils.lastLineEmpty(body)
|
||||||
|
|
|
@ -248,7 +248,6 @@
|
||||||
|
|
||||||
// paste some content
|
// paste some content
|
||||||
Plugin.prototype.paste = function(string) {
|
Plugin.prototype.paste = function(string) {
|
||||||
string = App.Utils.text2html(string)
|
|
||||||
if (document.selection) { // IE
|
if (document.selection) { // IE
|
||||||
var range = document.selection.createRange()
|
var range = document.selection.createRange()
|
||||||
range.pasteHTML(string)
|
range.pasteHTML(string)
|
||||||
|
|
|
@ -5,7 +5,7 @@ class App.Signature extends App.Model
|
||||||
|
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false },
|
||||||
{ name: 'body', display: 'Text', tag: 'textarea', limit: 250, 'null': true, rows: 10 },
|
{ name: 'body', display: 'Text', tag: 'richtext', limit: 500, 'null': true, rows: 10 },
|
||||||
{ name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, '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: 'active', display: 'Active', tag: 'active', default: true },
|
||||||
{ name: 'created_by_id', display: 'Created by', relation: 'User', readonly: 1 },
|
{ name: 'created_by_id', display: 'Created by', relation: 'User', readonly: 1 },
|
||||||
|
|
|
@ -5,7 +5,7 @@ class App.TextModule extends App.Model
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false },
|
||||||
{ name: 'keywords', display: 'Keywords', tag: 'input', type: 'text', limit: 100, null: true },
|
{ name: 'keywords', display: 'Keywords', tag: 'input', type: 'text', limit: 100, null: true },
|
||||||
{ name: 'content', display: 'Content', tag: 'textarea', limit: 250, null: false },
|
{ name: 'content', display: 'Content', tag: 'richtext', limit: 2000, null: false },
|
||||||
{ name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 },
|
{ name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 },
|
||||||
{ name: 'active', display: 'Active', tag: 'active', default: true },
|
{ name: 'active', display: 'Active', tag: 'active', default: true },
|
||||||
]
|
]
|
||||||
|
|
12
db/migrate/20160211000001_migrate_text_modules.rb
Normal file
12
db/migrate/20160211000001_migrate_text_modules.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
class MigrateTextModules < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
TextModule.all.each {|text_module|
|
||||||
|
text_module.content = text_module.content.text2html
|
||||||
|
text_module.save
|
||||||
|
}
|
||||||
|
Signature.all.each {|signature|
|
||||||
|
signature.body = signature.body.text2html
|
||||||
|
signature.save
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
|
@ -1516,7 +1516,7 @@ signature = Signature.create_if_not_exists(
|
||||||
Super Support - Waterford Business Park
|
Super Support - Waterford Business Park
|
||||||
5201 Blue Lagoon Drive - 8th Floor & 9th Floor - Miami, 33126 USA
|
5201 Blue Lagoon Drive - 8th Floor & 9th Floor - Miami, 33126 USA
|
||||||
Email: hot@example.com - Web: http://www.example.com/
|
Email: hot@example.com - Web: http://www.example.com/
|
||||||
--',
|
--'.text2html,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
created_by_id: 1
|
created_by_id: 1
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue