added setting option for wiki history compression (none or gzip)
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@292 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -28,11 +28,18 @@ class WikiContent < ActiveRecord::Base
|
||||
attr_protected :data
|
||||
|
||||
def text=(plain)
|
||||
gz = Zlib::GzipWriter.new(compressed = StringIO.new)
|
||||
gz.write(plain)
|
||||
gz.close
|
||||
self.data = compressed.string
|
||||
self.compression = 'gzip'
|
||||
case Setting.wiki_compression
|
||||
when 'gzip'
|
||||
gz = Zlib::GzipWriter.new(compressed = StringIO.new)
|
||||
gz.write(plain)
|
||||
gz.close
|
||||
self.data = compressed.string
|
||||
self.compression = 'gzip'
|
||||
else
|
||||
self.data = plain
|
||||
self.compression = ''
|
||||
end
|
||||
plain
|
||||
end
|
||||
|
||||
def text
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
</div>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user