The markdown digest seemed broken, no line breaks, we now use kramdown which is able to generate markdown from html
parent
4ce608dd5c
commit
45b18e0c34
@ -1,20 +1,19 @@
|
||||
=====================================================
|
||||
#{Event.human_attribute_name(:title).concat(':').ljust 12 } #{@event.title}
|
||||
#{Event.human_attribute_name(:start_time).concat(':').ljust 12 } #{l @event.start_time, format: :at}
|
||||
#{Event.human_attribute_name(:end_time).concat(':').ljust 12 } #{l @event.end_time, format: :at}
|
||||
-if @event.repeat > 0
|
||||
#{Event.human_attribute_name(:repeat).concat(':').ljust 12 } #{@event.repeat}
|
||||
#{Event.human_attribute_name(:rule).concat(':').ljust 12 } #{t @event.rule, scope: 'activerecord.attributes.event.rule_values'}
|
||||
#{Event.human_attribute_name(:place_name).concat(':').ljust 12 } #{@event.place_name}
|
||||
#{Event.human_attribute_name(:address).concat(':').ljust 12 } #{@event.address}
|
||||
#{Event.human_attribute_name(:city).concat(':').ljust 12 } #{@event.city}
|
||||
#{Event.human_attribute_name(:region).concat(':').ljust 12 } #{@event.region}
|
||||
#{Event.human_attribute_name(:locality).concat(':').ljust 12 } #{t "attributes.locality_#{@event.locality}"}
|
||||
- if @event.url.present?
|
||||
#{Event.human_attribute_name(:url).concat(':').ljust 12 } #{@event.url}
|
||||
#{Event.human_attribute_name(:contact).concat(':').ljust 12 } #{@event.contact}
|
||||
#{Event.human_attribute_name(:submitter).concat(':').ljust 12 } #{@event.submitter}
|
||||
#{Event.human_attribute_name(:tags).concat(':').ljust 12 } #{@event.tag_list}
|
||||
#{Event.human_attribute_name(:description).concat(':').ljust 12}
|
||||
= wrap(strip_tags(@event.description).gsub(/ /, '')).gsub /^/, ' '
|
||||
=====================================================
|
||||
================================================================================
|
||||
= display_attr :title
|
||||
= display_attr :start_time, l(@event.start_time, format: :at)
|
||||
= display_attr :end_time, l(@event.end_time, format: :at)
|
||||
= display_attr :place_name
|
||||
= display_attr :address
|
||||
= display_attr :city
|
||||
= display_attr :region, @event.region
|
||||
= display_attr :locality, t("attributes.locality_#{@event.locality}")
|
||||
= display_attr :url
|
||||
= display_attr :contact
|
||||
= display_attr :submitter
|
||||
= display_attr :tags, @event.tag_list
|
||||
- if @event.repeat > 0
|
||||
= display_attr :repeat
|
||||
= display_attr :rule, t(@event.rule, scope: 'activerecord.attributes.event.rule_values')
|
||||
\
|
||||
= Kramdown::Document.new(@event.description, input: 'html').to_kramdown
|
||||
================================================================================
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,23 @@
|
||||
(function() {
|
||||
$(document).on('turbolinks:load', function() {
|
||||
return tinyMCE.init({
|
||||
schema: 'html5',
|
||||
height: '40em',
|
||||
menubar: false,
|
||||
branding: false,
|
||||
language: 'fr_FR',
|
||||
selector: 'input.description',
|
||||
content_css: '/assets/application-453868b5e8524811b06953b99485725a8bb6787b4936274042f7695531abcda3.css',
|
||||
entity_encoding: 'raw',
|
||||
add_unload_trigger: true,
|
||||
browser_spellcheck: true,
|
||||
toolbar: [' cut copy paste | undo redo | searchreplace | link image media charmap table | code visualblocks preview fullscreen', ' removeformat | bold italic strikethrough | superscript subscript | bullist numlist | alignleft aligncenter alignright alignjustify alignnone | outdent indent'],
|
||||
plugins: 'lists, advlist, autolink, link, image, charmap, paste, print, preview, table, fullscreen, searchreplace, media, insertdatetime, visualblocks, wordcount, contextmenu, code'
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('turbolinks:before-cache', function() {
|
||||
return tinymce.remove();
|
||||
});
|
||||
|
||||
}).call(this);
|
Binary file not shown.
Loading…
Reference in New Issue