152 lines
6.9 KiB
Plaintext
152 lines
6.9 KiB
Plaintext
<!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 %>
|
||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'syllabus','new_user','prettify','share',:media => 'all' %>
|
||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||
<%= javascript_heads %>
|
||
<%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify','syllabus'%>
|
||
<%= 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();">
|
||
<% is_current_user = User.current.logged?%>
|
||
<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">
|
||
<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();">
|
||
<%=render :partial => 'layouts/syllabus_info' %>
|
||
</div>
|
||
<% update_visiti_count @syllabus %>
|
||
|
||
<div class="homepageLeftMenuContainer" id="syllabus_base_info" onmouseover="$('#syllabus_attr_edit').show();" onmouseout="$('#syllabus_attr_edit').hide();">
|
||
<%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
|
||
</div>
|
||
|
||
<div class="homepageLeftMenuContainer">
|
||
<div class="homepageLeftMenuBlock">
|
||
<%=link_to '班级', {:controller => "syllabuses", :action => "syllabus_courselist", :id => @syllabus.id}, :class => 'homepageMenuText' %>
|
||
<% if is_current_user%>
|
||
<% if User.current == @syllabus.user && User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||
<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>
|
||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "menuGrey", :target => '_blank'%>
|
||
</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%>
|
||
</div>
|
||
<% 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%>
|
||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>">
|
||
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
|
||
<ul>
|
||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => User.current,:all_count => all_count,:type =>'Syllabus',:page => 0} %>
|
||
</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>
|
||
<div class="fontGrey2 mt10 ml20">访问计数 <%=@syllabus.visits %> (自2016年7月)</div>
|
||
|
||
</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();
|
||
$("#syllabus_title_edit").live("blur", function () {
|
||
edit_syllabus_title('<%= edit_syllabus_title_syllabus_path(@syllabus.id)%>');
|
||
});
|
||
$("#syllabus_eng_name_edit").live("blur", function () {
|
||
edit_syllabus_eng_name('<%= edit_syllabus_eng_name_syllabus_path(@syllabus.id)%>');
|
||
});
|
||
|
||
$("#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");
|
||
|
||
}
|
||
function show_edit_base_info() {
|
||
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_edit_info', :locals => {:syllabus => @syllabus}) %>");
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|