Commit 6eb736e05645ed902dbb17522ecdbefe14baf8c4

Authored by Leandro Santos
Committed by Victor Costa
1 parent 64154b3e
Exists in fix_sign_up_form

Remove TinyMce, RawHTML and Textile article types and create the possibility to …

…choose wich editor will be used to create new text articles
Showing 162 changed files with 962 additions and 1083 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 162 files displayed.

app/api/helpers.rb
@@ -107,7 +107,7 @@ module Api @@ -107,7 +107,7 @@ module Api
107 def post_article(asset, params) 107 def post_article(asset, params)
108 return forbidden! unless current_person.can_post_content?(asset) 108 return forbidden! unless current_person.can_post_content?(asset)
109 109
110 - klass_type = params[:content_type] || params[:article].delete(:type) || TinyMceArticle.name 110 + klass_type = params[:content_type] || params[:article].delete(:type) || TextArticle.name
111 return forbidden! unless klass_type.constantize <= Article 111 return forbidden! unless klass_type.constantize <= Article
112 112
113 article = klass_type.constantize.new(params[:article]) 113 article = klass_type.constantize.new(params[:article])
@@ -461,11 +461,9 @@ module Api @@ -461,11 +461,9 @@ module Api
461 461
462 def parse_content_type(content_type) 462 def parse_content_type(content_type)
463 return nil if content_type.blank? 463 return nil if content_type.blank?
464 - content_types = content_type.split(',').map do |content_type|  
465 - content_type = content_type.camelcase  
466 - content_type == 'TextArticle' ? Article.text_article_types : content_type 464 + content_type.split(',').map do |content_type|
  465 + content_type.camelcase
467 end 466 end
468 - content_types.flatten.uniq  
469 end 467 end
470 468
471 def period(from_date, until_date) 469 def period(from_date, until_date)
app/controllers/my_profile/cms_controller.rb
@@ -151,6 +151,7 @@ class CmsController &lt; MyProfileController @@ -151,6 +151,7 @@ class CmsController &lt; MyProfileController
151 151
152 @article.profile = profile 152 @article.profile = profile
153 @article.author = user 153 @article.author = user
  154 + @article.editor = current_person.editor
154 @article.last_changed_by = user 155 @article.last_changed_by = user
155 @article.created_by = user 156 @article.created_by = user
156 157
@@ -399,8 +400,7 @@ class CmsController &lt; MyProfileController @@ -399,8 +400,7 @@ class CmsController &lt; MyProfileController
399 400
400 def available_article_types 401 def available_article_types
401 articles = [ 402 articles = [
402 - TinyMceArticle,  
403 - TextileArticle, 403 + TextArticle,
404 Event 404 Event
405 ] 405 ]
406 articles += special_article_types if params && params[:cms] 406 articles += special_article_types if params && params[:cms]
@@ -408,9 +408,6 @@ class CmsController &lt; MyProfileController @@ -408,9 +408,6 @@ class CmsController &lt; MyProfileController
408 if @parent && @parent.blog? 408 if @parent && @parent.blog?
409 articles -= Article.folder_types.map(&:constantize) 409 articles -= Article.folder_types.map(&:constantize)
410 end 410 end
411 - if user.is_admin?(profile.environment)  
412 - articles << RawHTMLArticle  
413 - end  
414 articles 411 articles
415 end 412 end
416 413
app/controllers/my_profile/profile_editor_controller.rb
@@ -92,7 +92,7 @@ class ProfileEditorController &lt; MyProfileController @@ -92,7 +92,7 @@ class ProfileEditorController &lt; MyProfileController
92 end 92 end
93 93
94 def welcome_page 94 def welcome_page
95 - @welcome_page = profile.welcome_page || TinyMceArticle.new(:name => 'Welcome Page', :profile => profile, :published => false) 95 + @welcome_page = profile.welcome_page || TextArticle.new(:name => 'Welcome Page', :profile => profile, :published => false)
96 if request.post? 96 if request.post?
97 begin 97 begin
98 @welcome_page.update!(params[:welcome_page]) 98 @welcome_page.update!(params[:welcome_page])
app/helpers/application_helper.rb
@@ -109,10 +109,6 @@ module ApplicationHelper @@ -109,10 +109,6 @@ module ApplicationHelper
109 content = capture(&block) 109 content = capture(&block)
110 end 110 end
111 111
112 - if options[:type] == :textile  
113 - content = RedCloth.new(content).to_html  
114 - end  
115 -  
116 options[:class] = '' if ! options[:class] 112 options[:class] = '' if ! options[:class]
117 options[:class] += ' button icon-help' # with-text 113 options[:class] += ' button icon-help' # with-text
118 114
@@ -130,13 +126,6 @@ module ApplicationHelper @@ -130,13 +126,6 @@ module ApplicationHelper
130 text 126 text
131 end 127 end
132 128
133 - # alias for <tt>help(content, :textile)</tt>. You can pass a block in the  
134 - # same way you would do if you called <tt>help</tt> directly.  
135 - def help_textile(content = nil, link_name = nil, options = {}, &block)  
136 - options[:type] = :textile  
137 - help(content, link_name, options, &block)  
138 - end  
139 -  
140 # TODO: do something more useful here 129 # TODO: do something more useful here
141 # TODO: test this helper 130 # TODO: test this helper
142 # TODO: add an icon? 131 # TODO: add an icon?
@@ -1243,4 +1232,15 @@ module ApplicationHelper @@ -1243,4 +1232,15 @@ module ApplicationHelper
1243 content.html_safe 1232 content.html_safe
1244 end 1233 end
1245 1234
  1235 + def current_editor_is?(editor)
  1236 + editor.blank? ? false : current_editor == editor
  1237 + end
  1238 +
  1239 + def current_editor(mode = '')
  1240 + editor = @article.editor || Article::Editor::TINY_MCE unless @article.nil?
  1241 + editor ||= (current_person.nil? || current_person.editor.nil?) ? Article::Editor::TINY_MCE : current_person.editor
  1242 + editor += '_' + mode unless mode.blank?
  1243 + editor
  1244 + end
  1245 +
1246 end 1246 end
app/helpers/profile_editor_helper.rb
@@ -158,4 +158,8 @@ module ProfileEditorHelper @@ -158,4 +158,8 @@ module ProfileEditorHelper
158 end 158 end
159 end 159 end
160 160
  161 + def select_editor(title, object, method, options)
  162 + labelled_form_field(title, select(object, method,[[_('TinyMCE'), Article::Editor::TINY_MCE], [_('Textile'), Article::Editor::TEXTILE], [_('Raw HTML'), Article::Editor::RAW_HTML]]))
  163 + end
  164 +
161 end 165 end
app/helpers/tinymce_helper.rb
@@ -18,7 +18,8 @@ module TinymceHelper @@ -18,7 +18,8 @@ module TinymceHelper
18 insertdatetime media nonbreaking save table contextmenu directionality 18 insertdatetime media nonbreaking save table contextmenu directionality
19 emoticons template paste textcolor colorpicker textpattern], 19 emoticons template paste textcolor colorpicker textpattern],
20 :image_advtab => true, 20 :image_advtab => true,
21 - :language => tinymce_language 21 + :language => tinymce_language,
  22 + :selector => '.' + current_editor(options[:mode])
22 23
23 options[:toolbar1] = toolbar1(options[:mode]) 24 options[:toolbar1] = toolbar1(options[:mode])
24 options[:menubar] = menubar(options[:mode]) 25 options[:menubar] = menubar(options[:mode])
app/models/article.rb
1 1
2 class Article < ApplicationRecord 2 class Article < ApplicationRecord
3 3
  4 + module Editor
  5 + TEXTILE = 'textile'
  6 + TINY_MCE = 'tiny_mce'
  7 + RAW_HTML = 'raw_html'
  8 + end
  9 +
4 include SanitizeHelper 10 include SanitizeHelper
5 11
6 attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, 12 attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent,
@@ -11,7 +17,7 @@ class Article &lt; ApplicationRecord @@ -11,7 +17,7 @@ class Article &lt; ApplicationRecord
11 :highlighted, :notify_comments, :display_hits, :slug, 17 :highlighted, :notify_comments, :display_hits, :slug,
12 :external_feed_builder, :display_versions, :external_link, 18 :external_feed_builder, :display_versions, :external_link,
13 :image_builder, :show_to_followers, :archived, 19 :image_builder, :show_to_followers, :archived,
14 - :author, :display_preview, :published_at, :person_followers 20 + :author, :display_preview, :published_at, :person_followers, :editor
15 21
16 extend ActsAsHavingImage::ClassMethods 22 extend ActsAsHavingImage::ClassMethods
17 acts_as_having_image 23 acts_as_having_image
@@ -518,17 +524,12 @@ class Article &lt; ApplicationRecord @@ -518,17 +524,12 @@ class Article &lt; ApplicationRecord
518 ['Folder', 'Blog', 'Forum', 'Gallery'] 524 ['Folder', 'Blog', 'Forum', 'Gallery']
519 end 525 end
520 526
521 - def self.text_article_types  
522 - ['TextArticle', 'TextileArticle', 'TinyMceArticle']  
523 - end  
524 -  
525 scope :published, -> { where 'articles.published = ?', true } 527 scope :published, -> { where 'articles.published = ?', true }
526 scope :folders, -> profile { where 'articles.type IN (?)', profile.folder_types } 528 scope :folders, -> profile { where 'articles.type IN (?)', profile.folder_types }
527 scope :no_folders, -> profile { where 'articles.type NOT IN (?)', profile.folder_types } 529 scope :no_folders, -> profile { where 'articles.type NOT IN (?)', profile.folder_types }
528 scope :galleries, -> { where "articles.type IN ('Gallery')" } 530 scope :galleries, -> { where "articles.type IN ('Gallery')" }
529 scope :images, -> { where :is_image => true } 531 scope :images, -> { where :is_image => true }
530 scope :no_images, -> { where :is_image => false } 532 scope :no_images, -> { where :is_image => false }
531 - scope :text_articles, -> { where 'articles.type IN (?)', text_article_types }  
532 scope :files, -> { where :type => 'UploadedFile' } 533 scope :files, -> { where :type => 'UploadedFile' }
533 scope :with_types, -> types { where 'articles.type IN (?)', types } 534 scope :with_types, -> types { where 'articles.type IN (?)', types }
534 535
@@ -711,10 +712,6 @@ class Article &lt; ApplicationRecord @@ -711,10 +712,6 @@ class Article &lt; ApplicationRecord
711 false 712 false
712 end 713 end
713 714
714 - def tiny_mce?  
715 - false  
716 - end  
717 -  
718 def folder? 715 def folder?
719 false 716 false
720 end 717 end
@@ -874,6 +871,10 @@ class Article &lt; ApplicationRecord @@ -874,6 +871,10 @@ class Article &lt; ApplicationRecord
874 true 871 true
875 end 872 end
876 873
  874 + def editor?(editor)
  875 + self.editor == editor
  876 + end
  877 +
877 private 878 private
878 879
879 def sanitize_tag_list 880 def sanitize_tag_list
app/models/event.rb
@@ -121,10 +121,6 @@ class Event &lt; Article @@ -121,10 +121,6 @@ class Event &lt; Article
121 true 121 true
122 end 122 end
123 123
124 - def tiny_mce?  
125 - true  
126 - end  
127 -  
128 def notifiable? 124 def notifiable?
129 true 125 true
130 end 126 end
app/models/external_feed.rb
@@ -25,7 +25,7 @@ class ExternalFeed &lt; ApplicationRecord @@ -25,7 +25,7 @@ class ExternalFeed &lt; ApplicationRecord
25 end 25 end
26 content = doc.to_s 26 content = doc.to_s
27 27
28 - article = TinyMceArticle.new 28 + article = TextArticle.new
29 article.name = title 29 article.name = title
30 article.profile = blog.profile 30 article.profile = blog.profile
31 article.body = content 31 article.body = content
app/models/person.rb
1 # A person is the profile of an user holding all relationships with the rest of the system 1 # A person is the profile of an user holding all relationships with the rest of the system
2 class Person < Profile 2 class Person < Profile
3 3
4 - attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone, :comercial_phone, :jabber_id, :personal_website, :nationality, :address_reference, :district, :schooling, :schooling_status, :formation, :custom_formation, :area_of_study, :custom_area_of_study, :professional_activity, :organization_website, :following_articles 4 + attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone, :comercial_phone, :jabber_id, :personal_website, :nationality, :address_reference, :district, :schooling, :schooling_status, :formation, :custom_formation, :area_of_study, :custom_area_of_study, :professional_activity, :organization_website, :following_articles, :editor
5 5
6 SEARCH_FILTERS = { 6 SEARCH_FILTERS = {
7 :order => %w[more_recent more_popular more_active], 7 :order => %w[more_recent more_popular more_active],
@@ -613,6 +613,10 @@ class Person &lt; Profile @@ -613,6 +613,10 @@ class Person &lt; Profile
613 Profile.followed_by self 613 Profile.followed_by self
614 end 614 end
615 615
  616 + def editor?(editor)
  617 + self.editor == editor
  618 + end
  619 +
616 def in_social_circle?(person) 620 def in_social_circle?(person)
617 self.is_a_friend?(person) || super 621 self.is_a_friend?(person) || super
618 end 622 end
app/models/raw_html_article.rb
@@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
1 -class RawHTMLArticle < TextArticle  
2 -  
3 - def self.type_name  
4 - _('HTML')  
5 - end  
6 -  
7 - def self.short_description  
8 - _('Raw HTML text article')  
9 - end  
10 -  
11 - def self.description  
12 - _('Allows HTML without filter (only for admins).')  
13 - end  
14 -  
15 - xss_terminate :only => [ ]  
16 -  
17 -end  
app/models/suggest_article.rb
@@ -44,7 +44,7 @@ class SuggestArticle &lt; Task @@ -44,7 +44,7 @@ class SuggestArticle &lt; Task
44 type = article[:type].constantize 44 type = article[:type].constantize
45 return type if type < Article 45 return type if type < Article
46 end 46 end
47 - TinyMceArticle 47 + TextArticle
48 end 48 end
49 49
50 def perform 50 def perform
app/models/text_article.rb
1 # a base class for all text article types. 1 # a base class for all text article types.
2 class TextArticle < Article 2 class TextArticle < Article
3 3
4 - xss_terminate :only => [ :name ], :on => 'validation' 4 + def self.short_description
  5 + _('Text article')
  6 + end
  7 +
  8 + def self.description
  9 + _('Text article to create user content.')
  10 + end
  11 +
  12 + xss_terminate :only => [ :name, :body, :abstract ], :with => 'white_list', :on => 'validation', :if => lambda { |a| !a.editor?(Article::Editor::TEXTILE) && !a.editor?(Article::Editor::RAW_HTML) }
  13 +
  14 + include WhiteListFilter
  15 + filter_iframes :abstract, :body
  16 + def iframe_whitelist
  17 + profile && profile.environment && profile.environment.trusted_sites_for_iframe
  18 + end
5 19
6 def self.type_name 20 def self.type_name
7 _('Article') 21 _('Article')
@@ -21,6 +35,18 @@ class TextArticle &lt; Article @@ -21,6 +35,18 @@ class TextArticle &lt; Article
21 true 35 true
22 end 36 end
23 37
  38 + def can_display_media_panel?
  39 + true
  40 + end
  41 +
  42 + def self.can_display_blocks?
  43 + false
  44 + end
  45 +
  46 + def notifiable?
  47 + true
  48 + end
  49 +
24 before_save :set_relative_path 50 before_save :set_relative_path
25 51
26 def set_relative_path 52 def set_relative_path
@@ -43,4 +69,24 @@ class TextArticle &lt; Article @@ -43,4 +69,24 @@ class TextArticle &lt; Article
43 parent && parent.kind_of?(Blog) && parent.display_preview 69 parent && parent.kind_of?(Blog) && parent.display_preview
44 end 70 end
45 71
  72 + def to_html(options ={})
  73 + content = super(options)
  74 + content = convert_textile_to_html(content) if self.editor?(Article::Editor::TEXTILE)
  75 + content
  76 + end
  77 +
  78 + def lead(length = nil)
  79 + content = super(length)
  80 + content = convert_textile_to_html(content) if self.editor?(Article::Editor::TEXTILE)
  81 + content
  82 + end
  83 +
  84 + protected
  85 +
  86 + def convert_textile_to_html(textile)
  87 + converter = RedCloth.new(textile|| '')
  88 + converter.hard_breaks = false
  89 + sanitize_html(converter.to_html, :white_list)
  90 + end
  91 +
46 end 92 end
app/models/textile_article.rb
@@ -1,44 +0,0 @@ @@ -1,44 +0,0 @@
1 -class TextileArticle < TextArticle  
2 - include SanitizeHelper  
3 -  
4 - def self.short_description  
5 - _('Text article with Textile markup language')  
6 - end  
7 -  
8 - def self.description  
9 - _('Accessible alternative for visually impaired users.')  
10 - end  
11 -  
12 - def to_html(options ={})  
13 - convert_to_html(body)  
14 - end  
15 -  
16 - def lead(length = nil)  
17 - if abstract.blank?  
18 - super  
19 - else  
20 - convert_to_html(abstract)  
21 - end  
22 - end  
23 -  
24 - def notifiable?  
25 - true  
26 - end  
27 -  
28 - def can_display_media_panel?  
29 - true  
30 - end  
31 -  
32 - def self.can_display_blocks?  
33 - false  
34 - end  
35 -  
36 - protected  
37 -  
38 - def convert_to_html(textile)  
39 - converter = RedCloth.new(textile|| '')  
40 - converter.hard_breaks = false  
41 - sanitize_html(converter.to_html, :white_list)  
42 - end  
43 -  
44 -end  
app/models/tiny_mce_article.rb
@@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
1 -class TinyMceArticle < TextArticle  
2 -  
3 - def self.short_description  
4 - _('Text article with visual editor')  
5 - end  
6 -  
7 - def self.description  
8 - _('Not accessible for visually impaired users.')  
9 - end  
10 -  
11 - xss_terminate :only => [ ]  
12 -  
13 - xss_terminate :only => [ :name, :abstract, :body ], :with => 'white_list', :on => 'validation'  
14 -  
15 - include WhiteListFilter  
16 - filter_iframes :abstract, :body  
17 - def iframe_whitelist  
18 - profile && profile.environment && profile.environment.trusted_sites_for_iframe  
19 - end  
20 -  
21 - def notifiable?  
22 - true  
23 - end  
24 -  
25 - def tiny_mce?  
26 - true  
27 - end  
28 -  
29 - def can_display_media_panel?  
30 - true  
31 - end  
32 -  
33 - def self.can_display_blocks?  
34 - false  
35 - end  
36 -  
37 -end  
app/views/admin_panel/_signup_intro.html.erb
@@ -2,4 +2,4 @@ @@ -2,4 +2,4 @@
2 <%= _('This text will be shown to the user on the top of the sign up form.') %> 2 <%= _('This text will be shown to the user on the top of the sign up form.') %>
3 </div> 3 </div>
4 4
5 -<%= labelled_form_field(_('Body'), text_area(:environment, :signup_intro, :cols => 40, :style => 'width: 100%', :class => 'mceEditor')) %> 5 +<%= labelled_form_field(_('Body'), text_area(:environment, :signup_intro, :cols => 40, :style => 'width: 100%', :class => current_editor)) %>
app/views/admin_panel/_signup_welcome_screen.html.erb
1 <div class='description'> 1 <div class='description'>
2 <%= _('If you enable this feature on the "Features" section of the Administration Panel, this text will be shown as a welcome message to users after signup.') %> 2 <%= _('If you enable this feature on the "Features" section of the Administration Panel, this text will be shown as a welcome message to users after signup.') %>
3 </div> 3 </div>
4 -<%= labelled_form_field(_('Body'), text_area(:environment, :signup_welcome_screen_body, :cols => 40, :style => 'width: 100%', :class => 'mceEditor')) %> 4 +<%= labelled_form_field(_('Body'), text_area(:environment, :signup_welcome_screen_body, :cols => 40, :style => 'width: 100%', :class => current_editor)) %>
5 5
6 <div class='description'> 6 <div class='description'>
7 <%= _('If this content is left blank, the following page will be displayed to the user:') %> 7 <%= _('If this content is left blank, the following page will be displayed to the user:') %>
app/views/admin_panel/_signup_welcome_text.html.erb
@@ -4,4 +4,4 @@ @@ -4,4 +4,4 @@
4 </div> 4 </div>
5 5
6 <%= labelled_form_field(_('Subject'), text_field(:environment, :signup_welcome_text_subject, :style => 'width:100%')) %> 6 <%= labelled_form_field(_('Subject'), text_field(:environment, :signup_welcome_text_subject, :style => 'width:100%')) %>
7 -<%= labelled_form_field(_('Body'), text_area(:environment, :signup_welcome_text_body, :cols => 40, :style => 'width: 100%', :class => 'mceEditor')) %> 7 +<%= labelled_form_field(_('Body'), text_area(:environment, :signup_welcome_text_body, :cols => 40, :style => 'width: 100%', :class => current_editor)) %>
app/views/admin_panel/_site_info.html.erb
@@ -31,4 +31,4 @@ @@ -31,4 +31,4 @@
31 <%= balanced_table(fields)%> 31 <%= balanced_table(fields)%>
32 32
33 <br /> 33 <br />
34 -<%= labelled_form_field _('Homepage content'), text_area(:environment, :description, :cols => 40, :style => 'width: 90%', :class => 'mceEditor') %> 34 +<%= labelled_form_field _('Homepage content'), text_area(:environment, :description, :cols => 40, :style => 'width: 90%', :class => current_editor) %>
app/views/admin_panel/_terms_of_use.html.erb
1 -<%= f.text_area :terms_of_use, :cols => 40, :style => 'width: 90%', :class => 'mceEditor' %> 1 +<%= f.text_area :terms_of_use, :cols => 40, :style => 'width: 90%', :class => current_editor %>
app/views/admin_panel/message_for_disabled_enterprise.html.erb
1 <h2><%= _('Site info') %></h2> 1 <h2><%= _('Site info') %></h2>
2 2
3 -<%= render :file => 'shared/tiny_mce' %>  
4 -  
5 <%= labelled_form_for :environment, :url => {:action => 'site_info'} do |f| %> 3 <%= labelled_form_for :environment, :url => {:action => 'site_info'} do |f| %>
6 4
7 - <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%' %> 5 + <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%', :class => current_editor %>
8 6
9 <%= button_bar do %> 7 <%= button_bar do %>
10 <%= submit_button(:save, _('Save')) %> 8 <%= submit_button(:save, _('Save')) %>
app/views/admin_panel/site_info.html.erb
@@ -2,8 +2,6 @@ @@ -2,8 +2,6 @@
2 2
3 <%= error_messages_for :environment %> 3 <%= error_messages_for :environment %>
4 4
5 -<%= render :file => 'shared/tiny_mce' %>  
6 -  
7 <%= labelled_form_for :environment do |f| %> 5 <%= labelled_form_for :environment do |f| %>
8 <% tabs = [] %> 6 <% tabs = [] %>
9 <% tabs << {:title => _('Site info'), :id => 'site-info', 7 <% tabs << {:title => _('Site info'), :id => 'site-info',
app/views/cms/_article.html.erb
1 -_tiny_mce_article.html.erb  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +_text_article.html.erb
3 \ No newline at end of file 3 \ No newline at end of file
app/views/cms/_blog.html.erb
@@ -2,8 +2,6 @@ @@ -2,8 +2,6 @@
2 2
3 <h1><%= _('My Blog') %></h1> 3 <h1><%= _('My Blog') %></h1>
4 4
5 -<%= render :file => 'shared/tiny_mce' %>  
6 -  
7 <%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %> 5 <%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %>
8 6
9 <%= render :partial => 'general_fields' %> 7 <%= render :partial => 'general_fields' %>
@@ -53,7 +51,7 @@ @@ -53,7 +51,7 @@
53 %> 51 %>
54 </div> 52 </div>
55 53
56 -<%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 10, :class => 'mceEditor')) %> 54 +<%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 10, :class => current_editor)) %>
57 55
58 <div id="blog-image-builder"> 56 <div id="blog-image-builder">
59 <%= f.fields_for :image_builder, @article.image do |i| %> 57 <%= f.fields_for :image_builder, @article.image do |i| %>
app/views/cms/_enterprise_homepage.html.erb
1 -<%= render :file => 'shared/tiny_mce' %>  
2 -  
3 -<%= labelled_form_field(_('Text'), text_area(:article, 'body', :cols => 40, :style => 'width:99%', :class => 'mceEditor')) %> 1 +<%= labelled_form_field(_('Text'), text_area(:article, 'body', :cols => 40, :style => 'width:99%', :class => current_editor)) %>
4 2
app/views/cms/_event.html.erb
1 <%= required_fields_message %> 1 <%= required_fields_message %>
2 2
3 -<%# TODO add Textile help here %>  
4 -<%= render :file => 'shared/tiny_mce' %>  
5 -  
6 <%= required f.text_field('name', :size => '64', :maxlength => 150) %> 3 <%= required f.text_field('name', :size => '64', :maxlength => 150) %>
7 4
8 <%= render :partial => 'general_fields' %> 5 <%= render :partial => 'general_fields' %>
@@ -15,4 +12,4 @@ @@ -15,4 +12,4 @@
15 12
16 <%= labelled_form_field(_('Address:'), text_field(:article, :address)) %> 13 <%= labelled_form_field(_('Address:'), text_field(:article, :address)) %>
17 14
18 -<%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true, :body_label => 'Information about the event:'} %> 15 +<%= render :partial => 'shared/lead_and_body', :locals => {:body_label => 'Information about the event:'} %>
app/views/cms/_forum.html.erb
@@ -4,18 +4,16 @@ @@ -4,18 +4,16 @@
4 4
5 <%= required_fields_message %> 5 <%= required_fields_message %>
6 6
7 -<%= render :file => 'shared/tiny_mce' %>  
8 -  
9 <%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %> 7 <%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %>
10 8
11 <%= render :partial => 'general_fields' %> 9 <%= render :partial => 'general_fields' %>
12 10
13 -<%= labelled_form_field(_('Description:'), text_area(:article, :body, :class => 'mceEditor', :cols => 64, :rows => 10)) %> 11 +<%= labelled_form_field(_('Description:'), text_area(:article, :body, :class => current_editor, :cols => 64, :rows => 10)) %>
14 12
15 <%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, Forum.posts_per_page_options)) %> 13 <%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, Forum.posts_per_page_options)) %>
16 14
17 <%= labelled_form_field(_('Has terms of use:'), check_box(:article, :has_terms_of_use))%> 15 <%= labelled_form_field(_('Has terms of use:'), check_box(:article, :has_terms_of_use))%>
18 16
19 <div id="text_area_terms_of_use"> 17 <div id="text_area_terms_of_use">
20 - <%= labelled_form_field(_('Terms of use:'), text_area(:article, :terms_of_use, :class => 'mceEditor',:cols => 64, :rows => 10)) %> 18 + <%= labelled_form_field(_('Terms of use:'), text_area(:article, :terms_of_use, :class => current_editor,:cols => 64, :rows => 10)) %>
21 </div> 19 </div>
app/views/cms/_raw_html_article.html.erb
@@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
1 -<%= required_fields_message %>  
2 -  
3 -<%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %>  
4 -  
5 -<%= render :partial => 'text_fields' %>  
6 -<%= render :partial => 'general_fields' %>  
7 -<%= render :partial => 'translatable' %>  
8 -<%= render :partial => 'shared/lead_and_body' %>  
app/views/cms/_text_article.html.erb 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +<%= required_fields_message %>
  2 +
  3 +<%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72', :maxlength => 150)) %>
  4 +
  5 +<%= render :partial => 'text_fields' %>
  6 +<%= render :partial => 'general_fields' %>
  7 +<%= render :partial => 'translatable' %>
  8 +
  9 +<%= render :partial => 'shared/lead_and_body' %>
  10 +
