% #Partial parameters default values
p_id ||= nil
id ||= ""
event ||= nil
%>
<%= content_for :javascript do %>
$(".newAttach").livequery('click',function () {
$(".newAttach1").show();
$(".newAttach.add").hide();
$(".newAttach.new_one").show();
var new_id = new Date().getTime();
$(this).before( attachment.replace(/NEW_RECORD/g, new_id) );
$("#post_attachments_attributes_"+new_id+"__tags").fcbkcomplete({
cache: true,
filter_case: false,
filter_hide: true,
firstselected: true,
filter_selected: true,
maxshownitems: 4,
newel: true,
complete_opts: true
});
});
<%end%>
<%# div title %>
<% if event.present?%>
<%= t('comment.new') %>
<% elsif p_id.present?%>
<%=t("reply_to")%>
<%= post.title %>
<%else%>
<%= t('thread.add') %>
<%end%>
<%# Form %>
<%= form_for(prepare_for_form(Post.new, :parent_id => p_id, :event => event), :html => { :multipart => true ,:id => id}) do |f| -%>
<%= f.hidden_field :parent_id %>
<%= f.hidden_field :event_id %>
<%# Post title - only for new threads %>
<%if p_id.nil? && event.nil? %>
<%= t('title') %>
<%= f.text_field :title, :size => 25, :class => "small_post_title"%>
<%end%>
<%# Post text %>
<%= t('body') %>
<%= small_post_text_area %>
<%# Attachments %>
<%= content_for :javascript do%>
<%= raw("var attachment='#{ generate_template(f, :attachments, :partial => 'posts/attachment') }'") %>
<% end %>
<%= t('attachment.add') %>
<%= t('attachment.add')%>
<%= t('attachment.new')%>
<%# Footer %>
<%=t("button.post")%>
<% if event.nil? && p_id.present?%>
<%=
#link_to t('thread.or_add_new'), space_posts_path(@space),:class=>"float"
%>
<%end%>
<% end %>