socialforge/app/views/courses/_course_activity.html.erb

162 lines
6.3 KiB
Plaintext
Raw Normal View History

2015-12-06 15:03:36 +08:00
<%= content_for(:header_tags) do %>
2015-12-14 17:13:57 +08:00
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
2015-12-06 15:03:36 +08:00
<% end %>
<script>
$(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block");
})
$("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none");
})
$(".homepagePostPortrait").mouseover(function(){
$(this).children(".userCard").css("display","block");
})
$(".homepagePostPortrait").mouseout(function(){
$(this).children(".userCard").css("display","none");
})
$(".userCard").mouseover(function(){
$(this).css("display","block");
})
$(".userCard").mouseout(function(){
$(this).css("display","none");
})
$(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff");
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
})
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999");
})
$(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
})
})
</script>
2015-09-24 16:30:14 +08:00
<style type="text/css">
/*回复框*/
div.ke-toolbar {
display: none;
width: 400px;
border: none;
background: none;
padding: 0px 0px;
}
span.ke-toolbar-icon {
line-height: 26px;
font-size: 14px;
padding-left: 26px;
}
span.ke-toolbar-icon-url {
2015-12-14 17:13:57 +08:00
background-image: url("/images/public_icon.png")
2015-09-24 16:30:14 +08:00
}
div.ke-toolbar .ke-outline {
padding: 0px 0px;
line-height: 26px;
font-size: 14px;
}
span.ke-icon-emoticons {
background-position: 0px -671px;
width: 50px;
height: 26px;
}
span.ke-icon-emoticons:hover {
background-position: -79px -671px;
width: 50px;
height: 26px;
}
div.ke-toolbar .ke-outline {
border: none;
}
.ke-inline-block {
display: none;
}
div.ke-container {
float: left;
}
</style>
<% course_activities.each do |activity| if course_activities %>
<script>
function expand_reply(container, btnid) {
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {
btn.data('init', 1);
btn.html('收起回复');
2015-09-24 16:30:14 +08:00
target.show();
} else {
btn.data('init', 0);
btn.html('展开更多');
2015-09-24 16:30:14 +08:00
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
2015-09-24 16:30:14 +08:00
}
}
$(function () {
2015-12-14 17:13:57 +08:00
init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>");
showNormalImage('activity_description_<%= activity.id %>');
if($("#intro_content_<%= activity.id %>").height() > 360) {
$("#intro_content_show_<%= activity.id %>").show();
}
$("#intro_content_show_<%= activity.id %>").click(function(){
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_show_<%= activity.id %>").hide();
$("#intro_content_hide_<%= activity.id %>").show();
});
$("#intro_content_hide_<%= activity.id %>").click(function(){
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= activity.id %>").hide();
$("#intro_content_show_<%= activity.id %>").show();
});
2015-09-24 16:30:14 +08:00
});
</script>
2015-10-12 16:15:27 +08:00
<% if activity && activity.course_act%>
2015-09-24 16:30:14 +08:00
<% act = activity.course_act %>
<% case activity.course_act_type.to_s %>
<% when 'HomeworkCommon' %>
2015-11-04 10:54:09 +08:00
<%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :course_activity => 1} %>
2015-09-24 16:30:14 +08:00
<% when 'News' %>
<%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% when 'Message' %>
<%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id,:is_course=>1,:is_board=>0} %>
2015-09-24 16:30:14 +08:00
<% when 'Poll' %>
<%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% when 'JournalsForMessage' %>
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% when 'Attachment' %>
<%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% when 'Course' %>
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if course_activities.count == 10 %>
<!--<div id="show_more_course_activities" class="loadMore mt10 f_grey">点击展开更多<%#= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %></div>-->
<%= link_to "点击展开更多",course_activity_path(@course.id, :type => type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
2015-09-24 16:30:14 +08:00
<% end %>
<!--
2015-09-24 16:30:14 +08:00
<script type="text/javascript">
$("#show_more_course_activities").mouseover(function () {
$("#more_course_activities_link").click();
});
</script>-->