app/views/cms/_text_editor_sidebar.html.erb
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 7
8 <div class='header'><strong><%= _('Insert media') %></strong><%= button('vertical-toggle', _('Show/Hide'), '#') %></div> 8 <div class='header'><strong><%= _('Insert media') %></strong><%= button('vertical-toggle', _('Show/Hide'), '#') %></div>
9 9
10 - <%= render(:partial => 'textile_quick_reference') if @article.is_a?(TextileArticle) %> 10 + <%= render(:partial => 'textile_quick_reference') if @article.editor?(Article::Editor::TEXTILE) %>
11 <div class='text-editor-sidebar-box' id='media-upload-box'> 11 <div class='text-editor-sidebar-box' id='media-upload-box'>
12 <div id='media-upload-form'> 12 <div id='media-upload-form'>
13 <%= form_tag({ :action => 'media_upload' }, :multipart => true) do %> 13 <%= form_tag({ :action => 'media_upload' }, :multipart => true) do %>
app/views/cms/_textile_article.html.erb
@@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
1 -<%= required_fields_message %>  
2 -  
3 -<%# TODO add Textile help here %>  
4 -  
5 -<%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72', :maxlength => 150)) %>  
6 -  
7 -<%= render :partial => 'text_fields' %>  
8 -<%= render :partial => 'general_fields' %>  
9 -<%= render :partial => 'translatable' %>  
10 -<%= render :partial => 'shared/lead_and_body' %>  
app/views/cms/_tiny_mce_article.html.erb
@@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
1 -<%= required_fields_message %>  
2 -  
3 -<%= render :file => 'shared/tiny_mce' %>  
4 -  
5 -<div>  
6 - <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %>  
7 -  
8 - <%= render :partial => 'text_fields' %>  
9 - <%= render :partial => 'general_fields' %>  
10 - <%= render :partial => 'translatable' %>  
11 - <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true} %>  
12 -</div>  
app/views/cms/suggest_an_article.html.erb
@@ -2,8 +2,6 @@ @@ -2,8 +2,6 @@
2 2
3 <%= required_fields_message %> 3 <%= required_fields_message %>
4 4
5 -<%= render :file => 'shared/tiny_mce' %>  
6 -  
7 <%= labelled_form_for 'task' do |f| %> 5 <%= labelled_form_for 'task' do |f| %>
8 6
9 <%= required labelled_form_field(_('Title'), text_field('task[article]', 'name', :size => 50)) %> 7 <%= required labelled_form_field(_('Title'), text_field('task[article]', 'name', :size => 50)) %>
@@ -17,7 +15,7 @@ @@ -17,7 +15,7 @@
17 <%= required labelled_form_field(_('Email'), text_field(:task, 'email')) %> 15 <%= required labelled_form_field(_('Email'), text_field(:task, 'email')) %>
18 <% end %> 16 <% end %>
19 17
20 - <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true, :object => 'task[article]'} %> 18 + <%= render :partial => 'shared/lead_and_body', :locals => {:object => 'task[article]'} %>
21 19
22 <%= hidden_field_tag('back_to', @back_to) %> 20 <%= hidden_field_tag('back_to', @back_to) %>
23 21
app/views/contact/new.html.erb
@@ -25,8 +25,7 @@ @@ -25,8 +25,7 @@
25 25
26 <%= required f.text_field(:subject) %> 26 <%= required f.text_field(:subject) %>
27 27
28 - <%= render :file => 'shared/tiny_mce' %>  
29 - <%= required f.text_area(:message, :class => 'mceEditor') %> 28 + <%= required f.text_area(:message, :class => current_editor) %>
30 29
31 <%= labelled_form_field check_box(:contact, :receive_a_copy) + _('I want to receive a copy of the message in my e-mail.'), '' %> 30 <%= labelled_form_field check_box(:contact, :receive_a_copy) + _('I want to receive a copy of the message in my e-mail.'), '' %>
32 31
app/views/email_templates/_form.html.erb
@@ -19,8 +19,7 @@ @@ -19,8 +19,7 @@
19 <%= @template_params_allowed %> 19 <%= @template_params_allowed %>
20 </div> 20 </div>
21 </div> 21 </div>
22 - <%= render :file => 'shared/tiny_mce' %>  
23 - <%= labelled_form_field(_('Body:'), f.text_area(:body, :class => 'mceEditor')) %> 22 + <%= labelled_form_field(_('Body:'), f.text_area(:body, :class => current_editor)) %>
24 </div> 23 </div>
25 24
26 <div class="actions"> 25 <div class="actions">
app/views/layouts/application-ng.html.erb
@@ -35,6 +35,9 @@ @@ -35,6 +35,9 @@
35 noosfero.profile = <%= (@profile.identifier if @profile).to_json.html_safe %> 35 noosfero.profile = <%= (@profile.identifier if @profile).to_json.html_safe %>
36 </script> 36 </script>
37 37
  38 + <% if current_editor_is?(Article::Editor::TINY_MCE) %>
  39 + <%= render :file => 'shared/tiny_mce' %>
  40 + <% end %>
38 </head> 41 </head>
39 <body class="<%= h body_classes %>"> 42 <body class="<%= h body_classes %>">
40 <a href="#content" id="link-go-content"><span><%= _("Go to the content") %></span></a> 43 <a href="#content" id="link-go-content"><span><%= _("Go to the content") %></span></a>
app/views/profile/send_mail.html.erb
@@ -16,8 +16,7 @@ @@ -16,8 +16,7 @@
16 16
17 <%= labelled_form_field(_('Subject:'), f.text_field(:subject)) %> 17 <%= labelled_form_field(_('Subject:'), f.text_field(:subject)) %>
18 18
19 - <%= render :file => 'shared/tiny_mce' %>  
20 - <%= labelled_form_field(_('Body:'), f.text_area(:body, :class => 'mceEditor')) %> 19 + <%= labelled_form_field(_('Body:'), f.text_area(:body, :class => 'body ' + current_editor)) %>
21 20
22 <%= submit_button(:send, _('Send')) %> 21 <%= submit_button(:send, _('Send')) %>
23 <%= button :cancel, _('Cancel e-mail'), :back %> 22 <%= button :cancel, _('Cancel e-mail'), :back %>
app/views/profile_editor/_person.html.erb
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
16 </div> 16 </div>
17 </div> 17 </div>
18 18
  19 + <%= select_editor(_('Editor'), 'profile_data', 'editor', {}) %>
  20 +
