Commit b74d554ff266d440dacc324da40689ad3832cf34

Authored by Antonio Terceiro
1 parent b825d717

ActionItem928: disabling media_panel reasonably

app/models/environment.rb
@@ -44,6 +44,7 @@ class Environment < ActiveRecord::Base @@ -44,6 +44,7 @@ class Environment < ActiveRecord::Base
44 'enterprise_activation' => _('Enable activation of enterprises'), 44 'enterprise_activation' => _('Enable activation of enterprises'),
45 'warn_obsolete_browser' => _('Enable warning of obsolete browser'), 45 'warn_obsolete_browser' => _('Enable warning of obsolete browser'),
46 'wysiwyg_editor_for_environment_home' => _('Use WYSIWYG editor to edit environment home page'), 46 'wysiwyg_editor_for_environment_home' => _('Use WYSIWYG editor to edit environment home page'),
  47 + 'media_panel' => _('Media panel in WYSIWYG editor'),
47 } 48 }
48 end 49 end
49 50
app/views/cms/edit.rhtml
1 <%= error_messages_for 'article' %> 1 <%= error_messages_for 'article' %>
2 2
3 -<% labelled_form_for 'article', @article, :html => { :multipart => true, :style => 'width:57%;float:left;' } do |f| %> 3 +<div class='<%= (environment.enabled?('media_panel') ? 'with_media_panel' : 'no_media_panel') %>'>
  4 +<% labelled_form_for 'article', @article, :html => { :multipart => true } do |f| %>
4 5
5 <%= hidden_field_tag("type", @type) if @type %> 6 <%= hidden_field_tag("type", @type) if @type %>
6 7
@@ -38,7 +39,8 @@ @@ -38,7 +39,8 @@
38 <% end %> 39 <% end %>
39 <% end %> 40 <% end %>
40 <% end %> 41 <% end %>
  42 +</div>
41 43
42 -<% if [TinyMceArticle, Event, EnterpriseHomepage].any?{|klass| @article.kind_of?(klass)} %> 44 +<% if environment.enabled?('media_panel') && [TinyMceArticle, Event, EnterpriseHomepage].any?{|klass| @article.kind_of?(klass)} %>
43 <%= render :partial => 'media_listing' %> 45 <%= render :partial => 'media_listing' %>
44 <% end %> 46 <% end %>
public/stylesheets/controller_cms.css
@@ -161,3 +161,12 @@ div.file-manager-button a:hover { @@ -161,3 +161,12 @@ div.file-manager-button a:hover {
161 .msie #media-listing-iframe { 161 .msie #media-listing-iframe {
162 height: 610px; 162 height: 610px;
163 } 163 }
  164 +
  165 +div.with_media_panel {
  166 + width: 57%;
  167 + float: left;
  168 +}
  169 +div.no_media_panel {
  170 + margin-left: 200px;
  171 + margin-right: 200px;
  172 +}