新版班级主页

This commit is contained in:
cxt 2016-07-22 15:32:37 +08:00
parent 1e28ff880d
commit 9422e2886c
35 changed files with 578 additions and 225 deletions

View File

@ -161,6 +161,7 @@ class BoardsController < ApplicationController
if @project
render :action => 'show', :layout => 'base_projects'
elsif @course
@left_nav_type = 2
@params=params
render :action => 'show', :layout => 'base_courses'
end
@ -185,6 +186,7 @@ class BoardsController < ApplicationController
@board = @project.boards.build
@board.safe_attributes = params[:board]
if @project.project_type == 1
@left_nav_type = 2
render :layout => 'base_courses'
end
end
@ -206,6 +208,7 @@ class BoardsController < ApplicationController
def edit
if @project.project_type == 1
@left_nav_type = 2
render :layout => 'base_courses'
end
end

View File

@ -907,6 +907,7 @@ class CoursesController < ApplicationController
end
@type = params[:type]
@left_nav_type = 1
respond_to do |format|
format.js
format.html{render :layout => 'base_courses'}
@ -938,6 +939,7 @@ class CoursesController < ApplicationController
end
@jour = paginateHelper @jours,10
@state = false
@left_nav_type = 6
respond_to do |format|
format.html{render :layout => 'base_courses'}
format.api
@ -1121,6 +1123,14 @@ class CoursesController < ApplicationController
end
end
#统计
def statistics_course
@left_nav_type = 9
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
end
private
def update_quotes attachment
if attachment.copy_from

View File

