]> source.dussan.org Git - redmine.git/commitdiff
Text formatting drop down disabled if RedCloth is not available (system settings).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 1 May 2007 08:37:07 +0000 (08:37 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 1 May 2007 08:37:07 +0000 (08:37 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@497 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/settings_controller.rb
app/views/settings/edit.rhtml

index 229a4ab3c050f1d66061df27ebb756f05feda0a0..fd094adb3b79f34d8efff2d786f09721f6f43c34 100644 (file)
@@ -29,5 +29,6 @@ class SettingsController < ApplicationController
       params[:settings].each { |name, value| Setting[name] = value }
       redirect_to :action => 'edit' and return
     end
+    @textile_available = ActionView::Helpers::TextHelper.method_defined?("textilize")
   end
 end
index 4c9b5502907ca3ccba855eb480bad10b75b701c1..057a988de11c09855a5f1ed755ca50044b44be68 100644 (file)
@@ -37,7 +37,7 @@
 <%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
 
 <p><label><%= l(:setting_text_formatting) %></label>
-<%= select_tag 'settings[text_formatting]', options_for_select( [[l(:label_none), 0], ["textile", "textile"]], Setting.text_formatting) %></p>
+<%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), 0], ["textile", "textile"]], (@textile_available ? Setting.text_formatting : 0)), :disabled => !@textile_available %></p>
 
 <p><label><%= l(:setting_wiki_compression) %></label>
 <%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p>