%= content_for :headers do -%>
<%= javascript_include_tag 'jquery.filestyle', 'fckeditor/fckeditor', 'jquery.ba-bbq.min' %>
<% end -%>
<%= content_for :javascript do %>
/*
* Expand and collapse thread
*/
extend_thread = function(id){
$("#parent_" + id + " .extended_thread").show();
$("#parent_" + id + " .extend_thread").hide();
$("#parent_" + id + " .collapse_thread").show();
$("#message-body-" + id).hide();
}
collapse_thread = function(id){
$("#parent_" + id + " .extended_thread").hide();
$("#parent_" + id + " .extend_thread").show();
$("#parent_" + id + " .collapse_thread").hide();
$("#message-body-" + id).show();
}
$("input.home_menu_checkbox").click(function(){
var contents;
var value = this.value
if ($.deparam.querystring().contents == null){
contents = "<%=Space.contents.map(&:to_s).join(",")%>".split(",");
}else{
contents = $.deparam.querystring().contents.split(",");
}
if ($(this).attr("checked")){
contents.push(value);
}
else{
contents = jQuery.grep(contents, function (a) {
return a != value;
});
}
window.location=$.param.querystring("<%=home_path%>" + "?" + $.param.querystring(), "contents=" + contents.join(","));
});
$("#home_menu .arrow_take_box").livequery('click', function(event) {
$('#home_menu .arrow_drop_box').toggle(0);
$('#home_menu .arrow_take_box').toggle(0);
$('.whyte_wrapper').toggle(0);
$('#show').toggle(0);
});
$("#home_menu .arrow_drop_box").livequery('click', function(event) {
$('#home_menu .arrow_drop_box').toggle(0);
$('#home_menu .arrow_take_box').toggle(0);
$('.whyte_wrapper').toggle(0);
$('#show').toggle(0);
});
$("#my_spaces_title .arrow_drop_box").livequery('click', function(event) {
$('.my_spaces_home .all_my_spaces').toggle(0);
$('#my_spaces_title .arrow_take_box').toggle(0);
$('#my_spaces_title .arrow_drop_box').toggle(0);
});
$("#my_spaces_title .arrow_take_box").livequery('click', function(event) {
$('.my_spaces_home .all_my_spaces').toggle(0);
$('#my_spaces_title .arrow_take_box').toggle(0);
$('#my_spaces_title .arrow_drop_box').toggle(0);
});
$("#my_spaces_title .arrow_drop_space").livequery('click', function(event) {
$('.my_spaces_home .all_my_spaces').toggle(0);
$('#my_spaces_title .arrow_take_box').toggle(0);
$('#my_spaces_title .arrow_drop_box').toggle(0);
});
<% end %>
<%= content_for :search do %>
<%= render :partial => 'search/form' %>
<%end%>
<%= content_for :sidebar do %>
<% if logged_in?%>
<%= link_to raw("" + t('space.create_own') + ""), new_space_path,:class => "new_space_link big_button orange_button"%>
<%end%>
<%if !(current_user.spaces.empty?)%>
<%periods = select_periods(@events_of_user)%>
<%else%>
<%periods = [["today",[]], ["event.upcoming.my_other",[]],["event.upcoming.other_all",[]]]%>
<%end%>
<%=image_tag("icons/date.png",:class=>"icon") + " " + t('calendar.my')%>
(GMT<%= Time.zone.formatted_offset %>)
<%periods.each do |period|%>
<%if (period[0]== "today") && (period[1].empty?)%>
<%= t(period[0])%>
<%=t('event.no_events')%>
<%elsif !period[1].empty?%>
<%= t(period[0])%>
<% for event in period[1] -%>
-
<% event_link="" + sanitize(event.title) + "
" + event.start_date.to_formatted_s(:short) + " - " + event.end_date.to_formatted_s(:short) + ""%>
<%= link_to raw(event_link), space_event_path(event.space,event) %>
<%= link_to "", space_event_path(event.space,event),:class=>"box-link"%>
<%end%>
<%end%>
<%end%>
<%=image_tag("icons/email.png",:class=>"icon")%>
<%= link_to t('inbox.my', :checked => PrivateMessage.inbox(current_user).select{|msg| !msg.checked}.size), user_messages_path(current_user), menu_options(:inbox, :id => "user_inbox_link")%>
<%if @private_messages.empty?%>
<%=t("message.private.none")%>
<%else%>
<%for private_message in @private_messages%>
<%if @sender.present?%>
<%@sender=User.find_with_disabled(private_message.sender_id)%>
<%= raw(link_logo(@sender,:size=>32, :url => user_path(@sender), :title=>@sender.login)) %>
<%= link_to strip_tags(first_words(sanitize(private_message.title),25)), user_messages_path(current_user, :message=>private_message.id) %>
<%= strip_tags(sanitize(first_words(private_message.body,35))) %>
<%else%>
<%= link_to strip_tags(first_words(sanitize(private_message.title),25)), user_messages_path(current_user, :message=>private_message.id) %>
<%= strip_tags(first_words(private_message.body,35)) %>
<%end%>
<%end%>
<%end%>
<%end%>
<%= content_for :menu do %>
<%= render :partial => "rooms" %>
<%= render :partial => 'profiles/user_spaces_home', :locals => {:show_user =>current_user, :title=>t('space.my_spaces')} %>
<%= render :partial => "menu" %>
<% end %>
<% for interval in intervals(@all_contents) do -%>
<% unless interval[:contents].empty? -%>
<%= t('updated') + " " + interval[:name] %>
<% end -%>
<% interval[:contents].each do |content| -%>
<% case content -%>
<% when Post -%>
<%= render :partial => "posts/unified_post" , :locals => {:thread => content.reload, :extended => false, :last => (interval[:contents].last == content), :show_author => true} %>
<% when Event -%>
<%= render :partial => "events/unified_event", :locals => {:event => content.reload, :last => (interval[:contents].last == content)} %>
<% when News -%>
<%= render :partial => "news/unified_news", :locals =>{:news => content.reload, :last => (interval[:contents].last == content)}%>
<% when Attachment -%>
<% content = content.reload -%>
<%= render :partial => "attachments/unified_attachment", :locals =>{:attachment => content, :last => (interval[:contents].last == content), :show_author => true} if content.post.blank?%>
<% else -%>
<%= t('unknown_content', :content => content.class) %>
<% end -%>
<% end -%>
<% end -%>
<%= will_paginate @all_contents %>