From a80dbc49b1670877aca09b11101d4a5b40ea58c2 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang
Date: Sun, 6 Jan 2008 20:24:26 +0000
Subject: Admin settings screen split to tabs. Email notification options moved
to this view as a tab and LDAP list is accessible from the 'Authentication'
tab.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1046 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
app/views/admin/index.rhtml | 8 ---
app/views/admin/mail_options.rhtml | 33 ---------
app/views/settings/_authentication.rhtml | 27 ++++++++
app/views/settings/_general.rhtml | 46 +++++++++++++
app/views/settings/_issues.rhtml | 20 ++++++
app/views/settings/_notifications.rhtml | 30 +++++++++
app/views/settings/_repositories.rhtml | 26 ++++++++
app/views/settings/edit.rhtml | 111 ++++---------------------------
8 files changed, 161 insertions(+), 140 deletions(-)
delete mode 100644 app/views/admin/mail_options.rhtml
create mode 100644 app/views/settings/_authentication.rhtml
create mode 100644 app/views/settings/_general.rhtml
create mode 100644 app/views/settings/_issues.rhtml
create mode 100644 app/views/settings/_notifications.rhtml
create mode 100644 app/views/settings/_repositories.rhtml
(limited to 'app/views')
diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml
index 2291c5415..18bee34cb 100644
--- a/app/views/admin/index.rhtml
+++ b/app/views/admin/index.rhtml
@@ -30,14 +30,6 @@
<%= link_to l(:label_enumerations), :controller => 'enumerations' %>
-
-<%= link_to l(:field_mail_notification), :controller => 'admin', :action => 'mail_options' %>
-
-
-
-<%= link_to l(:label_authentication), :controller => 'auth_sources' %>
-
-
<%= link_to l(:label_settings), :controller => 'settings' %>
diff --git a/app/views/admin/mail_options.rhtml b/app/views/admin/mail_options.rhtml
deleted file mode 100644
index 698933b9b..000000000
--- a/app/views/admin/mail_options.rhtml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-<%= link_to l(:label_send_test_email), :action => 'test_email' %>
-
-
-<%=l(:field_mail_notification)%>
-
-<% form_tag({:action => 'mail_options'}, :id => 'mail-options-form') do %>
-
-
-
-
-
-
-
-<%= submit_tag l(:button_save) %>
-<% end %>
-
-<% html_title(l(:field_mail_notification)) -%>
diff --git a/app/views/settings/_authentication.rhtml b/app/views/settings/_authentication.rhtml
new file mode 100644
index 000000000..a8fa63f0d
--- /dev/null
+++ b/app/views/settings/_authentication.rhtml
@@ -0,0 +1,27 @@
+<% form_tag({:action => 'edit', :tab => 'authentication'}) do %>
+
+
+
+<%= check_box_tag 'settings[login_required]', 1, Setting.login_required? %><%= hidden_field_tag 'settings[login_required]', 0 %>
+
+
+<%= select_tag 'settings[autologin]', options_for_select( [[l(:label_disabled), "0"]] + [1, 7, 30, 365].collect{|days| [lwr(:actionview_datehelper_time_in_words_day, days), days.to_s]}, Setting.autologin) %>
+
+
+<%= select_tag 'settings[self_registration]',
+ options_for_select( [[l(:label_disabled), "0"],
+ [l(:label_registration_activation_by_email), "1"],
+ [l(:label_registration_manual_activation), "2"],
+ [l(:label_registration_automatic_activation), "3"]
+ ], Setting.self_registration ) %>
+
+
+<%= check_box_tag 'settings[lost_password]', 1, Setting.lost_password? %><%= hidden_field_tag 'settings[lost_password]', 0 %>
+
+
+
+ <%= link_to 'Manage LDAP authentication...', :controller => 'auth_sources', :action => 'list' %>
+
+
+<%= submit_tag l(:button_save) %>
+<% end %>
diff --git a/app/views/settings/_general.rhtml b/app/views/settings/_general.rhtml
new file mode 100644
index 000000000..514e62b59
--- /dev/null
+++ b/app/views/settings/_general.rhtml
@@ -0,0 +1,46 @@
+<% form_tag({:action => 'edit'}) do %>
+
+
+
+<%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %>
+
+
+<%= text_area_tag 'settings[welcome_text]', Setting.welcome_text, :cols => 60, :rows => 5, :class => 'wiki-edit' %>
+<%= wikitoolbar_for 'settings[welcome_text]' %>
+
+
+<%= select_tag 'settings[ui_theme]', options_for_select( ([[l(:label_default), '']] + Redmine::Themes.themes.collect {|t| [t.name, t.id]}), Setting.ui_theme) %>
+
+
+<%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %>
+
+
+<%= select_tag 'settings[date_format]', options_for_select( [[l(:label_language_based), '']] + Setting::DATE_FORMATS.collect {|f| [Date.today.strftime(f), f]}, Setting.date_format) %>
+
+
+<%= select_tag 'settings[time_format]', options_for_select( [[l(:label_language_based), '']] + Setting::TIME_FORMATS.collect {|f| [Time.now.strftime(f), f]}, Setting.time_format) %>
+
+
+<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB
+
+
+<%= text_field_tag 'settings[per_page_options]', Setting.per_page_options_array.join(', '), :size => 20 %>
<%= l(:text_comma_separated) %>
+
+
+<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %>
+
+
+<%= select_tag 'settings[protocol]', options_for_select(['http', 'https'], Setting.protocol) %>
+
+
+<%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), "0"], ["textile", "textile"]], Setting.text_formatting) %>
+
+
+<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %>
+
+
+<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %>
+
+
+<%= submit_tag l(:button_save) %>
+<% end %>
diff --git a/app/views/settings/_issues.rhtml b/app/views/settings/_issues.rhtml
new file mode 100644
index 000000000..36c604fd9
--- /dev/null
+++ b/app/views/settings/_issues.rhtml
@@ -0,0 +1,20 @@
+<% form_tag({:action => 'edit', :tab => 'issues'}) do %>
+
+
+
+<%= check_box_tag 'settings[cross_project_issue_relations]', 1, Setting.cross_project_issue_relations? %><%= hidden_field_tag 'settings[cross_project_issue_relations]', 0 %>
+
+
+<%= text_field_tag 'settings[issues_export_limit]', Setting.issues_export_limit, :size => 6 %>
+
+
+
+
+<%= submit_tag l(:button_save) %>
+<% end %>
diff --git a/app/views/settings/_notifications.rhtml b/app/views/settings/_notifications.rhtml
new file mode 100644
index 000000000..ca04352f4
--- /dev/null
+++ b/app/views/settings/_notifications.rhtml
@@ -0,0 +1,30 @@
+<% form_tag({:action => 'edit', :tab => 'notifications'}) do %>
+
+
+
+<%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %>
+
+
+<%= check_box_tag 'settings[bcc_recipients]', 1, Setting.bcc_recipients? %>
+<%= hidden_field_tag 'settings[bcc_recipients]', 0 %>
+
+
+
+
+
+
+
+<%= link_to l(:label_send_test_email), :controller => 'admin', :action => 'test_email' %>
+
+
+<%= submit_tag l(:button_save) %>
+<% end %>
diff --git a/app/views/settings/_repositories.rhtml b/app/views/settings/_repositories.rhtml
new file mode 100644
index 000000000..59b3b51de
--- /dev/null
+++ b/app/views/settings/_repositories.rhtml
@@ -0,0 +1,26 @@
+<% form_tag({:action => 'edit', :tab => 'repositories'}) do %>
+
+
+
+<%= check_box_tag 'settings[autofetch_changesets]', 1, Setting.autofetch_changesets? %><%= hidden_field_tag 'settings[autofetch_changesets]', 0 %>
+
+
+<%= check_box_tag 'settings[sys_api_enabled]', 1, Setting.sys_api_enabled? %><%= hidden_field_tag 'settings[sys_api_enabled]', 0 %>
+
+
+<%= text_field_tag 'settings[repositories_encodings]', Setting.repositories_encodings, :size => 60 %>
<%= l(:text_comma_separated) %>
+
+
+
+
+<%= submit_tag l(:button_save) %>
+<% end %>
diff --git a/app/views/settings/edit.rhtml b/app/views/settings/edit.rhtml
index b1762a0e3..c7b47b6d0 100644
--- a/app/views/settings/edit.rhtml
+++ b/app/views/settings/edit.rhtml
@@ -1,105 +1,18 @@
<%= l(:label_settings) %>
-<% form_tag({:action => 'edit'}) do %>
-
-
-<%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %>
-
-
-<%= text_field_tag 'settings[app_subtitle]', Setting.app_subtitle, :size => 60 %>
-
-
-<%= text_area_tag 'settings[welcome_text]', Setting.welcome_text, :cols => 60, :rows => 5, :class => 'wiki-edit' %>
-<%= wikitoolbar_for 'settings[welcome_text]' %>
-
-
-<%= select_tag 'settings[ui_theme]', options_for_select( ([[l(:label_default), '']] + Redmine::Themes.themes.collect {|t| [t.name, t.id]}), Setting.ui_theme) %>
-
-
-<%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %>
-
-
-<%= select_tag 'settings[date_format]', options_for_select( [[l(:label_language_based), '']] + Setting::DATE_FORMATS.collect {|f| [Date.today.strftime(f), f]}, Setting.date_format) %>
-
-
-<%= select_tag 'settings[time_format]', options_for_select( [[l(:label_language_based), '']] + Setting::TIME_FORMATS.collect {|f| [Time.now.strftime(f), f]}, Setting.time_format) %>
-
-
-<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB
-
-
-<%= text_field_tag 'settings[per_page_options]', Setting.per_page_options_array.join(', '), :size => 20 %>
<%= l(:text_comma_separated) %>
-
-
-<%= text_field_tag 'settings[issues_export_limit]', Setting.issues_export_limit, :size => 6 %>
-
-
-<%= check_box_tag 'settings[cross_project_issue_relations]', 1, Setting.cross_project_issue_relations? %><%= hidden_field_tag 'settings[cross_project_issue_relations]', 0 %>
-
-
-<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %>
-
-
-<%= select_tag 'settings[protocol]', options_for_select(['http', 'https'], Setting.protocol) %>
-
-
-<%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), "0"], ["textile", "textile"]], Setting.text_formatting) %>
-
-
-<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %>
-
-
-<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %>
-
-
-<%= check_box_tag 'settings[autofetch_changesets]', 1, Setting.autofetch_changesets? %><%= hidden_field_tag 'settings[autofetch_changesets]', 0 %>
-
-
-<%= check_box_tag 'settings[sys_api_enabled]', 1, Setting.sys_api_enabled? %><%= hidden_field_tag 'settings[sys_api_enabled]', 0 %>
-
-
-<%= text_field_tag 'settings[repositories_encodings]', Setting.repositories_encodings, :size => 60 %>
<%= l(:text_comma_separated) %>
+
+
+ <% administration_settings_tabs.each do |tab| -%>
+ - <%= link_to l(tab[:label]), {}, :id => "tab-#{tab[:name]}", :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %>
+ <% end -%>
+
-
-
-
-
-
-
-<%= submit_tag l(:button_save) %>
+<% administration_settings_tabs.each do |tab| %>
+ <%= content_tag('div', render(:partial => tab[:partial]), :id => "tab-content-#{tab[:name]}", :class => 'tab-content') %>
<% end %>
-<% html_title(l(:label_settings)) -%>
+<%= tab = params[:tab] ? h(params[:tab]) : administration_settings_tabs.first[:name]
+javascript_tag "showTab('#{tab}');" %>
+
+<% html_title(l(:label_settings), l(:label_administration)) -%>
--
cgit v1.2.3