diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake index 8b92ea9e..77a200b8 100644 --- a/lib/tasks/migrate.rake +++ b/lib/tasks/migrate.rake @@ -355,5 +355,17 @@ namespace :migrate do p 'End Site' end + + + task :news_p => :environment do + news_bulletins = NewsBulletin.admin_manager_all rescue nil + i = 1 + news_bulletins.each do |news| + p "#{i}/#{news_bulletins.size} - #{news.id}" + news.subtitle.gsub!(/^\
/, '').gsub!(/\<\/p\>$/, '') rescue nil + p news.save(:validate => false) if news.changed? + i += 1 + end if news_bulletins + end end diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb index d62b4e87..c7db4c64 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb @@ -163,7 +163,7 @@ <%= f.label :subtitle, t('news.news_bulletin.subtitle') %> <%= f.fields_for :subtitle_translations do |f| %> <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea', :value => (@news_bulletin.subtitle_translations[locale] rescue nil) %> + <%= f.text_area locale, :style=>"width:100%", :value => (@news_bulletin.subtitle_translations[locale] rescue nil) %> <% end %> diff --git a/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb index c61b60ff..31844d11 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/home_banner.html.erb @@ -21,7 +21,7 @@
<%= truncate((post.subtitle rescue '') ,:length => 200).html_safe %>
+<%= truncate((post.subtitle rescue '') ,:length => 200) %>