<%= back_url_hidden_field_tag %> <%= error_messages_for 'canned_response' %>

<%= f.text_field :name, :size => 80, :required => true %>

<% if User.current.admin? || User.current.allowed_to?(:manage_public_canned_responses, @project) %> <% if @canned_response.user %>

<%= @canned_response.user.name %>

<% end %>

<%= f.check_box :is_public, :label => l(:field_is_public), :onchange => (User.current.admin? ? nil : 'if (this.checked) {$("#canned_response_is_for_all").removeAttr("checked"); $("#canned_response_is_for_all").attr("disabled", true);} else {$("#canned_response_is_for_all").removeAttr("disabled");}') %>

<% end %>

<%= check_box_tag 'canned_response_is_for_all', 1, @canned_response.project.nil?, :disabled => (!@canned_response.new_record? && (@canned_response.project.nil? || (@canned_response.is_public? && !User.current.admin?))) %>

<%= f.text_area :content, :required => true, :class => 'wiki-edit', :rows => 5 %> <%= l(:text_helpdesk_answer_macros, :macro => HelpdeskSettings::MACRO_LIST.map{|m| link_to m, "#", :class => "mail-macro"}.join(', ')).html_safe %> <%= wikitoolbar_for 'canned_response_content' %>

<% content_for :header_tags do %> <%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %> <% end %>