<% menu :posts %> <%= content_for :headers do -%> <%= javascript_include_tag 'jquery.filestyle', 'fckeditor/fckeditor', 'jquery.fcbkcomplete'%> <%= stylesheet_link_tag "fcbkcomplete", :media => "screen, projection" %> <% end -%> <%= content_for :javascript do %> <%= render :partial => 'fckeditor_functions' %> /* * Reply panel */ /* Submit without ajax until it will be posible to render message errors when a post witj attachment fail*/ /*$("#reply-form").postsForm('<%= space_post_path(@space,@post, :last_page => true) %>');*/ style_file_input(); $(".new_reply_options").click(function(){ $(".new_reply_options").removeClass("selected"); $(this).addClass("selected"); }); $(".new_attachment_link").livequery('click',function () { $(".new_attachment_form").show(); return false; }); $("a.big_new_reply").fancybox({ 'hideOnContentClick' : false, 'callbackOnShow' : function(){ $(".big_post_text").val($(".small_post_text").val()); big_textarea(); $("#fancy_outer").width($("#new_thread_big").width() + 50); $("#fancy_outer").height($("#new_thread_big").height() + 80); $(window).resize(); }, 'callbackOnClose' : function(){ var oEditor = FCKeditorAPI.GetInstance('post[text]') ; var data = oEditor.GetHTML(); $(".small_post_text").val(data); } }); $("a.edit_post_link").click(function(){ var route = "<%= space_posts_path(@space) %>" + "/" + $(this).attr("name") + "?edit=true"; $.get(route, {authenticity_token: "<%=form_authenticity_token()%>"}, function(data){ $("#sidebar").children("div:last").replaceWith(data); /*Edit thread*/ $(".edit_thread_options").click(function(){ $(".edit_thread_options").removeClass("selected"); $(this).addClass("selected");}); /*Edit reply*/ $(".edit_reply_options").click(function(){ $(".edit_reply_options").removeClass("selected"); $(this).addClass("selected");}); style_file_input(); /*Extract form fancbox*/ $("a#big_edit_thread").fancybox({ 'hideOnContentClick' : false, 'callbackOnShow' : function(){ $(".big_post_text").val($(".small_post_text").val()); big_textarea(); $("#fancy_outer").width($("#new_thread_big").width() + 50); $("#fancy_outer").height($("#new_thread_big").height() + 80); $(window).resize(); }, 'callbackOnClose' : function(){ var oEditor = FCKeditorAPI.GetInstance('post[text]') ; var data = oEditor.GetHTML(); $(".small_post_text").val(data); } }); } ); return false; }); $("#new_comment_big_link").livequery('click',function () { $(".big_options").removeClass("selected"); $(this).addClass("selected"); $("#new_photo_big_form").hide(); $("#fancy_outer").height($("#new_thread_big").height() + 80); $(window).resize(); return false; }); $("#new_photo_big_link").livequery('click',function () { $(".big_options").removeClass("selected"); $(this).addClass("selected"); $("#new_photo_big_form").show(); $("#fancy_outer").height($("#new_thread_big").height() + 80); $(window).resize(); return false; }); $("#new_doc_big_link").livequery('click',function () { $(".big_options").removeClass("selected"); $(this).addClass("selected"); $("#new_photo_big_form").show(); $("#fancy_outer").height($("#new_thread_big").height() + 80); $(window).resize(); return false; }); <% end %> <%= content_for :search do %> <%= render :partial => 'search/form' %> <%end%> <%if @space.authorize?([:create, :content],:to => current_user)%> <%= content_for :sidebar do %> <%if params[:edit]%> <%= render :partial => "edit_post", :locals => { :post => Post.find(params[:edit]) } %> <%else%> <% params[:reply_to] = @post.id %> <%= render :partial => "new_post", :locals => { :post => @post, :p_id=> @post.id, :id => "reply-form"} %> <%end%> <% end %> <% end %> <%= render :partial => 'post_with_children' %> <%= will_paginate @posts %>