@ -29,6 +29,7 @@ class ExerciseController < ApplicationController
exercises = @course.exercises.where("exercise_status <> 1").order("created_at asc")
end
@exercises = paginateHelper exercises,20 #分页
@left_nav_type = 8
respond_to do |format|
format.html
end
@ -72,6 +73,7 @@ class ExerciseController < ApplicationController
end
# @percent = get_percent(@exercise,User.current)
@exercise_questions = @exercise.exercise_questions
@left_nav_type = 8
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
@ -118,6 +120,7 @@ class ExerciseController < ApplicationController
end
def edit
@left_nav_type = 8
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@ -159,6 +162,7 @@ class ExerciseController < ApplicationController
@exercise = Exercise.find(params[:id])
exercise_questions = @exercise.exercise_questions
@exercise_questions = paginateHelper exercise_questions, 5
@left_nav_type = 8
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@ -379,6 +383,7 @@ class ExerciseController < ApplicationController
else
@exercise_users_list = []
end
@left_nav_type = 8
respond_to do |format|
format.html
format.xls {
@ -566,6 +571,7 @@ class ExerciseController < ApplicationController
eu = get_exercise_user(@exercise.id, @user.id)
eu.update_attributes(:score => score)
@exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first
@left_nav_type = 8
respond_to do |format|
format.html {render :layout => 'base_courses'}
end

View File

@ -366,6 +366,7 @@ class FilesController < ApplicationController
@tag_list = attachment_tag_list @all_attachments
@left_nav_type = 5
render :layout => 'base_courses'
elsif params[:org_subfield_id]
if params[:sort]
@ -445,6 +446,7 @@ class FilesController < ApplicationController
@versions = @project.versions.sort
@course_tag = @project.project_type
if @project.project_type == 1
@left_nav_type = 5
render :layout => 'base_courses'
end
end
@ -812,6 +814,7 @@ class FilesController < ApplicationController
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
# render layout: 'base_courses'
@left_nav_type = 5
respond_to do |format|
format.js
format.html {

View File

@ -39,6 +39,7 @@ class HomeworkCommonController < ApplicationController
end
end
@left_nav_type = 3
respond_to do |format|
format.js
format.html
@ -60,6 +61,7 @@ class HomeworkCommonController < ApplicationController
@is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i
if @is_in_course == 1 || @course_activity == 1
@left_nav_type = 3
respond_to do |format|
format.html{render :layout => 'base_courses'}
end

View File

@ -124,6 +124,7 @@ class MessagesController < ApplicationController
end
else
@left_nav_type = 2
respond_to do |format|
format.html {
layout_file = @project ? 'base_projects' : 'base_courses'
@ -241,6 +242,7 @@ class MessagesController < ApplicationController
if @project
layout_file = 'base_projects'
elsif @course
@left_nav_type = 2
layout_file = 'base_courses'
elsif @org_subfield
@organization = @org_subfield.organization

View File

@ -56,7 +56,7 @@ class NewsController < ApplicationController
:order => "#{News.table_name}.created_on DESC",
:offset => @page * 10,
:limit => 10)
@left_nav_type = 4
respond_to do |format|
format.html {
@news = News.new # for adding news inline
@ -136,6 +136,7 @@ class NewsController < ApplicationController
@newss = paginateHelper @newss,@limit
#@newss = paginateHelper scope_order,10
@left_nav_type = 4
respond_to do |format|
format.html {
@news = News.new
@ -176,6 +177,7 @@ class NewsController < ApplicationController
if @news.course_id
@course = Course.find(@news.course_id)
if @course
@left_nav_type = 4
render :layout => 'base_courses'
end
elsif @news.org_subfield_id
@ -279,6 +281,7 @@ class NewsController < ApplicationController
@organization = @org_subfield.organization
end
if @course
@left_nav_type = 4
render :layout => "base_courses"
elsif @org_subfield
render :layout => 'base_org'

View File

@ -15,6 +15,7 @@ class PollController < ApplicationController
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
end
@polls = paginateHelper polls,20 #分页
@left_nav_type = 7
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@ -25,7 +26,7 @@ class PollController < ApplicationController
def show
@poll = Poll.find params[:id]
if @poll.polls_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
if @poll.polls_status != 2 && !(User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
render_403
return
end
@ -44,6 +45,7 @@ class PollController < ApplicationController
@percent = get_percent(@poll,User.current)
poll_questions = @poll.poll_questions
@poll_questions = paginateHelper poll_questions,5 #分页
@left_nav_type = 7
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
@ -78,6 +80,7 @@ class PollController < ApplicationController
def edit
respond_to do |format|
@left_nav_type = 7
format.html{render :layout => 'base_courses'}
end
end
@ -112,6 +115,7 @@ class PollController < ApplicationController
@poll = Poll.find(params[:id])
poll_questions = @poll.poll_questions
@poll_questions = paginateHelper poll_questions, 5
@left_nav_type = 7
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@ -393,6 +397,7 @@ class PollController < ApplicationController
#显示某个学生某份问卷的填写结果
def poll_result
@poll_questions = paginateHelper @poll.poll_questions,5
@left_nav_type = 7
respond_to do |format|
format.html{render :layout => 'base_courses'}
end

View File

@ -526,6 +526,7 @@ class StudentWorkController < ApplicationController
@is_focus = params[:is_focus] ? params[:is_focus].to_i : 0
# 消息传过来的ID
@message_student_work_id = params[:student_work_id]
@left_nav_type = 3
respond_to do |format|
format.js
format.html
@ -918,6 +919,7 @@ class StudentWorkController < ApplicationController
ORDER BY absence #{order}")
end
@order = order == "desc" ? "asc" : "desc"
@left_nav_type = 3
respond_to do |format|
format.html
end

View File

@ -949,6 +949,7 @@ class UsersController < ApplicationController
@student_work = StudentWork.new
end
@course = @homework.course
@left_nav_type = 3
respond_to do |format|
format.js
format.html {render :layout => 'base_courses'}

View File

@ -35,7 +35,7 @@ module CoursesHelper
and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;"
default_ids = Course.find_by_sql(sql).flatten.map { |c| c.id }
excellent_ids << default_ids.flatten
arr_result = excellent_ids.flatten.uniq.first(5)
arr_result = excellent_ids.flatten.uniq.first(3)
excellent_courses = Course.find(arr_result)
return excellent_courses
end
@ -78,18 +78,18 @@ module CoursesHelper
#生成课程老师成员链接
def course_teacher_link teacher_num
if User.current.member_of_course?(@course) || User.current.admin?
link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'info_foot_num c_blue', :id => 'teacher_number'
link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'sy_cblue', :id => 'teacher_number'
else
content_tag 'span',teacher_num, :class => 'info_foot_num c_blue'
content_tag 'span',teacher_num, :class => 'sy_cblue'
end
end
#生成课程学生列表连接
def course_student_link student_num
if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin?
link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'info_foot_num c_blue', :id => "student_number"
link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'sy_cblue', :id => "student_number"
else
content_tag 'span',student_num, :class => 'info_foot_num c_blue'
content_tag 'span',student_num, :class => 'sy_cblue'
end
end
@ -772,12 +772,12 @@ module CoursesHelper
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post'
if joined
link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
link = link_to(text, url, :remote => true, :method => method, :class => "sy_btn_grey fl", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
else
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;")
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "sy_btn_grey fl")
end
else
link = "<span class='pr_join_span mr5' >#{l(:label_course_join_student)}</span>"
link = "<a href='javascript:void(0)' class='sy_btn_grey fl ml10' >#{l(:label_course_join_student)}</a>"
end
link.html_safe
end
@ -872,7 +872,7 @@ module CoursesHelper
desc.html_safe
end
# 学生按作业总分排序,取前8
# 学生按作业总分排序,取前3
def hero_homework_score(course, score_sort_by)
sql_select = "SELECT members.*,(
SELECT SUM(work_score)
@ -884,14 +884,14 @@ module CoursesHelper
FROM members
JOIN students_for_courses
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 9"
WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 3"
homework_scores = Member.find_by_sql(sql_select)
end
def contributor_course_scor(course_id)
ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by
(message_num*2 + message_reply_num + news_reply_num + news_num +
resource_num*5 + journal_num + homework_journal_num ) desc limit 9;")
resource_num*5 + journal_num + homework_journal_num ) desc limit 3;")
end
end

View File

@ -1,13 +1,15 @@
<% unless contributor_course_scor(course.id).count == 0 %>
<div>
<ul class="rankList">
<h4>
<h3 style="font-size: 14px; font-weight: normal;">
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => '' %>
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'sy_cblack' %>
<% else %>
班级活跃度
<% end %>
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
</h4>
<a class="sy_cmore fr" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
<div class="cl"></div>
</h3>
<div class="numIntro undis" style="cursor:pointer;">
<div class="active-degree-rule">
积分规则<br/>
@ -26,10 +28,11 @@
+ contributor_score.homework_journal_num.to_i * 1 + contributor_score.news_reply_num.to_i * 1 +
contributor_score.news_num.to_i * 1 %>
<% unless total_score ==0 %>
<li><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %>
<li>
<%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "50", :height => "50", :class=> "rankPortrait"),user_path(contributor_score.user) %>
<p><%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %></p>
<p><span class="c_green" style="cursor:pointer">
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="c_green">
<p><span class="sy_corange" style="cursor:pointer">
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="sy_corange">
<%=total_score %></a></span></p>
<div style="display: none" class="numIntro">
<div class="contributor-course-calculate">积分计算</div>
@ -61,4 +64,5 @@
<% end %>
<div class="cl"></div>
</ul>
</div>
<% end %>

View File

@ -1,9 +1,9 @@
<% hero_homework_scores = hero_homework_score(course, "desc") %>
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
<ul class="rankList">
<h4>
<h4 style="font-size: 14px; font-weight: normal;">
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => '' %>
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => 'sy_cblack' %>
<% else %>
<span>班级英雄榜</span>
<% end %>

View File

@ -1,25 +1,15 @@
<% exc_course = excellent_course_recommend(course) %>
<% unless exc_course.length == 0 %>
<ul class="courseR mb10">
<h4 class="mb5" ><%= l(:label_homework_recommendation) %></h4>
<% exc_course.each do |e_course| %>
<li class="mt15"> <%= image_tag(url_to_avatar(e_course), :width => "40", :height => "40", :class => "fl mr10 rankPortrait", :alt => "logo") %>
<div class="fl">
<p class="f12 mb5"><%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %><div class="cl"></div> </p>
<p class="f12">
<% if visable_attachemnts_incourse(e_course).count > 0 %>
<span class="fl mr15 fontGrey4"><%= l(:project_module_attachments) %>(<%= link_to visable_attachemnts_incourse(e_course).count, course_files_path(e_course), :class => "linkBlue2" %>)</span>
<% end %>
<% if e_course.homework_commons.where("publish_time <= '#{Date.today}'").count > 0 %>
<span class="fl fontGrey4"><%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.where("publish_time <= '#{Date.today}'").count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)</span>
<% end %>
<div class="cl"></div>
<ul class="sy_class_lclass">
<% exc_course.each_with_index do |e_course, i| %>
<li>
<span class="sy_sq_orange fl mr5 mt5"><%= i+1 %></span>
<%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle fl mb10" %>
<p class="sy_cgrey ml20">作业<span class="sy_cir_grey ml5 mr5"><%=e_course.homework_commons.where("publish_time <= '#{Date.today}'").count %></span>
资源<span class="sy_cir_grey ml5 mr5"><%=visable_attachemnts_incourse(e_course).count %></span>
</p>
</div>
<div class="cl"></div>
</li>
<% end %>
<div class="cl"></div>
</ul>
<% end %>

View File

@ -1,47 +1,53 @@
<% course_file_num = visable_attachemnts_incourse(@course).count%>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<li>
<a href="<%=course_boards_path(@course) %>">问答区</a>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
</li>
<% end %>
<% if show_nav?(@course.homework_commons.count) %>
<div class="subNav">
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f12 c_blue02 ml10 fn"%>
<%= link_to( "", homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
</div>
<li>
<a href="<%= homework_common_index_path(:course => @course.id) %>">作业</a>
<%= link_to( "",homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
</li>
<% end %>
<% if show_nav?(@course.news.count) %>
<div class="subNav">
<%= link_to "通知", course_news_index_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<%= link_to( "", new_course_news_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
</div>
<li>
<a href="<%=course_news_index_path(@course) %>">通知</a>
<%= link_to( "",new_course_news_path(@course,:is_new=>1), :class => 'sy_class_add', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
</li>
<% end %>
<% if show_nav?(course_file_num) %>
<div class="subNav">
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<li>
<a href="<%=course_files_path(@course) %>">资源库</a>
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<!--link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white')-->
<a class="courseMenuSetting" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
<a class="sy_class_add" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
<% end %>
</div>
<% end %>
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<div class="subNav">
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") %>
</div>
</li>
<% end %>
<% if show_nav?(course_feedback_count) %>
<div class="subNav">
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f12 c_blue02 ml10 fn" %>
<%= link_to "", course_feedback_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
</div>
<li>
<a href="<%=course_feedback_path(@course) %>">留言</a>
<%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
</li>
<% end %>
<% if show_nav?(course_poll_count) %>
<div class="subNav">
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f12 c_blue02 ml10 fn"%>
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'courseMenuSetting', :title =>"#{l(:label_new_poll)}") if is_teacher %>
</div>
<li>
<a href="<%=poll_index_path(:polls_type => "Course", :polls_group_id => @course.id) %>">问卷调查</a>
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'sy_class_add', :title =>"#{l(:label_new_poll)}") if is_teacher %>
</li>
<% end %>
<% if show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count) %>
<div class="subNav">
<%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f12 c_blue02 ml10 fn"%>
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'courseMenuSetting', :title =>"新建试卷") if is_teacher %>
</div>
<% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %>
<% if show_nav?(count) %>
<li>
<a href="<%=exercise_index_path(:course_id => @course.id) %>">在线测验</a>
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
</li>
<% end %>
<% if show_nav?(0) %>
<li>
<a href="<%=statistics_course_course_path(@course) %>">统计</a>
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
</li>
<% end %>

View File

@ -1,5 +1,7 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<!-- <#%= stylesheet_link_tag 'css', :media => 'all' %> -->
<div class="courseRSide fl">
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_contest_userresponse) %></h2>
</div>
@ -10,3 +12,4 @@
%>
<% html_title(l(:label_course_feedback)) -%>
</div>

View File

@ -0,0 +1,5 @@
<div class="sy_class_r ml10">
<div class="icons_tishi"><img src="../../images/sy/icons_smile.png" width="110" height="110" alt="" ></div>
<p class="sy_tab_con_p">统计功能即将上线,届时我们一起享受教育大数据的红利吧!</p>
<div style="height:400px;"></div>
</div><!--sy_class_r end-->

View File

@ -2,7 +2,7 @@
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
$("#Container").css("width","1000px");
});
//编辑问卷描述之后

