From 1795ab7e4d7d3fffeaee38380a18cab9e6a6eb94 Mon Sep 17 00:00:00 2001 From: echarp Date: Fri, 26 Sep 2014 22:30:54 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20sur=20le=20chemin=20css=20pour=20?= =?UTF-8?q?=C3=A9diteur=20tinymce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/events.js.coffee | 27 ----------------------- app/assets/javascripts/tinymce.coffee.erb | 27 +++++++++++++++++++++++ app/views/tags/show.html.haml | 4 ++-- 3 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 app/assets/javascripts/tinymce.coffee.erb diff --git a/app/assets/javascripts/events.js.coffee b/app/assets/javascripts/events.js.coffee index 7db041c4..40d43f82 100644 --- a/app/assets/javascripts/events.js.coffee +++ b/app/assets/javascripts/events.js.coffee @@ -1,27 +1,4 @@ $(document).ready -> - # Setup the graphical editor for event's description - tinyMCE.init - schema: 'html5', - menubar: false, - language: 'fr_FR', - selector: 'textarea#event_description', - content_css: '/assets/application.css', - entity_encoding : 'raw', - add_unload_trigger: true, - browser_spellcheck: true, - toolbar: [ - ' bold italic strikethrough - | bullist numlist outdent indent - | alignleft aligncenter alignright alignjustify - | link image media insertdatetime charmap table - | undo redo - | searchreplace - | code visualblocks preview fullscreen' - ], - plugins: 'lists, advlist, autolink, link, image, charmap, paste, print, - preview, table, fullscreen, searchreplace, media, insertdatetime, - visualblocks, visualchars, wordcount, contextmenu, code' - # Manage event tags edition $('#event_tags').each -> elt = $(this) @@ -38,7 +15,3 @@ $(document).ready -> $('#event_end_time').change -> if $('#event_start_time').val() >= $('#event_end_time').val() $('#event_start_time').val($('#event_end_time').val()) - -$(document).on 'page:receive', -> - # Delete existing tinymce editors, very important in the turbolinks context! - tinymce.remove() diff --git a/app/assets/javascripts/tinymce.coffee.erb b/app/assets/javascripts/tinymce.coffee.erb new file mode 100644 index 00000000..2ecc890a --- /dev/null +++ b/app/assets/javascripts/tinymce.coffee.erb @@ -0,0 +1,27 @@ +$(document).ready -> + # Setup the graphical editor for event's description + tinyMCE.init + schema: 'html5', + menubar: false, + language: 'fr_FR', + selector: 'textarea#event_description', + content_css: '<%= asset_path 'application.css' %>', + entity_encoding : 'raw', + add_unload_trigger: true, + browser_spellcheck: true, + toolbar: [ + ' bold italic strikethrough + | bullist numlist outdent indent + | alignleft aligncenter alignright alignjustify + | link image media insertdatetime charmap table + | undo redo + | searchreplace + | code visualblocks preview fullscreen' + ], + plugins: 'lists, advlist, autolink, link, image, charmap, paste, print, + preview, table, fullscreen, searchreplace, media, insertdatetime, + visualblocks, visualchars, wordcount, contextmenu, code' + +$(document).on 'page:receive', -> + # Delete existing tinymce editors, very important in the turbolinks context! + tinymce.remove() diff --git a/app/views/tags/show.html.haml b/app/views/tags/show.html.haml index 63b3bd97..0e26156e 100644 --- a/app/views/tags/show.html.haml +++ b/app/views/tags/show.html.haml @@ -5,7 +5,7 @@ - if @events_future.any? %p=raw t '.future', count: @events_future.count %ul - - @events_future.find_each do |event| + - @events_future.order('start_time asc').each do |event| %li %div = link_to event do @@ -16,7 +16,7 @@ - if @events_past.any? %p=raw t '.past', count: @events_past.count %ul - - @events_past.find_each do |event| + - @events_past.order('start_time desc').each do |event| %li %div = link_to event do