Merged r5950 to r5960 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@5961 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-05-29 12:06:05 +00:00
parent 2c2760d041
commit f08f09a9d3
48 changed files with 183 additions and 31 deletions

View File

@ -33,7 +33,9 @@ module SettingsHelper
choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
end
setting_label(setting, options) +
select_tag("settings[#{setting}]", options_for_select(choices, Setting.send(setting).to_s), options)
select_tag("settings[#{setting}]",
options_for_select(choices, Setting.send(setting).to_s),
options)
end
def setting_multiselect(setting, choices, options={})
@ -44,8 +46,13 @@ module SettingsHelper
hidden_field_tag("settings[#{setting}][]", '') +
choices.collect do |choice|
text, value = (choice.is_a?(Array) ? choice : [choice, choice])
content_tag('label',
check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
content_tag(
'label',
check_box_tag(
"settings[#{setting}][]",
value,
Setting.send(setting).include?(value)
) + text.to_s,
:class => 'block'
)
end.join

View File

@ -8,12 +8,9 @@
<div class="box tabular">
<p>
<%= label_tag('repository_scm', l(:label_scm)) %><%= scm_select_tag(@repository) %>
<% if @repository %>
<br />
<%= image_tag((@repository.class.scm_available ? 'true.png' : 'exclamation.png'))%>
<%= l(:text_scm_command) -%>: <%= @repository.class.scm_command %>
|
<%= l(:text_scm_command_version) -%>: <%= @repository.class.scm_version_string %>
<% if @repository && ! @repository.class.scm_available %>
<br />
<em><%= content_tag 'span', l(:text_scm_command_not_available), :class => 'error' %></em>
<% end %>
</p>
<% button_disabled = true %>

View File

@ -1,40 +1,94 @@
<% form_tag({:action => 'edit', :tab => 'repositories'}) do %>
<fieldset class="box tabular settings enabled_scm">
<legend><%= l(:setting_enabled_scm) %></legend>
<table>
<tr>
<th></th>
<th><%= l(:text_scm_command) %></th>
<th><%= l(:text_scm_command_version) %></th>
</tr>
<% Redmine::Scm::Base.all.collect do |choice| %>
<% scm_class = "Repository::#{choice}".constantize %>
<% text, value = (choice.is_a?(Array) ? choice : [choice, choice]) %>
<% setting = :enabled_scm %>
<tr>
<td class="scm_name">
<%=
check_box_tag(
"settings[#{setting}][]",
value,
Setting.send(setting).include?(value))
%>
<%= text.to_s %>
</td>
<td>
<%=
image_tag(
(scm_class.scm_available ? 'true.png' : 'exclamation.png'),
:style => "vertical-align:bottom;"
)
%>
<%= scm_class.scm_command %>
</td>
<td>
<%= scm_class.scm_version_string %>
</td>
</tr>
<% end %>
</table>
<p class="scm_config">
<%= l(:text_scm_config) %>
</p>
</fieldset>
<div class="box tabular settings">
<p><%= setting_check_box :autofetch_changesets %></p>
<p><%= setting_check_box :sys_api_enabled,
:onclick => "if (this.checked) { Form.Element.enable('settings_sys_api_key'); } else { Form.Element.disable('settings_sys_api_key'); }" %></p>
:onclick =>
"if (this.checked) { Form.Element.enable('settings_sys_api_key'); } else { Form.Element.disable('settings_sys_api_key'); }" %></p>
<p><%= setting_text_field :sys_api_key, :size => 30,
<p><%= setting_text_field :sys_api_key,
:size => 30,
:id => 'settings_sys_api_key',
:disabled => !Setting.sys_api_enabled?,
:label => :setting_mail_handler_api_key %>
<%= link_to_function l(:label_generate_key), "if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %>
<%= link_to_function l(:label_generate_key),
"if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %>
</p>
<p><%= setting_multiselect(:enabled_scm, Redmine::Scm::Base.all) %></p>
<p><%= setting_text_field :repositories_encodings, :size => 60 %><br />
<em><%= l(:text_comma_separated) %></em></p>
<p><%= setting_text_field :repository_log_display_limit, :size => 6 %></p>
</div>
<fieldset class="box tabular settings"><legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
<fieldset class="box tabular settings">
<legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
<p><%= setting_text_field :commit_ref_keywords, :size => 30 %><br />
<em><%= l(:text_comma_separated) %></em></p>
<p><%= setting_text_field :commit_fix_keywords, :size => 30 %>
&nbsp;<%= l(:label_applied_status) %>: <%= setting_select :commit_fix_status_id, [["", 0]] + IssueStatus.find(:all).collect{|status| [status.name, status.id.to_s]}, :label => false %>
&nbsp;<%= l(:field_done_ratio) %>: <%= setting_select :commit_fix_done_ratio, (0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] }, :blank => :label_no_change_option, :label => false %>
&nbsp;<%= l(:label_applied_status) %>: <%= setting_select :commit_fix_status_id,
[["", 0]] +
IssueStatus.find(:all).collect{
|status| [status.name, status.id.to_s]
},
:label => false %>
&nbsp;<%= l(:field_done_ratio) %>: <%= setting_select :commit_fix_done_ratio,
(0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] },
:blank => :label_no_change_option,
:label => false %>
<br /><em><%= l(:text_comma_separated) %></em></p>
<p><%= setting_check_box :commit_logtime_enabled,
:onclick => "if (this.checked) { Form.Element.enable('settings_commit_logtime_activity_id'); } else { Form.Element.disable('settings_commit_logtime_activity_id'); }"%></p>
:onclick =>
"if (this.checked) { Form.Element.enable('settings_commit_logtime_activity_id'); } else { Form.Element.disable('settings_commit_logtime_activity_id'); }"%></p>
<p><%= setting_select :commit_logtime_activity_id,
[[l(:label_default), 0]] + TimeEntryActivity.shared.all.collect{|activity| [activity.name, activity.id.to_s]},
[[l(:label_default), 0]] +
TimeEntryActivity.shared.all.collect{|activity| [activity.name, activity.id.to_s]},
:disabled => !Setting.commit_logtime_enabled?%></p>
</fieldset>