View File

@ -1,7 +1,7 @@
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
$("#Container").css("width","1000px");
var end_time = <%=exercise.end_time.to_i%>;
getTime(end_time);

View File

@ -1,7 +1,7 @@
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
$("#Container").css("width","1000px");
});
</script>

View File

@ -1,7 +1,7 @@
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
$("#Container").css("width","1000px");
});
</script>

View File

@ -1,9 +1,7 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
$(function(){
$("#RSide").css("width","730px");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#Container").css("width","1000px");
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
});
function republish_exercise(exercise_id,index)
{
@ -63,6 +61,8 @@
}
</script>
<div class="courseRSide fl" id="homework_page_right">
<div class="polls_content02" id="exercise" style="width: 730px;">
<%= render :partial => 'exercises_list'%>
</div><!--问卷内容end-->
</div>

View File

@ -1,7 +1,7 @@
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#homework_page_right").css("min-height",$("#courseLSide").height()-47);
$("#Container").css("width","1000px");
});

View File

@ -0,0 +1,278 @@
<%# course_model %>
<% course_file_num = visable_attachemnts_incourse(@course).count%>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% homework_num = visable_course_homework @course %>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<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 %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup'%>
<%= javascript_include_tag "course","sy_public", "syllabus","header","attachments",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!--<script type="text/javascript"-->
<!--src="http://cdn.mathjax.org/mathjax/latest/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>
<!--add by huang-->
<body onload="prettyPrint();">
<div class="navContainer mb10">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="cl"></div>
<div id="Container">
<div id="content">
<div id="LSide" class="fl">
<div class="project_info" style="position: relative" id="project_info_<%=@course.id %>">
<%=render :partial=>'layouts/project_info' %>
</div><!--课程信息 end-->
<div class="info_box">
<ul>
<li><%= l(:label_main_teacher)%> :&nbsp;&nbsp;<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
<li><%= l(:label_class_period)%> :&nbsp;&nbsp;<span ><%= @course.class_period %> <%= l(:label_class_hour) %></span></li>
<li><%= l(:label_main_term)%> :&nbsp;&nbsp;<span><%= current_time_and_term @course %></span></li>
<% if @course.school%>
<li><%= l(:label_course_organizers)%> :&nbsp;&nbsp;<%= @course.school%></li>
<% end%>
</ul>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @course %>
<%# over %>
<div class="subNavBox">
<% unless show_nav?(@course.course_activities.count) %>
<div class="subNav">
<%= link_to l(:label_activity), course_path(@course), :class => "f14 c_blue02" %>
<!--暂时不显示课程动态数,优化后在显示-->
<%= link_to "(#{@course.course_activities.count})", course_path(@course), :class => "subnav_num c_orange"%>
</div>
<% end %>
<% unless show_nav?(@course.homework_commons.count) %>
<div class="subNav">
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02"%>
<%= link_to "(#{homework_num})", homework_common_index_path(:course => @course.id), :class => "subnav_num c_orange"%>
<%= link_to( "", homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
</div>
<% end %>
<% unless show_nav?(@course.news.count) %>
<div class="subNav">
<%= link_to "通知", course_news_index_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.news.count})", course_news_index_path(@course), :class => "subnav_num c_orange"%>
<%= link_to( "", new_course_news_path(@course,:is_new=>1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
</div>
<% end %>
<% unless show_nav?(course_file_num) %>
<div class="subNav">
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{course_file_num})", course_files_path(@course), :class => "subnav_num c_orange",:id=>'courses_files_count_nav' %>
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<!--link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white')-->
<a class="courseMenuSetting" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
<% end %>
</div>
<% end %>
<% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<div class="subNav">
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") %>
</div>
<% end %>
<% unless show_nav?(course_feedback_count) %>
<div class="subNav">
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{course_feedback_count})", course_feedback_path(@course), :class => "subnav_num c_orange", :id => "course_jour_count"%>
<%= link_to "", course_feedback_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
</div>
<% end %>
<% unless show_nav?(course_poll_count) %>
<div class="subNav">
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f14 c_blue02"%>
<%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %>
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'courseMenuSetting', :title =>"#{l(:label_new_poll)}") if is_teacher %>
</div>
<% end %>
<% unless show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count) %>
<div class="subNav">
<%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f14 c_blue02"%>
<%= link_to "(#{User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count})", exercise_index_path(:course_id => @course.id), :class => "subnav_num c_orange" %>
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'courseMenuSetting', :title =>"新建试卷") if is_teacher %>
</div>
<% end %>
<%# 工具栏展开 %>
<% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 ||
course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %>
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContentCourse">
<%= render 'courses/tool_expand', :locals => {:is_teacher => is_teacher, :course_file_num => course_file_num} %>
</ul>
<% end %>
</div><!--项目侧导航 end-->
<%# 课程活跃度 %>
<div class="cl"></div>
<%= render :partial => 'courses/course_activity_users', :locals => {:course => @course} %>
<%# 课程英雄榜 %>
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
<% if @course.description && !@course.description.blank? %>
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_course_brief_introduction)%></h4>
<div id="course_description_content">
<%= textilizable(@course.description) if @course.description && !@course.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<label id="expend_more_information" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
</div><!--项目简介 end-->
<% end %>
<div class="project_Label">
<h4 class="mb5" ><%= l(:label_tag)%></h4>
<div class="tag_h" >
<%= render :partial => 'tags/new_tag', :locals => {:obj => @course, :object_flag => "9"} %>
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
<!--课程推荐-->
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @course.visits.to_i %> 自2016年5月</div>
</div><!--LSide end-->
<div id="RSide" class="fl">
<%= yield %>
<%#= render_flash_messages %>
<%#= call_hook :view_layouts_base_content %>
</div>
<div class="cl"></div>
</div><!--Content end-->
</div><!--Container end-->
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
<script>
var blog_artile_list_html = '';
$(function(){
$(document).on('input','input[name="course_outline_search"]',function(e){
throttle(course_outline_search,window,e);
})
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context,e);
},500);
}
function course_outline_search(e){
// if($(e.target).val().trim() == ''){
// return;
// }
$("#course_outline_hint").hide();
$.ajax({
url:'<%=search_course_outline_course_path(@course) %>'+"?&title="+ e.target.value,
type:'post',
success:function(data){
if(data.length != 0 ){
$("#course_outline_list").html('');
for(var i =0;i<data.length;i++){
var html = ' <ul class="blogRow"> '+
' <li class="fl"> '+
'<input name="outline_id" type="radio" value="'+data[i].blog_comment.id+'" class="courseSendCheckbox"/>'+
'</li>'+
'<li class="blogTitle fl">'+data[i].blog_comment.title+'</li>'+
'</ul>'+
'<div class="homeworkPublishTime">发布时间:'+data[i].blog_comment.created_at.match(/(\S*)T/)[1]+'</div>';
$("#course_outline_list").append(html)
}
}else{
$("#course_outline_list").html('');
$("#course_outline_hint").show();
}
}
})
}
})
//资源库上传附件
function course_files_upload(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
// 鼠标经过的时候显示内容
function message_titile_show(obj,e)
{
obj.parent().parent().next("div").show();
obj.parent().next("div").css("top",e.pageY).css("left",e.pageX).css("position","absolute");
}
function message_titile_hide(obj)
{
obj.parent().parent().next("div").hide();
}
function message_titile_show2(obj,e)
{
obj.parent().next("div").show();
obj.parent().next("div").css("top",e.pageY).css("left",e.pageX).css("position","absolute");
}
function message_titile_hide2(obj)
{
obj.parent().next("div").hide();
}
$("#expand_tools_expand").click(function(){
$("#navContentCourse").toggle();
});
</script>
</html>

View File

@ -0,0 +1,55 @@
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% teacher_num = TeacherAndAssistantCount(@course) %>
<% student_num = studentCount(@course) %>
<% course_file_num = visable_attachemnts_incourse(@course).count %>
<p class="sy_cgrey mb10">
<%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %>
&nbsp;&gt;&nbsp;
<%=link_to @course.name, course_path(@course), :class => 'sy_cgrey' %>
</p>
<% if is_teacher %>
<div class="homepagePostSetting" >
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><%= link_to "班级配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %></li>
<li><%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %></li>
<li><%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %></li>
<li><%= link_to "进入课程", syllabus_path(@course.syllabus), :class => "postOptionLink", :target => "_blank" %></li>
</ul>
</li>
</ul>
</div>
<% end %>
<div class="cl"></div>
<div class="sy_class_logo fl">
<%= image_tag(url_to_avatar(@course), :width => "110", :height => "110", :alt => "班级logo") %>
</div>
<div class="sy_class_id fl">
<p>邀请码<br /><span class="sy_corange"><%=@course.generate_invite_code %></span></p>
</div>
<div class="sy_class_info fl ml15">
<div class="sy_class_titbox">
<h3 class="fl sy_class_title"><%=@course.name %></h3>
<span class="icon_si fl mr20"><%=@course.is_public == 0 ? '私有' : '公开' %></span>
<p class="sy_cgrey fl mt3">
<span class=" mr15">教师:<%= course_teacher_link teacher_num %></span>
<span class=" mr15">学生:<%= course_student_link student_num %></span>
<span class=" mr15">资源:<%= link_to course_file_num, course_files_path(@course), :class => 'sy_cblue',:id=>'courses_files_count_info' %></span>
</p>
<div class="cl"></div>
</div>
<p class="sy_cgrey mb10">
<span class=" mr15">主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %></span>
<span class=" mr15">学时:<span class="sy_cblack"><%= @course.class_period %>学时</span></span>
<span class=" mr15">学期:<span class="sy_cblack"><%= current_time_and_term @course %></span></span>
<span class=" mr15">单位:<span class="sy_cblack"><%= @course.school ? @course.school : '无' %></span></span>
</p>
<!--<a href="javascript:void(0);" class="sy_btn_orange mr10" > 教师身份</a>-->
<% unless is_teacher %>
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
<% end %>
</div>
<div class="cl"></div>

View File

@ -17,8 +17,8 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup'%>
<%= javascript_include_tag "course","sy_public", "syllabus","header","attachments",'prettify' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus'%>
<%= javascript_include_tag "course","header","attachments",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
@ -40,7 +40,7 @@
</head>
<!--add by huang-->
<body onload="prettyPrint();">
<div class="navContainer mb10">
<div class="navContainer">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
@ -48,146 +48,103 @@
<% end%>
</div>
<div class="cl"></div>
<div id="Container">
<div id="content">
<div id="LSide" class="fl">
<div class="project_info" style="position: relative" id="project_info_<%=@course.id %>">
<%=render :partial=>'layouts/project_info' %>
</div><!--课程信息 end-->
<div class="info_box">
<ul>
<li><%= l(:label_main_teacher)%> :&nbsp;&nbsp;<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
<li><%= l(:label_class_period)%> :&nbsp;&nbsp;<span ><%= @course.class_period %> <%= l(:label_class_hour) %></span></li>
<li><%= l(:label_main_term)%> :&nbsp;&nbsp;<span><%= current_time_and_term @course %></span></li>
<% if @course.school%>
<li><%= l(:label_course_organizers)%> :&nbsp;&nbsp;<%= @course.school%></li>
<% end%>
</ul>
<div class="">
<div class="sy_class_infobox">
<%=render :partial => 'layouts/course_base_info' %>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @course %>
<%# over %>
<div class="subNavBox">
<div class="sy_content">
<div class="sy_class_l fl" id="courseLSide">
<div class="sy_class_leftnav mb12">
<ul class="accordion">
<% unless show_nav?(@course.course_activities.count) %>
<div class="subNav">
<%= link_to l(:label_activity), course_path(@course), :class => "f14 c_blue02" %>
<!--暂时不显示课程动态数,优化后在显示-->
<%= link_to "(#{@course.course_activities.count})", course_path(@course), :class => "subnav_num c_orange"%>
</div>
<% end %>
<% unless show_nav?(@course.homework_commons.count) %>
<div class="subNav">
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02"%>
<%= link_to "(#{homework_num})", homework_common_index_path(:course => @course.id), :class => "subnav_num c_orange"%>
<%= link_to( "", homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
</div>
<% end %>
<% unless show_nav?(@course.news.count) %>
<div class="subNav">
<%= link_to "通知", course_news_index_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.news.count})", course_news_index_path(@course), :class => "subnav_num c_orange"%>
<%= link_to( "", new_course_news_path(@course,:is_new=>1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
</div>
<% end %>
<% unless show_nav?(course_file_num) %>
<div class="subNav">
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{course_file_num})", course_files_path(@course), :class => "subnav_num c_orange",:id=>'courses_files_count_nav' %>
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<!--link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white')-->
<a class="courseMenuSetting" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
<% end %>
</div>
<li id="sy_01" class="sy_icons_index">
<a href="<%=course_path(@course) %>" >动态<span><%=@course.course_activities.count %></span></a>
</li>
<% end %>
<% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
<div class="subNav">
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") %>
</div>
<li id="sy_02" class="sy_icons_boards">
<% count = @course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0 %>
<a href="<%=course_boards_path(@course) %>">问答区<span><%=count %></span></a>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
</li>
<% end %>
<% unless show_nav?(@course.homework_commons.count) %>
<li id="sy_03" class="sy_icons_hwork">
<a href="<%= homework_common_index_path(:course => @course.id) %>">作业<span><%=homework_num %></span></a>
<%= link_to( "",homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
</li>
<% end %>
<% unless show_nav?(@course.news.count) %>
<li id="sy_04" class="sy_icons_news">
<a href="<%=course_news_index_path(@course) %>">通知<span><%=@course.news.count %></span></a>
<%= link_to( "",new_course_news_path(@course,:is_new=>1), :class => 'sy_class_add', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
</li>
<% end %>
<% unless show_nav?(course_file_num) %>
<li id="sy_05" class="sy_icons_files">
<a href="<%=course_files_path(@course) %>">资源库<span><%=course_file_num %></span></a>
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<a class="sy_class_add" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
<% end %>
</li>
<% end %>
<% unless show_nav?(course_feedback_count) %>
<div class="subNav">
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{course_feedback_count})", course_feedback_path(@course), :class => "subnav_num c_orange", :id => "course_jour_count"%>
<%= link_to "", course_feedback_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
</div>
<li id="sy_06" class="sy_icons_feedback">
<a href="<%=course_feedback_path(@course) %>">留言<span><%=course_feedback_count %></span></a>
<%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
</li>
<% end %>
<% unless show_nav?(course_poll_count) %>
<div class="subNav">
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f14 c_blue02"%>
<%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %>
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'courseMenuSetting', :title =>"#{l(:label_new_poll)}") if is_teacher %>
</div>
<li id="sy_07" class="sy_icons_poll">
<a href="<%=poll_index_path(:polls_type => "Course", :polls_group_id => @course.id) %>">问卷调查<span><%=course_poll_count %></span></a>
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'sy_class_add', :title =>"#{l(:label_new_poll)}") if is_teacher %>
</li>
<% end %>
<% unless show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count) %>
<div class="subNav">
<%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f14 c_blue02"%>
<%= link_to "(#{User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count})", exercise_index_path(:course_id => @course.id), :class => "subnav_num c_orange" %>
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'courseMenuSetting', :title =>"新建试卷") if is_teacher %>
</div>
<% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %>
<% unless show_nav?(count) %>
<li id="sy_08" class="sy_icons_exercise">
<a href="<%=exercise_index_path(:course_id => @course.id) %>">在线测验<span><%=count %></span></a>
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
</li>
<% end %>
<% statistics_count = 0 %>
<% unless show_nav?(statistics_count) %>
<li id="sy_09" class="sy_icons_st">
<a href="<%=statistics_course_course_path(@course) %>">统计<span></span></a>
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
</li>
<% end %>
<%# 工具栏展开 %>
<% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 ||
course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %>
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContentCourse">
<%= render 'courses/tool_expand', :locals => {:is_teacher => is_teacher, :course_file_num => course_file_num} %>
course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 || statistics_count == 0%>
<li id="expand_tools_expand" class="sy_icons_more"><a href="javascript:void(0)"> 更多</a>
</li>
<ul class="sub-menu undis" id="navContentCourse">
<%= render :partial => 'courses/tool_expand' %>
</ul>
<% end %>
</div><!--项目侧导航 end-->
</ul>
</div><!--sy_class_leftnav end-->
<%# 课程活跃度 %>
<div class="cl"></div>
<%= render :partial => 'courses/course_activity_users', :locals => {:course => @course} %>
<%# 课程英雄榜 %>
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
<% if @course.description && !@course.description.blank? %>
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_course_brief_introduction)%></h4>
<div id="course_description_content">
<%= textilizable(@course.description) if @course.description && !@course.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<label id="expend_more_information" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
</div><!--项目简介 end-->
<% end %>
<div class="project_Label">
<h4 class="mb5" ><%= l(:label_tag)%></h4>
<div class="tag_h" >
<%= render :partial => 'tags/new_tag', :locals => {:obj => @course, :object_flag => "9"} %>
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
<!--课程推荐-->
<div class="sy_class_leftbox mb15" >
<h3>班级推荐</h3>
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @course.visits.to_i %> 自2016年5月</div>
</div><!--LSide end-->
<div id="RSide" class="fl">
<%= yield %>
<%#= render_flash_messages %>
<%#= call_hook :view_layouts_base_content %>
</div>
</div><!--sy_class_l end-->
<div class="fl">
<%= yield %>
</div><!--sy_class_r end-->
<div class="cl"></div>
</div><!--sy_content end-->
</div>
</div><!--Content end-->
</div><!--Container end-->
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;">
@ -199,9 +156,15 @@
<script>
var blog_artile_list_html = '';
$(function(){
if($("#sy_0<%=@left_nav_type %>").length > 0){
$("#sy_0<%=@left_nav_type %> a").addClass('active');
} else {
$("#expand_tools_expand a").addClass('active');
$("#navContentCourse").toggle();
}
$(document).on('input','input[name="course_outline_search"]',function(e){
throttle(course_outline_search,window,e);
})
});
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
@ -239,7 +202,7 @@
})
}
})
});
//资源库上传附件
function course_files_upload(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>');
@ -271,6 +234,9 @@
}
$("#expand_tools_expand").click(function(){
var accordion_head = $('.accordion > li > a');
accordion_head.removeClass('active');
$("#expand_tools_expand a").addClass('active');
$("#navContentCourse").toggle();
});
</script>

