##// END OF EJS Templates
Text formatting drop down disabled if RedCloth is not available (system settings)....
Jean-Philippe Lang -
r494:124cca3af030
parent child
Show More
@@ -1,33 +1,34
1 1 # redMine - project management software
2 2 # Copyright (C) 2006-2007 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 class SettingsController < ApplicationController
19 19 layout 'base'
20 20 before_filter :require_admin
21 21
22 22 def index
23 23 edit
24 24 render :action => 'edit'
25 25 end
26 26
27 27 def edit
28 28 if request.post? and params[:settings] and params[:settings].is_a? Hash
29 29 params[:settings].each { |name, value| Setting[name] = value }
30 30 redirect_to :action => 'edit' and return
31 31 end
32 @textile_available = ActionView::Helpers::TextHelper.method_defined?("textilize")
32 33 end
33 34 end
@@ -1,67 +1,67
1 1 <h2><%= l(:label_settings) %></h2>
2 2
3 3 <div id="settings">
4 4 <% form_tag({:action => 'edit'}, :class => "tabular") do %>
5 5 <div class="box">
6 6 <p><label><%= l(:setting_app_title) %></label>
7 7 <%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %></p>
8 8
9 9 <p><label><%= l(:setting_app_subtitle) %></label>
10 10 <%= text_field_tag 'settings[app_subtitle]', Setting.app_subtitle, :size => 60 %></p>
11 11
12 12 <p><label><%= l(:setting_welcome_text) %></label>
13 13 <%= text_area_tag 'settings[welcome_text]', Setting.welcome_text, :cols => 60, :rows => 5 %></p>
14 14
15 15 <p><label><%= l(:setting_default_language) %></label>
16 16 <%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p>
17 17
18 18 <p><label><%= l(:setting_login_required) %></label>
19 19 <%= check_box_tag 'settings[login_required]', 1, Setting.login_required? %><%= hidden_field_tag 'settings[login_required]', 0 %></p>
20 20
21 21 <p><label><%= l(:setting_self_registration) %></label>
22 22 <%= check_box_tag 'settings[self_registration]', 1, Setting.self_registration? %><%= hidden_field_tag 'settings[self_registration]', 0 %></p>
23 23
24 24 <p><label><%= l(:label_password_lost) %></label>
25 25 <%= check_box_tag 'settings[lost_password]', 1, Setting.lost_password? %><%= hidden_field_tag 'settings[lost_password]', 0 %></p>
26 26
27 27 <p><label><%= l(:setting_attachment_max_size) %></label>
28 28 <%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p>
29 29
30 30 <p><label><%= l(:setting_issues_export_limit) %></label>
31 31 <%= text_field_tag 'settings[issues_export_limit]', Setting.issues_export_limit, :size => 6 %></p>
32 32
33 33 <p><label><%= l(:setting_mail_from) %></label>
34 34 <%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
35 35
36 36 <p><label><%= l(:setting_host_name) %></label>
37 37 <%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
38 38
39 39 <p><label><%= l(:setting_text_formatting) %></label>
40 <%= select_tag 'settings[text_formatting]', options_for_select( [[l(:label_none), 0], ["textile", "textile"]], Setting.text_formatting) %></p>
40 <%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), 0], ["textile", "textile"]], (@textile_available ? Setting.text_formatting : 0)), :disabled => !@textile_available %></p>
41 41
42 42 <p><label><%= l(:setting_wiki_compression) %></label>
43 43 <%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p>
44 44
45 45 <p><label><%= l(:setting_feeds_limit) %></label>
46 46 <%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p>
47 47
48 48 <p><label><%= l(:setting_autofetch_changesets) %></label>
49 49 <%= check_box_tag 'settings[autofetch_changesets]', 1, Setting.autofetch_changesets? %><%= hidden_field_tag 'settings[autofetch_changesets]', 0 %></p>
50 50
51 51 <p><label><%= l(:setting_sys_api_enabled) %></label>
52 52 <%= check_box_tag 'settings[sys_api_enabled]', 1, Setting.sys_api_enabled? %><%= hidden_field_tag 'settings[sys_api_enabled]', 0 %></p>
53 53 </div>
54 54
55 55 <fieldset class="box"><legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
56 56 <p><label><%= l(:setting_commit_ref_keywords) %></label>
57 57 <%= text_field_tag 'settings[commit_ref_keywords]', Setting.commit_ref_keywords, :size => 30 %><br /><em><%= l(:text_coma_separated) %></em></p>
58 58
59 59 <p><label><%= l(:setting_commit_fix_keywords) %></label>
60 60 <%= text_field_tag 'settings[commit_fix_keywords]', Setting.commit_fix_keywords, :size => 30 %>
61 61 &nbsp;<%= l(:label_applied_status) %>: <%= select_tag 'settings[commit_fix_status_id]', options_for_select( [["", 0]] + IssueStatus.find(:all).collect{|status| [status.name, status.id.to_s]}, Setting.commit_fix_status_id) %>
62 62 <br /><em><%= l(:text_coma_separated) %></em></p>
63 63 </fieldset>
64 64
65 65 <%= submit_tag l(:button_save) %>
66 66 </div>
67 67 <% end %> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now