19 <%= safe_join(@plugins.dispatch(:profile_info_extra_contents).collect { |content| instance_exec(&content) }, "") %> 21 <%= safe_join(@plugins.dispatch(:profile_info_extra_contents).collect { |content| instance_exec(&content) }, "") %>
20 22
21 <div class="formfieldline"> 23 <div class="formfieldline">
app/views/profile_editor/header_footer.html.erb
1 -<%= render :file => 'shared/tiny_mce' %>  
2 -  
3 <h1><%= _('Editing header and footer') %></h1> 1 <h1><%= _('Editing header and footer') %></h1>
4 2
5 <%= form_tag do %> 3 <%= form_tag do %>
@@ -21,9 +19,9 @@ @@ -21,9 +19,9 @@
21 </div> 19 </div>
22 <% end %> 20 <% end %>
23 <h2><%= _('Content for header ') %></h2> 21 <h2><%= _('Content for header ') %></h2>
24 - <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %> 22 + <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;', :class => current_editor) %>
25 <h2><%= _('Content for footer') %></h2> 23 <h2><%= _('Content for footer') %></h2>
26 - <%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %> 24 + <%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;', :class => current_editor) %>
27 <%= button_bar do %> 25 <%= button_bar do %>
28 <%= submit_button(:save, _('Save')) %> 26 <%= submit_button(:save, _('Save')) %>
29 <%= button(:cancel, _('Cancel'), :action => 'index') %> 27 <%= button(:cancel, _('Cancel'), :action => 'index') %>
app/views/profile_editor/welcome_page.html.erb
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <%= _('Your welcome page will only be displayed if this options is selected.') %> 8 <%= _('Your welcome page will only be displayed if this options is selected.') %>
9 </div> 9 </div>
10 10
11 - <%= f.text_area(:body, :cols => 40, :style => 'width: 100%', :class => 'mceEditor') %> 11 + <%= f.text_area(:body, :cols => 40, :style => 'width: 100%', :class => current_editor) %>
12 <div class='explanation'> 12 <div class='explanation'>
13 <%= _('This page will be displayed to the user after his signup with this template.') %> 13 <%= _('This page will be displayed to the user after his signup with this template.') %>
14 </div> 14 </div>
@@ -17,5 +17,3 @@ @@ -17,5 +17,3 @@
17 <%= submit_button('save', _('Save'), :cancel => @back_to) %> 17 <%= submit_button('save', _('Save'), :cancel => @back_to) %>
18 <% end %> 18 <% end %>
19 <% end %> 19 <% end %>
20 -  
21 -<%= render :file => 'shared/tiny_mce' %>  
app/views/shared/_lead_and_body.html.erb
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <% abstract_method ||= :abstract %> 3 <% abstract_method ||= :abstract %>
4 <% body_label ||= 'Text' %> 4 <% body_label ||= 'Text' %>
5 <% body_method ||= :body %> 5 <% body_method ||= :body %>
6 -<% editor_type = defined?(tiny_mce) && tiny_mce ? 'mceEditor' : '' %> 6 +<% editor_type = current_editor %>
7 <% lead_id ||= 0%> 7 <% lead_id ||= 0%>
8 <% f ||= false%> 8 <% f ||= false%>
9 9
app/views/shared/tiny_mce.html.erb
@@ -47,7 +47,9 @@ function tinymce_macros_setup(editor) { @@ -47,7 +47,9 @@ function tinymce_macros_setup(editor) {
47 tinymce.PluginManager.add('macrosPlugin', tinymce.plugins.MacrosPlugin); 47 tinymce.PluginManager.add('macrosPlugin', tinymce.plugins.MacrosPlugin);
48 48
49 jQuery(document).ready(function () { 49 jQuery(document).ready(function () {
50 - <%= tinymce_init_js :mode => mode %> 50 + <%= tinymce_init_js %>
  51 + <%= tinymce_init_js :mode => 'simple' %>
  52 + <%= tinymce_init_js :mode => 'restricted' %>
51 }); 53 });
52 </script> 54 </script>
53 55
app/views/tasks/_approve_article_accept_details.html.erb
1 <%= task_email_template(_('Select an acceptance email template:'), @acceptance_email_templates, task) %> 1 <%= task_email_template(_('Select an acceptance email template:'), @acceptance_email_templates, task) %>
2 2
3 -<%= render :file => 'shared/tiny_mce' %>  
4 -  
5 <%= labelled_form_field(_('Create a link'), f.check_box(:create_link)) %> 3 <%= labelled_form_field(_('Create a link'), f.check_box(:create_link)) %>
6 4
7 <%= labelled_form_field(_('Name for publishing'), f.text_field(:name)) %> 5 <%= labelled_form_field(_('Name for publishing'), f.text_field(:name)) %>
8 <%= select_profile_folder(_('Select the folder where the article must be published'), "tasks[#{task.id}][task][article_parent_id]", task.target) %> 6 <%= select_profile_folder(_('Select the folder where the article must be published'), "tasks[#{task.id}][task][article_parent_id]", task.target) %>
9 <%= labelled_form_field(_('Highlight this article'), f.check_box(:highlighted)) %> 7 <%= labelled_form_field(_('Highlight this article'), f.check_box(:highlighted)) %>
10 8
11 -<% tiny = task.article && task.article.tiny_mce? ? {:tiny_mce => true} : {} %>  
12 -<%= render :partial => 'shared/lead_and_body', :locals => {:lead_id => task.id, :f => f}.merge(tiny)%> 9 +<%= render :partial => 'shared/lead_and_body', :locals => {:lead_id => task.id, :f => f}%>
13 10
14 <%= labelled_form_field _('Comment for author'), f.text_field(:closing_statment, :style => 'width: 488px;') %> 11 <%= labelled_form_field _('Comment for author'), f.text_field(:closing_statment, :style => 'width: 488px;') %>
15 12
app/views/tasks/_suggest_article_accept_details.html.erb
1 -<%= render :file => 'shared/tiny_mce' %>  
2 -  
3 <% unless task.requestor %> 1 <% unless task.requestor %>
4 <%= labelled_form_field(_("Sent by: "), f.text_field(:name)) %> 2 <%= labelled_form_field(_("Sent by: "), f.text_field(:name)) %>
5 <p><%= label_tag(_("Email: %s") % task.email) %> </p> 3 <p><%= label_tag(_("Email: %s") % task.email) %> </p>
@@ -14,5 +12,5 @@ @@ -14,5 +12,5 @@
14 <%= labelled_form_field(_('Highlight this article'), a.check_box(:highlighted)) %> 12 <%= labelled_form_field(_('Highlight this article'), a.check_box(:highlighted)) %>
15 13
16 <%= a.hidden_field(:type) %> 14 <%= a.hidden_field(:type) %>
17 - <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true, :f => a, :lead_id => task.id} %> 15 + <%= render :partial => 'shared/lead_and_body', :locals => {:f => a, :lead_id => task.id} %>
18 <% end %> 16 <% end %>
app/views/users/send_mail.html.erb
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 2
3 <%= error_messages_for :mailing %> 3 <%= error_messages_for :mailing %>
4 4
5 -<%= render :file => 'shared/tiny_mce' %>  
6 <%= form_for :mailing do |f| %> 5 <%= form_for :mailing do |f| %>
7 <div class="recipients"> 6 <div class="recipients">
8 <%= label_tag(_("Recipients: "), nil, { class: "formlabel" }) %> 7 <%= label_tag(_("Recipients: "), nil, { class: "formlabel" }) %>
@@ -14,7 +13,7 @@ @@ -14,7 +13,7 @@
14 </div> 13 </div>
15 </div> 14 </div>
16 <%= labelled_form_field(_('Subject:'), f.text_field(:subject)) %> 15 <%= labelled_form_field(_('Subject:'), f.text_field(:subject)) %>
17 - <%= labelled_form_field(_('Body:'), f.text_area(:body, :class => 'mceEditor')) %> 16 + <%= labelled_form_field(_('Body:'), f.text_area(:body, :class => current_editor)) %>
18 <%= submit_button(:send, _('Send')) %> 17 <%= submit_button(:send, _('Send')) %>
19 <%= button :cancel, _('Cancel e-mail'), :controller => 'users' %> 18 <%= button :cancel, _('Cancel e-mail'), :controller => 'users' %>
20 <% end %> 19 <% end %>
db/migrate/20160809123835_add_people_and_article_editor.rb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +class AddPeopleAndArticleEditor < ActiveRecord::Migration
  2 + def change
  3 + add_column :profiles, :editor, :string, :null => false, :default => Article::Editor::TINY_MCE
  4 + add_column :articles, :editor, :string, :null => false, :default => Article::Editor::TINY_MCE
  5 + Article.where(:type => 'TextileArticle').update_all(:type => 'TextArticle', :editor => Article::Editor::TEXTILE)
  6 + Article.where(:type => 'TinyMceArticle').update_all(:type => 'TextArticle', :editor => Article::Editor::TINY_MCE)
  7 + Article.where(:type => 'RawHTMLArticle').update_all(:type => 'TextArticle', :editor => Article::Editor::RAW_HTML)
  8 + end
  9 +end
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 # 11 #
12 # It's strongly recommended that you check this file into your version control system. 12 # It's strongly recommended that you check this file into your version control system.
13 13
14 -ActiveRecord::Schema.define(version: 20160705162914) do 14 +ActiveRecord::Schema.define(version: 20160809123835) do
15 15
16 # These are extensions that must be enabled in order to support this database 16 # These are extensions that must be enabled in order to support this database
17 enable_extension "plpgsql" 17 enable_extension "plpgsql"
@@ -168,6 +168,7 @@ ActiveRecord::Schema.define(version: 20160705162914) do @@ -168,6 +168,7 @@ ActiveRecord::Schema.define(version: 20160705162914) do
168 t.boolean "show_to_followers", default: true 168 t.boolean "show_to_followers", default: true
169 t.integer "followers_count", default: 0 169 t.integer "followers_count", default: 0
170 t.boolean "archived", default: false 170 t.boolean "archived", default: false
  171 + t.string "editor", default: "tiny_mce", null: false
171 end 172 end
172 173
173 add_index "articles", ["comments_count"], name: "index_articles_on_comments_count", using: :btree 174 add_index "articles", ["comments_count"], name: "index_articles_on_comments_count", using: :btree
@@ -631,15 +632,16 @@ ActiveRecord::Schema.define(version: 20160705162914) do @@ -631,15 +632,16 @@ ActiveRecord::Schema.define(version: 20160705162914) do
631 t.boolean "is_template", default: false 632 t.boolean "is_template", default: false
632 t.integer "template_id" 633 t.integer "template_id"
633 t.string "redirection_after_login" 634 t.string "redirection_after_login"
634 - t.integer "friends_count", default: 0, null: false  
635 - t.integer "members_count", default: 0, null: false  
636 - t.integer "activities_count", default: 0, null: false 635 + t.integer "friends_count", default: 0, null: false
  636 + t.integer "members_count", default: 0, null: false
  637 + t.integer "activities_count", default: 0, null: false
637 t.string "personal_website" 638 t.string "personal_website"
638 t.string "jabber_id" 639 t.string "jabber_id"
639 t.integer "welcome_page_id" 640 t.integer "welcome_page_id"
640 t.boolean "allow_members_to_invite", default: true 641 t.boolean "allow_members_to_invite", default: true
641 t.boolean "invite_friends_only", default: false 642 t.boolean "invite_friends_only", default: false
642 t.boolean "secret", default: false 643 t.boolean "secret", default: false
  644 + t.string "editor", default: "tiny_mce", null: false
643 end 645 end
644 646
645 add_index "profiles", ["activities_count"], name: "index_profiles_on_activities_count", using: :btree 647 add_index "profiles", ["activities_count"], name: "index_profiles_on_activities_count", using: :btree
features/edit_article.feature
@@ -155,7 +155,7 @@ Feature: edit article @@ -155,7 +155,7 @@ Feature: edit article
155 Given I am on joaosilva's control panel 155 Given I am on joaosilva's control panel
156 And I follow "Manage Content" 156 And I follow "Manage Content"
157 And I follow "New content" 157 And I follow "New content"
158 - When I follow "Text article with Textile markup language" 158 + When I follow "Text article"
159 Then I should see "Tag list" 159 Then I should see "Tag list"
160 When I fill in "Title" with "Article with tags" 160 When I fill in "Title" with "Article with tags"
161 And I fill in "Tag list" with "aurium, bug" 161 And I fill in "Tag list" with "aurium, bug"
@@ -168,7 +168,7 @@ Feature: edit article @@ -168,7 +168,7 @@ Feature: edit article
168 Given I am on joaosilva's control panel 168 Given I am on joaosilva's control panel
169 And I follow "Manage Content" 169 And I follow "Manage Content"
170 When I follow "New content" 170 When I follow "New content"
171 - When I follow "Text article with visual editor" 171 + When I follow "Text article"
172 And I fill in "Title" with "My Article" 172 And I fill in "Title" with "My Article"
173 And I press "Save" 173 And I press "Save"
174 Then I should see "My Article" 174 Then I should see "My Article"
@@ -203,8 +203,8 @@ Feature: edit article @@ -203,8 +203,8 @@ Feature: edit article
203 And I press "Save" 203 And I press "Save"
204 Then I should be on /joaosilva/my-folder 204 Then I should be on /joaosilva/my-folder
205 When I follow "New article" 205 When I follow "New article"
206 - And I should see "Text article with visual editor"  
207 - And I follow "Text article with visual editor" 206 + And I should see "Text article"
  207 + And I follow "Text article"
208 And I fill in "Title" with "My Article" 208 And I fill in "Title" with "My Article"
209 And I press "Save" 209 And I press "Save"
210 Then I should see "My Article" 210 Then I should see "My Article"
@@ -222,12 +222,11 @@ Feature: edit article @@ -222,12 +222,11 @@ Feature: edit article
222 And I press "Save" 222 And I press "Save"
223 Then I should be on /joaosilva/my-folder 223 Then I should be on /joaosilva/my-folder
224 When I follow "New article" 224 When I follow "New article"
225 - And I should see "Text article with visual editor"  
226 - And I follow "Text article with visual editor" 225 + And I should see "Text article"
  226 + And I follow "Text article"
227 And I follow "Cancel" within ".no-boxes" 227 And I follow "Cancel" within ".no-boxes"
228 Then I should be on /joaosilva/my-folder 228 Then I should be on /joaosilva/my-folder
229 229
230 - @selenium  
231 Scenario: save and continue 230 Scenario: save and continue
232 Given I am on /joaosilva/save-the-whales 231 Given I am on /joaosilva/save-the-whales
233 And I follow "Edit" 232 And I follow "Edit"
@@ -240,8 +239,8 @@ Feature: edit article @@ -240,8 +239,8 @@ Feature: edit article
240 Given I am on joaosilva's control panel 239 Given I am on joaosilva's control panel
241 When I follow "Manage Content" 240 When I follow "Manage Content"
242 And I follow "New content" 241 And I follow "New content"
243 - And I should see "Text article with visual editor"  
244 - And I follow "Text article with visual editor" 242 + And I should see "Text article"
  243 + And I follow "Text article"
245 And I fill in "Title" with "My new article" 244 And I fill in "Title" with "My new article"
246 And I fill in "Text" with "text for the new article" 245 And I fill in "Text" with "text for the new article"
247 And I press "Save and continue" 246 And I press "Save and continue"
@@ -287,7 +286,7 @@ Feature: edit article @@ -287,7 +286,7 @@ Feature: edit article
287 Given I am on joaosilva's control panel 286 Given I am on joaosilva's control panel
288 And I follow "Manage Content" 287 And I follow "Manage Content"
289 And I follow "New content" 288 And I follow "New content"
290 - When I follow "Text article with visual editor" 289 + When I follow "Text article"
291 And I fill in "Title" with "My time testing Article" 290 And I fill in "Title" with "My time testing Article"
292 And I fill in "Publish date" with "1980-11-15 20:37" 291 And I fill in "Publish date" with "1980-11-15 20:37"
293 And I press "Save" 292 And I press "Save"
features/forum.feature
@@ -99,8 +99,8 @@ Feature: forum @@ -99,8 +99,8 @@ Feature: forum
99 And I check "Has terms of use:" 99 And I check "Has terms of use:"
100 And I press "Save" 100 And I press "Save"
101 When I follow "New discussion topic" 101 When I follow "New discussion topic"
102 - And I should see "Text article with visual editor"  
103 - And I follow "Text article with visual editor" 102 + And I should see "Text article"
  103 + And I follow "Text article"
104 And I fill in "Title" with "Topic" 104 And I fill in "Title" with "Topic"
105 And I press "Save" 105 And I press "Save"
106 And I am logged in as "mariasilva" 106 And I am logged in as "mariasilva"
features/media_panel_upload_files.feature
@@ -8,7 +8,7 @@ Feature: uploads items on media panel @@ -8,7 +8,7 @@ Feature: uploads items on media panel
8 | joaosilva | Joao Silva | 8 | joaosilva | Joao Silva |
9 And feature "media_panel" is enabled on environment 9 And feature "media_panel" is enabled on environment
10 And I am logged in as "joaosilva" 10 And I am logged in as "joaosilva"
11 - And I am on /myprofile/joaosilva/cms/new?type=TinyMceArticle 11 + And I am on /myprofile/joaosilva/cms/new?type=TextArticle
12 12
13 Scenario: see media panel collapsed 13 Scenario: see media panel collapsed
14 Then I should see "Insert media" 14 Then I should see "Insert media"
@@ -123,7 +123,7 @@ Feature: uploads items on media panel @@ -123,7 +123,7 @@ Feature: uploads items on media panel
123 Given the following files 123 Given the following files
124 | owner | file | mime | 124 | owner | file | mime |
125 | joaosilva | other-pic.jpg | image/jpeg | 125 | joaosilva | other-pic.jpg | image/jpeg |
126 - When I go to /myprofile/joaosilva/cms/new?type=TinyMceArticle 126 + When I go to /myprofile/joaosilva/cms/new?type=TextArticle
127 And I follow "Show/Hide" 127 And I follow "Show/Hide"
128 And I select "Recent media" from "parent_id" within "#published-media" 128 And I select "Recent media" from "parent_id" within "#published-media"
129 Then I should see div with title "other-pic.jpg" within ".items" 129 Then I should see div with title "other-pic.jpg" within ".items"
@@ -148,7 +148,7 @@ Feature: uploads items on media panel @@ -148,7 +148,7 @@ Feature: uploads items on media panel
148 | owner | file | mime | parent | 148 | owner | file | mime | parent |
149 | joaosilva | rails.png | image/png | other-gallery | 149 | joaosilva | rails.png | image/png | other-gallery |
150 | joaosilva | other-pic.jpg | image/jpeg | gallery | 150 | joaosilva | other-pic.jpg | image/jpeg | gallery |
151 - When I go to /myprofile/joaosilva/cms/new?type=TinyMceArticle 151 + When I go to /myprofile/joaosilva/cms/new?type=TextArticle
152 And I follow "Show/Hide" 152 And I follow "Show/Hide"
153 And I select "joaosilva/Gallery" from "parent_id" within "#published-media" 153 And I select "joaosilva/Gallery" from "parent_id" within "#published-media"
154 Then I should see div with title "other-pic.jpg" within ".items" 154 Then I should see div with title "other-pic.jpg" within ".items"
@@ -165,7 +165,7 @@ Feature: uploads items on media panel @@ -165,7 +165,7 @@ Feature: uploads items on media panel
165 And the following files 165 And the following files
166 | owner | file | mime | parent | 166 | owner | file | mime | parent |
167 | joaosilva | other-pic.jpg | image/jpeg | gallery | 167 | joaosilva | other-pic.jpg | image/jpeg | gallery |
168 - When I go to /myprofile/joaosilva/cms/new?type=TinyMceArticle 168 + When I go to /myprofile/joaosilva/cms/new?type=TextArticle
169 And I follow "Show/Hide" 169 And I follow "Show/Hide"
170 And I select "joaosilva/Gallery" from "parent_id" within "#published-media" 170 And I select "joaosilva/Gallery" from "parent_id" within "#published-media"
171 And I select "joaosilva/Gallery" from "parent_id" within "#media-upload-form" 171 And I select "joaosilva/Gallery" from "parent_id" within "#media-upload-form"
@@ -187,7 +187,7 @@ Feature: uploads items on media panel @@ -187,7 +187,7 @@ Feature: uploads items on media panel
187 And the following files 187 And the following files
188 | owner | file | mime | parent | 188 | owner | file | mime | parent |
189 | joaosilva | rails.png | image/png | other-gallery | 189 | joaosilva | rails.png | image/png | other-gallery |
190 - When I go to /myprofile/joaosilva/cms/new?type=TinyMceArticle 190 + When I go to /myprofile/joaosilva/cms/new?type=TextArticle
191 And I follow "Show/Hide" 191 And I follow "Show/Hide"
192 And I select "Recent media" from "parent_id" within "#published-media" 192 And I select "Recent media" from "parent_id" within "#published-media"
193 And I fill in "Search" with "rails" within "#published-media" 193 And I fill in "Search" with "rails" within "#published-media"
@@ -227,7 +227,7 @@ Feature: uploads items on media panel @@ -227,7 +227,7 @@ Feature: uploads items on media panel
227 | joaosilva | other-pic.jpg | image/jpeg | my-gallery | 227 | joaosilva | other-pic.jpg | image/jpeg | my-gallery |
228 | joaosilva | rails.png | image/png | gallery | 228 | joaosilva | rails.png | image/png | gallery |
229 | joaosilva | other-pic.jpg | image/jpeg | gallery | 229 | joaosilva | other-pic.jpg | image/jpeg | gallery |
230 - When I go to /myprofile/joaosilva/cms/new?type=TinyMceArticle 230 + When I go to /myprofile/joaosilva/cms/new?type=TextArticle
231 And I follow "Show/Hide" 231 And I follow "Show/Hide"
232 And I should not see "View all" 232 And I should not see "View all"
233 And I attach the file "public/503.jpg" to "file" 233 And I attach the file "public/503.jpg" to "file"
features/new_content_on_cms.feature
@@ -15,8 +15,7 @@ Feature: create content on cms @@ -15,8 +15,7 @@ Feature: create content on cms
15 15
16 Scenario: list all content types 16 Scenario: list all content types
17 Given I follow "New content" 17 Given I follow "New content"
18 - Then I should see "Text article with visual editor"  
19 - And I should see "Text article with Textile markup" 18 + Then I should see "Text article"
20 And I should see "Folder" 19 And I should see "Folder"
21 And I should see "Blog" 20 And I should see "Blog"
22 And I should see "Uploaded file" 21 And I should see "Uploaded file"
@@ -30,22 +29,6 @@ Feature: create content on cms @@ -30,22 +29,6 @@ Feature: create content on cms
30 And I go to joaosilva's cms 29 And I go to joaosilva's cms
31 Then I should see "My Folder" 30 Then I should see "My Folder"
32 31
33 - Scenario: create a tiny_mce article  
34 - Given I follow "New content"  
35 - When I follow "Text article with visual editor"  
36 - And I fill in "Title" with "My tiny_mce article"  
37 - And I press "Save"  
38 - And I go to joaosilva's cms  
39 - Then I should see "My tiny_mce article"  
40 -  
41 - Scenario: create a textile article  
42 - Given I follow "New content"  
43 - When I follow "Text article with Textile markup"  
44 - And I fill in "Title" with "My textile article"  
45 - And I press "Save"  
46 - And I go to joaosilva's cms  
47 - Then I should see "My textile article"  
48 -  
49 Scenario: create a Blog 32 Scenario: create a Blog
50 Given I follow "New content" 33 Given I follow "New content"
51 When I follow "Blog" 34 When I follow "Blog"
features/profile_search.feature
@@ -47,8 +47,8 @@ Feature: search inside a profile @@ -47,8 +47,8 @@ Feature: search inside a profile
47 And I go to joaosilva's profile 47 And I go to joaosilva's profile
48 And I fill in "q" with "article" 48 And I fill in "q" with "article"
49 And I press "Search" 49 And I press "Search"
50 - Then I should see "public article" within ".main-block"  
51 - And I should not see "private article" within ".main-block" 50 + Then I should see "published article" within ".main-block"
  51 + And I should not see "unpublished article" within ".main-block"
52 52
53 Scenario: search on environment 53 Scenario: search on environment
54 Given I go to joaosilva's profile 54 Given I go to joaosilva's profile
features/publish_article.feature
@@ -60,11 +60,10 @@ Feature: publish article @@ -60,11 +60,10 @@ Feature: publish article
60 And I am on mariasilva's control panel 60 And I am on mariasilva's control panel
61 And I follow "Manage Content" 61 And I follow "Manage Content"
62 And I follow "New content" 62 And I follow "New content"
63 - And I should see "Text article with Textile markup language"  
64 - And I follow "Text article with Textile markup language" 63 + And I should see "Text article"
  64 + And I follow "Text article"
65 And I fill in the following: 65 And I fill in the following:
66 | Title | Sample Article | 66 | Title | Sample Article |
67 - | Text | this is Maria's first published article |  
68 And I press "Save" 67 And I press "Save"
69 And I follow "Spread" 68 And I follow "Spread"
70 And I type in "Sample Community" into autocomplete list "search-communities-to-publish" and I choose "Sample Community" 69 And I type in "Sample Community" into autocomplete list "search-communities-to-publish" and I choose "Sample Community"
features/search_contents.feature
@@ -22,7 +22,6 @@ Feature: search contents @@ -22,7 +22,6 @@ Feature: search contents
22 Then I should see "whales and dolphins" within ".search-text-article-item" 22 Then I should see "whales and dolphins" within ".search-text-article-item"
23 And I should see "whales and dolphins" within ".only-one-result-box" 23 And I should see "whales and dolphins" within ".only-one-result-box"
24 And I should not see "bees and butterflies" 24 And I should not see "bees and butterflies"
25 - And The page should contain ".icon-content-textile-article"  
26 When I follow "whales and dolphins" 25 When I follow "whales and dolphins"
27 Then I should be on article "whales and dolphins" 26 Then I should be on article "whales and dolphins"
28 27
features/secret_community.feature
@@ -52,7 +52,7 @@ Feature: Use a secret community @@ -52,7 +52,7 @@ Feature: Use a secret community
52 And I go to mycommunity's control panel 52 And I go to mycommunity's control panel
53 And I follow "Manage Content" 53 And I follow "Manage Content"
54 And I follow "New content" 54 And I follow "New content"
55 - And I follow "Text article with visual editor" 55 + And I follow "Text article"
56 And I fill in "Title" with "My public article" 56 And I fill in "Title" with "My public article"
57 And I choose "Public" 57 And I choose "Public"
58 And I press "Save and continue" 58 And I press "Save and continue"
features/step_definitions/noosfero_steps.rb
@@ -101,7 +101,7 @@ end @@ -101,7 +101,7 @@ end
101 101
102 Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded files|rss feeds)$/ do |content, table| 102 Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded files|rss feeds)$/ do |content, table|
103 klass = { 103 klass = {
104 - 'articles' => TextileArticle, 104 + 'articles' => TextArticle,
105 'events' => Event, 105 'events' => Event,
106 'blogs' => Blog, 106 'blogs' => Blog,
107 'folders' => Folder, 107 'folders' => Folder,
@@ -178,7 +178,7 @@ Given /^the following articles? with images?$/ do |table| @@ -178,7 +178,7 @@ Given /^the following articles? with images?$/ do |table|
178 img_tag = "<img " 178 img_tag = "<img "
179 img.each { |attr, value| img_tag += "#{attr}=\"#{value}\" " } 179 img.each { |attr, value| img_tag += "#{attr}=\"#{value}\" " }
180 img_tag += "/>" 180 img_tag += "/>"
181 - article = TinyMceArticle.new(:profile => owner, :name => item[:name], :body => img_tag) 181 + article = TextArticle.new(:profile => owner, :name => item[:name], :body => img_tag)
182 if item[:parent] 182 if item[:parent]
183 article.parent = Article.find_by slug: item[:parent] 183 article.parent = Article.find_by slug: item[:parent]
184 end 184 end
features/tiny_mce.feature
@@ -10,7 +10,7 @@ Feature: Create tinyMCE article @@ -10,7 +10,7 @@ Feature: Create tinyMCE article
10 10
11 @selenium 11 @selenium
12 Scenario: mce complete mode should show on message creation 12 Scenario: mce complete mode should show on message creation
13 - Given I am on /myprofile/joaosilva/cms/new?type=TinyMceArticle 13 + Given I am on /myprofile/joaosilva/cms/new?type=TextArticle
14 Then The tinymce "toolbar1" should be "fullscreen | insertfile undo redo | copy paste | bold italic underline | styleselect fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" 14 Then The tinymce "toolbar1" should be "fullscreen | insertfile undo redo | copy paste | bold italic underline | styleselect fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
15 And The tinymce "menubar" should be "edit insert view tools" 15 And The tinymce "menubar" should be "edit insert view tools"
16 And The tinymce "toolbar2" should contain "print preview code media | table" 16 And The tinymce "toolbar2" should contain "print preview code media | table"
plugins/admin_notifications/views/shared/_form.html.erb
1 <div class="notification-plugin-form"> 1 <div class="notification-plugin-form">
2 2
3 - <% abstract_options = {:value => @notification.message, :style => 'width: 100%; height: 200px;', :class => 'mceEditor'} %> 3 + <% abstract_options = {:value => @notification.message, :style => 'width: 100%; height: 200px;', :class => current_editor('restricted')} %>
4 4
5 <%= button :back, _('Back'), :controller => 'admin_notifications_plugin_admin' %> 5 <%= button :back, _('Back'), :controller => 'admin_notifications_plugin_admin' %>
6 6
7 <%= form_for :notifications do |f| %> 7 <%= form_for :notifications do |f| %>
8 8
9 - <%= render :file => 'shared/tiny_mce', :locals => {:mode => 'restricted'} %>  
10 -  
11 <%= labelled_form_field(_("Optional Title:"), f.text_field(:title, value: @notification.title)) %> 9 <%= labelled_form_field(_("Optional Title:"), f.text_field(:title, value: @notification.title)) %>
12 10
13 <%= labelled_form_field(_("Enter your message here:"), f.text_area(:message, abstract_options)) %> 11 <%= labelled_form_field(_("Enter your message here:"), f.text_area(:message, abstract_options)) %>
plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb
1 class Application < Rails::Application 1 class Application < Rails::Application
2 - config.action_view.sanitized_allowed_attributes << 'data-macro-paragraph_uuid' 2 + config.action_view.sanitized_allowed_attributes << 'data-macro-paragraph_uuid' unless config.action_view.sanitized_allowed_attributes.include?('data-macro-paragraph_uuid')
3 end 3 end
4 4
5 class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro 5 class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro
plugins/comment_paragraph/test/unit/article_test.rb
@@ -5,7 +5,7 @@ class ArticleTest &lt; ActiveSupport::TestCase @@ -5,7 +5,7 @@ class ArticleTest &lt; ActiveSupport::TestCase
5 5
6 def setup 6 def setup
7 @profile = fast_create(Community) 7 @profile = fast_create(Community)
8 - @article = fast_create(TinyMceArticle, :profile_id => profile.id) 8 + @article = fast_create(TextArticle, :profile_id => profile.id)
9 @environment = Environment.default 9 @environment = Environment.default
10 @environment.enable_plugin(CommentParagraphPlugin) 10 @environment.enable_plugin(CommentParagraphPlugin)
11 end 11 end
plugins/comment_paragraph/test/unit/discussion_block_test.rb
@@ -74,7 +74,7 @@ class DiscussionBlockTest &lt; ActiveSupport::TestCase @@ -74,7 +74,7 @@ class DiscussionBlockTest &lt; ActiveSupport::TestCase
74 b.save 74 b.save
75 a1 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) 75 a1 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id)
76 fast_create(Event, :profile_id => community.id) 76 fast_create(Event, :profile_id => community.id)
77 - fast_create(TinyMceArticle, :profile_id => community.id) 77 + fast_create(TextArticle, :profile_id => community.id)
78 a2 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) 78 a2 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id)
79 assert_equivalent [a1, a2], b.discussions 79 assert_equivalent [a1, a2], b.discussions
80 end 80 end
@@ -183,7 +183,7 @@ class DiscussionBlockViewTest &lt; ActionView::TestCase @@ -183,7 +183,7 @@ class DiscussionBlockViewTest &lt; ActionView::TestCase
183 b.save 183 b.save
184 a1 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) 184 a1 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id)
185 fast_create(Event, :profile_id => community.id) 185 fast_create(Event, :profile_id => community.id)
186 - fast_create(TinyMceArticle, :profile_id => community.id) 186 + fast_create(TextArticle, :profile_id => community.id)
187 a2 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) 187 a2 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id)
188 assert_equivalent [a2.id, a1.id], b.api_content['articles'].map {|a| a[:id]} 188 assert_equivalent [a2.id, a1.id], b.api_content['articles'].map {|a| a[:id]}
189 end 189 end
plugins/comment_paragraph/test/unit/tinymce_helper_test.rb
@@ -7,6 +7,7 @@ class TinymceHelperTest &lt; ActiveSupport::TestCase @@ -7,6 +7,7 @@ class TinymceHelperTest &lt; ActiveSupport::TestCase
7 def setup 7 def setup
8 expects(:top_url).returns('/') 8 expects(:top_url).returns('/')
9 expects(:tinymce_language).returns('en') 9 expects(:tinymce_language).returns('en')
  10 + expects(:current_editor).returns(Article::Editor::TINY_MCE)
