Added content_type to ticket_articles.

This commit is contained in:
Martin Edenhofer 2014-12-27 00:21:28 +01:00
parent 4c370451d8
commit f8340b3b3b
3 changed files with 14 additions and 1 deletions

View file

@ -579,6 +579,7 @@ class App.TicketZoom extends App.Controller
articleParams.from = @Session.get().displayName() articleParams.from = @Session.get().displayName()
articleParams.ticket_id = ticket.id articleParams.ticket_id = ticket.id
articleParams.form_id = @form_id articleParams.form_id = @form_id
articleParams.content_type = 'text/html'
if !articleParams['internal'] if !articleParams['internal']
articleParams['internal'] = false articleParams['internal'] = false
@ -1508,6 +1509,10 @@ class Article extends App.Controller
preview: -> preview: ->
if @article.content_type is 'text/html'
@article['html'] = @article.body
return
# build html body # build html body
# cleanup body # cleanup body
# @article['html'] = @article.body.trim() # @article['html'] = @article.body.trim()

View file

@ -1,5 +1,5 @@
class App.TicketArticle extends App.Model class App.TicketArticle extends App.Model
@configure 'TicketArticle', 'from', 'to', 'cc', 'subject', 'body', 'ticket_id', 'type_id', 'sender_id', 'internal', 'in_reply_to', 'form_id', 'updated_at' @configure 'TicketArticle', 'from', 'to', 'cc', 'subject', 'body', 'content_type', 'ticket_id', 'type_id', 'sender_id', 'internal', 'in_reply_to', 'form_id', 'updated_at'
@extend Spine.Model.Ajax @extend Spine.Model.Ajax
@url: @apiPath + '/ticket_articles' @url: @apiPath + '/ticket_articles'
@configure_attributes = [ @configure_attributes = [

View file

@ -0,0 +1,8 @@
class UpdateTicketArticle < ActiveRecord::Migration
def up
add_column :ticket_articles, :content_type, :string, :limit => 20, :null => false, :default => 'text/plain'
end
def down
end
end