Commit 3b7fd632340227fbcb61f5154df09f43d47f331e
Exists in
staging
and in
3 other branches
Merge remote-tracking branch 'origin/master'
Showing
162 changed files
with
1006 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 | 107 | def post_article(asset, params) |
| 108 | 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 | 111 | return forbidden! unless klass_type.constantize <= Article |
| 112 | 112 | |
| 113 | 113 | article = klass_type.constantize.new(params[:article]) |
| ... | ... | @@ -461,11 +461,9 @@ module Api |
| 461 | 461 | |
| 462 | 462 | def parse_content_type(content_type) |
| 463 | 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 | 466 | end |
| 468 | - content_types.flatten.uniq | |
| 469 | 467 | end |
| 470 | 468 | |
| 471 | 469 | def period(from_date, until_date) | ... | ... |
app/controllers/my_profile/cms_controller.rb
| ... | ... | @@ -151,6 +151,7 @@ class CmsController < MyProfileController |
| 151 | 151 | |
| 152 | 152 | @article.profile = profile |
| 153 | 153 | @article.author = user |
| 154 | + @article.editor = current_person.editor | |
| 154 | 155 | @article.last_changed_by = user |
| 155 | 156 | @article.created_by = user |
| 156 | 157 | |
| ... | ... | @@ -399,8 +400,7 @@ class CmsController < MyProfileController |
| 399 | 400 | |
| 400 | 401 | def available_article_types |
| 401 | 402 | articles = [ |
| 402 | - TinyMceArticle, | |
| 403 | - TextileArticle, | |
| 403 | + TextArticle, | |
| 404 | 404 | Event |
| 405 | 405 | ] |
| 406 | 406 | articles += special_article_types if params && params[:cms] |
| ... | ... | @@ -408,9 +408,6 @@ class CmsController < MyProfileController |
| 408 | 408 | if @parent && @parent.blog? |
| 409 | 409 | articles -= Article.folder_types.map(&:constantize) |
| 410 | 410 | end |
| 411 | - if user.is_admin?(profile.environment) | |
| 412 | - articles << RawHTMLArticle | |
| 413 | - end | |
| 414 | 411 | articles |
| 415 | 412 | end |
| 416 | 413 | ... | ... |
app/controllers/my_profile/profile_editor_controller.rb
| ... | ... | @@ -92,7 +92,7 @@ class ProfileEditorController < MyProfileController |
| 92 | 92 | end |
| 93 | 93 | |
| 94 | 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 | 96 | if request.post? |
| 97 | 97 | begin |
| 98 | 98 | @welcome_page.update!(params[:welcome_page]) | ... | ... |
app/helpers/application_helper.rb
| ... | ... | @@ -109,10 +109,6 @@ module ApplicationHelper |
| 109 | 109 | content = capture(&block) |
| 110 | 110 | end |
| 111 | 111 | |
| 112 | - if options[:type] == :textile | |
| 113 | - content = RedCloth.new(content).to_html | |
| 114 | - end | |
| 115 | - | |
| 116 | 112 | options[:class] = '' if ! options[:class] |
| 117 | 113 | options[:class] += ' button icon-help' # with-text |
| 118 | 114 | |
| ... | ... | @@ -130,13 +126,6 @@ module ApplicationHelper |
| 130 | 126 | text |
| 131 | 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 | 129 | # TODO: do something more useful here |
| 141 | 130 | # TODO: test this helper |
| 142 | 131 | # TODO: add an icon? |
| ... | ... | @@ -1243,4 +1232,15 @@ module ApplicationHelper |
| 1243 | 1232 | content.html_safe |
| 1244 | 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 | 1246 | end | ... | ... |
app/helpers/profile_editor_helper.rb
app/helpers/tinymce_helper.rb
| ... | ... | @@ -18,7 +18,8 @@ module TinymceHelper |
| 18 | 18 | insertdatetime media nonbreaking save table contextmenu directionality |
| 19 | 19 | emoticons template paste textcolor colorpicker textpattern], |
| 20 | 20 | :image_advtab => true, |
| 21 | - :language => tinymce_language | |
| 21 | + :language => tinymce_language, | |
| 22 | + :selector => '.' + current_editor(options[:mode]) | |
| 22 | 23 | |
| 23 | 24 | options[:toolbar1] = toolbar1(options[:mode]) |
| 24 | 25 | options[:menubar] = menubar(options[:mode]) | ... | ... |
app/models/article.rb
| 1 | 1 | |
| 2 | 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 | 10 | include SanitizeHelper |
| 5 | 11 | |
| 6 | 12 | attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, |
| ... | ... | @@ -11,7 +17,7 @@ class Article < ApplicationRecord |
| 11 | 17 | :highlighted, :notify_comments, :display_hits, :slug, |
| 12 | 18 | :external_feed_builder, :display_versions, :external_link, |
| 13 | 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 | 22 | extend ActsAsHavingImage::ClassMethods |
| 17 | 23 | acts_as_having_image |
| ... | ... | @@ -518,17 +524,12 @@ class Article < ApplicationRecord |
| 518 | 524 | ['Folder', 'Blog', 'Forum', 'Gallery'] |
| 519 | 525 | end |
| 520 | 526 | |
| 521 | - def self.text_article_types | |
| 522 | - ['TextArticle', 'TextileArticle', 'TinyMceArticle'] | |
| 523 | - end | |
| 524 | - | |
| 525 | 527 | scope :published, -> { where 'articles.published = ?', true } |
| 526 | 528 | scope :folders, -> profile { where 'articles.type IN (?)', profile.folder_types } |
| 527 | 529 | scope :no_folders, -> profile { where 'articles.type NOT IN (?)', profile.folder_types } |
| 528 | 530 | scope :galleries, -> { where "articles.type IN ('Gallery')" } |
| 529 | 531 | scope :images, -> { where :is_image => true } |
| 530 | 532 | scope :no_images, -> { where :is_image => false } |
| 531 | - scope :text_articles, -> { where 'articles.type IN (?)', text_article_types } | |
| 532 | 533 | scope :files, -> { where :type => 'UploadedFile' } |
| 533 | 534 | scope :with_types, -> types { where 'articles.type IN (?)', types } |
| 534 | 535 | |
| ... | ... | @@ -711,10 +712,6 @@ class Article < ApplicationRecord |
| 711 | 712 | false |
| 712 | 713 | end |
| 713 | 714 | |
| 714 | - def tiny_mce? | |
| 715 | - false | |
| 716 | - end | |
| 717 | - | |
| 718 | 715 | def folder? |
| 719 | 716 | false |
| 720 | 717 | end |
| ... | ... | @@ -874,6 +871,10 @@ class Article < ApplicationRecord |
| 874 | 871 | true |
| 875 | 872 | end |
| 876 | 873 | |
| 874 | + def editor?(editor) | |
| 875 | + self.editor == editor | |
| 876 | + end | |
| 877 | + | |
| 877 | 878 | private |
| 878 | 879 | |
| 879 | 880 | def sanitize_tag_list | ... | ... |
app/models/event.rb
app/models/external_feed.rb
app/models/person.rb
| 1 | 1 | # A person is the profile of an user holding all relationships with the rest of the system |
| 2 | 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 | 6 | SEARCH_FILTERS = { |
| 7 | 7 | :order => %w[more_recent more_popular more_active], |
| ... | ... | @@ -341,6 +341,8 @@ class Person < Profile |
| 341 | 341 | |
| 342 | 342 | validates_associated :user |
| 343 | 343 | |
| 344 | + validates :editor, inclusion: { in: lambda { |p| p.available_editors } } | |
| 345 | + | |
| 344 | 346 | def email |
| 345 | 347 | self.user.nil? ? nil : self.user.email |
| 346 | 348 | end |
| ... | ... | @@ -613,8 +615,21 @@ class Person < Profile |
| 613 | 615 | Profile.followed_by self |
| 614 | 616 | end |
| 615 | 617 | |
| 618 | + def editor?(editor) | |
| 619 | + self.editor == editor | |
| 620 | + end | |
| 621 | + | |
| 616 | 622 | def in_social_circle?(person) |
| 617 | 623 | self.is_a_friend?(person) || super |
| 618 | 624 | end |
| 619 | 625 | |
| 626 | + def available_editors | |
| 627 | + available_editors = { | |
| 628 | + Article::Editor::TINY_MCE => _('TinyMCE'), | |
| 629 | + Article::Editor::TEXTILE => _('Textile') | |
| 630 | + } | |
| 631 | + available_editors.merge!({Article::Editor::RAW_HTML => _('Raw HTML')}) if self.is_admin? | |
| 632 | + available_editors | |
| 633 | + end | |
| 634 | + | |
| 620 | 635 | end | ... | ... |
app/models/raw_html_article.rb
| ... | ... | @@ -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
app/models/text_article.rb
| 1 | 1 | # a base class for all text article types. |
| 2 | 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 | 20 | def self.type_name |
| 7 | 21 | _('Article') |
| ... | ... | @@ -21,6 +35,18 @@ class TextArticle < Article |
| 21 | 35 | true |
| 22 | 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 | 50 | before_save :set_relative_path |
| 25 | 51 | |
| 26 | 52 | def set_relative_path |
| ... | ... | @@ -43,4 +69,24 @@ class TextArticle < Article |
| 43 | 69 | parent && parent.kind_of?(Blog) && parent.display_preview |
| 44 | 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 | 92 | end | ... | ... |
app/models/textile_article.rb
| ... | ... | @@ -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 | -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 | 2 | <%= _('This text will be shown to the user on the top of the sign up form.') %> |
| 3 | 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 | 1 | <div class='description'> |
| 2 | 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 | 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 | 6 | <div class='description'> |
| 7 | 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 | </div> |
| 5 | 5 | |
| 6 | 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 | 31 | <%= balanced_table(fields)%> |
| 32 | 32 | |
| 33 | 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
app/views/admin_panel/message_for_disabled_enterprise.html.erb
| 1 | 1 | <h2><%= _('Site info') %></h2> |
| 2 | 2 | |
| 3 | -<%= render :file => 'shared/tiny_mce' %> | |
| 4 | - | |
| 5 | 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 | 7 | <%= button_bar do %> |
| 10 | 8 | <%= submit_button(:save, _('Save')) %> | ... | ... |
app/views/admin_panel/site_info.html.erb
app/views/cms/_article.html.erb
app/views/cms/_blog.html.erb
| ... | ... | @@ -2,8 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | <h1><%= _('My Blog') %></h1> |
| 4 | 4 | |
| 5 | -<%= render :file => 'shared/tiny_mce' %> | |
| 6 | - | |
| 7 | 5 | <%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %> |
| 8 | 6 | |
| 9 | 7 | <%= render :partial => 'general_fields' %> |
| ... | ... | @@ -53,7 +51,7 @@ |
| 53 | 51 | %> |
| 54 | 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 | 56 | <div id="blog-image-builder"> |
| 59 | 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 | 1 | <%= required_fields_message %> |
| 2 | 2 | |
| 3 | -<%# TODO add Textile help here %> | |
| 4 | -<%= render :file => 'shared/tiny_mce' %> | |
| 5 | - | |
| 6 | 3 | <%= required f.text_field('name', :size => '64', :maxlength => 150) %> |
| 7 | 4 | |
| 8 | 5 | <%= render :partial => 'general_fields' %> |
| ... | ... | @@ -15,4 +12,4 @@ |
| 15 | 12 | |
| 16 | 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 | 4 | |
| 5 | 5 | <%= required_fields_message %> |
| 6 | 6 | |
| 7 | -<%= render :file => 'shared/tiny_mce' %> | |
| 8 | - | |
| 9 | 7 | <%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %> |
| 10 | 8 | |
| 11 | 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 | 13 | <%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, Forum.posts_per_page_options)) %> |
| 16 | 14 | |
| 17 | 15 | <%= labelled_form_field(_('Has terms of use:'), check_box(:article, :has_terms_of_use))%> |
| 18 | 16 | |
| 19 | 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 | 19 | </div> | ... | ... |
app/views/cms/_raw_html_article.html.erb
| ... | ... | @@ -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' %> |
| ... | ... | @@ -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 | |
| 8 | 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 | 11 | <div class='text-editor-sidebar-box' id='media-upload-box'> |
| 12 | 12 | <div id='media-upload-form'> |
| 13 | 13 | <%= form_tag({ :action => 'media_upload' }, :multipart => true) do %> | ... | ... |
app/views/cms/_textile_article.html.erb
| ... | ... | @@ -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 | -<%= 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 | 2 | |
| 3 | 3 | <%= required_fields_message %> |
| 4 | 4 | |
| 5 | -<%= render :file => 'shared/tiny_mce' %> | |
| 6 | - | |
| 7 | 5 | <%= labelled_form_for 'task' do |f| %> |
| 8 | 6 | |
| 9 | 7 | <%= required labelled_form_field(_('Title'), text_field('task[article]', 'name', :size => 50)) %> |
| ... | ... | @@ -17,7 +15,7 @@ |
| 17 | 15 | <%= required labelled_form_field(_('Email'), text_field(:task, 'email')) %> |
| 18 | 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 | 20 | <%= hidden_field_tag('back_to', @back_to) %> |
| 23 | 21 | ... | ... |
app/views/contact/new.html.erb
| ... | ... | @@ -25,8 +25,7 @@ |
| 25 | 25 | |
| 26 | 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 | 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 | 19 | <%= @template_params_allowed %> |
| 20 | 20 | </div> |
| 21 | 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 | 23 | </div> |
| 25 | 24 | |
| 26 | 25 | <div class="actions"> | ... | ... |
app/views/layouts/application-ng.html.erb
| ... | ... | @@ -35,6 +35,9 @@ |
| 35 | 35 | noosfero.profile = <%= (@profile.identifier if @profile).to_json.html_safe %> |
| 36 | 36 | </script> |
| 37 | 37 | |
| 38 | + <% if current_editor_is?(Article::Editor::TINY_MCE) %> | |
| 39 | + <%= render :file => 'shared/tiny_mce' %> | |
| 40 | + <% end %> | |
| 38 | 41 | </head> |
| 39 | 42 | <body class="<%= h body_classes %>"> |
| 40 | 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 | 16 | |
| 17 | 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 | 21 | <%= submit_button(:send, _('Send')) %> |
| 23 | 22 | <%= button :cancel, _('Cancel e-mail'), :back %> | ... | ... |
app/views/profile_editor/_person.html.erb
| ... | ... | @@ -16,6 +16,8 @@ |
| 16 | 16 | </div> |
| 17 | 17 | </div> |
| 18 | 18 | |
| 19 | + <%= select_editor(_('Editor'), 'profile_data', 'editor', {}) %> | |
| 20 | + | |
| 19 | 21 | <%= safe_join(@plugins.dispatch(:profile_info_extra_contents).collect { |content| instance_exec(&content) }, "") %> |
| 20 | 22 | |
| 21 | 23 | <div class="formfieldline"> | ... | ... |
app/views/profile_editor/header_footer.html.erb
| 1 | -<%= render :file => 'shared/tiny_mce' %> | |
| 2 | - | |
| 3 | 1 | <h1><%= _('Editing header and footer') %></h1> |
| 4 | 2 | |
| 5 | 3 | <%= form_tag do %> |
| ... | ... | @@ -21,9 +19,9 @@ |
| 21 | 19 | </div> |
| 22 | 20 | <% end %> |
| 23 | 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 | 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 | 25 | <%= button_bar do %> |
| 28 | 26 | <%= submit_button(:save, _('Save')) %> |
| 29 | 27 | <%= button(:cancel, _('Cancel'), :action => 'index') %> | ... | ... |
app/views/profile_editor/welcome_page.html.erb
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | <%= _('Your welcome page will only be displayed if this options is selected.') %> |
| 9 | 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 | 12 | <div class='explanation'> |
| 13 | 13 | <%= _('This page will be displayed to the user after his signup with this template.') %> |
| 14 | 14 | </div> |
| ... | ... | @@ -17,5 +17,3 @@ |
| 17 | 17 | <%= submit_button('save', _('Save'), :cancel => @back_to) %> |
| 18 | 18 | <% end %> |
| 19 | 19 | <% end %> |
| 20 | - | |
| 21 | -<%= render :file => 'shared/tiny_mce' %> | ... | ... |
app/views/shared/_lead_and_body.html.erb
app/views/shared/tiny_mce.html.erb
| ... | ... | @@ -47,7 +47,9 @@ function tinymce_macros_setup(editor) { |
| 47 | 47 | tinymce.PluginManager.add('macrosPlugin', tinymce.plugins.MacrosPlugin); |
| 48 | 48 | |
| 49 | 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 | 54 | </script> |
| 53 | 55 | ... | ... |
app/views/tasks/_approve_article_accept_details.html.erb
| 1 | 1 | <%= task_email_template(_('Select an acceptance email template:'), @acceptance_email_templates, task) %> |
| 2 | 2 | |
| 3 | -<%= render :file => 'shared/tiny_mce' %> | |
| 4 | - | |
| 5 | 3 | <%= labelled_form_field(_('Create a link'), f.check_box(:create_link)) %> |
| 6 | 4 | |
| 7 | 5 | <%= labelled_form_field(_('Name for publishing'), f.text_field(:name)) %> |
| 8 | 6 | <%= select_profile_folder(_('Select the folder where the article must be published'), "tasks[#{task.id}][task][article_parent_id]", task.target) %> |
| 9 | 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 | 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 | 1 | <% unless task.requestor %> |
| 4 | 2 | <%= labelled_form_field(_("Sent by: "), f.text_field(:name)) %> |
| 5 | 3 | <p><%= label_tag(_("Email: %s") % task.email) %> </p> |
| ... | ... | @@ -14,5 +12,5 @@ |
| 14 | 12 | <%= labelled_form_field(_('Highlight this article'), a.check_box(:highlighted)) %> |
| 15 | 13 | |
| 16 | 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 | 16 | <% end %> | ... | ... |
app/views/users/send_mail.html.erb
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | <%= error_messages_for :mailing %> |
| 4 | 4 | |
| 5 | -<%= render :file => 'shared/tiny_mce' %> | |
| 6 | 5 | <%= form_for :mailing do |f| %> |
| 7 | 6 | <div class="recipients"> |
| 8 | 7 | <%= label_tag(_("Recipients: "), nil, { class: "formlabel" }) %> |
| ... | ... | @@ -14,7 +13,7 @@ |
| 14 | 13 | </div> |
| 15 | 14 | </div> |
| 16 | 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 | 17 | <%= submit_button(:send, _('Send')) %> |
| 19 | 18 | <%= button :cancel, _('Cancel e-mail'), :controller => 'users' %> |
| 20 | 19 | <% end %> | ... | ... |
db/migrate/20160809123835_add_people_and_article_editor.rb
0 → 100644
| ... | ... | @@ -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 | ... | ... |
db/schema.rb
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | # |
| 12 | 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 | 16 | # These are extensions that must be enabled in order to support this database |
| 17 | 17 | enable_extension "plpgsql" |
| ... | ... | @@ -168,6 +168,7 @@ ActiveRecord::Schema.define(version: 20160705162914) do |
| 168 | 168 | t.boolean "show_to_followers", default: true |
| 169 | 169 | t.integer "followers_count", default: 0 |
| 170 | 170 | t.boolean "archived", default: false |
| 171 | + t.string "editor", default: "tiny_mce", null: false | |
| 171 | 172 | end |
| 172 | 173 | |
| 173 | 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 | 632 | t.boolean "is_template", default: false |
| 632 | 633 | t.integer "template_id" |
| 633 | 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 | 638 | t.string "personal_website" |
| 638 | 639 | t.string "jabber_id" |
| 639 | 640 | t.integer "welcome_page_id" |
| 640 | 641 | t.boolean "allow_members_to_invite", default: true |
| 641 | 642 | t.boolean "invite_friends_only", default: false |
| 642 | 643 | t.boolean "secret", default: false |
| 644 | + t.string "editor", default: "tiny_mce", null: false | |
| 643 | 645 | end |
| 644 | 646 | |
| 645 | 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 | 155 | Given I am on joaosilva's control panel |
| 156 | 156 | And I follow "Manage Content" |
| 157 | 157 | And I follow "New content" |
| 158 | - When I follow "Text article with Textile markup language" | |
| 158 | + When I follow "Text article" | |
| 159 | 159 | Then I should see "Tag list" |
| 160 | 160 | When I fill in "Title" with "Article with tags" |
| 161 | 161 | And I fill in "Tag list" with "aurium, bug" |
| ... | ... | @@ -168,7 +168,7 @@ Feature: edit article |
| 168 | 168 | Given I am on joaosilva's control panel |
| 169 | 169 | And I follow "Manage Content" |
| 170 | 170 | When I follow "New content" |
| 171 | - When I follow "Text article with visual editor" | |
| 171 | + When I follow "Text article" | |
| 172 | 172 | And I fill in "Title" with "My Article" |
| 173 | 173 | And I press "Save" |
| 174 | 174 | Then I should see "My Article" |
| ... | ... | @@ -203,8 +203,8 @@ Feature: edit article |
| 203 | 203 | And I press "Save" |
| 204 | 204 | Then I should be on /joaosilva/my-folder |
| 205 | 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 | 208 | And I fill in "Title" with "My Article" |
| 209 | 209 | And I press "Save" |
| 210 | 210 | Then I should see "My Article" |
| ... | ... | @@ -222,12 +222,11 @@ Feature: edit article |
| 222 | 222 | And I press "Save" |
| 223 | 223 | Then I should be on /joaosilva/my-folder |
| 224 | 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 | 227 | And I follow "Cancel" within ".no-boxes" |
| 228 | 228 | Then I should be on /joaosilva/my-folder |
| 229 | 229 | |
| 230 | - @selenium | |
| 231 | 230 | Scenario: save and continue |
| 232 | 231 | Given I am on /joaosilva/save-the-whales |
| 233 | 232 | And I follow "Edit" |
| ... | ... | @@ -240,8 +239,8 @@ Feature: edit article |
| 240 | 239 | Given I am on joaosilva's control panel |
| 241 | 240 | When I follow "Manage Content" |
| 242 | 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 | 244 | And I fill in "Title" with "My new article" |
| 246 | 245 | And I fill in "Text" with "text for the new article" |
| 247 | 246 | And I press "Save and continue" |
| ... | ... | @@ -287,7 +286,7 @@ Feature: edit article |
| 287 | 286 | Given I am on joaosilva's control panel |
| 288 | 287 | And I follow "Manage Content" |
| 289 | 288 | And I follow "New content" |
| 290 | - When I follow "Text article with visual editor" | |
| 289 | + When I follow "Text article" | |
| 291 | 290 | And I fill in "Title" with "My time testing Article" |
| 292 | 291 | And I fill in "Publish date" with "1980-11-15 20:37" |
| 293 | 292 | And I press "Save" | ... | ... |
features/forum.feature
| ... | ... | @@ -99,8 +99,8 @@ Feature: forum |
| 99 | 99 | And I check "Has terms of use:" |
| 100 | 100 | And I press "Save" |
| 101 | 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 | 104 | And I fill in "Title" with "Topic" |
| 105 | 105 | And I press "Save" |
| 106 | 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 | 8 | | joaosilva | Joao Silva | |
| 9 | 9 | And feature "media_panel" is enabled on environment |
| 10 | 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 | 13 | Scenario: see media panel collapsed |
| 14 | 14 | Then I should see "Insert media" |
| ... | ... | @@ -123,7 +123,7 @@ Feature: uploads items on media panel |
| 123 | 123 | Given the following files |
| 124 | 124 | | owner | file | mime | |
| 125 | 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 | 127 | And I follow "Show/Hide" |
| 128 | 128 | And I select "Recent media" from "parent_id" within "#published-media" |
| 129 | 129 | Then I should see div with title "other-pic.jpg" within ".items" |
| ... | ... | @@ -148,7 +148,7 @@ Feature: uploads items on media panel |
| 148 | 148 | | owner | file | mime | parent | |
| 149 | 149 | | joaosilva | rails.png | image/png | other-gallery | |
| 150 | 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 | 152 | And I follow "Show/Hide" |
| 153 | 153 | And I select "joaosilva/Gallery" from "parent_id" within "#published-media" |
| 154 | 154 | Then I should see div with title "other-pic.jpg" within ".items" |
| ... | ... | @@ -165,7 +165,7 @@ Feature: uploads items on media panel |
| 165 | 165 | And the following files |
| 166 | 166 | | owner | file | mime | parent | |
| 167 | 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 | 169 | And I follow "Show/Hide" |
| 170 | 170 | And I select "joaosilva/Gallery" from "parent_id" within "#published-media" |
| 171 | 171 | And I select "joaosilva/Gallery" from "parent_id" within "#media-upload-form" |
| ... | ... | @@ -187,7 +187,7 @@ Feature: uploads items on media panel |
| 187 | 187 | And the following files |
| 188 | 188 | | owner | file | mime | parent | |
| 189 | 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 | 191 | And I follow "Show/Hide" |
| 192 | 192 | And I select "Recent media" from "parent_id" within "#published-media" |
| 193 | 193 | And I fill in "Search" with "rails" within "#published-media" |
| ... | ... | @@ -227,7 +227,7 @@ Feature: uploads items on media panel |
| 227 | 227 | | joaosilva | other-pic.jpg | image/jpeg | my-gallery | |
| 228 | 228 | | joaosilva | rails.png | image/png | gallery | |
| 229 | 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 | 231 | And I follow "Show/Hide" |
| 232 | 232 | And I should not see "View all" |
| 233 | 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 | 15 | |
| 16 | 16 | Scenario: list all content types |
| 17 | 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 | 19 | And I should see "Folder" |
| 21 | 20 | And I should see "Blog" |
| 22 | 21 | And I should see "Uploaded file" |
| ... | ... | @@ -30,22 +29,6 @@ Feature: create content on cms |
| 30 | 29 | And I go to joaosilva's cms |
| 31 | 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 | 32 | Scenario: create a Blog |
| 50 | 33 | Given I follow "New content" |
| 51 | 34 | When I follow "Blog" | ... | ... |
features/profile_search.feature
| ... | ... | @@ -47,8 +47,8 @@ Feature: search inside a profile |
| 47 | 47 | And I go to joaosilva's profile |
| 48 | 48 | And I fill in "q" with "article" |
| 49 | 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 | 53 | Scenario: search on environment |
| 54 | 54 | Given I go to joaosilva's profile | ... | ... |
features/publish_article.feature
| ... | ... | @@ -60,11 +60,10 @@ Feature: publish article |
| 60 | 60 | And I am on mariasilva's control panel |
| 61 | 61 | And I follow "Manage Content" |
| 62 | 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 | 65 | And I fill in the following: |
| 66 | 66 | | Title | Sample Article | |
| 67 | - | Text | this is Maria's first published article | | |
| 68 | 67 | And I press "Save" |
| 69 | 68 | And I follow "Spread" |
| 70 | 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 | 22 | Then I should see "whales and dolphins" within ".search-text-article-item" |
| 23 | 23 | And I should see "whales and dolphins" within ".only-one-result-box" |
| 24 | 24 | And I should not see "bees and butterflies" |
| 25 | - And The page should contain ".icon-content-textile-article" | |
| 26 | 25 | When I follow "whales and dolphins" |
| 27 | 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 | 52 | And I go to mycommunity's control panel |
| 53 | 53 | And I follow "Manage Content" |
| 54 | 54 | And I follow "New content" |
| 55 | - And I follow "Text article with visual editor" | |
| 55 | + And I follow "Text article" | |
| 56 | 56 | And I fill in "Title" with "My public article" |
| 57 | 57 | And I choose "Public" |
| 58 | 58 | And I press "Save and continue" | ... | ... |
features/step_definitions/noosfero_steps.rb
| ... | ... | @@ -101,7 +101,7 @@ end |
| 101 | 101 | |
| 102 | 102 | Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded files|rss feeds)$/ do |content, table| |
| 103 | 103 | klass = { |
| 104 | - 'articles' => TextileArticle, | |
| 104 | + 'articles' => TextArticle, | |
| 105 | 105 | 'events' => Event, |
| 106 | 106 | 'blogs' => Blog, |
| 107 | 107 | 'folders' => Folder, |
| ... | ... | @@ -178,7 +178,7 @@ Given /^the following articles? with images?$/ do |table| |
| 178 | 178 | img_tag = "<img " |
| 179 | 179 | img.each { |attr, value| img_tag += "#{attr}=\"#{value}\" " } |
| 180 | 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 | 182 | if item[:parent] |
| 183 | 183 | article.parent = Article.find_by slug: item[:parent] |
| 184 | 184 | end | ... | ... |
features/tiny_mce.feature
| ... | ... | @@ -10,7 +10,7 @@ Feature: Create tinyMCE article |
| 10 | 10 | |
| 11 | 11 | @selenium |
| 12 | 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 | 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 | 15 | And The tinymce "menubar" should be "edit insert view tools" |
| 16 | 16 | And The tinymce "toolbar2" should contain "print preview code media | table" | ... | ... |
plugins/admin_notifications/views/shared/_form.html.erb
| 1 | 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 | 5 | <%= button :back, _('Back'), :controller => 'admin_notifications_plugin_admin' %> |
| 6 | 6 | |
| 7 | 7 | <%= form_for :notifications do |f| %> |
| 8 | 8 | |
| 9 | - <%= render :file => 'shared/tiny_mce', :locals => {:mode => 'restricted'} %> | |
| 10 | - | |
| 11 | 9 | <%= labelled_form_field(_("Optional Title:"), f.text_field(:title, value: @notification.title)) %> |
| 12 | 10 | |
| 13 | 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 | 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 | 3 | end |
| 4 | 4 | |
| 5 | 5 | class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro | ... | ... |
plugins/comment_paragraph/test/unit/article_test.rb
| ... | ... | @@ -5,7 +5,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 5 | 5 | |
| 6 | 6 | def setup |
| 7 | 7 | @profile = fast_create(Community) |
| 8 | - @article = fast_create(TinyMceArticle, :profile_id => profile.id) | |
| 8 | + @article = fast_create(TextArticle, :profile_id => profile.id) | |
| 9 | 9 | @environment = Environment.default |
| 10 | 10 | @environment.enable_plugin(CommentParagraphPlugin) |
| 11 | 11 | end | ... | ... |
plugins/comment_paragraph/test/unit/discussion_block_test.rb
| ... | ... | @@ -74,7 +74,7 @@ class DiscussionBlockTest < ActiveSupport::TestCase |
| 74 | 74 | b.save |
| 75 | 75 | a1 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) |
| 76 | 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 | 78 | a2 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) |
| 79 | 79 | assert_equivalent [a1, a2], b.discussions |
| 80 | 80 | end |
| ... | ... | @@ -183,7 +183,7 @@ class DiscussionBlockViewTest < ActionView::TestCase |
| 183 | 183 | b.save |
| 184 | 184 | a1 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) |
| 185 | 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 | 187 | a2 = fast_create(CommentParagraphPlugin::Discussion, :profile_id => community.id) |
| 188 | 188 | assert_equivalent [a2.id, a1.id], b.api_content['articles'].map {|a| a[:id]} |
| 189 | 189 | end | ... | ... |
plugins/comment_paragraph/test/unit/tinymce_helper_test.rb
| ... | ... | @@ -7,6 +7,7 @@ class TinymceHelperTest < ActiveSupport::TestCase |
| 7 | 7 | def setup |
| 8 | 8 | expects(:top_url).returns('/') |
| 9 | 9 | expects(:tinymce_language).returns('en') |
| 10 | + expects(:current_editor).returns(Article::Editor::TINY_MCE) | |
| 10 | 11 | @plugins = mock |
| 11 | 12 | @plugins.expects(:dispatch).returns([]).at_least_once |
| 12 | 13 | @environment = Environment.default | ... | ... |
plugins/community_track/lib/community_track_plugin/step.rb
plugins/community_track/test/functional/community_track_plugin_content_viewer_controller_test.rb
| ... | ... | @@ -5,7 +5,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 5 | 5 | def setup |
| 6 | 6 | @profile = Community.create!(:name => 'Sample community', :identifier => 'sample-community') |
| 7 | 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 | 10 | user = create_user('testinguser') |
| 11 | 11 | login_as(user.login) |
| ... | ... | @@ -49,7 +49,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 49 | 49 | end |
| 50 | 50 | |
| 51 | 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 | 53 | get :view_page, @step.url |
| 54 | 54 | assert_tag :tag => 'div', :attributes => { :class => 'tools' }, :descendant => { :tag => 'div', :attributes => { :class => 'item' } } |
| 55 | 55 | end | ... | ... |
plugins/community_track/test/unit/community_track_plugin/step_test.rb
| ... | ... | @@ -235,7 +235,7 @@ class StepTest < ActiveSupport::TestCase |
| 235 | 235 | end |
| 236 | 236 | |
| 237 | 237 | should 'return enabled tools for a step' do |
| 238 | - assert_includes @step.enabled_tools, TinyMceArticle | |
| 238 | + assert_includes @step.enabled_tools, TextArticle | |
| 239 | 239 | assert_includes @step.enabled_tools, Forum |
| 240 | 240 | end |
| 241 | 241 | ... | ... |
plugins/community_track/views/cms/community_track_plugin/_step.html.erb
| 1 | 1 | <%= required_fields_message %> |
| 2 | 2 | |
| 3 | -<%= render :file => 'shared/tiny_mce' %> | |
| 4 | - | |
| 5 | 3 | <div> |
| 6 | 4 | <%= required f.text_field('name', :size => '64', :maxlength => 150) %> |
| 7 | 5 | <%= labelled_form_field(_('Period'), ( |
| ... | ... | @@ -19,4 +17,4 @@ |
| 19 | 17 | |
| 20 | 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 | 1 | <div class='community-track'> |
| 2 | 2 | <%= required_fields_message %> |
| 3 | 3 | |
| 4 | - <%= render :file => 'shared/tiny_mce' %> | |
| 5 | - | |
| 6 | 4 | <div> |
| 7 | 5 | <%= required labelled_form_field(c_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> |
| 8 | 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 | 10 | <div> |
| 13 | 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 < Block |
| 22 | 22 | end |
| 23 | 23 | |
| 24 | 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 | 26 | checked_types = types.map {|t| t.constantize} |
| 27 | 27 | checked_types + (@available_content_types - checked_types) |
| 28 | 28 | end | ... | ... |
plugins/context_content/test/functional/content_viewer_controller_test.rb
| ... | ... | @@ -8,7 +8,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 8 | 8 | |
| 9 | 9 | box = Box.create!(:owner => @profile) |
| 10 | 10 | @block = ContextContentPlugin::ContextContentBlock.new(:box_id => box.id) |
| 11 | - @block.types = ['TinyMceArticle'] | |
| 11 | + @block.types = ['TextArticle'] | |
| 12 | 12 | @block.limit = 1 |
| 13 | 13 | @block.title = "New Context Block" |
| 14 | 14 | @block.save! |
| ... | ... | @@ -21,7 +21,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 21 | 21 | end |
| 22 | 22 | |
| 23 | 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 | 25 | get :view_page, @page.url |
| 26 | 26 | assert_tag 'div', :attributes => {:id => "context_content_#{@block.id}", :class => 'contents'} |
| 27 | 27 | assert_no_tag 'div', :attributes => {:id => "context_content_more_#{@block.id}", :class => 'more_button'}, :descendant => {:tag => 'a'} |
| ... | ... | @@ -31,7 +31,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 31 | 31 | should 'display context content block title if it is not configured to use_parent_title' do |
| 32 | 32 | @block.use_parent_title = false |
| 33 | 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 | 35 | get :view_page, @page.url |
| 36 | 36 | assert_tag 'h3', :attributes => {:class => 'block-title'}, :content => @block.title |
| 37 | 37 | assert_no_tag 'h3', :attributes => {:class => 'block-title'}, :content => @page.name |
| ... | ... | @@ -40,15 +40,15 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 40 | 40 | should 'display context content with folder title if it is configured to use_parent_title' do |
| 41 | 41 | @block.use_parent_title = true |
| 42 | 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 | 44 | get :view_page, @page.url |
| 45 | 45 | assert_tag 'h3', :attributes => {:class => 'block-title'}, :content => @page.name |
| 46 | 46 | assert_no_tag 'h3', :attributes => {:class => 'block-title'}, :content => @block.title |
| 47 | 47 | end |
| 48 | 48 | |
| 49 | 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 | 52 | get :view_page, @page.url |
| 53 | 53 | assert_tag 'div', :attributes => {:id => "context_content_#{@block.id}", :class => 'contents'} |
| 54 | 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 < ActionController::TestCase |
| 9 | 9 | box = create(Box, :owner_type => 'Profile', :owner_id => @profile.id) |
| 10 | 10 | @block = ContextContentPlugin::ContextContentBlock.new |
| 11 | 11 | @block.box = box |
| 12 | - @block.types = ['TinyMceArticle'] | |
| 12 | + @block.types = ['TextArticle'] | |
| 13 | 13 | @block.limit = 1 |
| 14 | 14 | owner = create_user('block-owner').person |
| 15 | 15 | @block.box = owner.boxes.last |
| ... | ... | @@ -23,14 +23,14 @@ class ContextContentPluginProfileControllerTest < ActionController::TestCase |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 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 | 27 | xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier |
| 28 | 28 | assert_response 500 |
| 29 | 29 | end |
| 30 | 30 | |
| 31 | 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 | 34 | xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier |
| 35 | 35 | assert_response :success |
| 36 | 36 | assert_match /context_content_#{@block.id}/, @response.body |
| ... | ... | @@ -39,7 +39,7 @@ class ContextContentPluginProfileControllerTest < ActionController::TestCase |
| 39 | 39 | end |
| 40 | 40 | |
| 41 | 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 | 43 | xhr :get, :view_content, :id => @block.id, :article_id => @page.id, :page => 2, :profile => @profile.identifier |
| 44 | 44 | assert_no_match /context_content_more_#{@block.id}/, @response.body |
| 45 | 45 | end | ... | ... |
plugins/context_content/test/functional/profile_design_controller_test.rb
| ... | ... | @@ -13,7 +13,7 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 13 | 13 | |
| 14 | 14 | box = Box.create!(:owner => @profile) |
| 15 | 15 | @block = ContextContentPlugin::ContextContentBlock.new(:box_id => box.id) |
| 16 | - @block.types = ['TinyMceArticle'] | |
| 16 | + @block.types = ['TextArticle'] | |
| 17 | 17 | @block.limit = 1 |
| 18 | 18 | @block.save! |
| 19 | 19 | |
| ... | ... | @@ -38,11 +38,11 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 38 | 38 | @block.show_parent_content = false |
| 39 | 39 | @block.save! |
| 40 | 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 | 42 | @block.reload |
| 43 | 43 | assert_equal 'context', @block.title |
| 44 | 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 | 46 | end |
| 47 | 47 | |
| 48 | 48 | end | ... | ... |
plugins/context_content/test/unit/context_content_block_test.rb
| ... | ... | @@ -5,7 +5,7 @@ class ContextContentBlockTest < ActiveSupport::TestCase |
| 5 | 5 | def setup |
| 6 | 6 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) |
| 7 | 7 | @block = ContextContentPlugin::ContextContentBlock.create! |
| 8 | - @block.types = ['TinyMceArticle'] | |
| 8 | + @block.types = ['TextArticle'] | |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | 11 | should 'describe itself' do |
| ... | ... | @@ -22,13 +22,13 @@ class ContextContentBlockTest < ActiveSupport::TestCase |
| 22 | 22 | |
| 23 | 23 | should 'return children of page' do |
| 24 | 24 | folder = fast_create(Folder) |
| 25 | - article = fast_create(TinyMceArticle, :parent_id => folder.id) | |
| 25 | + article = fast_create(TextArticle, :parent_id => folder.id) | |
| 26 | 26 | assert_equal [article], @block.contents(folder) |
| 27 | 27 | end |
| 28 | 28 | |
| 29 | 29 | should 'return parent name of the contents' do |
| 30 | 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 | 32 | assert_equal folder.name, @block.parent_title([article]) |
| 33 | 33 | end |
| 34 | 34 | |
| ... | ... | @@ -39,40 +39,40 @@ class ContextContentBlockTest < ActiveSupport::TestCase |
| 39 | 39 | should 'limit number of children to display' do |
| 40 | 40 | @block.limit = 2 |
| 41 | 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 | 45 | assert_equal 2, @block.contents(folder).length |
| 46 | 46 | end |
| 47 | 47 | |
| 48 | 48 | should 'show contents for next page' do |
| 49 | 49 | @block.limit = 2 |
| 50 | 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 | 54 | assert_equal [article3], @block.contents(folder, 2) |
| 55 | 55 | end |
| 56 | 56 | |
| 57 | 57 | should 'show parent contents for next page' do |
| 58 | 58 | @block.limit = 2 |
| 59 | 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 | 63 | assert_equal [article3], @block.contents(article1, 2) |
| 64 | 64 | end |
| 65 | 65 | |
| 66 | 66 | should 'return parent children if page has no children' do |
| 67 | 67 | folder = fast_create(Folder) |
| 68 | - article = fast_create(TinyMceArticle, :parent_id => folder.id) | |
| 68 | + article = fast_create(TextArticle, :parent_id => folder.id) | |
| 69 | 69 | assert_equal [article], @block.contents(article) |
| 70 | 70 | end |
| 71 | 71 | |
| 72 | 72 | should 'do not return parent children if show_parent_content is false' do |
| 73 | 73 | @block.show_parent_content = false |
| 74 | 74 | folder = fast_create(Folder) |
| 75 | - article = fast_create(TinyMceArticle, :parent_id => folder.id) | |
| 75 | + article = fast_create(TextArticle, :parent_id => folder.id) | |
| 76 | 76 | assert_equal [], @block.contents(article) |
| 77 | 77 | end |
| 78 | 78 | |
| ... | ... | @@ -82,13 +82,13 @@ class ContextContentBlockTest < ActiveSupport::TestCase |
| 82 | 82 | end |
| 83 | 83 | |
| 84 | 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 | 87 | end |
| 88 | 88 | |
| 89 | 89 | should 'return available content types' do |
| 90 | 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 | 92 | end |
| 93 | 93 | |
| 94 | 94 | should 'return first 2 content types' do |
| ... | ... | @@ -120,7 +120,7 @@ class ContextContentBlockTest < ActiveSupport::TestCase |
| 120 | 120 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new]) |
| 121 | 121 | |
| 122 | 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 | 124 | end |
| 125 | 125 | |
| 126 | 126 | should 'return box owner on profile method call' do |
| ... | ... | @@ -144,7 +144,7 @@ class ContextContentBlockViewTest < ActionView::TestCase |
| 144 | 144 | def setup |
| 145 | 145 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) |
| 146 | 146 | @block = ContextContentPlugin::ContextContentBlock.create! |
| 147 | - @block.types = ['TinyMceArticle'] | |
| 147 | + @block.types = ['TextArticle'] | |
| 148 | 148 | end |
| 149 | 149 | |
| 150 | 150 | should 'render nothing if it has no content to show' do |
| ... | ... | @@ -153,7 +153,7 @@ class ContextContentBlockViewTest < ActionView::TestCase |
| 153 | 153 | |
| 154 | 154 | should 'render context content block view' do |
| 155 | 155 | @page = fast_create(Folder) |
| 156 | - article = fast_create(TinyMceArticle, :parent_id => @page.id) | |
| 156 | + article = fast_create(TextArticle, :parent_id => @page.id) | |
| 157 | 157 | contents = [article] |
| 158 | 158 | @block.use_parent_title = true |
| 159 | 159 | |
| ... | ... | @@ -178,9 +178,9 @@ class ContextContentBlockViewTest < ActionView::TestCase |
| 178 | 178 | should 'display pagination links if it has more than one page' do |
| 179 | 179 | @block.limit = 2 |
| 180 | 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 | 184 | contents = [article1, article2, article3] |
| 185 | 185 | contents.each do |article| |
| 186 | 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 < ActionController::TestCase |
| 180 | 180 | form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software') |
| 181 | 181 | |
| 182 | 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 | 186 | end |
| 186 | 187 | |
| 187 | 188 | should 'export submissions as csv' do | ... | ... |
plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb
| 1 | 1 | <% self.extend(CustomFormsPlugin::Helper) %> |
| 2 | -<%= render :file => 'shared/tiny_mce', :locals => {:mode => 'simple'} %> | |
| 3 | 2 | |
| 4 | 3 | <%= error_messages_for :form %> |
| 5 | 4 | <%= required labelled_form_field _('Name'), f.text_field(:name) %> |
| ... | ... | @@ -17,7 +16,7 @@ |
| 17 | 16 | <%= labelled_check_box _('Triggered after membership'), 'form[on_membership]', '1', @form.on_membership %> |
| 18 | 17 | </p> |
| 19 | 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 | 21 | <h2><%= c_('Fields') %></h2> |
| 23 | 22 | ... | ... |
plugins/delivery/views/delivery_plugin/admin_method/_edit.html.slim
| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | = labelled_field f, :name, t('delivery_plugin.models.method.name'), f.text_field(:name), |
| 13 | 13 | help: t('delivery_plugin.models.method.name_help') |
| 14 | 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 | 17 | fieldset |
| 18 | 18 | legend= t'delivery_plugin.models.method.costs_legend' |
| ... | ... | @@ -34,5 +34,3 @@ |
| 34 | 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 | 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 < Block |
| 24 | 24 | {:value => 'title', :checked => true}, |
| 25 | 25 | {:value => 'abstract', :checked => true}] |
| 26 | 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 | 28 | settings_items :order_by_recent, :type => :boolean, :default => :true |
| 29 | 29 | settings_items :content_with_translations, :type => :boolean, :default => :true |
| 30 | 30 | settings_items :limit_to_show, :type => :integer, :default => 6 |
| ... | ... | @@ -61,7 +61,7 @@ class DisplayContentBlock < Block |
| 61 | 61 | end |
| 62 | 62 | |
| 63 | 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 | 65 | checked_types = types.map {|t| t.constantize} |
| 66 | 66 | checked_types + (@available_content_types - checked_types) |
| 67 | 67 | end |
| ... | ... | @@ -108,7 +108,7 @@ class DisplayContentBlock < Block |
| 108 | 108 | @parent_nodes ||= self.holder.articles.where(:id => nodes).map { |article| get_parent(article) }.compact.flatten |
| 109 | 109 | end |
| 110 | 110 | |
| 111 | - VALID_CONTENT = ['RawHTMLArticle', 'TextArticle', 'TextileArticle', 'TinyMceArticle', 'Folder', 'Blog', 'Forum'] | |
| 111 | + VALID_CONTENT = ['TextArticle', 'Folder', 'Blog', 'Forum'] | |
| 112 | 112 | |
| 113 | 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 < ActionController::TestCase |
| 39 | 39 | |
| 40 | 40 | should 'index action returns an json with node content' do |
| 41 | 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 | 44 | get :index, :block_id => block.id |
| 45 | 45 | json_response = ActiveSupport::JSON.decode(@response.body) |
| ... | ... | @@ -51,7 +51,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
| 51 | 51 | |
| 52 | 52 | should 'index action returns an json with node checked if the node is in the nodes list' do |
| 53 | 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 | 55 | block.nodes= [article.id] |
| 56 | 56 | block.save! |
| 57 | 57 | |
| ... | ... | @@ -67,8 +67,8 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
| 67 | 67 | should 'index action returns an json with node undetermined if the node is in the parent nodes list' do |
| 68 | 68 | Article.delete_all |
| 69 | 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 | 72 | block.nodes = [article.id] |
| 73 | 73 | block.save! |
| 74 | 74 | |
| ... | ... | @@ -81,7 +81,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
| 81 | 81 | should 'index action returns an json with node closed if the node has article with children' do |
| 82 | 82 | Article.delete_all |
| 83 | 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 | 86 | get :index, :block_id => block.id |
| 87 | 87 | json_response = ActiveSupport::JSON.decode(@response.body) |
| ... | ... | @@ -95,8 +95,8 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
| 95 | 95 | should 'index action returns an json with all the children nodes if some parent is in the parents list' do |
| 96 | 96 | Article.delete_all |
| 97 | 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 | 100 | block.checked_nodes= {a1.id => true} |
| 101 | 101 | block.save! |
| 102 | 102 | |
| ... | ... | @@ -118,9 +118,9 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
| 118 | 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 | 119 | Article.delete_all |
| 120 | 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 | 124 | block.checked_nodes= {a2.id => true, a3.id => true} |
| 125 | 125 | block.save! |
| 126 | 126 | |
| ... | ... | @@ -148,9 +148,9 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
| 148 | 148 | should 'index action returns an json without children nodes if the parent is not in the parents list' do |
| 149 | 149 | Article.delete_all |
| 150 | 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 | 155 | get :index, :block_id => block.id |
| 156 | 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 < ActionController::TestCase |
| 40 | 40 | |
| 41 | 41 | should 'index action returns an json with node content' do |
| 42 | 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 | 45 | get :index, :block_id => block.id, :profile => profile.identifier |
| 46 | 46 | json_response = ActiveSupport::JSON.decode(@response.body) |
| ... | ... | @@ -52,7 +52,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
| 52 | 52 | |
| 53 | 53 | should 'index action returns an json with node checked if the node is in the nodes list' do |
| 54 | 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 | 56 | block.nodes= [article.id] |
| 57 | 57 | block.save! |
| 58 | 58 | |
| ... | ... | @@ -68,8 +68,8 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
| 68 | 68 | should 'index action returns an json with node undetermined if the node is in the parent nodes list' do |
| 69 | 69 | Article.delete_all |
| 70 | 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 | 73 | block.nodes = [article.id] |
| 74 | 74 | block.save! |
| 75 | 75 | |
| ... | ... | @@ -82,7 +82,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
| 82 | 82 | should 'index action returns an json with node closed if the node has article with children' do |
| 83 | 83 | Article.delete_all |
| 84 | 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 | 86 | block.save! |
| 87 | 87 | |
| 88 | 88 | get :index, :block_id => block.id, :profile => profile.identifier |
| ... | ... | @@ -97,8 +97,8 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
| 97 | 97 | should 'index action returns an json with all the children nodes if some parent is in the parents list' do |
| 98 | 98 | Article.delete_all |
| 99 | 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 | 102 | block.checked_nodes = {a1.id => true} |
| 103 | 103 | block.save! |
| 104 | 104 | |
| ... | ... | @@ -120,9 +120,9 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
| 120 | 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 | 121 | Article.delete_all |
| 122 | 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 | 126 | block.checked_nodes = {a1.id => true} |
| 127 | 127 | block.save! |
| 128 | 128 | |
| ... | ... | @@ -150,9 +150,9 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
| 150 | 150 | should 'index action returns an json without children nodes if the parent is not in the parents list' do |
| 151 | 151 | Article.delete_all |
| 152 | 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 | 157 | get :index, :block_id => block.id, :profile => profile.identifier |
| 158 | 158 | json_response = ActiveSupport::JSON.decode(@response.body) | ... | ... |
plugins/display_content/test/unit/display_content_block_test.rb
| ... | ... | @@ -2,7 +2,7 @@ require_relative '../test_helper' |
| 2 | 2 | class DisplayContentBlockTest < ActiveSupport::TestCase |
| 3 | 3 | |
| 4 | 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 | 7 | should 'describe itself' do |
| 8 | 8 | assert_not_equal Block.description, DisplayContentBlock.description |
| ... | ... | @@ -39,9 +39,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 39 | 39 | should 'nodes be the article ids in hash of checked nodes' do |
| 40 | 40 | profile = create_user('testuser').person |
| 41 | 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 | 46 | checked_articles= {a1.id => true, a2.id => true, a3.id => false} |
| 47 | 47 | block = DisplayContentBlock.new |
| ... | ... | @@ -54,9 +54,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 54 | 54 | should 'nodes be save in database' do |
| 55 | 55 | profile = create_user('testuser').person |
| 56 | 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 | 61 | checked_articles= {a1.id => true, a2.id => true, a3.id => false} |
| 62 | 62 | block = DisplayContentBlock.new |
| ... | ... | @@ -71,10 +71,10 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 71 | 71 | should 'be able to update nodes' do |
| 72 | 72 | profile = create_user('testuser').person |
| 73 | 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 | 79 | checked_articles= {a1.id => true, a2.id => true, a3.id => false} |
| 80 | 80 | block = DisplayContentBlock.new |
| ... | ... | @@ -95,13 +95,13 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 95 | 95 | should "save selected folders and articles" do |
| 96 | 96 | profile = create_user('testuser').person |
| 97 | 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 | 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 | 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 | 106 | checked_articles= {a1.id => true, a2.id => true, f1.id => false} |
| 107 | 107 | |
| ... | ... | @@ -115,13 +115,13 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 115 | 115 | should "save selected articles and blogs" do |
| 116 | 116 | profile = create_user('testuser').person |
| 117 | 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 | 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 | 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 | 126 | checked_articles= {a1.id => true, a2.id => true, b1.id => false, b2.id => true} |
| 127 | 127 | |
| ... | ... | @@ -132,36 +132,10 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 132 | 132 | assert_equivalent [a1.id, a2.id, b1.id, b2.id], block.nodes |
| 133 | 133 | end |
| 134 | 134 | |
| 135 | - should 'TextileArticle be saved as node' do | |
| 135 | + should 'TextArticle be saved as node' do | |
| 136 | 136 | profile = create_user('testuser').person |
| 137 | 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 | 140 | checked_articles= {a1.id => true} |
| 167 | 141 | block = DisplayContentBlock.new |
| ... | ... | @@ -230,9 +204,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 230 | 204 | should "return all root articles from profile" do |
| 231 | 205 | profile = create_user('testuser').person |
| 232 | 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 | 211 | block = DisplayContentBlock.new |
| 238 | 212 | block.nodes= [a1.id, a2.id, a3.id] |
| ... | ... | @@ -247,9 +221,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 247 | 221 | should "return all children of an articles's profile" do |
| 248 | 222 | profile = create_user('testuser').person |
| 249 | 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 | 228 | block = DisplayContentBlock.new |
| 255 | 229 | box = mock() |
| ... | ... | @@ -264,9 +238,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 264 | 238 | profile = fast_create(Community, :name => 'my test community', :identifier => 'mytestcommunity') |
| 265 | 239 | environment = Environment.default |
| 266 | 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 | 245 | block = DisplayContentBlock.new |
| 272 | 246 | box = mock() |
| ... | ... | @@ -283,9 +257,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 283 | 257 | profile = fast_create(Community, :name => 'my test community', :identifier => 'mytestcommunity') |
| 284 | 258 | environment = Environment.default |
| 285 | 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 | 264 | block = DisplayContentBlock.new |
| 291 | 265 | box = mock() |
| ... | ... | @@ -404,9 +378,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 404 | 378 | profile = create_user('testuser').person |
| 405 | 379 | Article.delete_all |
| 406 | 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 | 385 | checked_articles= {f1.id => true, a1.id => true, a2.id => true, a3.id => false} |
| 412 | 386 | block = DisplayContentBlock.new |
| ... | ... | @@ -420,9 +394,9 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 420 | 394 | profile = create_user('testuser').person |
| 421 | 395 | Article.delete_all |
| 422 | 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 | 401 | checked_articles= {f1.id => true, a1.id => true, a2.id => true, a3.id => false} |
| 428 | 402 | block = DisplayContentBlock.new |
| ... | ... | @@ -472,37 +446,37 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 472 | 446 | should 'return available content types with checked types first' do |
| 473 | 447 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) |
| 474 | 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 | 453 | end |
| 480 | 454 | |
| 481 | 455 | should 'return available content types' do |
| 482 | 456 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) |
| 483 | 457 | block = DisplayContentBlock.create! |
| 484 | - block.types = ['TinyMceArticle'] | |
| 458 | + block.types = ['TextArticle'] | |
| 485 | 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 | 461 | end |
| 488 | 462 | |
| 489 | 463 | should 'return first 2 content types' do |
| 490 | 464 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) |
| 491 | 465 | block = DisplayContentBlock.create! |
| 492 | - block.types = ['TinyMceArticle'] | |
| 466 | + block.types = ['TextArticle'] | |
| 493 | 467 | assert_equal 2, block.first_content_types.length |
| 494 | 468 | end |
| 495 | 469 | |
| 496 | 470 | should 'return all but first 2 content types' do |
| 497 | 471 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([]) |
| 498 | 472 | block = DisplayContentBlock.create! |
| 499 | - block.types = ['TinyMceArticle'] | |
| 473 | + block.types = ['TextArticle'] | |
| 500 | 474 | assert_equal block.available_content_types.length - 2, block.more_content_types.length |
| 501 | 475 | end |
| 502 | 476 | |
| 503 | 477 | should 'return 2 as default value for first_types_count' do |
| 504 | 478 | block = DisplayContentBlock.create! |
| 505 | - block.types = ['TinyMceArticle'] | |
| 479 | + block.types = ['TextArticle'] | |
| 506 | 480 | assert_equal 2, block.first_types_count |
| 507 | 481 | end |
| 508 | 482 | |
| ... | ... | @@ -527,14 +501,14 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 527 | 501 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new]) |
| 528 | 502 | |
| 529 | 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 | 505 | end |
| 532 | 506 | |
| 533 | 507 | should 'do not fail if a selected article was removed' do |
| 534 | 508 | profile = create_user('testuser').person |
| 535 | 509 | Article.delete_all |
| 536 | 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 | 513 | checked_articles= {a1.id => true} |
| 540 | 514 | |
| ... | ... | @@ -547,16 +521,16 @@ class DisplayContentBlockTest < ActiveSupport::TestCase |
| 547 | 521 | |
| 548 | 522 | end |
| 549 | 523 | |
| 550 | -require 'boxes_helper' | |
| 551 | - | |
| 552 | 524 | class DisplayContentBlockViewTest < ActionView::TestCase |
| 553 | 525 | include BoxesHelper |
| 526 | + include DatesHelper | |
| 527 | + helper :dates | |
| 554 | 528 | |
| 555 | 529 | should 'list links for all articles title defined in nodes' do |
| 556 | 530 | profile = create_user('testuser').person |
| 557 | 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 | 535 | block = DisplayContentBlock.new |
| 562 | 536 | block.sections = [{:value => 'title', :checked => true}] |
| ... | ... | @@ -572,8 +546,8 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 572 | 546 | should 'list content for all articles lead defined in nodes' do |
| 573 | 547 | profile = create_user('testuser').person |
| 574 | 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 | 552 | block = DisplayContentBlock.new |
| 579 | 553 | block.sections = [{:value => 'abstract', :checked => true}] |
| ... | ... | @@ -602,7 +576,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 602 | 576 | |
| 603 | 577 | should 'show title if defined by user' do |
| 604 | 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 | 581 | block = DisplayContentBlock.new |
| 608 | 582 | block.nodes = [a.id] |
| ... | ... | @@ -616,7 +590,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 616 | 590 | |
| 617 | 591 | should 'show abstract if defined by user' do |
| 618 | 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 | 595 | block = DisplayContentBlock.new |
| 622 | 596 | block.nodes = [a.id] |
| ... | ... | @@ -630,7 +604,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 630 | 604 | |
| 631 | 605 | should 'show body if defined by user' do |
| 632 | 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 | 609 | block = DisplayContentBlock.new |
| 636 | 610 | block.nodes = [a.id] |
| ... | ... | @@ -642,7 +616,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 642 | 616 | assert_match /#{a.body}/, render_block_content(block) |
| 643 | 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 | 620 | profile = create_user('testuser').person |
| 647 | 621 | a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :body => 'some body') |
| 648 | 622 | |
| ... | ... | @@ -658,7 +632,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 658 | 632 | |
| 659 | 633 | should 'show image if defined by user' do |
| 660 | 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 | 636 | a.save! |
| 663 | 637 | |
| 664 | 638 | process_delayed_job_queue |
| ... | ... | @@ -676,8 +650,8 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 676 | 650 | should 'show articles in recent order' do |
| 677 | 651 | profile = create_user('testuser').person |
| 678 | 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 | 656 | block = DisplayContentBlock.new |
| 683 | 657 | block.sections = [{:value => 'title', :checked => true}] |
| ... | ... | @@ -697,8 +671,8 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 697 | 671 | should 'show articles in oldest order' do |
| 698 | 672 | profile = create_user('testuser').person |
| 699 | 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 | 677 | block = DisplayContentBlock.new |
| 704 | 678 | block.sections = [{:value => 'title', :checked => true}] |
| ... | ... | @@ -718,8 +692,8 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 718 | 692 | should 'show articles in recent order with limit option' do |
| 719 | 693 | profile = create_user('testuser').person |
| 720 | 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 | 698 | block = DisplayContentBlock.new |
| 725 | 699 | block.sections = [{:value => 'title', :checked => true}] |
| ... | ... | @@ -741,10 +715,10 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 741 | 715 | profile = create_user('testuser').person |
| 742 | 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 | 723 | block = DisplayContentBlock.new |
| 750 | 724 | block.sections = [{:value => 'title', :checked => true}] |
| ... | ... | @@ -771,8 +745,8 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 771 | 745 | profile = create_user('testuser').person |
| 772 | 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 | 751 | block = DisplayContentBlock.new |
| 778 | 752 | block.sections = [{:value => 'title', :checked => true}] |
| ... | ... | @@ -794,7 +768,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 794 | 768 | |
| 795 | 769 | should 'not escape abstract html of articles' do |
| 796 | 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 | 773 | block = DisplayContentBlock.new |
| 800 | 774 | block.sections = [{:value => 'abstract', :checked => true}] |
| ... | ... | @@ -807,7 +781,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 807 | 781 | |
| 808 | 782 | should 'not raise if abstract of article is nil' do |
| 809 | 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 | 786 | block = DisplayContentBlock.new |
| 813 | 787 | block.sections = [{:value => 'abstract', :checked => true}] |
| ... | ... | @@ -823,7 +797,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 823 | 797 | |
| 824 | 798 | should 'not escape body html of articles' do |
| 825 | 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 | 802 | block = DisplayContentBlock.new |
| 829 | 803 | block.sections = [{:value => 'body', :checked => true}] |
| ... | ... | @@ -836,7 +810,7 @@ class DisplayContentBlockViewTest < ActionView::TestCase |
| 836 | 810 | |
| 837 | 811 | should 'not raise if body of article is nil' do |
| 838 | 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 | 815 | block = DisplayContentBlock.new |
| 842 | 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 | 15 | = f.text_field :title, class: 'form-control' |
| 16 | 16 | |
| 17 | 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 | 20 | = f.label :config_type, t("fb_app_plugin.views.myprofile.catalogs.catalog_type_chooser_label") |
| 21 | 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 < ActionController::TestCase |
| 6 | 6 | @controller = MarkCommentAsReadPluginProfileController.new |
| 7 | 7 | |
| 8 | 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 | 10 | @comment = Comment.new(:source => @article, :author => @profile, :body => 'test') |
| 11 | 11 | @comment.save! |
| 12 | 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 < ActiveSupport::TestCase |
| 4 | 4 | |
| 5 | 5 | def setup |
| 6 | 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 | 8 | @comment = Comment.create!(:title => 'title', :body => 'body', :author => @person, :source => @article) |
| 9 | 9 | end |
| 10 | 10 | ... | ... |
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb
| ... | ... | @@ -5,7 +5,7 @@ class MarkCommentAsReadPluginTest < ActionView::TestCase |
| 5 | 5 | def setup |
| 6 | 6 | @plugin = MarkCommentAsReadPlugin.new |
| 7 | 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 | 9 | @comment = Comment.create!(:source => @article, :author => @person, :body => 'test') |
| 10 | 10 | self.stubs(:user).returns(@person) |
| 11 | 11 | self.stubs(:profile).returns(@person) | ... | ... |
plugins/metadata/test/functional/content_viewer_controller_test.rb
| ... | ... | @@ -21,7 +21,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 21 | 21 | end |
| 22 | 22 | |
| 23 | 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 | 26 | get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] |
| 27 | 27 | |
| ... | ... | @@ -37,7 +37,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 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 | 42 | get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] |
| 43 | 43 | assert_tag tag: 'meta', attributes: { name: 'twitter:image', content: /\/images\/x.png/ } |
| ... | ... | @@ -45,7 +45,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | 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 | 50 | get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] |
| 51 | 51 | assert_tag tag: 'meta', attributes: { property: 'og:image', content: /\/images\/%C3%A7.png/ } |
| ... | ... | @@ -63,7 +63,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 63 | 63 | |
| 64 | 64 | should 'not expose metadata on private pages' do |
| 65 | 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 | 68 | get :view_page, profile: profile.identifier, page: [ a.name.to_slug ] |
| 69 | 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 < ActionDispatch::IntegrationTest |
| 10 | 10 | environment.add_admin(person) |
| 11 | 11 | |
| 12 | 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 | 14 | newsletter = NewsletterPlugin::Newsletter.create!(:environment => environment, :person => person, :enabled => true) |
| 15 | 15 | newsletter.blog_ids = [blog.id] |
| 16 | 16 | newsletter.save! | ... | ... |
plugins/newsletter/test/unit/newsletter_plugin_moderate_newsletter_test.rb
| ... | ... | @@ -28,9 +28,9 @@ class NewsletterPluginModerateNewsletterTest < ActiveSupport::TestCase |
| 28 | 28 | should 'set posts for mailing body on perform' do |
| 29 | 29 | person = create_user('john').person |
| 30 | 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 | 35 | newsletter = NewsletterPlugin::Newsletter.create!(:environment => person.environment, :person => person, :enabled => true) |
| 36 | 36 | newsletter.blog_ids = [blog.id] | ... | ... |
plugins/newsletter/test/unit/newsletter_plugin_newsletter_test.rb
| ... | ... | @@ -381,9 +381,9 @@ EOS |
| 381 | 381 | person = fast_create(Person) |
| 382 | 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 | 388 | newsletter = NewsletterPlugin::Newsletter.create!( |
| 389 | 389 | :environment => person.environment, |
| ... | ... | @@ -397,9 +397,9 @@ EOS |
| 397 | 397 | person = fast_create(Person) |
| 398 | 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 | 404 | newsletter = NewsletterPlugin::Newsletter.create!( |
| 405 | 405 | :environment => person.environment, | ... | ... |
plugins/newsletter/views/newsletter_plugin_admin/index.html.erb
| 1 | 1 | <h1><%= _('Newsletter settings') %></h1> |
| 2 | 2 | |
| 3 | -<%= render :file => 'shared/tiny_mce' %> | |
| 4 | - | |
| 5 | 3 | <%= error_messages_for :newsletter %> |
| 6 | 4 | |
| 7 | 5 | <%= form_for(:newsletter, html: { multipart: true }) do |f| %> |
| ... | ... | @@ -81,7 +79,7 @@ |
| 81 | 79 | content_tag('h3', ui_icon('ui-icon-triangle-1-s') + |
| 82 | 80 | _('Newsletter footer'), :class => 'newsletter-toggle-link', :element_id => '#newsletter-footer-field'), |
| 83 | 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 | 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 < ActiveSupport::TestCase |
| 51 | 51 | user = User.current.person |
| 52 | 52 | |
| 53 | 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 | 55 | assert_last_activity user, :create_an_article, url_for(blog_post) |
| 56 | 56 | |
| 57 | 57 | gallery = Gallery.create! name: 'gallery', profile: user |
| ... | ... | @@ -65,7 +65,7 @@ class OpenGraphPlugin::PublisherTest < ActiveSupport::TestCase |
| 65 | 65 | assert_last_activity user, :create_an_event, url_for(event) |
| 66 | 66 | |
| 67 | 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 | 69 | assert_last_activity user, :start_a_discussion, url_for(topic, topic.url.merge(og_type: MetadataPlugin.og_types[:forum])) |
| 70 | 70 | |
| 71 | 71 | AddFriend.create!(person: user, friend: @other_actor).finish |
| ... | ... | @@ -82,7 +82,7 @@ class OpenGraphPlugin::PublisherTest < ActiveSupport::TestCase |
| 82 | 82 | User.current = @actor.user |
| 83 | 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 | 86 | story = :announce_news_from_a_sse_initiative |
| 87 | 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 < ActiveSupport::TestCase |
| 91 | 91 | user = User.current.person |
| 92 | 92 | |
| 93 | 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 | 95 | assert_last_activity user, :announce_news_from_a_sse_initiative, 'http://noosfero.net/coop/blog/blah2' |
| 96 | 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 | 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 | 101 | assert_last_activity user, :announce_news_from_a_community, 'http://noosfero.net/comm/blog/blah' |
| 102 | 102 | end |
| 103 | 103 | ... | ... |
plugins/orders_cycle/views/orders_cycle_plugin_cycle/_edit_fields.html.slim
| ... | ... | @@ -5,8 +5,7 @@ h3= t('views.cycle._edit_fields.general_settings') |
| 5 | 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 | 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 | 10 | .cycle-fields-block |
| 12 | 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 | 1 | <%= render :file => 'shared/tiny_mce', :locals => {:mode => 'simple'} %> |
| 2 | 2 | <% if !@product.description.blank? %> |
| 3 | 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 | 5 | <% else %> |
| 6 | 6 | <%= edit_product_ui_button_to_remote( |
| 7 | 7 | @product, | ... | ... |
plugins/products/views/products_plugin/page/_edit_description.html.erb
| 1 | -<%= render file: 'shared/tiny_mce', locals: {mode: 'simple'} %> | |
| 2 | 1 | <%= remote_form_for(@product, |
| 3 | 2 | loading: "small_loading('product-description-form')", |
| 4 | 3 | update: 'product-description', |
| 5 | 4 | url: {controller: 'products_plugin/page', action: 'edit', id: @product, field: 'description'}, |
| 6 | 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 | 8 | <%= button_bar do %> |
| 10 | 9 | <%= submit_button :save, _('Save') %> |
| 11 | 10 | <%= cancel_edit_product_link(@product, 'description') %> | ... | ... |
plugins/products/views/products_plugin/page/_form.html.erb
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | <%= display_form_field( _('Name:'), f.text_field(:name) ) %> |
| 7 | 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 | 9 | <%= labelled_form_field(f.check_box(:highlighted) + _('Highlight this product'),'') %> |
| 10 | 10 | <%= f.fields_for :image_builder, @product.image do |i| %> |
| 11 | 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 < ActiveSupport::TestCase |
| 42 | 42 | block = ProfileMembersHeadlinesBlock.create |
| 43 | 43 | block.stubs(:owner).returns(community) |
| 44 | 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 | 46 | self.expects(:render).with(:template => 'blocks/profile_members_headlines', :locals => { :block => block }).returns('file-with-authors-and-headlines') |
| 47 | 47 | assert_equal 'file-with-authors-and-headlines', render_block_content(block) |
| 48 | 48 | end |
| ... | ... | @@ -53,7 +53,7 @@ class ProfileMembersHeadlinesBlockTest < ActiveSupport::TestCase |
| 53 | 53 | block = ProfileMembersHeadlinesBlock.new(:limit => 1, :filtered_roles => [role.id]) |
| 54 | 54 | block.expects(:owner).returns(community) |
| 55 | 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 | 57 | assert_equal [member1], block.authors_list |
| 58 | 58 | end |
| 59 | 59 | |
| ... | ... | @@ -62,7 +62,7 @@ class ProfileMembersHeadlinesBlockTest < ActiveSupport::TestCase |
| 62 | 62 | block.expects(:owner).returns(community) |
| 63 | 63 | private_author = fast_create(Person, :public_profile => false) |
| 64 | 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 | 66 | assert_equal [], block.authors_list |
| 67 | 67 | end |
| 68 | 68 | |
| ... | ... | @@ -76,7 +76,7 @@ class ProfileMembersHeadlinesBlockTest < ActiveSupport::TestCase |
| 76 | 76 | block.stubs(:owner).returns(community) |
| 77 | 77 | community.members.each do |member| |
| 78 | 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 | 80 | end |
| 81 | 81 | assert_equal [author], block.authors_list |
| 82 | 82 | end | ... | ... |
plugins/recent_content/lib/recent_content_block.rb
| ... | ... | @@ -7,7 +7,7 @@ class RecentContentBlock < Block |
| 7 | 7 | |
| 8 | 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 | 12 | def self.description |
| 13 | 13 | c_('Recent content') | ... | ... |
plugins/recent_content/test/unit/recent_content_block_test.rb
| ... | ... | @@ -2,7 +2,7 @@ require_relative '../test_helper' |
| 2 | 2 | class RecentContentBlockTest < ActiveSupport::TestCase |
| 3 | 3 | |
| 4 | 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 | 7 | should 'describe itself' do |
| 8 | 8 | assert_not_equal Block.description, RecentContentBlock.description |
| ... | ... | @@ -61,9 +61,9 @@ class RecentContentBlockTest < ActiveSupport::TestCase |
| 61 | 61 | |
| 62 | 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 | 68 | block = RecentContentBlock.new |
| 69 | 69 | block.stubs(:holder).returns(profile) | ... | ... |
plugins/relevant_content/test/unit/article.rb
| ... | ... | @@ -29,9 +29,9 @@ class RelevantContentBlockTest < ActiveSupport::TestCase |
| 29 | 29 | |
| 30 | 30 | should 'list most commented articles' do |
| 31 | 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 | 36 | 2.times { Comment.create(:title => 'test', :body => 'asdsad', :author => profile, :source => a2).save! } |
| 37 | 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 | 4 | |
| 5 | 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 | 8 | * Add a "to" and "message" field and a submit button |
| 9 | 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 < ActiveSupport::TestCase |
| 29 | 29 | should 'expand macro used on form on profile context' do |
| 30 | 30 | profile = fast_create(Community) |
| 31 | 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 | 33 | assert_match /profile\/#{profile.identifier}\/plugin\/send_email\/deliver/, @plugin.parse_content(article.to_html, nil).first |
| 35 | 34 | end |
| 36 | 35 | ... | ... |
plugins/solr/lib/ext/article.rb
| ... | ... | @@ -72,13 +72,7 @@ class Article |
| 72 | 72 | end |
| 73 | 73 | |
| 74 | 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 | 76 | end |
| 83 | 77 | |
| 84 | 78 | def solr_plugin_f_profile_type |
| ... | ... | @@ -111,8 +105,6 @@ class Article |
| 111 | 105 | # see http://stackoverflow.com/questions/4138957/activerecordsubclassnotfound-error-when-using-sti-in-rails/4139245 |
| 112 | 106 | UploadedFile |
| 113 | 107 | TextArticle |
| 114 | - TinyMceArticle | |
| 115 | - TextileArticle | |
| 116 | 108 | Folder |
| 117 | 109 | EnterpriseHomepage |
| 118 | 110 | Gallery | ... | ... |