10 @plugins = mock 11 @plugins = mock
11 @plugins.expects(:dispatch).returns([]).at_least_once 12 @plugins.expects(:dispatch).returns([]).at_least_once
12 @environment = Environment.default 13 @environment = Environment.default
plugins/community_track/lib/community_track_plugin/step.rb
@@ -61,7 +61,7 @@ class CommunityTrackPlugin::Step &lt; Folder @@ -61,7 +61,7 @@ class CommunityTrackPlugin::Step &lt; Folder
61 end 61 end
62 62
63 def enabled_tools 63 def enabled_tools
64 - [TinyMceArticle, Forum] 64 + [TextArticle, Forum]
65 end 65 end
66 66
67 def to_html(options = {}) 67 def to_html(options = {})
plugins/community_track/test/functional/community_track_plugin_content_viewer_controller_test.rb
@@ -5,7 +5,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -5,7 +5,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
5 def setup 5 def setup
6 @profile = Community.create!(:name => 'Sample community', :identifier => 'sample-community') 6 @profile = Community.create!(:name => 'Sample community', :identifier => 'sample-community')
7 @track = create_track('track', @profile) 7 @track = create_track('track', @profile)
8 - @step = CommunityTrackPlugin::Step.create!(:name => 'step1', :body => 'body', :profile => @profile, :parent => @track, :published => false, :end_date => DateTime.now.end_of_day, :start_date => DateTime.now.beginning_of_day, :tool_type => TinyMceArticle.name) 8 + @step = CommunityTrackPlugin::Step.create!(:name => 'step1', :body => 'body', :profile => @profile, :parent => @track, :published => false, :end_date => DateTime.now.end_of_day, :start_date => DateTime.now.beginning_of_day, :tool_type => TextArticle.name)
9 9
10 user = create_user('testinguser') 10 user = create_user('testinguser')
11 login_as(user.login) 11 login_as(user.login)
@@ -49,7 +49,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -49,7 +49,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
49 end 49 end
50 50
51 should 'show tools for a step' do 51 should 'show tools for a step' do
52 - TinyMceArticle.create!(:profile => @profile, :name => 'article', :parent => @step) 52 + TextArticle.create!(:profile => @profile, :name => 'article', :parent => @step)
53 get :view_page, @step.url 53 get :view_page, @step.url
54 assert_tag :tag => 'div', :attributes => { :class => 'tools' }, :descendant => { :tag => 'div', :attributes => { :class => 'item' } } 54 assert_tag :tag => 'div', :attributes => { :class => 'tools' }, :descendant => { :tag => 'div', :attributes => { :class => 'item' } }
55 end 55 end
plugins/community_track/test/unit/community_track_plugin/step_test.rb
@@ -235,7 +235,7 @@ class StepTest &lt; ActiveSupport::TestCase @@ -235,7 +235,7 @@ class StepTest &lt; ActiveSupport::TestCase
235 end 235 end
236 236
237 should 'return enabled tools for a step' do 237 should 'return enabled tools for a step' do
238 - assert_includes @step.enabled_tools, TinyMceArticle 238 + assert_includes @step.enabled_tools, TextArticle
239 assert_includes @step.enabled_tools, Forum 239 assert_includes @step.enabled_tools, Forum
240 end 240 end
241 241
plugins/community_track/views/cms/community_track_plugin/_step.html.erb
1 <%= required_fields_message %> 1 <%= required_fields_message %>
2 2
3 -<%= render :file => 'shared/tiny_mce' %>  
4 -  
5 <div> 3 <div>
6 <%= required f.text_field('name', :size => '64', :maxlength => 150) %> 4 <%= required f.text_field('name', :size => '64', :maxlength => 150) %>
7 <%= labelled_form_field(_('Period'), ( 5 <%= labelled_form_field(_('Period'), (
@@ -19,4 +17,4 @@ @@ -19,4 +17,4 @@
19 17
20 <%= labelled_form_field check_box(:article, :hidden) + _('Hidden Step'), '' %> 18 <%= labelled_form_field check_box(:article, :hidden) + _('Hidden Step'), '' %>
21 19
22 -<%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true, :body_label => 'Description:'} %> 20 +<%= render :partial => 'shared/lead_and_body', :locals => {:body_label => 'Description:'} %>
plugins/community_track/views/cms/community_track_plugin/_track.html.erb
1 <div class='community-track'> 1 <div class='community-track'>
2 <%= required_fields_message %> 2 <%= required_fields_message %>
3 3
4 - <%= render :file => 'shared/tiny_mce' %>  
5 -  
6 <div> 4 <div>
7 <%= required labelled_form_field(c_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> 5 <%= required labelled_form_field(c_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %>
8 </div> 6 </div>
9 7
10 - <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true, :body_label => 'Description:'} %> 8 + <%= render :partial => 'shared/lead_and_body', :locals => {:body_label => 'Description:'} %>
11 9
12 <div> 10 <div>
13 <%= labelled_form_field(_('Goals:'), text_area(:article, :goals, :rows => 3, :cols => 64)) %> 11 <%= labelled_form_field(_('Goals:'), text_area(:article, :goals, :rows => 3, :cols => 64)) %>
plugins/context_content/lib/context_content_plugin/context_content_block.rb
@@ -22,7 +22,7 @@ class ContextContentPlugin::ContextContentBlock &lt; Block @@ -22,7 +22,7 @@ class ContextContentPlugin::ContextContentBlock &lt; Block
22 end 22 end
23 23
24 def available_content_types 24 def available_content_types
25 - @available_content_types ||= [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed] + plugins.dispatch(:content_types) 25 + @available_content_types ||= [UploadedFile, Event, TextArticle, Folder, Blog, Forum, Gallery, RssFeed] + plugins.dispatch(:content_types)
26 checked_types = types.map {|t| t.constantize} 26 checked_types = types.map {|t| t.constantize}
27 checked_types + (@available_content_types - checked_types) 27 checked_types + (@available_content_types - checked_types)
28 end 28 end
plugins/context_content/test/functional/content_viewer_controller_test.rb
@@ -8,7 +8,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -8,7 +8,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
8 8
9 box = Box.create!(:owner => @profile) 9 box = Box.create!(:owner => @profile)
10 @block = ContextContentPlugin::ContextContentBlock.new(:box_id => box.id) 10 @block = ContextContentPlugin::ContextContentBlock.new(:box_id => box.id)
11 - @block.types = ['TinyMceArticle'] 11 + @block.types = ['TextArticle']
12 @block.limit = 1 12 @block.limit = 1
13 @block.title = "New Context Block" 13 @block.title = "New Context Block"
14 @block.save! 14 @block.save!
@@ -21,7 +21,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -21,7 +21,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
21 end 21 end
22 22
23 should 'display context content block if it has contents' do 23 should 'display context content block if it has contents' do
24 - article = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1') 24 + article = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1')
25 get :view_page, @page.url 25 get :view_page, @page.url
26 assert_tag 'div', :attributes => {:id => "context_content_#{@block.id}", :class => 'contents'} 26 assert_tag 'div', :attributes => {:id => "context_content_#{@block.id}", :class => 'contents'}
27 assert_no_tag 'div', :attributes => {:id => "context_content_more_#{@block.id}", :class => 'more_button'}, :descendant => {:tag => 'a'} 27 assert_no_tag 'div', :attributes => {:id => "context_content_more_#{@block.id}", :class => 'more_button'}, :descendant => {:tag => 'a'}
@@ -31,7 +31,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -31,7 +31,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
31 should 'display context content block title if it is not configured to use_parent_title' do 31 should 'display context content block title if it is not configured to use_parent_title' do
32 @block.use_parent_title = false 32 @block.use_parent_title = false
33 @block.save 33 @block.save
34 - article = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1') 34 + article = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1')
35 get :view_page, @page.url 35 get :view_page, @page.url
36 assert_tag 'h3', :attributes => {:class => 'block-title'}, :content => @block.title 36 assert_tag 'h3', :attributes => {:class => 'block-title'}, :content => @block.title
37 assert_no_tag 'h3', :attributes => {:class => 'block-title'}, :content => @page.name 37 assert_no_tag 'h3', :attributes => {:class => 'block-title'}, :content => @page.name
@@ -40,15 +40,15 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -40,15 +40,15 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
40 should 'display context content with folder title if it is configured to use_parent_title' do 40 should 'display context content with folder title if it is configured to use_parent_title' do
41 @block.use_parent_title = true 41 @block.use_parent_title = true
42 @block.save 42 @block.save
43 - article = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1') 43 + article = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1')
44 get :view_page, @page.url 44 get :view_page, @page.url
45 assert_tag 'h3', :attributes => {:class => 'block-title'}, :content => @page.name 45 assert_tag 'h3', :attributes => {:class => 'block-title'}, :content => @page.name
46 assert_no_tag 'h3', :attributes => {:class => 'block-title'}, :content => @block.title 46 assert_no_tag 'h3', :attributes => {:class => 'block-title'}, :content => @block.title
47 end 47 end
48 48
49 should 'display context content block with pagination' do 49 should 'display context content block with pagination' do
50 - article1 = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id)  
51 - article2 = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id) 50 + article1 = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id)
  51 + article2 = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id)
52 get :view_page, @page.url 52 get :view_page, @page.url
53 assert_tag 'div', :attributes => {:id => "context_content_#{@block.id}", :class => 'contents'} 53 assert_tag 'div', :attributes => {:id => "context_content_#{@block.id}", :class => 'contents'}
54 assert_tag 'div', :attributes => {:id => "context_content_more_#{@block.id}", :class => 'more_button'}, :descendant => {:tag => 'a', :attributes => {:class => 'button icon-button icon-left disabled'} } 54 assert_tag 'div', :attributes => {:id => "context_content_more_#{@block.id}", :class => 'more_button'}, :descendant => {:tag => 'a', :attributes => {:class => 'button icon-button icon-left disabled'} }
plugins/context_content/test/functional/context_content_plugin_profile_controller_test.rb
@@ -9,7 +9,7 @@ class ContextContentPluginProfileControllerTest &lt; ActionController::TestCase @@ -9,7 +9,7 @@ class ContextContentPluginProfileControllerTest &lt; ActionController::TestCase
9 box = create(Box, :owner_type => 'Profile', :owner_id => @profile.id) 9 box = create(Box, :owner_type => 'Profile', :owner_id => @profile.id)
10 @block = ContextContentPlugin::ContextContentBlock.new 10 @block = ContextContentPlugin::ContextContentBlock.new
11 @block.box = box 11 @block.box = box
12 - @block.types = ['TinyMceArticle'] 12 + @block.types = ['TextArticle']
13 @block.limit = 1 13 @block.limit = 1
14 owner = create_user('block-owner').person 14 owner = create_user('block-owner').person
15 @block.box = owner.boxes.last 15 @block.box = owner.boxes.last
@@ -23,14 +23,14 @@ class ContextContentPluginProfileControllerTest &lt; ActionController::TestCase @@ -23,14 +23,14 @@ class ContextContentPluginProfileControllerTest &lt; ActionController::TestCase
23 end 23 end
24 24
25 should 'render error if page do not exists' do 25 should 'render error if page do not exists' do
26 - article = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id) 26 + article = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id)
27 xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier 27 xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier
28 assert_response 500 28 assert_response 500
29 end 29 end
30 30
31 should 'replace div with content for page passed as parameter' do 31 should 'replace div with content for page passed as parameter' do
32 - article1 = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1')  
33 - article2 = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article2') 32 + article1 = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1')
  33 + article2 = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article2')
34 xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier 34 xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier
35 assert_response :success 35 assert_response :success
36 assert_match /context_content_#{@block.id}/, @response.body 36 assert_match /context_content_#{@block.id}/, @response.body
@@ -39,7 +39,7 @@ class ContextContentPluginProfileControllerTest &lt; ActionController::TestCase @@ -39,7 +39,7 @@ class ContextContentPluginProfileControllerTest &lt; ActionController::TestCase
39 end 39 end
40 40
41 should 'do not render pagination buttons if it has only one page' do 41 should 'do not render pagination buttons if it has only one page' do
42 - article1 = fast_create(TinyMceArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1') 42 + article1 = fast_create(TextArticle, :parent_id => @page.id, :profile_id => @profile.id, :name => 'article1')
43 xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier 43 xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier
44 assert_no_match /context_content_more_#{@block.id}/, @response.body 44 assert_no_match /context_content_more_#{@block.id}/, @response.body
45 end 45 end
plugins/context_content/test/functional/profile_design_controller_test.rb
@@ -13,7 +13,7 @@ class ProfileDesignControllerTest &lt; ActionController::TestCase @@ -13,7 +13,7 @@ class ProfileDesignControllerTest &lt; ActionController::TestCase
13 13
14 box = Box.create!(:owner => @profile) 14 box = Box.create!(:owner => @profile)
15 @block = ContextContentPlugin::ContextContentBlock.new(:box_id => box.id) 15 @block = ContextContentPlugin::ContextContentBlock.new(:box_id => box.id)
16 - @block.types = ['TinyMceArticle'] 16 + @block.types = ['TextArticle']
17 @block.limit = 1 17 @block.limit = 1
18 @block.save! 18 @block.save!
19 19
@@ -38,11 +38,11 @@ class ProfileDesignControllerTest &lt; ActionController::TestCase @@ -38,11 +38,11 @@ class ProfileDesignControllerTest &lt; ActionController::TestCase
38 @block.show_parent_content = false 38 @block.show_parent_content = false
39 @block.save! 39 @block.save!
40 get :edit, :id => @block.id, :profile => @profile.identifier 40 get :edit, :id => @block.id, :profile => @profile.identifier
41 - post :save, :id => @block.id, :block => {:title => 'context', :show_image => '0', :show_name => '0', :show_parent_content => '0', :types => ['TinyMceArticle', '', nil, 'Folder'] }, :profile => @profile.identifier 41 + post :save, :id => @block.id, :block => {:title => 'context', :show_image => '0', :show_name => '0', :show_parent_content => '0', :types => ['TextArticle', '', nil, 'Folder'] }, :profile => @profile.identifier
42 @block.reload 42 @block.reload
43 assert_equal 'context', @block.title 43 assert_equal 'context', @block.title
44 refute @block.show_image && !@block.show_name && !@block.show_parent_content 44 refute @block.show_image && !@block.show_name && !@block.show_parent_content
45 - assert_equal ['TinyMceArticle', 'Folder'], @block.types 45 + assert_equal ['TextArticle', 'Folder'], @block.types
46 end 46 end
47 47
48 end 48 end
plugins/context_content/test/unit/context_content_block_test.rb
@@ -5,7 +5,7 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase @@ -5,7 +5,7 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase
5 def setup 5 def setup
6 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) 6 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([])
7 @block = ContextContentPlugin::ContextContentBlock.create! 7 @block = ContextContentPlugin::ContextContentBlock.create!
8 - @block.types = ['TinyMceArticle'] 8 + @block.types = ['TextArticle']
9 end 9 end
10 10
11 should 'describe itself' do 11 should 'describe itself' do
@@ -22,13 +22,13 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase @@ -22,13 +22,13 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase
22 22
23 should 'return children of page' do 23 should 'return children of page' do
24 folder = fast_create(Folder) 24 folder = fast_create(Folder)
25 - article = fast_create(TinyMceArticle, :parent_id => folder.id) 25 + article = fast_create(TextArticle, :parent_id => folder.id)
26 assert_equal [article], @block.contents(folder) 26 assert_equal [article], @block.contents(folder)
27 end 27 end
28 28
29 should 'return parent name of the contents' do 29 should 'return parent name of the contents' do
30 folder = fast_create(Folder, :name => " New Folder") 30 folder = fast_create(Folder, :name => " New Folder")
31 - article = fast_create(TinyMceArticle, :parent_id => folder.id) 31 + article = fast_create(TextArticle, :parent_id => folder.id)
32 assert_equal folder.name, @block.parent_title([article]) 32 assert_equal folder.name, @block.parent_title([article])
33 end 33 end
34 34
@@ -39,40 +39,40 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase @@ -39,40 +39,40 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase
39 should 'limit number of children to display' do 39 should 'limit number of children to display' do
40 @block.limit = 2 40 @block.limit = 2
41 folder = fast_create(Folder) 41 folder = fast_create(Folder)
42 - article1 = fast_create(TinyMceArticle, :parent_id => folder.id)  
43 - article2 = fast_create(TinyMceArticle, :parent_id => folder.id)  
44 - article3 = fast_create(TinyMceArticle, :parent_id => folder.id) 42 + article1 = fast_create(TextArticle, :parent_id => folder.id)
  43 + article2 = fast_create(TextArticle, :parent_id => folder.id)
  44 + article3 = fast_create(TextArticle, :parent_id => folder.id)
