Commit 24c78ad590eca967f4b0f28c66a9856d28abc176
1 parent
1e3f985a
Exists in
master
and in
28 other branches
Remove "Disable CMS" feature
This "feature" started as a workaround for the fact that "the CMS is not good rnough". In practice, it was only effective for enterprises, and the only known site that actually used this in the past does not use it for ages.
Showing
5 changed files
with
25 additions
and
45 deletions
Show diff stats
app/models/environment.rb
... | ... | @@ -94,7 +94,6 @@ class Environment < ActiveRecord::Base |
94 | 94 | 'disable_asset_events' => _('Disable search for events'), |
95 | 95 | 'disable_products_for_enterprises' => __('Disable products for enterprises'), |
96 | 96 | 'disable_categories' => _('Disable categories'), |
97 | - 'disable_cms' => _('Disable CMS'), | |
98 | 97 | 'disable_header_and_footer' => _('Disable header/footer editing by users'), |
99 | 98 | 'disable_gender_icon' => _('Disable gender icon'), |
100 | 99 | 'disable_categories_menu' => _('Disable the categories menu'), | ... | ... |
app/views/cms/_tiny_mce_article.rhtml
... | ... | @@ -3,13 +3,7 @@ |
3 | 3 | <%= render :file => 'shared/tiny_mce' %> |
4 | 4 | |
5 | 5 | <div> |
6 | - <% if profile.enterprise? && environment.enabled?('disable_cms') && !@article.name.blank? %> | |
7 | - <div> | |
8 | - <%= _('Title') %>: <%= @article.name %> | |
9 | - </div> | |
10 | - <% else %> | |
11 | - <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %> | |
12 | - <% end %> | |
6 | + <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %> | |
13 | 7 | |
14 | 8 | <%= render :partial => 'translatable' %> |
15 | 9 | <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true} %> | ... | ... |
app/views/content_viewer/_article_toolbar.rhtml
... | ... | @@ -5,36 +5,32 @@ |
5 | 5 | <%= link_to content_tag( 'span', label_for_edit_article(@page) ), |
6 | 6 | profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }), |
7 | 7 | :class => 'button with-text icon-edit' %> |
8 | - <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %> | |
9 | - <% if @page != profile.home_page && !@page.has_posts? %> | |
10 | - <%= link_to content_tag( 'span', _('Delete') ), | |
11 | - profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page}), | |
12 | - :method => :post, | |
13 | - :class => 'button with-text icon-delete', | |
14 | - :confirm => delete_article_message(@page) %> | |
15 | - <% end %> | |
16 | - <% if !environment.enabled?('disable_cms') && !@page.folder? %> | |
17 | - <% if profile.kind_of?(Person) %> | |
18 | - <%= link_to content_tag( 'span', _('Spread this') ), | |
19 | - profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page }), | |
20 | - :class => 'button with-text icon-spread' %> | |
21 | - <% elsif profile.kind_of?(Community) && environment.portal_community %> | |
22 | - <%= link_to content_tag( 'span', _('Spread this') ), | |
23 | - profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page }), | |
24 | - :class => 'button with-text icon-spread' %> | |
25 | - <% end %> | |
8 | + <% if @page != profile.home_page && !@page.has_posts? %> | |
9 | + <%= link_to content_tag( 'span', _('Delete') ), | |
10 | + profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page}), | |
11 | + :method => :post, | |
12 | + :class => 'button with-text icon-delete', | |
13 | + :confirm => delete_article_message(@page) %> | |
14 | + <% end %> | |
15 | + <% if !@page.folder? %> | |
16 | + <% if profile.kind_of?(Person) %> | |
17 | + <%= link_to content_tag( 'span', _('Spread this') ), | |
18 | + profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page }), | |
19 | + :class => 'button with-text icon-spread' %> | |
20 | + <% elsif profile.kind_of?(Community) && environment.portal_community %> | |
21 | + <%= link_to content_tag( 'span', _('Spread this') ), | |
22 | + profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page }), | |
23 | + :class => 'button with-text icon-spread' %> | |
26 | 24 | <% end %> |
27 | 25 | <% end %> |
28 | 26 | <% end %> |
29 | - <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %> | |
30 | - <% if !@page.gallery? %> | |
31 | - <%= link_to _('Add translation'), | |
32 | - profile.admin_url.merge(:controller => 'cms', :action => 'new', | |
33 | - :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)), | |
34 | - :type => @page.type, :article => { :translation_of_id => @page.native_translation.id }), | |
35 | - :class => 'button with-text icon-locale' if @page.translatable? && !@page.native_translation.language.blank? %> | |
36 | - <%= lightbox_remote_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) %> | |
37 | - <% end %> | |
27 | + <% if !@page.gallery? %> | |
28 | + <%= link_to _('Add translation'), | |
29 | + profile.admin_url.merge(:controller => 'cms', :action => 'new', | |
30 | + :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)), | |
31 | + :type => @page.type, :article => { :translation_of_id => @page.native_translation.id }), | |
32 | + :class => 'button with-text icon-locale' if @page.translatable? && !@page.native_translation.language.blank? %> | |
33 | + <%= lightbox_remote_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) %> | |
38 | 34 | <% end %> |
39 | 35 | <% if @page.accept_uploads? %> |
40 | 36 | <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) %> | ... | ... |
app/views/profile_editor/index.rhtml
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | |
27 | 27 | <%= control_panel_button(_('Edit Header and Footer'), 'header-and-footer', :controller => 'profile_editor', :action => 'header_footer') unless profile.enterprise? && environment.enabled?('disable_header_and_footer') && !user.is_admin?(environment) %> |
28 | 28 | |
29 | - <%= control_panel_button(_('Manage Content'), 'cms', :controller => 'cms') if !environment.enabled?('disable_cms') || profile.community? %> | |
29 | + <%= control_panel_button(_('Manage Content'), 'cms', :controller => 'cms') %> | |
30 | 30 | |
31 | 31 | <% unless profile.enterprise? %> |
32 | 32 | <%= case profile.blogs.count | ... | ... |
test/functional/profile_editor_controller_test.rb
... | ... | @@ -601,15 +601,6 @@ class ProfileEditorControllerTest < ActionController::TestCase |
601 | 601 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/default_user/cms' } |
602 | 602 | end |
603 | 603 | |
604 | - should 'not display link to CMS if disabled' do | |
605 | - env = Environment.default | |
606 | - env.enable('disable_cms') | |
607 | - env.save! | |
608 | - get :index, :profile => profile.identifier | |
609 | - | |
610 | - assert_no_tag :tag => 'a', :attributes => { :href => '/myprofile/default_user/cms' } | |
611 | - end | |
612 | - | |
613 | 604 | should 'offer to create blog in control panel' do |
614 | 605 | get :index, :profile => profile.identifier |
615 | 606 | assert_tag :tag => 'a', :attributes => { :href => "/myprofile/default_user/cms/new?type=Blog" } | ... | ... |