Feature #8095 » prototype.diff
| app/helpers/application_helper.rb | ||
|---|---|---|
| 923 | 923 | 
    if options[:formatting] == false  | 
| 924 | 924 | 
    text = h(text)  | 
| 925 | 925 | 
    else  | 
| 926 | 
    formatting = Setting.text_formatting  | 
|
| 926 | 
          formatting = Setting.text_formatting_for(project)
   | 
|
| 927 | 927 | 
    text = Redmine::WikiFormatting.to_html(formatting, text, :object => obj, :attribute => attr)  | 
| 928 | 928 | 
    end  | 
| 929 | 929 | |
| ... | ... | |
| 1950 | 1950 | 
    private  | 
| 1951 | 1951 | |
| 1952 | 1952 | 
    def wiki_helper  | 
| 1953 | 
    helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting)  | 
|
| 1953 | 
        helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting_for(@project))
   | 
|
| 1954 | 1954 | 
    extend helper  | 
| 1955 | 1955 | 
    return self  | 
| 1956 | 1956 | 
    end  | 
| app/helpers/settings_helper.rb | ||
|---|---|---|
| 110 | 110 | 
            check_box_tag("settings[#{setting}]", 1, setting_value(setting).to_s != '0', options).html_safe
   | 
| 111 | 111 | 
    end  | 
| 112 | 112 | |
| 113 | 
      def setting_date_field(setting, options={})
   | 
|
| 114 | 
    setting_label(setting, options).html_safe +  | 
|
| 115 | 
          date_field_tag("settings[#{setting}]", setting_value(setting), options).html_safe
   | 
|
| 116 | 
    end  | 
|
| 117 | ||
| 113 | 118 | 
      def setting_label(setting, options={})
   | 
| 114 | 119 | 
    label = options.delete(:label)  | 
| 115 | 120 | 
    if label == false  | 
| app/models/setting.rb | ||
|---|---|---|
| 273 | 273 | 
    a  | 
| 274 | 274 | 
    end  | 
| 275 | 275 | |
| 276 | 
    def self.text_formatting_for(project)  | 
|
| 277 | 
    cutoff = Setting.use_textile_before_date.to_date rescue nil  | 
|
| 278 | 
    default_text_formatting = Setting.default_text_formatting  | 
|
| 279 | 
    return default_text_formatting if project.nil? || cutoff.blank? || default_text_formatting == "textile"  | 
|
| 280 | ||
| 281 | 
    created = project.created_on.utc.to_date  | 
|
| 282 | 
    created < cutoff ? :textile : default_text_formatting  | 
|
| 283 | 
    end  | 
|
| 284 | ||
| 276 | 285 | 
    # Checks if settings have changed since the values were read  | 
| 277 | 286 | 
    # and clears the cache hash if it's the case  | 
| 278 | 287 | 
    # Called once per request  | 
| ... | ... | |
| 334 | 343 | 
    load_available_settings  | 
| 335 | 344 | 
    load_plugin_settings  | 
| 336 | 345 | |
| 346 | 
    class << self  | 
|
| 347 | 
    alias_method :default_text_formatting, :text_formatting  | 
|
| 348 | 
    end  | 
|
| 349 | ||
| 337 | 350 | 
    private  | 
| 338 | 351 | |
| 339 | 352 | 
    def force_utf8_strings(arg)  | 
| app/views/settings/_general.html.erb | ||
|---|---|---|
| 33 | 33 | |
| 34 | 34 | 
    <p><%= setting_check_box :cache_formatted_text %></p>  | 
| 35 | 35 | |
| 36 | 
    <p><%= setting_date_field :use_textile_before_date %></p>  | 
|
| 37 | ||
| 36 | 38 | 
    <p><%= setting_select :wiki_compression, [['Gzip', 'gzip']], :blank => :label_none %></p>  | 
| 37 | 39 | |
| 38 | 40 | 
    <p><%= setting_text_field :feeds_limit, :size => 6 %></p>  | 
| config/locales/en.yml | ||
|---|---|---|
| 442 | 442 | 
    setting_plain_text_mail: Plain text mail (no HTML)  | 
| 443 | 443 | 
    setting_host_name: Host name and path  | 
| 444 | 444 | 
    setting_text_formatting: Text formatting  | 
| 445 | 
    setting_use_textile_before_date: "Use Textile for projects created before"  | 
|
| 445 | 446 | 
    setting_wiki_compression: Wiki history compression  | 
| 446 | 447 | 
    setting_feeds_limit: Maximum number of items in Atom feeds  | 
| 447 | 448 | 
    setting_default_projects_public: New projects are public by default  | 
| config/settings.yml | ||
|---|---|---|
| 373 | 373 | 
    default: 0  | 
| 374 | 374 | 
    reactions_enabled:  | 
| 375 | 375 | 
    default: 1  | 
| 376 | 
    use_textile_before_date:  | 
|
| 377 | 
    default: ''  | 
|
- « Previous
 - 1
 - 2
 - 3
 - Next »