45 assert_equal 2, @block.contents(folder).length 45 assert_equal 2, @block.contents(folder).length
46 end 46 end
47 47
48 should 'show contents for next page' do 48 should 'show contents for next page' do
49 @block.limit = 2 49 @block.limit = 2
50 folder = fast_create(Folder) 50 folder = fast_create(Folder)
51 - article1 = fast_create(TinyMceArticle, :name => 'article 1', :parent_id => folder.id)  
52 - article2 = fast_create(TinyMceArticle, :name => 'article 2', :parent_id => folder.id)  
53 - article3 = fast_create(TinyMceArticle, :name => 'article 3', :parent_id => folder.id) 51 + article1 = fast_create(TextArticle, :name => 'article 1', :parent_id => folder.id)
  52 + article2 = fast_create(TextArticle, :name => 'article 2', :parent_id => folder.id)
  53 + article3 = fast_create(TextArticle, :name => 'article 3', :parent_id => folder.id)
54 assert_equal [article3], @block.contents(folder, 2) 54 assert_equal [article3], @block.contents(folder, 2)
55 end 55 end
56 56
57 should 'show parent contents for next page' do 57 should 'show parent contents for next page' do
58 @block.limit = 2 58 @block.limit = 2
59 folder = fast_create(Folder) 59 folder = fast_create(Folder)
60 - article1 = fast_create(TinyMceArticle, :name => 'article 1', :parent_id => folder.id)  
61 - article2 = fast_create(TinyMceArticle, :name => 'article 2', :parent_id => folder.id)  
62 - article3 = fast_create(TinyMceArticle, :name => 'article 3', :parent_id => folder.id) 60 + article1 = fast_create(TextArticle, :name => 'article 1', :parent_id => folder.id)
  61 + article2 = fast_create(TextArticle, :name => 'article 2', :parent_id => folder.id)
  62 + article3 = fast_create(TextArticle, :name => 'article 3', :parent_id => folder.id)
63 assert_equal [article3], @block.contents(article1, 2) 63 assert_equal [article3], @block.contents(article1, 2)
64 end 64 end
65 65
66 should 'return parent children if page has no children' do 66 should 'return parent children if page has no children' do
67 folder = fast_create(Folder) 67 folder = fast_create(Folder)
68 - article = fast_create(TinyMceArticle, :parent_id => folder.id) 68 + article = fast_create(TextArticle, :parent_id => folder.id)
69 assert_equal [article], @block.contents(article) 69 assert_equal [article], @block.contents(article)
70 end 70 end
71 71
72 should 'do not return parent children if show_parent_content is false' do 72 should 'do not return parent children if show_parent_content is false' do
73 @block.show_parent_content = false 73 @block.show_parent_content = false
74 folder = fast_create(Folder) 74 folder = fast_create(Folder)
75 - article = fast_create(TinyMceArticle, :parent_id => folder.id) 75 + article = fast_create(TextArticle, :parent_id => folder.id)
76 assert_equal [], @block.contents(article) 76 assert_equal [], @block.contents(article)
77 end 77 end
78 78
@@ -82,13 +82,13 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase @@ -82,13 +82,13 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase
82 end 82 end
83 83
84 should 'return available content types with checked types first' do 84 should 'return available content types with checked types first' do
85 - @block.types = ['TinyMceArticle', 'Folder']  
86 - assert_equal [TinyMceArticle, Folder, UploadedFile, Event, TextileArticle, RawHTMLArticle, Blog, Forum, Gallery, RssFeed], @block.available_content_types 85 + @block.types = ['TextArticle', 'Folder']
  86 + assert_equal [TextArticle, Folder, UploadedFile, Event, Blog, Forum, Gallery, RssFeed], @block.available_content_types
87 end 87 end
88 88
89 should 'return available content types' do 89 should 'return available content types' do
90 @block.types = [] 90 @block.types = []
91 - assert_equal [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed], @block.available_content_types 91 + assert_equal [UploadedFile, Event, TextArticle, Folder, Blog, Forum, Gallery, RssFeed], @block.available_content_types
92 end 92 end
93 93
94 should 'return first 2 content types' do 94 should 'return first 2 content types' do
@@ -120,7 +120,7 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase @@ -120,7 +120,7 @@ class ContextContentBlockTest &lt; ActiveSupport::TestCase
120 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new]) 120 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new])
121 121
122 @block.types = [] 122 @block.types = []
123 - assert_equal [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed, SomePluginContent], @block.available_content_types 123 + assert_equal [UploadedFile, Event, TextArticle, Folder, Blog, Forum, Gallery, RssFeed, SomePluginContent], @block.available_content_types
124 end 124 end
125 125
126 should 'return box owner on profile method call' do 126 should 'return box owner on profile method call' do
@@ -144,7 +144,7 @@ class ContextContentBlockViewTest &lt; ActionView::TestCase @@ -144,7 +144,7 @@ class ContextContentBlockViewTest &lt; ActionView::TestCase
144 def setup 144 def setup
145 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) 145 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([])
146 @block = ContextContentPlugin::ContextContentBlock.create! 146 @block = ContextContentPlugin::ContextContentBlock.create!
147 - @block.types = ['TinyMceArticle'] 147 + @block.types = ['TextArticle']
148 end 148 end
149 149
150 should 'render nothing if it has no content to show' do 150 should 'render nothing if it has no content to show' do
@@ -153,7 +153,7 @@ class ContextContentBlockViewTest &lt; ActionView::TestCase @@ -153,7 +153,7 @@ class ContextContentBlockViewTest &lt; ActionView::TestCase
153 153
154 should 'render context content block view' do 154 should 'render context content block view' do
155 @page = fast_create(Folder) 155 @page = fast_create(Folder)
156 - article = fast_create(TinyMceArticle, :parent_id => @page.id) 156 + article = fast_create(TextArticle, :parent_id => @page.id)
157 contents = [article] 157 contents = [article]
158 @block.use_parent_title = true 158 @block.use_parent_title = true
159 159
@@ -178,9 +178,9 @@ class ContextContentBlockViewTest &lt; ActionView::TestCase @@ -178,9 +178,9 @@ class ContextContentBlockViewTest &lt; ActionView::TestCase
178 should 'display pagination links if it has more than one page' do 178 should 'display pagination links if it has more than one page' do
179 @block.limit = 2 179 @block.limit = 2
180 @page = fast_create(Folder) 180 @page = fast_create(Folder)
181 - article1 = fast_create(TinyMceArticle, :parent_id => @page.id)  
182 - article2 = fast_create(TinyMceArticle, :parent_id => @page.id)  
183 - article3 = fast_create(TinyMceArticle, :parent_id => @page.id) 181 + article1 = fast_create(TextArticle, :parent_id => @page.id)
  182 + article2 = fast_create(TextArticle, :parent_id => @page.id)
  183 + article3 = fast_create(TextArticle, :parent_id => @page.id)
184 contents = [article1, article2, article3] 184 contents = [article1, article2, article3]
185 contents.each do |article| 185 contents.each do |article|
186 article.expects(:view_url).returns('http://test.noosfero.plugins') 186 article.expects(:view_url).returns('http://test.noosfero.plugins')
plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb
@@ -180,8 +180,9 @@ class CustomFormsPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -180,8 +180,9 @@ class CustomFormsPluginMyprofileControllerTest &lt; ActionController::TestCase
180 form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software') 180 form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software')
181 181
182 get :edit, :profile => profile.identifier, :id => form.id 182 get :edit, :profile => profile.identifier, :id => form.id
  183 + expects(:current_editor).returns(Article::Editor::TINY_MCE)
183 184
184 - assert_tag :tag => 'textarea', :attributes => { :id => 'form_description', :class => 'mceEditor' } 185 + assert_tag :tag => 'textarea', :attributes => { :id => 'form_description', :class => /#{current_editor}/ }
185 end 186 end
186 187
187 should 'export submissions as csv' do 188 should 'export submissions as csv' do
plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
1 <% self.extend(CustomFormsPlugin::Helper) %> 1 <% self.extend(CustomFormsPlugin::Helper) %>
2 -<%= render :file => 'shared/tiny_mce', :locals => {:mode => 'simple'} %>  
3 2
4 <%= error_messages_for :form %> 3 <%= error_messages_for :form %>
5 <%= required labelled_form_field _('Name'), f.text_field(:name) %> 4 <%= required labelled_form_field _('Name'), f.text_field(:name) %>
@@ -17,7 +16,7 @@ @@ -17,7 +16,7 @@
17 <%= labelled_check_box _('Triggered after membership'), 'form[on_membership]', '1', @form.on_membership %> 16 <%= labelled_check_box _('Triggered after membership'), 'form[on_membership]', '1', @form.on_membership %>
18 </p> 17 </p>
19 <% end %> 18 <% end %>
20 -<%= labelled_form_field c_('Description'), f.text_area(:description, :style => 'width: 100%', :class => 'mceEditor') %> 19 +<%= labelled_form_field c_('Description'), f.text_area(:description, :style => 'width: 100%', :class => current_editor('simple')) %>
21 20
22 <h2><%= c_('Fields') %></h2> 21 <h2><%= c_('Fields') %></h2>
23 22
plugins/delivery/views/delivery_plugin/admin_method/_edit.html.slim
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 = labelled_field f, :name, t('delivery_plugin.models.method.name'), f.text_field(:name), 12 = labelled_field f, :name, t('delivery_plugin.models.method.name'), f.text_field(:name),
13 help: t('delivery_plugin.models.method.name_help') 13 help: t('delivery_plugin.models.method.name_help')
14 = labelled_field f, :description, t('delivery_plugin.models.method.instructions'), 14 = labelled_field f, :description, t('delivery_plugin.models.method.instructions'),
15 - f.text_area(:description, rows: 5, class: 'mceEditor'), help: t('delivery_plugin.models.method.instructions_help') 15 + f.text_area(:description, rows: 5, class: current_editor('simple')), help: t('delivery_plugin.models.method.instructions_help')
16 16
17 fieldset 17 fieldset
18 legend= t'delivery_plugin.models.method.costs_legend' 18 legend= t'delivery_plugin.models.method.costs_legend'
@@ -34,5 +34,3 @@ @@ -34,5 +34,3 @@
34 = submit_button :save, if delivery_method.new_record? then t('delivery_plugin.views.method.edit.add') else t('delivery_plugin.views.method.edit.save') end 34 = submit_button :save, if delivery_method.new_record? then t('delivery_plugin.views.method.edit.add') else t('delivery_plugin.views.method.edit.save') end
35 = link_to_function t('delivery_plugin.views.method.edit.back'), "delivery.method.view.toggle()" 35 = link_to_function t('delivery_plugin.views.method.edit.back'), "delivery.method.view.toggle()"
36 36
37 -= render file: 'shared/tiny_mce', locals: {mode: 'simple'}  
38 -  
plugins/display_content/lib/display_content_block.rb
@@ -24,7 +24,7 @@ class DisplayContentBlock &lt; Block @@ -24,7 +24,7 @@ class DisplayContentBlock &lt; Block
24 {:value => 'title', :checked => true}, 24 {:value => 'title', :checked => true},
25 {:value => 'abstract', :checked => true}] 25 {:value => 'abstract', :checked => true}]
26 settings_items :display_folder_children, :type => :boolean, :default => true 26 settings_items :display_folder_children, :type => :boolean, :default => true
27 - settings_items :types, :type => Array, :default => ['TextileArticle', 'TinyMceArticle', 'RawHTMLArticle'] 27 + settings_items :types, :type => Array, :default => ['TextArticle']
28 settings_items :order_by_recent, :type => :boolean, :default => :true 28 settings_items :order_by_recent, :type => :boolean, :default => :true
29 settings_items :content_with_translations, :type => :boolean, :default => :true 29 settings_items :content_with_translations, :type => :boolean, :default => :true
30 settings_items :limit_to_show, :type => :integer, :default => 6 30 settings_items :limit_to_show, :type => :integer, :default => 6
@@ -61,7 +61,7 @@ class DisplayContentBlock &lt; Block @@ -61,7 +61,7 @@ class DisplayContentBlock &lt; Block
61 end 61 end
62 62
63 def available_content_types 63 def available_content_types
64 - @available_content_types ||= [TinyMceArticle, RawHTMLArticle, TextileArticle, UploadedFile, Event, Folder, Blog, Forum, Gallery, RssFeed] + plugins.dispatch(:content_types) 64 + @available_content_types ||= [TextArticle, UploadedFile, Event, Folder, Blog, Forum, Gallery, RssFeed] + plugins.dispatch(:content_types)
65 checked_types = types.map {|t| t.constantize} 65 checked_types = types.map {|t| t.constantize}
66 checked_types + (@available_content_types - checked_types) 66 checked_types + (@available_content_types - checked_types)
67 end 67 end
@@ -108,7 +108,7 @@ class DisplayContentBlock &lt; Block @@ -108,7 +108,7 @@ class DisplayContentBlock &lt; Block
108 @parent_nodes ||= self.holder.articles.where(:id => nodes).map { |article| get_parent(article) }.compact.flatten 108 @parent_nodes ||= self.holder.articles.where(:id => nodes).map { |article| get_parent(article) }.compact.flatten
109 end 109 end
110 110
111 - VALID_CONTENT = ['RawHTMLArticle', 'TextArticle', 'TextileArticle', 'TinyMceArticle', 'Folder', 'Blog', 'Forum'] 111 + VALID_CONTENT = ['TextArticle', 'Folder', 'Blog', 'Forum']
112 112
113 include Noosfero::Plugin::HotSpot 113 include Noosfero::Plugin::HotSpot
114 114
plugins/display_content/test/functional/display_content_plugin_admin_controller_test.rb
@@ -39,7 +39,7 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase @@ -39,7 +39,7 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase
39 39
40 should 'index action returns an json with node content' do 40 should 'index action returns an json with node content' do
41 Article.delete_all 41 Article.delete_all
42 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => environment.portal_community.id) 42 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => environment.portal_community.id)
43 43
44 get :index, :block_id => block.id 44 get :index, :block_id => block.id
45 json_response = ActiveSupport::JSON.decode(@response.body) 45 json_response = ActiveSupport::JSON.decode(@response.body)
@@ -51,7 +51,7 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase @@ -51,7 +51,7 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase
51 51
52 should 'index action returns an json with node checked if the node is in the nodes list' do 52 should 'index action returns an json with node checked if the node is in the nodes list' do
53 Article.delete_all 53 Article.delete_all
54 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => environment.portal_community.id) 54 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => environment.portal_community.id)
55 block.nodes= [article.id] 55 block.nodes= [article.id]
56 block.save! 56 block.save!
57 57
@@ -67,8 +67,8 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase @@ -67,8 +67,8 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase
67 should 'index action returns an json with node undetermined if the node is in the parent nodes list' do 67 should 'index action returns an json with node undetermined if the node is in the parent nodes list' do
68 Article.delete_all 68 Article.delete_all
69 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id) 69 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id)
70 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)  
71 - article2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id) 70 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)
  71 + article2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id)
72 block.nodes = [article.id] 72 block.nodes = [article.id]
73 block.save! 73 block.save!
74 74
@@ -81,7 +81,7 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase @@ -81,7 +81,7 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase
81 should 'index action returns an json with node closed if the node has article with children' do 81 should 'index action returns an json with node closed if the node has article with children' do
82 Article.delete_all 82 Article.delete_all
83 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id) 83 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id)
84 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id) 84 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)
85 85
86 get :index, :block_id => block.id 86 get :index, :block_id => block.id
87 json_response = ActiveSupport::JSON.decode(@response.body) 87 json_response = ActiveSupport::JSON.decode(@response.body)
@@ -95,8 +95,8 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase @@ -95,8 +95,8 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase
95 should 'index action returns an json with all the children nodes if some parent is in the parents list' do 95 should 'index action returns an json with all the children nodes if some parent is in the parents list' do
96 Article.delete_all 96 Article.delete_all
97 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id) 97 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id)
98 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)  
99 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id) 98 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)
  99 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id)
100 block.checked_nodes= {a1.id => true} 100 block.checked_nodes= {a1.id => true}
101 block.save! 101 block.save!
102 102
@@ -118,9 +118,9 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase @@ -118,9 +118,9 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase
118 should 'index action returns an json with all the children nodes and root nodes if some parent is in the parents list and there is others root articles' do 118 should 'index action returns an json with all the children nodes and root nodes if some parent is in the parents list and there is others root articles' do
119 Article.delete_all 119 Article.delete_all
120 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id) 120 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id)
121 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)  
122 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id)  
123 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => environment.portal_community.id) 121 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)
  122 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id)
  123 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => environment.portal_community.id)
124 block.checked_nodes= {a2.id => true, a3.id => true} 124 block.checked_nodes= {a2.id => true, a3.id => true}
125 block.save! 125 block.save!
126 126
@@ -148,9 +148,9 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase @@ -148,9 +148,9 @@ class DisplayContentPluginAdminControllerTest &lt; ActionController::TestCase
148 should 'index action returns an json without children nodes if the parent is not in the parents list' do 148 should 'index action returns an json without children nodes if the parent is not in the parents list' do
149 Article.delete_all 149 Article.delete_all
150 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id) 150 f = fast_create(Folder, :name => 'test folder 1', :profile_id => environment.portal_community.id)
151 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)  
152 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id)  
153 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => environment.portal_community.id) 151 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => environment.portal_community.id, :parent_id => f.id)
  152 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => environment.portal_community.id, :parent_id => f.id)
  153 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => environment.portal_community.id)