View File

@ -973,3 +973,5 @@ bg:
enumeration_doc_categories: Категории документи
enumeration_activities: Дейности (time tracking)
enumeration_system_activity: Системна активност
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -988,3 +988,5 @@ bs:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -977,3 +977,5 @@ ca:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -978,3 +978,5 @@ cs:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -991,3 +991,5 @@ da:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -991,3 +991,5 @@ de:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -974,3 +974,5 @@ el:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -977,3 +977,5 @@ en-GB:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -946,6 +946,8 @@ en:
text_mercurial_repository_note: "Local repository (e.g. /hgrepo, c:\hgrepo)"
text_scm_command: Command
text_scm_command_version: Version
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
default_role_manager: Manager
default_role_developer: Developer

View File

@ -1011,3 +1011,5 @@ es:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -978,3 +978,5 @@ eu:
text_scm_command: Komandoa
text_scm_command_version: Bertsioa
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -977,3 +977,5 @@ fa:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -995,3 +995,5 @@ fi:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -989,3 +989,5 @@ fr:
text_scm_command: Commande
text_scm_command_version: Version
label_git_report_last_commit: Afficher le dernier commit des fichiers et répertoires
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -986,3 +986,5 @@ gl:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -979,3 +979,5 @@ he:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -981,3 +981,5 @@ hr:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -993,3 +993,5 @@
text_scm_command: Parancs
text_scm_command_version: Verzió
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -982,3 +982,5 @@ id:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -975,3 +975,5 @@ it:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -950,6 +950,8 @@ ja:
text_mercurial_repository_note: "ローカルリポジトリ (例: /hgrepo, c:\hgrepo)"
text_scm_command: コマンド
text_scm_command_version: バージョン
text_scm_config: バージョン管理システムのコマンドをconfig/configuration.ymlで設定できます。設定後、Redmineを再起動してください。
text_scm_command_not_available: バージョン管理システムのコマンドが利用できません。管理画面にて設定を確認してください。
default_role_manager: 管理者
default_role_developer: 開発者

View File

@ -1026,3 +1026,5 @@ ko:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -1034,3 +1034,5 @@ lt:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -969,3 +969,5 @@ lv:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -974,3 +974,5 @@ mk:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -975,3 +975,5 @@ mn:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -956,3 +956,5 @@ nl:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -961,3 +961,5 @@
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -991,3 +991,5 @@ pl:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -994,3 +994,5 @@ pt-BR:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -979,3 +979,5 @@ pt:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -967,3 +967,5 @@ ro:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -1087,3 +1087,5 @@ ru:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -969,3 +969,5 @@ sk:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -970,3 +970,5 @@ sl:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -974,3 +974,5 @@ sr-YU:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -975,3 +975,5 @@ sr:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -1015,3 +1015,5 @@ sv:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -971,3 +971,5 @@ th:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -993,3 +993,5 @@ tr:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -970,3 +970,5 @@ uk:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -1025,3 +1025,5 @@ vi:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -1055,3 +1055,5 @@
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
enumeration_system_activity: 系統活動
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -977,3 +977,5 @@ zh:
text_scm_command: Command
text_scm_command_version: Version
label_git_report_last_commit: Report last commit for files and directories
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.

View File

@ -434,6 +434,10 @@ input#time_entry_comments { width: 90%;}
.tabular.settings label{ margin-left: -300px; width: 295px; }
.tabular.settings textarea { width: 99%; }
.tabular.settings.enabled_scm table {width:100%}
.tabular.settings.enabled_scm td.scm_name{ font-weight: bold; }
.tabular.settings.enabled_scm p.scm_config{ padding-left: 8px; font-style:italic;}
fieldset.settings label { display: block; }
fieldset#notified_events .parent { padding-left: 20px; }
@ -505,6 +509,8 @@ div.flash.warning {
color: #A6750C;
}
span.error {padding-left:20px; background:url(../images/exclamation.png) no-repeat 0 50%;}
#errorExplanation ul { font-size: 0.9em;}
#errorExplanation h2, #errorExplanation p { display: none; }