View File

@ -363,6 +363,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
}
}
</script>
<div class="courseRSide fl">
<div class=" polls_content polls_edit" id="polls">
<!-- 头部 -->
@ -431,3 +432,4 @@ function insert_MCQ(quest_type,quest_num,quest_id){
</select>
</div>
</div><!--编辑end-->
</div>

View File

@ -86,6 +86,8 @@
hideModal($("#popbox_upload"));
}
</script>
<div class="courseRSide fl">
<div class="polls_content02" id="polls">
<%= render :partial => 'poll_list'%>
</div><!--问卷内容end-->
</div>

View File

@ -1,4 +1,5 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<div class="courseRSide fl">
<div class="polls_content polls_box" id="polls">
<div class="ur_page_head" >
<h1 class="ur_page_title">
@ -221,3 +222,4 @@
</div>
</div>
</div><!--问卷内容end-->
</div>

View File

@ -1,4 +1,5 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<div class="courseRSide fl">
<div class="polls_content polls_box" id="polls">
<div class="ur_page_head" >
<h1 class="ur_page_title">
@ -33,3 +34,4 @@
<div class="cl"></div>
</div>
</div>
</div>

View File

@ -7,7 +7,7 @@
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
$("#Container").css("width","1000px");
});

View File

@ -1147,6 +1147,7 @@ RedmineApp::Application.routes.draw do
get 'search_public_orgs_not_in_course'
get "homework_search"
get "show_comparecode"
get "statistics_course"
end
collection do
match 'join_private_courses', :via => [:get, :post]

