Commit 705552e932c745dd5ddf337416cb54caf4504654

Authored by Joenio Costa
Committed by Daniela Feitosa
1 parent 0109d80f

Always use TinyMCE on edit site info

Makes no sense to have a configuration like that in environment
app/models/environment.rb
@@ -93,7 +93,6 @@ class Environment < ActiveRecord::Base @@ -93,7 +93,6 @@ class Environment < ActiveRecord::Base
93 'enterprise_registration' => __('Enterprise registration'), 93 'enterprise_registration' => __('Enterprise registration'),
94 94
95 'enterprise_activation' => __('Enable activation of enterprises'), 95 'enterprise_activation' => __('Enable activation of enterprises'),
96 - 'wysiwyg_editor_for_environment_home' => _('Use WYSIWYG editor to edit environment home page'),  
97 'media_panel' => _('Media panel in WYSIWYG editor'), 96 'media_panel' => _('Media panel in WYSIWYG editor'),
98 'select_preferred_domain' => _('Select preferred domains per profile'), 97 'select_preferred_domain' => _('Select preferred domains per profile'),
99 'use_portal_community' => _('Use the portal as news source for front page'), 98 'use_portal_community' => _('Use the portal as news source for front page'),
@@ -274,7 +273,6 @@ class Environment < ActiveRecord::Base @@ -274,7 +273,6 @@ class Environment < ActiveRecord::Base
274 organizations_are_moderated_by_default 273 organizations_are_moderated_by_default
275 show_balloon_with_profile_links_when_clicked 274 show_balloon_with_profile_links_when_clicked
276 use_portal_community 275 use_portal_community
277 - wysiwyg_editor_for_environment_home  
278 ).each do |feature| 276 ).each do |feature|
279 enable(feature) 277 enable(feature)
280 end 278 end
app/views/admin_panel/site_info.rhtml
1 <h2><%= _('Site info') %></h2> 1 <h2><%= _('Site info') %></h2>
2 2
3 -<% if @environment.enabled?('wysiwyg_editor_for_environment_home') %>  
4 - <%= render :file => 'shared/tiny_mce' %>  
5 -<% end %> 3 +<%= render :file => 'shared/tiny_mce' %>
6 4
7 <% labelled_form_for :environment, @environment do |f| %> 5 <% labelled_form_for :environment, @environment do |f| %>
8 6
test/functional/admin_panel_controller_test.rb
@@ -127,14 +127,7 @@ class AdminPanelControllerTest &lt; Test::Unit::TestCase @@ -127,14 +127,7 @@ class AdminPanelControllerTest &lt; Test::Unit::TestCase
127 assert_equal "This <strong>is</strong> my new environment", Environment.default.message_for_disabled_enterprise 127 assert_equal "This <strong>is</strong> my new environment", Environment.default.message_for_disabled_enterprise
128 end 128 end
129 129
130 - should 'not use WYSWYIG if disabled' do  
131 - e = Environment.default; e.disable('wysiwyg_editor_for_environment_home'); e.save!  
132 - get :site_info  
133 - assert_no_tag :tag => "script", :content => /tinyMCE\.init/  
134 - end  
135 -  
136 - should 'use WYSWYIG if enabled' do  
137 - e = Environment.default; e.enable('wysiwyg_editor_for_environment_home'); e.save! 130 + should 'always use WYSIWYG' do
138 get :site_info 131 get :site_info
139 assert_tag :tag => "script", :content => /tinyMCE\.init/ 132 assert_tag :tag => "script", :content => /tinyMCE\.init/
140 end 133 end