154 154
155 get :index, :block_id => block.id 155 get :index, :block_id => block.id
156 json_response = ActiveSupport::JSON.decode(@response.body) 156 json_response = ActiveSupport::JSON.decode(@response.body)
plugins/display_content/test/functional/display_content_plugin_myprofile_controller_test.rb
@@ -40,7 +40,7 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -40,7 +40,7 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase
40 40
41 should 'index action returns an json with node content' do 41 should 'index action returns an json with node content' do
42 Article.delete_all 42 Article.delete_all
43 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id) 43 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
44 44
45 get :index, :block_id => block.id, :profile => profile.identifier 45 get :index, :block_id => block.id, :profile => profile.identifier
46 json_response = ActiveSupport::JSON.decode(@response.body) 46 json_response = ActiveSupport::JSON.decode(@response.body)
@@ -52,7 +52,7 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -52,7 +52,7 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase
52 52
53 should 'index action returns an json with node checked if the node is in the nodes list' do 53 should 'index action returns an json with node checked if the node is in the nodes list' do
54 Article.delete_all 54 Article.delete_all
55 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id) 55 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
56 block.nodes= [article.id] 56 block.nodes= [article.id]
57 block.save! 57 block.save!
58 58
@@ -68,8 +68,8 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -68,8 +68,8 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase
68 should 'index action returns an json with node undetermined if the node is in the parent nodes list' do 68 should 'index action returns an json with node undetermined if the node is in the parent nodes list' do
69 Article.delete_all 69 Article.delete_all
70 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 70 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
71 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)  
72 - article2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id) 71 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)
  72 + article2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id)
73 block.nodes = [article.id] 73 block.nodes = [article.id]
74 block.save! 74 block.save!
75 75
@@ -82,7 +82,7 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -82,7 +82,7 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase
82 should 'index action returns an json with node closed if the node has article with children' do 82 should 'index action returns an json with node closed if the node has article with children' do
83 Article.delete_all 83 Article.delete_all
84 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 84 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
85 - article = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id) 85 + article = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)
86 block.save! 86 block.save!
87 87
88 get :index, :block_id => block.id, :profile => profile.identifier 88 get :index, :block_id => block.id, :profile => profile.identifier
@@ -97,8 +97,8 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -97,8 +97,8 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase
97 should 'index action returns an json with all the children nodes if some parent is in the parents list' do 97 should 'index action returns an json with all the children nodes if some parent is in the parents list' do
98 Article.delete_all 98 Article.delete_all
99 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 99 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
100 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)  
101 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id) 100 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)
  101 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id)
102 block.checked_nodes = {a1.id => true} 102 block.checked_nodes = {a1.id => true}
103 block.save! 103 block.save!
104 104
@@ -120,9 +120,9 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -120,9 +120,9 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase
120 should 'index action returns an json with all the children nodes and root nodes if some parent is in the parents list and there is others root articles' do 120 should 'index action returns an json with all the children nodes and root nodes if some parent is in the parents list and there is others root articles' do
121 Article.delete_all 121 Article.delete_all
122 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 122 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
123 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)  
124 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id)  
125 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id) 123 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)
  124 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id)
  125 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id)
126 block.checked_nodes = {a1.id => true} 126 block.checked_nodes = {a1.id => true}
127 block.save! 127 block.save!
128 128
@@ -150,9 +150,9 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase @@ -150,9 +150,9 @@ class DisplayContentPluginMyprofileControllerTest &lt; ActionController::TestCase
150 should 'index action returns an json without children nodes if the parent is not in the parents list' do 150 should 'index action returns an json without children nodes if the parent is not in the parents list' do
151 Article.delete_all 151 Article.delete_all
152 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 152 f = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
153 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)  
154 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id)  
155 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id) 153 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f.id)
  154 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f.id)
  155 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id)
156 156
157 get :index, :block_id => block.id, :profile => profile.identifier 157 get :index, :block_id => block.id, :profile => profile.identifier
158 json_response = ActiveSupport::JSON.decode(@response.body) 158 json_response = ActiveSupport::JSON.decode(@response.body)
plugins/display_content/test/unit/display_content_block_test.rb
@@ -2,7 +2,7 @@ require_relative &#39;../test_helper&#39; @@ -2,7 +2,7 @@ require_relative &#39;../test_helper&#39;
2 class DisplayContentBlockTest < ActiveSupport::TestCase 2 class DisplayContentBlockTest < ActiveSupport::TestCase
3 3
4 INVALID_KIND_OF_ARTICLE = [Event, RssFeed, UploadedFile, Gallery] 4 INVALID_KIND_OF_ARTICLE = [Event, RssFeed, UploadedFile, Gallery]
5 - VALID_KIND_OF_ARTICLE = [RawHTMLArticle, TextArticle, TextileArticle, TinyMceArticle, Folder, Blog, Forum] 5 + VALID_KIND_OF_ARTICLE = [TextArticle, Folder, Blog, Forum]
6 6
7 should 'describe itself' do 7 should 'describe itself' do
8 assert_not_equal Block.description, DisplayContentBlock.description 8 assert_not_equal Block.description, DisplayContentBlock.description
@@ -39,9 +39,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -39,9 +39,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
39 should 'nodes be the article ids in hash of checked nodes' do 39 should 'nodes be the article ids in hash of checked nodes' do
40 profile = create_user('testuser').person 40 profile = create_user('testuser').person
41 Article.delete_all 41 Article.delete_all
42 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
43 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id)  
44 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id) 42 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  43 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
  44 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id)
45 45
46 checked_articles= {a1.id => true, a2.id => true, a3.id => false} 46 checked_articles= {a1.id => true, a2.id => true, a3.id => false}
47 block = DisplayContentBlock.new 47 block = DisplayContentBlock.new
@@ -54,9 +54,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -54,9 +54,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
54 should 'nodes be save in database' do 54 should 'nodes be save in database' do
55 profile = create_user('testuser').person 55 profile = create_user('testuser').person
56 Article.delete_all 56 Article.delete_all
57 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
58 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id)  
59 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id) 57 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  58 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
  59 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id)
60 60
61 checked_articles= {a1.id => true, a2.id => true, a3.id => false} 61 checked_articles= {a1.id => true, a2.id => true, a3.id => false}
62 block = DisplayContentBlock.new 62 block = DisplayContentBlock.new
@@ -71,10 +71,10 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -71,10 +71,10 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
71 should 'be able to update nodes' do 71 should 'be able to update nodes' do
72 profile = create_user('testuser').person 72 profile = create_user('testuser').person
73 Article.delete_all 73 Article.delete_all
74 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
75 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id)  
76 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id)  
77 - a4 = fast_create(TextileArticle, :name => 'test article 4', :profile_id => profile.id) 74 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  75 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
  76 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id)
  77 + a4 = fast_create(TextArticle, :name => 'test article 4', :profile_id => profile.id)
78 78
79 checked_articles= {a1.id => true, a2.id => true, a3.id => false} 79 checked_articles= {a1.id => true, a2.id => true, a3.id => false}
80 block = DisplayContentBlock.new 80 block = DisplayContentBlock.new
@@ -95,13 +95,13 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -95,13 +95,13 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
95 should "save selected folders and articles" do 95 should "save selected folders and articles" do
96 profile = create_user('testuser').person 96 profile = create_user('testuser').person
97 Article.delete_all 97 Article.delete_all
98 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
99 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id) 98 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  99 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
100 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 100 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
101 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => f1.id) 101 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => f1.id)
102 f2 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id, :parent_id => f1.id) 102 f2 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id, :parent_id => f1.id)
103 - a4 = fast_create(TextileArticle, :name => 'test article 4', :profile_id => profile.id, :parent_id => f2.id)  
104 - a5 = fast_create(TextileArticle, :name => 'test article 5', :profile_id => profile.id, :parent_id => f2.id) 103 + a4 = fast_create(TextArticle, :name => 'test article 4', :profile_id => profile.id, :parent_id => f2.id)
  104 + a5 = fast_create(TextArticle, :name => 'test article 5', :profile_id => profile.id, :parent_id => f2.id)
105 105
106 checked_articles= {a1.id => true, a2.id => true, f1.id => false} 106 checked_articles= {a1.id => true, a2.id => true, f1.id => false}
107 107
@@ -115,13 +115,13 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -115,13 +115,13 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
115 should "save selected articles and blogs" do 115 should "save selected articles and blogs" do
116 profile = create_user('testuser').person 116 profile = create_user('testuser').person
117 Article.delete_all 117 Article.delete_all
118 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
119 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id) 118 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  119 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
120 b1 = fast_create(Blog, :name => 'test blog 1', :profile_id => profile.id) 120 b1 = fast_create(Blog, :name => 'test blog 1', :profile_id => profile.id)
121 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => b1.id) 121 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => b1.id)
122 b2 = fast_create(Blog, :name => 'test blog 2', :profile_id => profile.id) 122 b2 = fast_create(Blog, :name => 'test blog 2', :profile_id => profile.id)
123 - a4 = fast_create(TextileArticle, :name => 'test article 4', :profile_id => profile.id, :parent_id => b2.id)  
124 - a5 = fast_create(TextileArticle, :name => 'test article 5', :profile_id => profile.id, :parent_id => b2.id) 123 + a4 = fast_create(TextArticle, :name => 'test article 4', :profile_id => profile.id, :parent_id => b2.id)
  124 + a5 = fast_create(TextArticle, :name => 'test article 5', :profile_id => profile.id, :parent_id => b2.id)
125 125
126 checked_articles= {a1.id => true, a2.id => true, b1.id => false, b2.id => true} 126 checked_articles= {a1.id => true, a2.id => true, b1.id => false, b2.id => true}
127 127
@@ -132,36 +132,10 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -132,36 +132,10 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
132 assert_equivalent [a1.id, a2.id, b1.id, b2.id], block.nodes 132 assert_equivalent [a1.id, a2.id, b1.id, b2.id], block.nodes
133 end 133 end
134 134
135 - should 'TextileArticle be saved as node' do 135 + should 'TextArticle be saved as node' do
136 profile = create_user('testuser').person 136 profile = create_user('testuser').person
137 Article.delete_all 137 Article.delete_all
138 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
139 -  
140 - checked_articles= {a1.id => true}  
141 - block = DisplayContentBlock.new  
142 - block.stubs(:holder).returns(profile)  
143 - block.checked_nodes= checked_articles  
144 - assert_equal [], [a1.id] - block.nodes  
145 - assert_equal [], block.nodes - [a1.id]  
146 - end  
147 -  
148 - should 'TinyMceArticle be saved as node' do  
149 - profile = create_user('testuser').person  
150 - Article.delete_all  
151 - a1 = fast_create(TinyMceArticle, :name => 'test article 1', :profile_id => profile.id)  
152 -  
153 - checked_articles= {a1.id => true}  
154 - block = DisplayContentBlock.new  
155 - block.stubs(:holder).returns(profile)  
156 - block.checked_nodes= checked_articles  
157 - assert_equal [], [a1.id] - block.nodes  
158 - assert_equal [], block.nodes - [a1.id]  
159 - end  
160 -  
161 - should 'RawHTMLArticle be saved as node' do  
162 - profile = create_user('testuser').person  
163 - Article.delete_all  
164 - a1 = fast_create(RawHTMLArticle, :name => 'test article 1', :profile_id => profile.id) 138 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
165 139
166 checked_articles= {a1.id => true} 140 checked_articles= {a1.id => true}
167 block = DisplayContentBlock.new 141 block = DisplayContentBlock.new
@@ -230,9 +204,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -230,9 +204,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
230 should "return all root articles from profile" do 204 should "return all root articles from profile" do
231 profile = create_user('testuser').person 205 profile = create_user('testuser').person
232 Article.delete_all 206 Article.delete_all
233 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
234 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id)  
235 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id) 207 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  208 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
  209 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id)
236 210
237 block = DisplayContentBlock.new 211 block = DisplayContentBlock.new
238 block.nodes= [a1.id, a2.id, a3.id] 212 block.nodes= [a1.id, a2.id, a3.id]
@@ -247,9 +221,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -247,9 +221,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
247 should "return all children of an articles's profile" do 221 should "return all children of an articles's profile" do
248 profile = create_user('testuser').person 222 profile = create_user('testuser').person
249 Article.delete_all 223 Article.delete_all
250 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
251 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id)  
252 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id) 224 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  225 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
  226 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id)
253 227
254 block = DisplayContentBlock.new 228 block = DisplayContentBlock.new
255 box = mock() 229 box = mock()
@@ -264,9 +238,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -264,9 +238,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
264 profile = fast_create(Community, :name => 'my test community', :identifier => 'mytestcommunity') 238 profile = fast_create(Community, :name => 'my test community', :identifier => 'mytestcommunity')
265 environment = Environment.default 239 environment = Environment.default
266 Article.delete_all 240 Article.delete_all
267 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
268 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id)  
269 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id) 241 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  242 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
  243 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id)
270 244
271 block = DisplayContentBlock.new 245 block = DisplayContentBlock.new
272 box = mock() 246 box = mock()
@@ -283,9 +257,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -283,9 +257,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
283 profile = fast_create(Community, :name => 'my test community', :identifier => 'mytestcommunity') 257 profile = fast_create(Community, :name => 'my test community', :identifier => 'mytestcommunity')
284 environment = Environment.default 258 environment = Environment.default
285 Article.delete_all 259 Article.delete_all
286 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
287 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id)  
288 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id) 260 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  261 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
  262 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => a2.id)
289 263
290 block = DisplayContentBlock.new 264 block = DisplayContentBlock.new
291 box = mock() 265 box = mock()
@@ -404,9 +378,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -404,9 +378,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
404 profile = create_user('testuser').person 378 profile = create_user('testuser').person
405 Article.delete_all 379 Article.delete_all
406 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 380 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
407 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f1.id)  
408 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f1.id)  
409 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => f1.id) 381 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f1.id)
  382 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f1.id)
  383 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => f1.id)
410 384
411 checked_articles= {f1.id => true, a1.id => true, a2.id => true, a3.id => false} 385 checked_articles= {f1.id => true, a1.id => true, a2.id => true, a3.id => false}
412 block = DisplayContentBlock.new 386 block = DisplayContentBlock.new
@@ -420,9 +394,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -420,9 +394,9 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
420 profile = create_user('testuser').person 394 profile = create_user('testuser').person
421 Article.delete_all 395 Article.delete_all
422 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 396 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
423 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f1.id)  
424 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f1.id)  
425 - a3 = fast_create(TextileArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => f1.id) 397 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f1.id)
  398 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :parent_id => f1.id)
  399 + a3 = fast_create(TextArticle, :name => 'test article 3', :profile_id => profile.id, :parent_id => f1.id)
426 400
427 checked_articles= {f1.id => true, a1.id => true, a2.id => true, a3.id => false} 401 checked_articles= {f1.id => true, a1.id => true, a2.id => true, a3.id => false}
428 block = DisplayContentBlock.new 402 block = DisplayContentBlock.new
@@ -472,37 +446,37 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -472,37 +446,37 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
472 should 'return available content types with checked types first' do 446 should 'return available content types with checked types first' do
473 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) 447 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([])
474 block = DisplayContentBlock.create! 448 block = DisplayContentBlock.create!
475 - block.types = ['TinyMceArticle'] 449 + block.types = ['TextArticle']
476 450
477 - block.types = ['TinyMceArticle', 'Folder']  
478 - assert_equivalent [TinyMceArticle, Folder, UploadedFile, Event, TextileArticle, RawHTMLArticle, Blog, Forum, Gallery, RssFeed], block.available_content_types 451 + block.types = ['TextArticle', 'Folder']
  452 + assert_equivalent [TextArticle, Folder, UploadedFile, Event, Blog, Forum, Gallery, RssFeed], block.available_content_types
479 end 453 end
480 454
481 should 'return available content types' do 455 should 'return available content types' do
482 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) 456 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([])
483 block = DisplayContentBlock.create! 457 block = DisplayContentBlock.create!
484 - block.types = ['TinyMceArticle'] 458 + block.types = ['TextArticle']
485 block.types = [] 459 block.types = []
486 - assert_equivalent [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed], block.available_content_types 460 + assert_equivalent [UploadedFile, Event, TextArticle, Folder, Blog, Forum, Gallery, RssFeed], block.available_content_types
487 end 461 end
488 462
489 should 'return first 2 content types' do 463 should 'return first 2 content types' do
490 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) 464 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([])
491 block = DisplayContentBlock.create! 465 block = DisplayContentBlock.create!
492 - block.types = ['TinyMceArticle'] 466 + block.types = ['TextArticle']
493 assert_equal 2, block.first_content_types.length 467 assert_equal 2, block.first_content_types.length
494 end 468 end
495 469
496 should 'return all but first 2 content types' do 470 should 'return all but first 2 content types' do
497 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) 471 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([])
498 block = DisplayContentBlock.create! 472 block = DisplayContentBlock.create!
499 - block.types = ['TinyMceArticle'] 473 + block.types = ['TextArticle']
500 assert_equal block.available_content_types.length - 2, block.more_content_types.length 474 assert_equal block.available_content_types.length - 2, block.more_content_types.length
501 end 475 end
502 476
503 should 'return 2 as default value for first_types_count' do 477 should 'return 2 as default value for first_types_count' do
504 block = DisplayContentBlock.create! 478 block = DisplayContentBlock.create!
505 - block.types = ['TinyMceArticle'] 479 + block.types = ['TextArticle']
506 assert_equal 2, block.first_types_count 480 assert_equal 2, block.first_types_count
507 end 481 end
508 482
@@ -527,14 +501,14 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -527,14 +501,14 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
527 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new]) 501 Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new])
528 502
529 block.types = [] 503 block.types = []
530 - assert_equivalent [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed, SomePluginContent], block.available_content_types 504 + assert_equivalent [UploadedFile, Event, TextArticle, Folder, Blog, Forum, Gallery, RssFeed, SomePluginContent], block.available_content_types
531 end 505 end
532 506
533 should 'do not fail if a selected article was removed' do 507 should 'do not fail if a selected article was removed' do
534 profile = create_user('testuser').person 508 profile = create_user('testuser').person
535 Article.delete_all 509 Article.delete_all
536 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id) 510 f1 = fast_create(Folder, :name => 'test folder 1', :profile_id => profile.id)
537 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f1.id) 511 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :parent_id => f1.id)
538 512
539 checked_articles= {a1.id => true} 513 checked_articles= {a1.id => true}
540 514
@@ -547,16 +521,16 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase @@ -547,16 +521,16 @@ class DisplayContentBlockTest &lt; ActiveSupport::TestCase
547 521
548 end 522 end
549 523
550 -require 'boxes_helper'  
551 -  
552 class DisplayContentBlockViewTest < ActionView::TestCase 524 class DisplayContentBlockViewTest < ActionView::TestCase
553 include BoxesHelper 525 include BoxesHelper
  526 + include DatesHelper
  527 + helper :dates
554 528
555 should 'list links for all articles title defined in nodes' do 529 should 'list links for all articles title defined in nodes' do
556 profile = create_user('testuser').person 530 profile = create_user('testuser').person
557 Article.delete_all 531 Article.delete_all
558 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id)  
559 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id) 532 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
  533 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id)
560 534
561 block = DisplayContentBlock.new 535 block = DisplayContentBlock.new
562 block.sections = [{:value => 'title', :checked => true}] 536 block.sections = [{:value => 'title', :checked => true}]
@@ -572,8 +546,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -572,8 +546,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
572 should 'list content for all articles lead defined in nodes' do 546 should 'list content for all articles lead defined in nodes' do
573 profile = create_user('testuser').person 547 profile = create_user('testuser').person
574 Article.delete_all 548 Article.delete_all
575 - a1 = fast_create(TinyMceArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'abstract article 1')  
576 - a2 = fast_create(TinyMceArticle, :name => 'test article 2', :profile_id => profile.id, :abstract => 'abstract article 2') 549 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'abstract article 1')
  550 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :abstract => 'abstract article 2')
