From dc311221f121c83750226c3e041b4c7d16f4975f Mon Sep 17 00:00:00 2001 From: Dan Rice Date: Tue, 12 Mar 2013 18:30:38 +0200 Subject: [PATCH] Render notes using RedCloth without formatize Removes the outdated bluecloth dependency --- Gemfile | 1 - Gemfile.lock | 6 ------ app/assets/stylesheets/mobile.css.scss | 4 ++++ app/controllers/application_controller.rb | 2 +- app/helpers/notes_helper.rb | 4 ++-- app/views/notes/_note.m.erb | 2 +- app/views/notes/_note_details.html.erb | 2 +- app/views/notes/_notes_summary.m.erb | 4 +++- lib/tracks/utils.rb | 10 +++------- test/functional/todos_controller_test.rb | 2 +- 10 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index 51a81db7..40d91e4c 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,6 @@ gem "sqlite3" gem "mysql2" gem "RedCloth" -gem "formatize" gem "sanitize" gem "will_paginate" gem "acts_as_list" diff --git a/Gemfile.lock b/Gemfile.lock index 88ae7beb..37867c9e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,7 +38,6 @@ GEM cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) bcrypt-ruby (3.0.1) - bluecloth (2.2.0) builder (3.0.4) bullet (4.3.1) uniform_notifier @@ -80,10 +79,6 @@ GEM factory_girl (~> 4.2.0) railties (>= 3.0.0) ffi (1.4.0) - formatize (1.1.0) - RedCloth (~> 4.2) - actionpack (~> 3.0) - bluecloth (~> 2.2) gherkin (2.11.6) json (>= 1.7.6) hike (1.2.1) @@ -205,7 +200,6 @@ DEPENDENCIES cucumber-rails database_cleaner factory_girl_rails - formatize htmlentities jquery-rails mocha diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index 253daabf..2b64cbae 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -280,3 +280,7 @@ input#todo_description, input#tag_list, textarea#todo_notes, select#todo_project background: #cc3334 image-url('next.png') right center no-repeat; } } + +div.note_wrapper p { + display: inline; +} diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e11781c4..647f0289 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,7 +10,7 @@ class ApplicationController < ActionController::Base protect_from_forgery include LoginSystem - helper_method :current_user, :prefs, :format_date, :markdown + helper_method :current_user, :prefs, :format_date layout proc{ |controller| controller.mobile? ? "mobile" : "application" } # exempt_from_layout /\.js\.erb$/ diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index b5a416f0..1717fa92 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -1,10 +1,10 @@ module NotesHelper def truncated_note(note, characters = 50) - sanitize(textilize_without_paragraph(truncate(note.body, :length => characters, :omission => "..."))) + Tracks::Utils.render_text(truncate(note.body, :length => characters, :omission => "...")) end def rendered_note(note) - sanitize(textilize_without_paragraph(note.body)) + Tracks::Utils.render_text(note.body) end def link_to_delete_note(note, descriptor = sanitize(note.id.to_s)) diff --git a/app/views/notes/_note.m.erb b/app/views/notes/_note.m.erb index 1fce22c0..e3757374 100644 --- a/app/views/notes/_note.m.erb +++ b/app/views/notes/_note.m.erb @@ -1,5 +1,5 @@
- <%= sanitize(textilize_without_paragraph(note.body)) %> + <%= rendered_note(note) %>

diff --git a/app/views/notes/_note_details.html.erb b/app/views/notes/_note_details.html.erb index bd83f112..7bcfbc49 100644 --- a/app/views/notes/_note_details.html.erb +++ b/app/views/notes/_note_details.html.erb @@ -1,5 +1,5 @@ <% note = note_details -%> -
<%= Tracks::Utils.render_text(note.body) %>
+
<%= rendered_note(note) %>