View File

@ -497,7 +497,7 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;}
/*20151123课程排行榜Tim*/
.courseMenuSetting {background:url(/images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top:3px; float:right; margin-right:5px;}
.courseMenuSetting:hover {background:url(/images/homepage_icon2.png) -190px -407px no-repeat;}
.rankList {width:220px; padding:10px; background-color:#ffffff; margin-top:10px;}
.rankList {width:208px; background: #fff; border: 1px solid #e5e5e5; border-bottom: none; padding:10px 15px;}
.rankList li {width:73px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;}
.rankList li p {width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;}
.rankPortrait {border-radius:50%; width:35px; height:35px;}

View File

@ -7,7 +7,7 @@
/*主内容左右分栏*/
#LSide{ width:240px;}
#RSide{ width:670px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;}
.courseRSide{ width:730px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;}
/*资源库*/
.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right}
.resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;}

View File

@ -485,7 +485,7 @@ a:hover.sy_btn_orange{
.accordion li.sy_icons_index > a:before { background-position: 5px 13px; }
.accordion li.sy_icons_index:hover > a:before,
.accordion li.sy_icons_index:target > a:before,
.accordion li.sy_icons_indexs > a.active:before { background-position: -23px 13px; }
.accordion li.sy_icons_index > a.active:before { background-position: -23px 13px; }
.accordion li.sy_icons_boards > a:before { background-position: 5px -23px; }
.accordion li.sy_icons_boards:hover > a:before,