diff --git a/app/serializers/event_serializer.rb b/app/serializers/event_serializer.rb index 355d2eb7..c2dffbeb 100644 --- a/app/serializers/event_serializer.rb +++ b/app/serializers/event_serializer.rb @@ -25,15 +25,6 @@ class EventSerializer < ActiveModel::Serializer object.track.try(:guid) end - def abstract - # This should never happen - if object.abstract.blank? - nil - else - simple_format(object.abstract).gsub('\n', '') - end - end - def length object.event_type.try(:length) || EventType::LENGTH_STEP end diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 4414dee6..98d70e34 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -145,7 +145,7 @@ %tr %td %b Abstract - %td= simple_format(@event.abstract) + %td= markdown(@event.abstract) %tr %td %b Description diff --git a/app/views/conference/_schedule_splashpage.html.haml b/app/views/conference/_schedule_splashpage.html.haml index af23f8d7..67bd52e4 100644 --- a/app/views/conference/_schedule_splashpage.html.haml +++ b/app/views/conference/_schedule_splashpage.html.haml @@ -39,7 +39,7 @@ %p.text-center %b= event.title %h5.text-center - = simple_format truncate(event.abstract, length: 500, separator: ' ') + = markdown truncate(event.abstract, length: 500, separator: ' ') = link_to "Read More", conference_program_proposal_path(@conference.short_title, event) = content_for :splash_nav do diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index 4df88438..73ad0b06 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -33,8 +33,8 @@ %span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" } = difficulty_level.description - = f.input :abstract, input_html: { rows: 5 }, - required: true, hint: link_to('Tips to improve your presentations', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx') + = f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, + hint: markdown_hint(link_to('Tips to improve your presentations.', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx')) %p You have used diff --git a/app/views/proposal/new.html.haml b/app/views/proposal/new.html.haml index 658afa18..5281ec37 100644 --- a/app/views/proposal/new.html.haml +++ b/app/views/proposal/new.html.haml @@ -43,8 +43,8 @@ :javascript $("##{@program.event_types.first.id}-help").collapse('show'); - = f.input :abstract, input_html: { rows: 5, required: true }, - required: true, hint: link_to('Tips to improve your presentations', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx') + = f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, + hint: markdown_hint(link_to('Tips to improve your presentations.', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx')) %p You have used diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index e350164a..b80d3ece 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -64,7 +64,7 @@ .row .col-md-12 %p - = simple_format(@event.abstract) + = markdown(@event.abstract) %dl#proposal-info .col-md-12 %dt Date: diff --git a/app/views/schedules/_event.html.haml b/app/views/schedules/_event.html.haml index 1be0e685..abd3143d 100644 --- a/app/views/schedules/_event.html.haml +++ b/app/views/schedules/_event.html.haml @@ -12,7 +12,7 @@ %h4 presented by #{event.speaker_names} %p - = truncate(event.abstract, :length => 400) + = markdown(truncate(event.abstract, :length => 400)) = link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400 - if event_schedule.present? %span.track diff --git a/spec/serializers/event_serializer_spec.rb b/spec/serializers/event_serializer_spec.rb index e4f96e53..b4edc2d1 100644 --- a/spec/serializers/event_serializer_spec.rb +++ b/spec/serializers/event_serializer_spec.rb @@ -12,7 +12,7 @@ describe EventSerializer, type: :serializer do length: 30, scheduled_date: '', language: nil, - abstract: '
Lorem ipsum dolor sit amet
', + abstract: 'Lorem ipsum dolor sit amet', speaker_ids: [], type: 'Example Event Type', room: nil, @@ -44,7 +44,7 @@ describe EventSerializer, type: :serializer do length: 30, scheduled_date: ' 2014-03-04T00:00:00+0000 ', language: 'English', - abstract: 'Lorem ipsum dolor sit amet
', + abstract: 'Lorem ipsum dolor sit amet', speaker_ids: [speaker.user.id], type: 'Example Event Type', room: room.guid,