Permalink
Fetching contributors…
Cannot retrieve contributors at this time. Cannot retrieve contributors at this time
250 lines (217 sloc) 14.6 KB
<%- @view_title = "Administration" -%>
<script type="text/javascript">
serverConfiguration = new ServerConfiguration("<%=validate_server_config_params_path%>");
</script>
<div id="server_configuration">
<%= form_for @server_configuration_form, :as => :server_configuration_form, :url => {:action => :update}, :html => {:method => 'post'} do |form| %>
<%= config_md5_field %>
<div id="server_management">
<h2 class="legend"><%= l.string("SERVER_MANAGEMENT") -%></h2>
<div class="fieldset">
<div class="form_item">
<label for="server_configuration_form_site_url"><%= l.string("SITE_URL") -%></label>
<%= form.text_field :siteUrl, :size => 30, :maxLength => 255 %>
<div class="contextual_help has_go_tip_right" title="<%= l.string("TOOLTIP_SITE_URL") -%>"></div>
<span id="site_url_error_message"></span>
</div>
<div class="form_item">
<label for="server_configuration_form_secure_site_url"><%= l.string("SECURE_SITE_URL") -%></label>
<%= form.text_field :secureSiteUrl, :size => 30, :maxLength => 255 %>
<div class="contextual_help has_go_tip_right" title="<%= l.string("TOOLTIP_SECURE_SITE_URL") -%>"></div>
<span id="secure_site_url_error_message"></span>
</div>
</div>
</div>
<div id="user_management">
<h2 class="legend"><%= l.string("User Management") -%></h2>
<div class="fieldset">
<div class="form_item required">
<div class="form_item checkbox_row">
<%- html_options = {:include_hidden => false} %>
<%- html_options = {:include_hidden => false, :disabled => true, :title => l.string("CANNOT_TURN_OFF_AUTO_LOGIN")} unless @allow_user_to_turn_off_auto_login %>
<%- allow_auto_login_value = @server_configuration_form.allow_auto_login ? "1" : "0" %>
<%= form.hidden_field :allow_auto_login, :value => allow_auto_login_value %>
<%= form.check_box :allow_auto_login, html_options, "1", "0" %>
<label class="inline" for="server_configuration_form_allow_auto_login"><%= l.string("ALLOW_AUTO_LOGIN_MESSAGE") -%></label>
</div>
<div class="ldap_settings">
<h3><%= l.string("LDAP Settings") -%></h3>
<div class="form_item">
<label for="server_configuration_form_ldap_uri"><%= required_label_text(l.string("URI")) -%></label>
<%= form.text_field :ldap_uri, {:size => 30, :maxLength => 255} %>
<span id="ldap_uri_error_message"></span>
</div>
<div class="form_item">
<%= label_tag "server_configuration_form_ldap_username", l.string("LDAP_USERNAME") -%>
<%= form.text_field :ldap_username, {:size => 30} %>
<span id="ldap_username_error_message"></span>
</div>
<div class="form_item">
<label for="server_configuration_form_ldap_password"><%= required_label_text(l.string("LDAP_PASSWORD")) -%></label>
<%= form.password_field :ldap_password, {:size => 30, :maxLength => 64, :disabled => true} %>
<%= form.hidden_field :ldap_encrypted_password %>
<span class="checkbox_row">
<%= form.check_box :ldap_password_changed, {}, "true", "false" %>
<label for="server_configuration_form_ldap_password_changed"><%= l.string("CHANGE_PASSWORD") -%></label>
</span>
<button type="button" class="submit tertiary " id="testLDAPSettings"
onclick="serverConfiguration.validateLdapSettings(this, '<%= validate_ldap_settings_path %>', 'ldap_settings_validation', '<%= form_authenticity_token %>')">
<span><%= l.string("LDAP_VALIDATE") -%></span>
</button>
<span id="ldap_settings_validation"></span>
</div>
<script type="text/javascript">
Util.on_load(function () {
var checkBox = jQuery("#server_configuration_form_ldap_password_changed");
var passwordField = jQuery("#server_configuration_form_ldap_password");
Util.bindPasswordField(checkBox, passwordField);
});
</script>
<div class="form_item">
<label for="server_configuration_form_ldap_search_base"><%= required_label_text(l.string("SEARCH_BASE")) -%></label>
<%= form.text_area :ldap_search_base, {:size => 30, :class => "large", :rows => 5} %>
<div class="contextual_help has_go_tip_right" title="<%= l.string("TOOLTIP_LDAP_SEARCH_BASE_FORMAT") -%>"></div>
</div>
<div class="form_item">
<label for="server_configuration_form_ldap_search_filter"><%= l.string("SEARCH_FILTER") -%></label>
<%= form.text_field :ldap_search_filter, {:size => 30} %>
</div>
</div>
<div class="password_file_settings">
<h3><%= l.string("Password File Settings") -%></h3>
<div class="form_item">
<label for="server_configuration_form_password_file_path"><%= l.string("PASSWORD_FILE_PATH") -%></label>
<%= form.text_field :password_file_path, {:size => 80, :class => "large"} %>
<span id="password_file_path_error_message"></span>
</div>
</div>
</div>
<%= render :partial => 'shared/form_required_message.html', :locals => {:scope => {}} %>
</div>
</div>
<div id="mail_host">
<div id="mail_host_config">
<h2 class="legend"><%= l.string("Email notification") -%></h2>
<div class="fieldset">
<div class="form_item required">
<div class="form_item">
<label for="server_configuration_form_hostName"><%= required_label_text(l.string("HOSTNAME")) -%></label>
<%= form.text_field :hostName, :size => 30, :maxLength => 64, :onblur => "serverConfiguration.validateHostName('server_configuration_form_hostName', 'hostname_error_message')" %>
<span id="hostname_error_message"></span>
</div>
<div class="form_item">
<label for="server_configuration_form_port"><%= required_label_text(l.string("PORT")) -%></label>
<%= form.text_field :port, :size => 30, :maxLength => 5, :onblur => "serverConfiguration.validatePort('server_configuration_form_port', 'port_error_message')" %>
<span id="port_error_message"></span>
</div>
<div class="form_item">
<label for="server_configuration_form_username"><%= l.string("USERNAME") -%></label>
<%= form.text_field :username, :size => 30, :maxLength => 64 %>
</div>
<div class="form_item">
<label for="server_configuration_form_password"><%= l.string("PASSWORD") -%></label>
<%= form.password_field :password, :size => 30, :maxLength => 64, :disabled => true %>
<span class="checkbox_row">
<%= form.check_box :password_changed, {}, "true", "false" %>
<label for="server_configuration_form_password_changed"><%= l.string("CHANGE_PASSWORD") -%></label>
</span>
<%= form.hidden_field :encrypted_password %>
</div>
<script type="text/javascript">
Util.on_load(function () {
var checkBox = jQuery("#server_configuration_form_password_changed");
var passwordField = jQuery("#server_configuration_form_password");
Util.bindPasswordField(checkBox, passwordField);
});
</script>
<div class="form_item checkbox_row">
<div class="checkbox_label_wrapper">
<%= form.check_box :tls, {}, "true", "false" %>
<label class="inline" for="server_configuration_form_tls"><%= l.string("MAIL_HOST_USE_SMTPS") -%></label>
</div>
<div class="contextual_help has_go_tip_right" title="<%= l.string("TOOLTIP_MAIL_HOST_SMTPS") -%>"></div>
</div>
<div class="form_item">
<label for="server_configuration_form_from"><%= required_label_text(l.string("MAIL_HOST_FROM")) -%></label>
<%= form.text_field :from, :size => 30, :maxLength => 64, :onblur => "serverConfiguration.validateEmail('server_configuration_form_from', 'from_error_message')" %>
<span id="from_error_message"></span>
</div>
<div class="form_item">
<label for="server_configuration_form_adminMail"><%= required_label_text(l.string("MAIL_HOST_ADMIN_MAIL")) -%></label>
<%= form.text_field :adminMail, :size => 30, :maxLength => 64, :onblur => "serverConfiguration.validateEmail('server_configuration_form_adminMail', 'admin_mail_error_message')" %>
<button type="button" class="submit tertiary" id="testNotification"
onclick="serverConfiguration.sendTestEmail(this, '<%= send_test_email_path %>', '<%= form_authenticity_token %>')">
<span><%= l.string("MAIL_HOST_SEND_TEST_EMAIL") -%></span>
</button>
<span id="admin_mail_error_message"></span>
</div>
</div>
<%= render :partial => 'shared/form_required_message.html', :locals => {:scope => {}} %>
</div>
</div>
</div>
<div id="pipeline_management">
<h2 class="legend"><%= l.string("PIPELINE_MANAGEMENT") -%></h2>
<div class="fieldset">
<div class="form_item">
<label for="artifacts_location"><%= l.string("ARTIFACTS_LOCATION") -%></label>
<%= form.text_field :artifactsDir, :size => 30, :maxLength => 64, :id => "artifacts_location" %>
</div>
<div class="form_item">
<label>Auto delete old artifacts:</label>
<div class="checkbox_row">
<%= form.radio_button :purgeArtifacts, "Never", :id => "never_delete_artifacts" -%>
<label for="never_delete_artifacts"><%= l.string("NEVER_DELETE_ARTIFACTS") -%></label>
</div>
<div class="checkbox_row">
<%= form.radio_button :purgeArtifacts, "Size", :id => "select_artifact_purge_size" %>
<span class="checkbox_label"><%== l.string("WHEN_AVAILABLE_DISK_SPACE_SIZE_IS_LESS_THAN_AND_KEEP_DELETING_UNTIL",
form.text_field(:purgeStart, :size => 30, :maxLength => 64, :class => "small_text_field"),
form.text_field(:purgeUpto, :size => 30, :maxLength => 64, :class => "small_text_field")) -%></span>
</div>
</div>
<div class="form_item" id="hung_job_timeout">
<label><%= l.string("HUNG_JOBS_TIMEOUT") -%></label>
<div class="checkbox_row">
<%= form.radio_button :timeoutType, "neverTimeout", :id => "hungjobs_neverTimeout" -%>
<%= label_tag 'hungjobs_neverTimeout', l.string("ALL_JOBS_NEVER_TIMEOUT") -%>
</div>
<div class="checkbox_row">
<%= form.radio_button :timeoutType, "overrideTimeout", :id => "hungjobs_overrideTimeout" -%>
<%= label_tag 'hungjobs_overrideTimeout', l.string("ALL_JOBS_OVERRIDE_TIMEOUT_PREFIX") -%>
<%= form.text_field :jobTimeout, :size => 4, :maxLength => 64, :class => "small_text_field" -%>
<%= label_tag 'hungjobs_overrideTimeout', l.string("ALL_JOBS_OVERRIDE_TIMEOUT_SUFFIX") -%>
</div>
</div>
</div>
</div>
<div id="command_repository_management">
<h2 class="legend"><%= l.string("COMMAND_REPOSITORY_MANAGEMENT") -%></h2>
<div class="fieldset">
<div class="form_item" id="lookup-command-repo-location">
<%= label_tag 'command_repo_location', l.string("COMMAND_REPO_LOCATION") -%>
<div class="path_textbox">
<%= label_tag 'command_repo_root_location', @command_repository_base_dir_location -%>
<%= form.text_field :commandRepositoryLocation -%>
</div>
<div class="contextual_help has_go_tip_right" title="<%= l.string("TOOLTIP_COMMAND_REPOSITORY_LOCATION") -%>"></div>
</div>
<div class="form_item" id="lookup-command-reload">
<div class="button_row_with_help">
<button type="button" class="submit tertiary" id="reloadCommandRepoCache"
onclick="serverConfiguration.reloadCommandRepoCache('<%= admin_command_cache_reload_path -%>', 'command_repo_reload_result', '<%= form_authenticity_token %>')">
<span><%= l.string("RELOAD_COMMAND_REPO_CACHE") -%></span>
</button>
<div class="contextual_help has_go_tip_right" style='float:right;' title="<%= l.string("TOOLTIP_COMMAND_REPOSITORY_CACHE_RELOAD") -%>"></div>
</div>
<span id="command_repo_reload_result"></span>
</div>
</div>
</div>
<div class="form_buttons">
<button type="submit" class="submit primary" id="submit_form"><span><%= l.string("SAVE") -%></span></button>
<button type="reset" class="submit" id="reset_form"><span><%= l.string("RESET") -%></span></button>
</div>
<%= render :partial => 'shared/convert_tool_tips.html', :locals => {:scope => {}} %>
<% end %>
</div>