2016-06-28 15:13:04 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
2016-06-29 10:45:56 +08:00
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'syllabus','new_user','prettify','share',:media => 'all' %>
2016-06-28 15:13:04 +08:00
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
2016-06-29 10:45:56 +08:00
<%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify','syllabus'%>
2016-06-28 15:13:04 +08:00
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单, $$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
</head>
<body onload="prettyPrint();">
2016-06-29 10:45:56 +08:00
<% is_current_user = User.current.logged?%>
2016-06-28 15:13:04 +08:00
<div class="navContainer">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="cl"></div>
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="homepageLeft">
2016-07-07 15:28:33 +08:00
<div class="homepagePortraitContainer mt15" onmouseover="$('#syllabus_edit_title_png').show();$('#syllabus_edit_ng_name_png').show();" onmouseout="$('#syllabus_edit_title_png').hide();$('#syllabus_edit_ng_name_png').hide();">
2016-06-28 15:13:04 +08:00
<%=render :partial => 'layouts/syllabus_info' %>
</div>
2016-06-30 10:44:11 +08:00
<% update_visiti_count @syllabus %>
2016-06-28 15:13:04 +08:00
2016-07-07 15:28:33 +08:00
<div class="homepageLeftMenuContainer" id="syllabus_base_info" onmouseover="$('#syllabus_attr_edit').show();" onmouseout="$('#syllabus_attr_edit').hide();">
2016-07-01 11:11:53 +08:00
<%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
2016-06-28 15:13:04 +08:00
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
2016-06-30 10:44:11 +08:00
<%=link_to '班级', {:controller => "syllabuses", :action => "syllabus_courselist", :id => @syllabus.id}, :class => 'homepageMenuText' %>
2016-06-29 10:45:56 +08:00
<% if is_current_user%>
2016-07-07 15:04:57 +08:00
<% if User.current == @syllabus.user && User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
2016-06-29 10:45:56 +08:00
<div class="courseMenu" id="courseMenu">
<ul>
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu">
<li>
2016-06-30 10:44:11 +08:00
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "menuGrey", :target => '_blank'%>
2016-06-29 10:45:56 +08:00
</li>
<li>
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
</ul>
</div>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%>
<% end%>
<% end%>
2016-06-28 15:13:04 +08:00
</div>
2016-07-13 09:34:36 +08:00
<% if User.current == @syllabus.user || User.current.admin?
all_courses = @syllabus.courses.where("is_delete = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc")
else
all_courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc")
end %>
<% courses = all_courses.limit(5) %>
<% all_count = all_courses.count%>
2016-06-28 15:13:04 +08:00
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>">
2016-06-29 10:45:56 +08:00
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
2016-06-28 15:13:04 +08:00
<ul>
2016-06-29 10:45:56 +08:00
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => User.current,:all_count => all_count,:type =>'Syllabus',:page => 0} %>
2016-06-28 15:13:04 +08:00
</ul>
</div>
<% if !courses.empty? %>
<div class="homepageLeftMenuMore" id="user_hide_course">
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_courseicon" onclick="leftCourseslistChange();"></a>
</div>
<% end %>
</div>
</div>
<div class="project_Label">
<h4 class="mb5" >标签:</h4>
<div class="tag_h">
<%= render :partial => 'tags/syllabus_tag', :locals => {:obj => @syllabus,:object_flag => "11"}%>
</div>
<div class="cl"></div>
</div>
2016-06-30 10:44:11 +08:00
<div class="fontGrey2 mt10 ml20">访问计数 <%=@syllabus.visits %> ( 自2016年7月) </div>
2016-06-28 15:13:04 +08:00
</div><!--left end -->
<div class="homepageRight">
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<script type="text/javascript">
$(function(){
$('#user_hide_course').hide();
});
$("#courseMenu").mouseenter(function(){
$("#topnav_course_menu").show();
});
$("#courseMenu").mouseleave(function(){
$("#topnav_course_menu").hide();
});
function leftCourseslistChange(){
$('#homepageLeftMenuCourses').slideToggle();
$('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon");
$('#hide_show_courseicon').toggleClass("homepageLeftMenuMoreIcon");
}
2016-07-01 11:11:53 +08:00
function show_edit_base_info() {
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_edit_info', :locals => {:syllabus => @syllabus}) %>");
}
2016-06-28 15:13:04 +08:00
</script>
</body>
</html>