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