577 551
578 block = DisplayContentBlock.new 552 block = DisplayContentBlock.new
579 block.sections = [{:value => 'abstract', :checked => true}] 553 block.sections = [{:value => 'abstract', :checked => true}]
@@ -602,7 +576,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -602,7 +576,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
602 576
603 should 'show title if defined by user' do 577 should 'show title if defined by user' do
604 profile = create_user('testuser').person 578 profile = create_user('testuser').person
605 - a = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id) 579 + a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id)
606 580
607 block = DisplayContentBlock.new 581 block = DisplayContentBlock.new
608 block.nodes = [a.id] 582 block.nodes = [a.id]
@@ -616,7 +590,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -616,7 +590,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
616 590
617 should 'show abstract if defined by user' do 591 should 'show abstract if defined by user' do
618 profile = create_user('testuser').person 592 profile = create_user('testuser').person
619 - a = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'some abstract') 593 + a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'some abstract')
620 594
621 block = DisplayContentBlock.new 595 block = DisplayContentBlock.new
622 block.nodes = [a.id] 596 block.nodes = [a.id]
@@ -630,7 +604,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -630,7 +604,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
630 604
631 should 'show body if defined by user' do 605 should 'show body if defined by user' do
632 profile = create_user('testuser').person 606 profile = create_user('testuser').person
633 - a = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :body => 'some body') 607 + a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :body => 'some body')
634 608
635 block = DisplayContentBlock.new 609 block = DisplayContentBlock.new
636 block.nodes = [a.id] 610 block.nodes = [a.id]
@@ -642,7 +616,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -642,7 +616,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
642 assert_match /#{a.body}/, render_block_content(block) 616 assert_match /#{a.body}/, render_block_content(block)
643 end 617 end
644 618
645 - should 'show publishd date if defined by user' do 619 + should 'show published date if defined by user' do
646 profile = create_user('testuser').person 620 profile = create_user('testuser').person
647 a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :body => 'some body') 621 a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :body => 'some body')
648 622
@@ -658,7 +632,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -658,7 +632,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
658 632
659 should 'show image if defined by user' do 633 should 'show image if defined by user' do
660 profile = create_user('testuser').person 634 profile = create_user('testuser').person
661 - a = create(TinyMceArticle, :name => 'test article 1', :profile_id => profile.id, :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}) 635 + a = create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')})
662 a.save! 636 a.save!
663 637
664 process_delayed_job_queue 638 process_delayed_job_queue
@@ -676,8 +650,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -676,8 +650,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
676 should 'show articles in recent order' do 650 should 'show articles in recent order' do
677 profile = create_user('testuser').person 651 profile = create_user('testuser').person
678 Article.delete_all 652 Article.delete_all
679 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :published_at => DateTime.current)  
680 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :published_at => (DateTime.current + 1)) 653 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :published_at => DateTime.current)
  654 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :published_at => (DateTime.current + 1))
681 655
682 block = DisplayContentBlock.new 656 block = DisplayContentBlock.new
683 block.sections = [{:value => 'title', :checked => true}] 657 block.sections = [{:value => 'title', :checked => true}]
@@ -697,8 +671,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -697,8 +671,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
697 should 'show articles in oldest order' do 671 should 'show articles in oldest order' do
698 profile = create_user('testuser').person 672 profile = create_user('testuser').person
699 Article.delete_all 673 Article.delete_all
700 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :published_at => DateTime.current)  
701 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :published_at => (DateTime.current + 1)) 674 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :published_at => DateTime.current)
  675 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :published_at => (DateTime.current + 1))
702 676
703 block = DisplayContentBlock.new 677 block = DisplayContentBlock.new
704 block.sections = [{:value => 'title', :checked => true}] 678 block.sections = [{:value => 'title', :checked => true}]
@@ -718,8 +692,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -718,8 +692,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
718 should 'show articles in recent order with limit option' do 692 should 'show articles in recent order with limit option' do
719 profile = create_user('testuser').person 693 profile = create_user('testuser').person
720 Article.delete_all 694 Article.delete_all
721 - a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :published_at => DateTime.current)  
722 - a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id, :published_at => (DateTime.current + 1)) 695 + a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :published_at => DateTime.current)
  696 + a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :published_at => (DateTime.current + 1))
723 697
724 block = DisplayContentBlock.new 698 block = DisplayContentBlock.new
725 block.sections = [{:value => 'title', :checked => true}] 699 block.sections = [{:value => 'title', :checked => true}]
@@ -741,10 +715,10 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -741,10 +715,10 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
741 profile = create_user('testuser').person 715 profile = create_user('testuser').person
742 Article.delete_all 716 Article.delete_all
743 717
744 - en_article = fast_create(TextileArticle, :profile_id => profile.id, :name => 'en_article', :language => 'en')  
745 - en_article2 = fast_create(TextileArticle, :profile_id => profile.id, :name => 'en_article 2', :language => 'en') 718 + en_article = fast_create(TextArticle, :profile_id => profile.id, :name => 'en_article', :language => 'en')
  719 + en_article2 = fast_create(TextArticle, :profile_id => profile.id, :name => 'en_article 2', :language => 'en')
746 720
747 - pt_article = fast_create TextileArticle, profile_id: profile.id, name: 'pt_article', language: 'pt', translation_of_id: en_article.id 721 + pt_article = fast_create TextArticle, profile_id: profile.id, name: 'pt_article', language: 'pt', translation_of_id: en_article.id
748 722
749 block = DisplayContentBlock.new 723 block = DisplayContentBlock.new
750 block.sections = [{:value => 'title', :checked => true}] 724 block.sections = [{:value => 'title', :checked => true}]
@@ -771,8 +745,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -771,8 +745,8 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
771 profile = create_user('testuser').person 745 profile = create_user('testuser').person
772 Article.delete_all 746 Article.delete_all
773 747
774 - en_article = fast_create(TextileArticle, :profile_id => profile.id, :name => 'en_article', :language => 'en')  
775 - pt_article = fast_create(TextileArticle, :profile_id => profile.id, :name => 'pt_article', :language => 'pt', :translation_of_id => en_article) 748 + en_article = fast_create(TextArticle, :profile_id => profile.id, :name => 'en_article', :language => 'en')
  749 + pt_article = fast_create(TextArticle, :profile_id => profile.id, :name => 'pt_article', :language => 'pt', :translation_of_id => en_article)
