<%= link_to(l(:button_back), { :controller => 'admin', :action => 'projects', :status => '' }, :class => 'icon icon-cancel') %>

<%= l(:label_redirection) %>

<% form = form_for(:redirect, :url => { :action => 'update', :id => @project }, :html => { :id => 'project-redirect-form', :class => 'tabular' }, :builder => (TabularFormBuilder rescue Redmine::Views::LabelledFormBuilder)) do |f| %> <%= error_messages_for 'redirect' %>

<%= f.select(:redirect_type, options_for_select([ [ l(:label_no_redirect), 'no_redirect' ], [ l(:label_redirect_to_url), 'to_url' ], [ l(:label_redirect_to_redmine), 'to_redmine' ] ], @redirect ? @redirect.redirect_type : 'no_redirect'), {}, :onchange => "toggle_redirect_form_visibility(this.value);") %>

<%= f.text_field(:url, :size => 80) %>
<%= l(:sample_redirect_url) %>

<%= f.text_field(:base_url, :size => 80) %>
<%= l(:sample_redirect_base_url) %> (<%= l(:hint_project_name_same) %>)

<%= f.text_field(:delay, :size => 5) %> <%= l(:label_seconds) %> (<%= l(:hint_redirect_delay) %>)

<%= f.text_area(:message, :cols => 80, :rows => 10, :class => 'wiki-edit', :accesskey => accesskey(:edit)) %>

<%= submit_tag(l(:button_save)) %> <% if defined? link_to_remote %> <%= link_to_remote(l(:label_preview), { :url => { :action => 'preview', :id => @project }, :method => 'post', :update => 'preview', :with => "Form.serialize('project-redirect-form')", :complete => "Element.scrollTo('preview')" }, :accesskey => accesskey(:preview)) %> <% else %> <%= preview_link({ :action => 'preview', :id => @project }, 'project-redirect-form') %> <% end %> <%= wikitoolbar_for('redirect_message') %> <%= javascript_tag("toggle_redirect_form_visibility('#{@redirect ? @redirect.redirect_type : 'no_redirect'}');")%> <% end %> <%= form if Rails::VERSION::MAJOR >= 3 %>
<% html_title(l(:label_redirection)) %> <% content_for(:header_tags) do %> <% if defined? observe_field %> <%= javascript_include_tag('removal_prototype', :plugin => 'project_removal') %> <% else %> <%= javascript_include_tag('removal_jquery', :plugin => 'project_removal') %> <% end %> <% end %>