776 750
777 block = DisplayContentBlock.new 751 block = DisplayContentBlock.new
778 block.sections = [{:value => 'title', :checked => true}] 752 block.sections = [{:value => 'title', :checked => true}]
@@ -794,7 +768,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -794,7 +768,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
794 768
795 should 'not escape abstract html of articles' do 769 should 'not escape abstract html of articles' do
796 profile = create_user('testuser').person 770 profile = create_user('testuser').person
797 - a1 = fast_create(TextileArticle, abstract: "<p class='test-article-abstract'>Test</p>", name: 'test article 1', profile_id: profile.id, published_at: DateTime.current) 771 + a1 = fast_create(TextArticle, abstract: "<p class='test-article-abstract'>Test</p>", name: 'test article 1', profile_id: profile.id, published_at: DateTime.current)
798 772
799 block = DisplayContentBlock.new 773 block = DisplayContentBlock.new
800 block.sections = [{:value => 'abstract', :checked => true}] 774 block.sections = [{:value => 'abstract', :checked => true}]
@@ -807,7 +781,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -807,7 +781,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
807 781
808 should 'not raise if abstract of article is nil' do 782 should 'not raise if abstract of article is nil' do
809 profile = create_user('testuser').person 783 profile = create_user('testuser').person
810 - a1 = fast_create(TextileArticle, name: 'test article 1', profile_id: profile.id, published_at: DateTime.current) 784 + a1 = fast_create(TextArticle, name: 'test article 1', profile_id: profile.id, published_at: DateTime.current)
811 785
812 block = DisplayContentBlock.new 786 block = DisplayContentBlock.new
813 block.sections = [{:value => 'abstract', :checked => true}] 787 block.sections = [{:value => 'abstract', :checked => true}]
@@ -823,7 +797,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -823,7 +797,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
823 797
824 should 'not escape body html of articles' do 798 should 'not escape body html of articles' do
825 profile = create_user('testuser').person 799 profile = create_user('testuser').person
826 - a1 = fast_create(TextileArticle, body: "<p class='test-article-body'>Test</p>", name: 'test article 1', profile_id: profile.id, published_at: DateTime.current) 800 + a1 = fast_create(TextArticle, body: "<p class='test-article-body'>Test</p>", name: 'test article 1', profile_id: profile.id, published_at: DateTime.current)
827 801
828 block = DisplayContentBlock.new 802 block = DisplayContentBlock.new
829 block.sections = [{:value => 'body', :checked => true}] 803 block.sections = [{:value => 'body', :checked => true}]
@@ -836,7 +810,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase @@ -836,7 +810,7 @@ class DisplayContentBlockViewTest &lt; ActionView::TestCase
836 810
837 should 'not raise if body of article is nil' do 811 should 'not raise if body of article is nil' do
838 profile = create_user('testuser').person 812 profile = create_user('testuser').person
839 - a1 = fast_create(TextileArticle, name: 'test article 1', profile_id: profile.id, published_at: DateTime.current) 813 + a1 = fast_create(TextArticle, name: 'test article 1', profile_id: profile.id, published_at: DateTime.current)
840 814
841 block = DisplayContentBlock.new 815 block = DisplayContentBlock.new
842 block.sections = [{:value => 'abstract', :checked => true}] 816 block.sections = [{:value => 'abstract', :checked => true}]
plugins/fb_app/views/fb_app_plugin_page_tab/_configure_form.html.slim
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 = f.text_field :title, class: 'form-control' 15 = f.text_field :title, class: 'form-control'
16 16
17 = f.label :subtitle, t("fb_app_plugin.views.myprofile.catalogs.catalog_subtitle_label") 17 = f.label :subtitle, t("fb_app_plugin.views.myprofile.catalogs.catalog_subtitle_label")
18 - = f.text_area :subtitle, class: 'form-control mceEditor', id: "page-tab-subtitle-#{page_tab.id}" 18 + = f.text_area :subtitle, class: 'form-control ' + current_editor, id: "page-tab-subtitle-#{page_tab.id}"
19 19
20 = f.label :config_type, t("fb_app_plugin.views.myprofile.catalogs.catalog_type_chooser_label") 20 = f.label :config_type, t("fb_app_plugin.views.myprofile.catalogs.catalog_type_chooser_label")
21 = f.select :config_type, 21 = f.select :config_type,
plugins/mark_comment_as_read/test/functional/mark_comment_as_read_plugin_profile_controller_test.rb
@@ -6,7 +6,7 @@ class MarkCommentAsReadPluginProfileControllerTest &lt; ActionController::TestCase @@ -6,7 +6,7 @@ class MarkCommentAsReadPluginProfileControllerTest &lt; ActionController::TestCase
6 @controller = MarkCommentAsReadPluginProfileController.new 6 @controller = MarkCommentAsReadPluginProfileController.new
7 7
8 @profile = create_user('profile').person 8 @profile = create_user('profile').person
9 - @article = TinyMceArticle.create!(:profile => @profile, :name => 'An article') 9 + @article = TextArticle.create!(:profile => @profile, :name => 'An article')
10 @comment = Comment.new(:source => @article, :author => @profile, :body => 'test') 10 @comment = Comment.new(:source => @article, :author => @profile, :body => 'test')
11 @comment.save! 11 @comment.save!
12 login_as(@profile.identifier) 12 login_as(@profile.identifier)
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb
@@ -4,7 +4,7 @@ class MarkCommentAsReadPlugin::CommentTest &lt; ActiveSupport::TestCase @@ -4,7 +4,7 @@ class MarkCommentAsReadPlugin::CommentTest &lt; ActiveSupport::TestCase
4 4
5 def setup 5 def setup
6 @person = create_user('user').person 6 @person = create_user('user').person
7 - @article = TinyMceArticle.create!(:profile => @person, :name => 'An article') 7 + @article = TextArticle.create!(:profile => @person, :name => 'An article')
8 @comment = Comment.create!(:title => 'title', :body => 'body', :author => @person, :source => @article) 8 @comment = Comment.create!(:title => 'title', :body => 'body', :author => @person, :source => @article)
9 end 9 end
10 10
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb
@@ -5,7 +5,7 @@ class MarkCommentAsReadPluginTest &lt; ActionView::TestCase @@ -5,7 +5,7 @@ class MarkCommentAsReadPluginTest &lt; ActionView::TestCase
5 def setup 5 def setup
6 @plugin = MarkCommentAsReadPlugin.new 6 @plugin = MarkCommentAsReadPlugin.new
7 @person = create_user('user').person 7 @person = create_user('user').person
8 - @article = TinyMceArticle.create!(:profile => @person, :name => 'An article') 8 + @article = TextArticle.create!(:profile => @person, :name => 'An article')
9 @comment = Comment.create!(:source => @article, :author => @person, :body => 'test') 9 @comment = Comment.create!(:source => @article, :author => @person, :body => 'test')
10 self.stubs(:user).returns(@person) 10 self.stubs(:user).returns(@person)
11 self.stubs(:profile).returns(@person) 11 self.stubs(:profile).returns(@person)
plugins/metadata/test/functional/content_viewer_controller_test.rb
@@ -21,7 +21,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -21,7 +21,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
21 end 21 end
22 22
23 should 'add meta tags with article info' do 23 should 'add meta tags with article info' do
24 - a = TinyMceArticle.create(name: 'Article to be shared', body: '<p>This article should be shared with all social networks</p>', profile: profile) 24 + a = TextArticle.create(name: 'Article to be shared', body: '<p>This article should be shared with all social networks</p>', profile: profile)
25 25
26 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] 26 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ]
27 27
@@ -37,7 +37,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -37,7 +37,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
37 end 37 end
38 38
39 should 'add meta tags with article images' do 39 should 'add meta tags with article images' do
40 - a = TinyMceArticle.create(name: 'Article to be shared with images', body: 'This article should be shared with all social networks <img src="/images/x.png" />', profile: profile) 40 + a = TextArticle.create(name: 'Article to be shared with images', body: 'This article should be shared with all social networks <img src="/images/x.png" />', profile: profile)
41 41
42 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] 42 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ]
43 assert_tag tag: 'meta', attributes: { name: 'twitter:image', content: /\/images\/x.png/ } 43 assert_tag tag: 'meta', attributes: { name: 'twitter:image', content: /\/images\/x.png/ }
@@ -45,7 +45,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -45,7 +45,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
45 end 45 end
46 46
47 should 'escape utf8 characters correctly' do 47 should 'escape utf8 characters correctly' do
48 - a = TinyMceArticle.create(name: 'Article to be shared with images', body: 'This article should be shared with all social networks <img src="/images/ç.png" />', profile: profile) 48 + a = TextArticle.create(name: 'Article to be shared with images', body: 'This article should be shared with all social networks <img src="/images/ç.png" />', profile: profile)
49 49
50 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] 50 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ]
51 assert_tag tag: 'meta', attributes: { property: 'og:image', content: /\/images\/%C3%A7.png/ } 51 assert_tag tag: 'meta', attributes: { property: 'og:image', content: /\/images\/%C3%A7.png/ }
@@ -63,7 +63,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -63,7 +63,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
63 63
64 should 'not expose metadata on private pages' do 64 should 'not expose metadata on private pages' do
65 profile.update_column :public_profile, false 65 profile.update_column :public_profile, false
66 - a = TinyMceArticle.create(name: 'Article to be shared with images', body: 'This article should be shared with all social networks <img src="/images/x.png" />', profile: profile) 66 + a = TextArticle.create(name: 'Article to be shared with images', body: 'This article should be shared with all social networks <img src="/images/x.png" />', profile: profile)
67 67
68 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] 68 get :view_page, profile: profile.identifier, page: [ a.name.to_slug ]
69 assert_no_tag tag: 'meta', attributes: { property: 'og:image', content: /\/images\/x.png/ } 69 assert_no_tag tag: 'meta', attributes: { property: 'og:image', content: /\/images\/x.png/ }
plugins/newsletter/test/integration/safe_strings_test.rb
@@ -10,7 +10,7 @@ class NewsletterPluginSafeStringsTest &lt; ActionDispatch::IntegrationTest @@ -10,7 +10,7 @@ class NewsletterPluginSafeStringsTest &lt; ActionDispatch::IntegrationTest
10 environment.add_admin(person) 10 environment.add_admin(person)
11 11
12 blog = fast_create(Blog, :profile_id => person.id) 12 blog = fast_create(Blog, :profile_id => person.id)
13 - post = fast_create(TextileArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test') 13 + post = fast_create(TextArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
14 newsletter = NewsletterPlugin::Newsletter.create!(:environment => environment, :person => person, :enabled => true) 14 newsletter = NewsletterPlugin::Newsletter.create!(:environment => environment, :person => person, :enabled => true)
15 newsletter.blog_ids = [blog.id] 15 newsletter.blog_ids = [blog.id]
16 newsletter.save! 16 newsletter.save!
plugins/newsletter/test/unit/newsletter_plugin_moderate_newsletter_test.rb
@@ -28,9 +28,9 @@ class NewsletterPluginModerateNewsletterTest &lt; ActiveSupport::TestCase @@ -28,9 +28,9 @@ class NewsletterPluginModerateNewsletterTest &lt; ActiveSupport::TestCase
28 should 'set posts for mailing body on perform' do 28 should 'set posts for mailing body on perform' do
29 person = create_user('john').person 29 person = create_user('john').person
30 blog = fast_create(Blog, profile_id: person.id) 30 blog = fast_create(Blog, profile_id: person.id)
31 - post_1 = fast_create(TextileArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')  
32 - post_2 = fast_create(TextileArticle, :name => 'Second post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')  
33 - post_3 = fast_create(TextileArticle, :name => 'Third post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test') 31 + post_1 = fast_create(TextArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
  32 + post_2 = fast_create(TextArticle, :name => 'Second post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
  33 + post_3 = fast_create(TextArticle, :name => 'Third post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
34 34
35 newsletter = NewsletterPlugin::Newsletter.create!(:environment => person.environment, :person => person, :enabled => true) 35 newsletter = NewsletterPlugin::Newsletter.create!(:environment => person.environment, :person => person, :enabled => true)
36 newsletter.blog_ids = [blog.id] 36 newsletter.blog_ids = [blog.id]
plugins/newsletter/test/unit/newsletter_plugin_newsletter_test.rb
@@ -381,9 +381,9 @@ EOS @@ -381,9 +381,9 @@ EOS
381 person = fast_create(Person) 381 person = fast_create(Person)
382 blog = fast_create(Blog, profile_id: person.id) 382 blog = fast_create(Blog, profile_id: person.id)
383 383
384 - post_1 = fast_create(TextileArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')  
385 - post_2 = fast_create(TextileArticle, :name => 'Second post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')  
386 - post_3 = fast_create(TextileArticle, :name => 'Third post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test') 384 + post_1 = fast_create(TextArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
  385 + post_2 = fast_create(TextArticle, :name => 'Second post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
  386 + post_3 = fast_create(TextArticle, :name => 'Third post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
387 387
388 newsletter = NewsletterPlugin::Newsletter.create!( 388 newsletter = NewsletterPlugin::Newsletter.create!(
389 :environment => person.environment, 389 :environment => person.environment,
@@ -397,9 +397,9 @@ EOS @@ -397,9 +397,9 @@ EOS
397 person = fast_create(Person) 397 person = fast_create(Person)
398 blog = fast_create(Blog, profile_id: person.id) 398 blog = fast_create(Blog, profile_id: person.id)
399 399
400 - post_1 = fast_create(TextileArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')  
401 - post_2 = fast_create(TextileArticle, :name => 'Second post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')  
402 - post_3 = fast_create(TextileArticle, :name => 'Third post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test') 400 + post_1 = fast_create(TextArticle, :name => 'First post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
  401 + post_2 = fast_create(TextArticle, :name => 'Second post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
  402 + post_3 = fast_create(TextArticle, :name => 'Third post', :profile_id => person.id, :parent_id => blog.id, :body => 'Test')
403 403
404 newsletter = NewsletterPlugin::Newsletter.create!( 404 newsletter = NewsletterPlugin::Newsletter.create!(
405 :environment => person.environment, 405 :environment => person.environment,
plugins/newsletter/views/newsletter_plugin_admin/index.html.erb
1 <h1><%= _('Newsletter settings') %></h1> 1 <h1><%= _('Newsletter settings') %></h1>
2 2
3 -<%= render :file => 'shared/tiny_mce' %>  
4 -  
5 <%= error_messages_for :newsletter %> 3 <%= error_messages_for :newsletter %>
6 4
7 <%= form_for(:newsletter, html: { multipart: true }) do |f| %> 5 <%= form_for(:newsletter, html: { multipart: true }) do |f| %>
@@ -81,7 +79,7 @@ @@ -81,7 +79,7 @@
81 content_tag('h3', ui_icon('ui-icon-triangle-1-s') + 79 content_tag('h3', ui_icon('ui-icon-triangle-1-s') +
82 _('Newsletter footer'), :class => 'newsletter-toggle-link', :element_id => '#newsletter-footer-field'), 80 _('Newsletter footer'), :class => 'newsletter-toggle-link', :element_id => '#newsletter-footer-field'),
83 content_tag('div', 81 content_tag('div',
84 - f.text_area(:footer, :style => 'width: 100%', :class => 'mceEditor'), 82 + f.text_area(:footer, :style => 'width: 100%', :class => current_editor),
85 :id => 'newsletter-footer-field' 83 :id => 'newsletter-footer-field'
86 )) 84 ))
87 %> 85 %>
plugins/open_graph/test/unit/open_graph_graph/publisher_test.rb
@@ -51,7 +51,7 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase @@ -51,7 +51,7 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase
51 user = User.current.person 51 user = User.current.person
52 52
53 blog = Blog.create! profile: user, name: 'blog' 53 blog = Blog.create! profile: user, name: 'blog'
54 - blog_post = TinyMceArticle.create! profile: user, parent: blog, name: 'blah', author: user 54 + blog_post = TextArticle.create! profile: user, parent: blog, name: 'blah', author: user
55 assert_last_activity user, :create_an_article, url_for(blog_post) 55 assert_last_activity user, :create_an_article, url_for(blog_post)
56 56
57 gallery = Gallery.create! name: 'gallery', profile: user 57 gallery = Gallery.create! name: 'gallery', profile: user
@@ -65,7 +65,7 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase @@ -65,7 +65,7 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase
65 assert_last_activity user, :create_an_event, url_for(event) 65 assert_last_activity user, :create_an_event, url_for(event)
66 66
67 forum = Forum.create! name: 'forum', profile: user 67 forum = Forum.create! name: 'forum', profile: user
68 - topic = TinyMceArticle.create! profile: user, parent: forum, name: 'blah2', author: user 68 + topic = TextArticle.create! profile: user, parent: forum, name: 'blah2', author: user
69 assert_last_activity user, :start_a_discussion, url_for(topic, topic.url.merge(og_type: MetadataPlugin.og_types[:forum])) 69 assert_last_activity user, :start_a_discussion, url_for(topic, topic.url.merge(og_type: MetadataPlugin.og_types[:forum]))
70 70
71 AddFriend.create!(person: user, friend: @other_actor).finish 71 AddFriend.create!(person: user, friend: @other_actor).finish
@@ -82,7 +82,7 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase @@ -82,7 +82,7 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase
82 User.current = @actor.user 82 User.current = @actor.user
83 user = User.current.person 83 user = User.current.person
84 84
85 - blog_post = TinyMceArticle.create! profile: @enterprise, parent: @enterprise.blog, name: 'blah', author: user 85 + blog_post = TextArticle.create! profile: @enterprise, parent: @enterprise.blog, name: 'blah', author: user
86 story = :announce_news_from_a_sse_initiative 86 story = :announce_news_from_a_sse_initiative
87 assert_last_activity user, story, passive_url_for(blog_post, nil, OpenGraphPlugin::Stories::Definitions[story]) 87 assert_last_activity user, story, passive_url_for(blog_post, nil, OpenGraphPlugin::Stories::Definitions[story])
88 88
@@ -91,13 +91,13 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase @@ -91,13 +91,13 @@ class OpenGraphPlugin::PublisherTest &lt; ActiveSupport::TestCase
91 user = User.current.person 91 user = User.current.person
92 92
93 # fan 93 # fan
94 - blog_post = TinyMceArticle.create! profile: @enterprise, parent: @enterprise.blog, name: 'blah2', author: user 94 + blog_post = TextArticle.create! profile: @enterprise, parent: @enterprise.blog, name: 'blah2', author: user
95 assert_last_activity user, :announce_news_from_a_sse_initiative, 'http://noosfero.net/coop/blog/blah2' 95 assert_last_activity user, :announce_news_from_a_sse_initiative, 'http://noosfero.net/coop/blog/blah2'
96 # member 96 # member
97 - blog_post = TinyMceArticle.create! profile: @myenterprise, parent: @myenterprise.blog, name: 'blah2', author: user 97 + blog_post = TextArticle.create! profile: @myenterprise, parent: @myenterprise.blog, name: 'blah2', author: user
98 assert_last_activity user, :announce_news_from_a_sse_initiative, 'http://noosfero.net/mycoop/blog/blah2' 98 assert_last_activity user, :announce_news_from_a_sse_initiative, 'http://noosfero.net/mycoop/blog/blah2'
99 99
100 - blog_post = TinyMceArticle.create! profile: @community, parent: @community.blog, name: 'blah', author: user 100 + blog_post = TextArticle.create! profile: @community, parent: @community.blog, name: 'blah', author: user
101 assert_last_activity user, :announce_news_from_a_community, 'http://noosfero.net/comm/blog/blah' 101 assert_last_activity user, :announce_news_from_a_community, 'http://noosfero.net/comm/blog/blah'
102 end 102 end
103 103
plugins/orders_cycle/views/orders_cycle_plugin_cycle/_edit_fields.html.slim
@@ -5,8 +5,7 @@ h3= t(&#39;views.cycle._edit_fields.general_settings&#39;) @@ -5,8 +5,7 @@ h3= t(&#39;views.cycle._edit_fields.general_settings&#39;)
5 = form_for @cycle, as: :cycle , remote: true, url: {action: @cycle.new? ? :new : :edit, id: @cycle.id }, html: {data: {loading: '#cycle-fields form'}} do |f| 5 = form_for @cycle, as: :cycle , remote: true, url: {action: @cycle.new? ? :new : :edit, id: @cycle.id }, html: {data: {loading: '#cycle-fields form'}} do |f|
6 6
7 = labelled_field f, :name, t('views.cycle._edit_fields.name'), f.text_field(:name), class: 'cycle-field-name' 7 = labelled_field f, :name, t('views.cycle._edit_fields.name'), f.text_field(:name), class: 'cycle-field-name'
8 - = labelled_field f, :description, t('views.cycle._edit_fields.description'), f.text_area(:description, class: 'mceEditor'), class: 'cycle-field-description'  
9 - = render file: 'shared/tiny_mce', locals: {mode: 'simple'} 8 + = labelled_field f, :description, t('views.cycle._edit_fields.description'), f.text_area(:description, class: current_editor('simple')), class: 'cycle-field-description'
10 9
11 .cycle-fields-block 10 .cycle-fields-block
12 = labelled_datetime_range_field f, :start, :finish, t('views.cycle._edit_fields.orders_interval'), class: 'cycle-orders-period' 11 = labelled_datetime_range_field f, :start, :finish, t('views.cycle._edit_fields.orders_interval'), class: 'cycle-orders-period'
plugins/products/views/products_plugin/page/_display_description.html.erb
1 <%= render :file => 'shared/tiny_mce', :locals => {:mode => 'simple'} %> 1 <%= render :file => 'shared/tiny_mce', :locals => {:mode => 'simple'} %>
2 <% if !@product.description.blank? %> 2 <% if !@product.description.blank? %>
3 <%= @product.description %> 3 <%= @product.description %>
4 - <%= edit_product_button_to_remote(@product, 'description', _('Edit description'), :title => _('Edit the description of your product and give consumers more information about what you are advertising')) %> 4 + <%= edit_product_button_to_remote(@product, 'description', _('Edit description'), {:title => _('Edit the description of your product and give consumers more information about what you are advertising'), :class => current_editor}) %>
5 <% else %> 5 <% else %>
6 <%= edit_product_ui_button_to_remote( 6 <%= edit_product_ui_button_to_remote(
7 @product, 7 @product,
plugins/products/views/products_plugin/page/_edit_description.html.erb
1 -<%= render file: 'shared/tiny_mce', locals: {mode: 'simple'} %>  
2 <%= remote_form_for(@product, 1 <%= remote_form_for(@product,
3 loading: "small_loading('product-description-form')", 2 loading: "small_loading('product-description-form')",
4 update: 'product-description', 3 update: 'product-description',
5 url: {controller: 'products_plugin/page', action: 'edit', id: @product, field: 'description'}, 4 url: {controller: 'products_plugin/page', action: 'edit', id: @product, field: 'description'},
6 html: {id: 'product-description-form', method: 'post'}) do |f| %> 5 html: {id: 'product-description-form', method: 'post'}) do |f| %>
7 6
8 - <%= labelled_form_field(_('Description:'), f.text_area(:description, rows: 15, style: 'width: 90%;', class: 'mceEditor')) %> 7 + <%= labelled_form_field(_('Description:'), f.text_area(:description, rows: 15, style: 'width: 90%;', class: current_editor('simple'))) %>
9 <%= button_bar do %> 8 <%= button_bar do %>
10 <%= submit_button :save, _('Save') %> 9 <%= submit_button :save, _('Save') %>
11 <%= cancel_edit_product_link(@product, 'description') %> 10 <%= cancel_edit_product_link(@product, 'description') %>
plugins/products/views/products_plugin/page/_form.html.erb
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 5
6 <%= display_form_field( _('Name:'), f.text_field(:name) ) %> 6 <%= display_form_field( _('Name:'), f.text_field(:name) ) %>
7 <%= display_form_field( _('Price:'), f.text_field(:price) ) %> 7 <%= display_form_field( _('Price:'), f.text_field(:price) ) %>
8 - <%= display_form_field( _('Description:'), f.text_area(:description, :rows => 10, :class => 'mceEditor') ) %> 8 + <%= display_form_field( _('Description:'), f.text_area(:description, :rows => 10, :class => current_editor('simples')) ) %>
9 <%= labelled_form_field(f.check_box(:highlighted) + _('Highlight this product'),'') %> 9 <%= labelled_form_field(f.check_box(:highlighted) + _('Highlight this product'),'') %>
10 <%= f.fields_for :image_builder, @product.image do |i| %> 10 <%= f.fields_for :image_builder, @product.image do |i| %>
11 <%= file_field_or_thumbnail(_('Image:'), @product.image, i) %> 11 <%= file_field_or_thumbnail(_('Image:'), @product.image, i) %>
plugins/profile_members_headlines/test/unit/profile_members_headlines_block_test.rb
@@ -42,7 +42,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase @@ -42,7 +42,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase
42 block = ProfileMembersHeadlinesBlock.create 42 block = ProfileMembersHeadlinesBlock.create
43 block.stubs(:owner).returns(community) 43 block.stubs(:owner).returns(community)
44 blog = fast_create(Blog, :profile_id => member1.id) 44 blog = fast_create(Blog, :profile_id => member1.id)
45 - post = fast_create(TinyMceArticle, :name => 'headlines', :profile_id => member1.id, :parent_id => blog.id) 45 + post = fast_create(TextArticle, :name => 'headlines', :profile_id => member1.id, :parent_id => blog.id)
46 self.expects(:render).with(:template => 'blocks/profile_members_headlines', :locals => { :block => block }).returns('file-with-authors-and-headlines') 46 self.expects(:render).with(:template => 'blocks/profile_members_headlines', :locals => { :block => block }).returns('file-with-authors-and-headlines')
47 assert_equal 'file-with-authors-and-headlines', render_block_content(block) 47 assert_equal 'file-with-authors-and-headlines', render_block_content(block)
48 end 48 end
@@ -53,7 +53,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase @@ -53,7 +53,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase
53 block = ProfileMembersHeadlinesBlock.new(:limit => 1, :filtered_roles => [role.id]) 53 block = ProfileMembersHeadlinesBlock.new(:limit => 1, :filtered_roles => [role.id])
54 block.expects(:owner).returns(community) 54 block.expects(:owner).returns(community)
55 blog = fast_create(Blog, :profile_id => member1.id) 55 blog = fast_create(Blog, :profile_id => member1.id)
56 - post = fast_create(TinyMceArticle, :name => 'headlines', :profile_id => member1.id, :parent_id => blog.id) 56 + post = fast_create(TextArticle, :name => 'headlines', :profile_id => member1.id, :parent_id => blog.id)
57 assert_equal [member1], block.authors_list 57 assert_equal [member1], block.authors_list
58 end 58 end
59 59
@@ -62,7 +62,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase @@ -62,7 +62,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase
62 block.expects(:owner).returns(community) 62 block.expects(:owner).returns(community)
63 private_author = fast_create(Person, :public_profile => false) 63 private_author = fast_create(Person, :public_profile => false)
64 blog = fast_create(Blog, :profile_id => private_author.id) 64 blog = fast_create(Blog, :profile_id => private_author.id)
65 - post = fast_create(TinyMceArticle, :name => 'headlines', :profile_id => private_author.id, :parent_id => blog.id) 65 + post = fast_create(TextArticle, :name => 'headlines', :profile_id => private_author.id, :parent_id => blog.id)
66 assert_equal [], block.authors_list 66 assert_equal [], block.authors_list
67 end 67 end
68 68
@@ -76,7 +76,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase @@ -76,7 +76,7 @@ class ProfileMembersHeadlinesBlockTest &lt; ActiveSupport::TestCase
76 block.stubs(:owner).returns(community) 76 block.stubs(:owner).returns(community)
77 community.members.each do |member| 77 community.members.each do |member|
78 blog = fast_create(Blog, :profile_id => member.id) 78 blog = fast_create(Blog, :profile_id => member.id)
79 - post = fast_create(TinyMceArticle, :name => 'headlines', :profile_id => member.id, :parent_id => blog.id) 79 + post = fast_create(TextArticle, :name => 'headlines', :profile_id => member.id, :parent_id => blog.id)
80 end 80 end
81 assert_equal [author], block.authors_list 81 assert_equal [author], block.authors_list
82 end 82 end
plugins/recent_content/lib/recent_content_block.rb
@@ -7,7 +7,7 @@ class RecentContentBlock &lt; Block @@ -7,7 +7,7 @@ class RecentContentBlock &lt; Block
7 7
8 attr_accessible :presentation_mode, :total_items, :show_blog_picture, :selected_folder 8 attr_accessible :presentation_mode, :total_items, :show_blog_picture, :selected_folder
9 9
10 - VALID_CONTENT = ['RawHTMLArticle', 'TextArticle', 'TextileArticle', 'TinyMceArticle'] 10 + VALID_CONTENT = ['TextArticle']
11 11
12 def self.description 12 def self.description
13 c_('Recent content') 13 c_('Recent content')
plugins/recent_content/test/unit/recent_content_block_test.rb
@@ -2,7 +2,7 @@ require_relative &#39;../test_helper&#39; @@ -2,7 +2,7 @@ require_relative &#39;../test_helper&#39;
2 class RecentContentBlockTest < ActiveSupport::TestCase 2 class RecentContentBlockTest < ActiveSupport::TestCase
3 3
4 INVALID_KIND_OF_ARTICLE = [RssFeed, UploadedFile, Gallery, Folder, Blog, Forum] 4 INVALID_KIND_OF_ARTICLE = [RssFeed, UploadedFile, Gallery, Folder, Blog, Forum]
5 - VALID_KIND_OF_ARTICLE = [RawHTMLArticle, TextArticle, TextileArticle, TinyMceArticle] 5 + VALID_KIND_OF_ARTICLE = [TextArticle]
6 6
7 should 'describe itself' do 7 should 'describe itself' do
8 assert_not_equal Block.description, RecentContentBlock.description 8 assert_not_equal Block.description, RecentContentBlock.description
@@ -61,9 +61,9 @@ class RecentContentBlockTest &lt; ActiveSupport::TestCase @@ -61,9 +61,9 @@ class RecentContentBlockTest &lt; ActiveSupport::TestCase
61 61
62 root = fast_create(Blog, :name => 'test-blog', :profile_id => profile.id) 62 root = fast_create(Blog, :name => 'test-blog', :profile_id => profile.id)
63 63
64 - a1 = fast_create(TextileArticle, :name => 'article #1', :profile_id => profile.id, :parent_id => root.id, :created_at => Time.now - 2.days)  
65 - a2 = fast_create(TextileArticle, :name => 'article #2', :profile_id => profile.id, :parent_id => root.id, :created_at => Time.now - 1.days)  
66 - a3 = fast_create(TextileArticle, :name => 'article #3', :profile_id => profile.id, :parent_id => root.id, :created_at => Time.now) 64 + a1 = fast_create(TextArticle, :name => 'article #1', :profile_id => profile.id, :parent_id => root.id, :created_at => Time.now - 2.days)
  65 + a2 = fast_create(TextArticle, :name => 'article #2', :profile_id => profile.id, :parent_id => root.id, :created_at => Time.now - 1.days)
  66 + a3 = fast_create(TextArticle, :name => 'article #3', :profile_id => profile.id, :parent_id => root.id, :created_at => Time.now)
67 67
68 block = RecentContentBlock.new 68 block = RecentContentBlock.new
69 block.stubs(:holder).returns(profile) 69 block.stubs(:holder).returns(profile)
plugins/relevant_content/test/unit/article.rb
@@ -29,9 +29,9 @@ class RelevantContentBlockTest &lt; ActiveSupport::TestCase @@ -29,9 +29,9 @@ class RelevantContentBlockTest &lt; ActiveSupport::TestCase
29 29
30 should 'list most commented articles' do 30 should 'list most commented articles' do
31 Article.delete_all 31 Article.delete_all
32 - a1 = create(TextileArticle, :name => "art 1", :profile_id => profile.id)  
33 - a2 = create(TextileArticle, :name => "art 2", :profile_id => profile.id)  
34 - a3 = create(TextileArticle, :name => "art 3", :profile_id => profile.id) 32 + a1 = create(TextArticle, :name => "art 1", :profile_id => profile.id)
  33 + a2 = create(TextArticle, :name => "art 2", :profile_id => profile.id)
  34 + a3 = create(TextArticle, :name => "art 3", :profile_id => profile.id)
35 35
36 2.times { Comment.create(:title => 'test', :body => 'asdsad', :author => profile, :source => a2).save! } 36 2.times { Comment.create(:title => 'test', :body => 'asdsad', :author => profile, :source => a2).save! }
37 4.times { Comment.create(:title => 'test', :body => 'asdsad', :author => profile, :source => a3).save! } 37 4.times { Comment.create(:title => 'test', :body => 'asdsad', :author => profile, :source => a3).save! }
plugins/send_email/doc/send_email.textile
@@ -4,7 +4,7 @@ Allows to send e-mails through an e-mail form. @@ -4,7 +4,7 @@ Allows to send e-mails through an e-mail form.
4 4
5 h2. Usage 5 h2. Usage
6 6
7 -* Create a HTML form using RawHTMLBlock or RawHTMLArticle that invokes the {sendemail} action 7 +* Create a HTML form using RawHTMLBlock that invokes the {sendemail} action
8 * Add a "to" and "message" field and a submit button 8 * Add a "to" and "message" field and a submit button
9 * Make sure to fill in allowed 'to' addresses in plugin settings 9 * Make sure to fill in allowed 'to' addresses in plugin settings
10 10
plugins/send_email/test/unit/send_email_plugin_test.rb
@@ -29,8 +29,7 @@ class SendEmailPluginTest &lt; ActiveSupport::TestCase @@ -29,8 +29,7 @@ class SendEmailPluginTest &lt; ActiveSupport::TestCase
29 should 'expand macro used on form on profile context' do 29 should 'expand macro used on form on profile context' do
30 profile = fast_create(Community) 30 profile = fast_create(Community)
31 @plugin.context.stubs(:profile).returns(profile) 31 @plugin.context.stubs(:profile).returns(profile)
32 - article = RawHTMLArticle.create!(:name => 'Raw HTML', :body => "<form action='{sendemail}'></form>", :profile => profile)  
33 - 32 + article = TextArticle.create!(:name => 'Text HTML', :body => "<form action='{sendemail}'></form>", :profile => profile, :editor => Article::Editor::RAW_HTML)
34 assert_match /profile\/#{profile.identifier}\/plugin\/send_email\/deliver/, @plugin.parse_content(article.to_html, nil).first 33 assert_match /profile\/#{profile.identifier}\/plugin\/send_email\/deliver/, @plugin.parse_content(article.to_html, nil).first
35 end 34 end
36 35
plugins/solr/lib/ext/article.rb
@@ -72,13 +72,7 @@ class Article @@ -72,13 +72,7 @@ class Article
72 end 72 end
73 73
74 def solr_plugin_f_type 74 def solr_plugin_f_type
75 - #join common types  
76 - case self.class.name  
77 - when 'TinyMceArticle', 'TextileArticle'  
78 - TextArticle.name  
79 - else  
80 - self.class.name  
81 - end 75 + self.class.name
82 end 76 end
83 77
84 def solr_plugin_f_profile_type 78 def solr_plugin_f_profile_type
@@ -111,8 +105,6 @@ class Article @@ -111,8 +105,6 @@ class Article
111 # see http://stackoverflow.com/questions/4138957/activerecordsubclassnotfound-error-when-using-sti-in-rails/4139245 105 # see http://stackoverflow.com/questions/4138957/activerecordsubclassnotfound-error-when-using-sti-in-rails/4139245
112 UploadedFile 106 UploadedFile
113 TextArticle 107 TextArticle
114 - TinyMceArticle  
115 - TextileArticle  
116 Folder 108 Folder
117 EnterpriseHomepage 109 EnterpriseHomepage
118 Gallery 110 Gallery