Merge branch 'dev_haigong' into dev_local

dev_local
cxt 6 years ago
commit 678e24b6a2

@ -326,14 +326,16 @@ class BoardsController < ApplicationController
end
def update_position
if @course || @contest
if @course
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
boards = @board.parent.children
if params[:opr] == 'up' && @board.position > 1
if @is_teacher && params[:opr] == 'up' && @board.position > 1
before_board = boards.where("position = #{@board.position - 1}").first
if before_board && @board.update_attribute('position', @board.position - 1)
before_board.update_attribute('position', before_board.position + 1)
end
elsif params[:opr] == 'down' && @board.position < boards.count
elsif @is_teacher && params[:opr] == 'down' && @board.position < boards.count
after_board = boards.where("position = #{@board.position + 1}").first
if after_board && @board.update_attribute('position', @board.position + 1)
after_board.update_attribute('position', after_board.position - 1)

@ -106,7 +106,7 @@ class GraduationTopicsController < ApplicationController
def student_select_topic
if User.current.student_graduation_topics.where(:course_id => @course.id, :status => [0, 1]).count == 0
@topic.student_graduation_topics << StudentGraduationTopic.new(:course_id => @course.id, :user_id => User.current.id,
:member_id => @course.members.where(:user_id => User.current.id).first.try(:id))
:member_id => @course.course_members.where(:user_id => current_user.id).first.try(:id))
@topic.update_attributes(:status => 1)
end
redirect_to graduation_topic_path(@topic)

@ -359,8 +359,8 @@ class HomeworkCommonController < ApplicationController
# homework 的记录更新
# 发布时间不为空
if params_publish_time && min_publish_time != ""
@homework.publish_time = min_publish_time
@homework.end_time = max_end_time
@homework.publish_time = min_publish_time if @homework.publish_time.nil? || @homework.publish_time > Time.now
@homework.end_time = max_end_time if @homework.end_time.nil? || @homework.end_time > Time.now
# @homework.archive_time = params_archive_time if params_archive_time
if @homework.publish_time < Time.now and @homework_detail_manual.comment_status == 0
@homework_detail_manual.comment_status = 1
@ -379,10 +379,10 @@ class HomeworkCommonController < ApplicationController
=end
# 发布时间未设置 则按当前时间立即发布
elsif params_publish_time && min_publish_time == ""
@homework_detail_manual.comment_status = 1
@homework.publish_time = Time.now
@homework_detail_manual.comment_status = 1 if @homework_detail_manual.comment_status == 0
@homework.publish_time = Time.now if @homework.publish_time.nil? || @homework.publish_time > Time.now
@homework.unified_setting = 1
@homework.end_time = Time.at(((1.month.since.to_i)/3600.0).ceil * 3600)
@homework.end_time = Time.at(((1.month.since.to_i)/3600.0).ceil * 3600) if @homework.end_time.nil? || @homework.end_time > Time.now
# @homework.archive_time = Time.at(((2.months.since.to_i)/3600.0).ceil * 3600)
create_homework_user = 1
@ -391,7 +391,7 @@ class HomeworkCommonController < ApplicationController
end
# 已发布的作业,只更新截止时间和结束时间
else
@homework.end_time = max_end_time if params_end_time
@homework.end_time = max_end_time if params_end_time && (@homework.end_time.nil? || @homework.end_time > Time.now)
# @homework.archive_time = params_archive_time if params_archive_time
=begin

@ -1,7 +1,8 @@
<% if @course %>
$("#tbc_04").html("<%=escape_javascript(render :partial => 'courses/settings/boards_setting') %>");
<% course_board = @course.boards.where(:parent_id => 0).first %>
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board})%>");
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals =>
{:course_board => course_board, :is_teacher => @is_teacher})%>");
<% elsif @contest %>
$("#game-setting-content-3").html("<%=escape_javascript(render :partial => 'contests/boards') %>");
<% contest_board = @contest.boards.where(:parent_id => 0).first %>

@ -32,10 +32,12 @@
<%= render :partial => 'users/course_create', :locals => {:activity => activity.course_act, :user_activity_id => activity.id, :is_course => 1} if activity.course_act %>
<% when 'JoinCourse' %>
<% act = CourseMessage.where(:id => activity.course_act_id).first %>
<% if act.present? %>
<%= render :partial => 'users/join_course', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<% else %>
<%= render :partial => "welcome/no_data" %>

@ -1,6 +1,8 @@
<%= render :partial => "graduation_tasks/task_tag", :locals => {:task => task} %>
<% from_course = defined?(is_course) ? true : false %>
<% if false %>
<% if @is_teacher %>
<div class="<%= from_course ? 'fr mr20 edu-menu-panel' : 'fr edu-position-hidebox' %>" style="<%= from_course ? '' : 'position: absolute;right: 0px;top: 0px;'%>">
<% if from_course %>
@ -62,3 +64,4 @@
<% end %>
<% end %>
<% end %>
<% end %>

@ -62,6 +62,8 @@
<% end %>
<%# elsif homework_common.homework_type != 4 %>
<% else %>
<% if false %>
<% if had_commit_studentwork_count(homework_common) > 0 %>
<span class="ml50 fl">
<%= link_to had_commit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id), :class => 'color-orange03 mr5', :target => '_blank' %>
@ -77,6 +79,7 @@
未交
</span>
<% end %>
<% end %>
<%# elsif homework_common.homework_type == 4 && homework_common.homework_commons_shixuns.shixun %>
<%# had_passed_count = had_passed_changllenge_count(homework_common.homework_commons_shixuns.shixun, User.current) %>
<%# challenge_count = homework_common.homework_commons_shixuns.shixun.challenges.count %>
@ -148,7 +151,7 @@
<li>
<%= link_to '立即发布', publish_notice_homework_common_path(homework_common), :remote => true %>
</li>
<% elsif (homework_common.homework_detail_manual.try(:comment_status) == 1 || homework_common.homework_detail_manual.try(:comment_status) == 2) && homework_common.end_time > Time.now %>
<% elsif (homework_common.homework_detail_manual.try(:comment_status) == 1 || homework_common.homework_detail_manual.try(:comment_status) == 2) && homework_common.end_time.present? && homework_common.end_time > Time.now %>
<li>
<%= link_to '立即截止', end_notice_homework_common_path(homework_common), :remote => true %>
</li>

@ -1,25 +1,29 @@
<% course_board = @course.boards.where(:parent_id => 0).first %>
<% count = course_board ? course_board.messages.count : 0 %>
<li class="clearfix" id="sy_02">
<% if course_module.module_name != course_board.name %>
<% course_board.update_name(course_module.module_name) %>
<% end %>
<a href="<%= course_boards_path(@course) %>" class="fl"><i class="iconfont icon-taolun mr20 fl"></i>
<span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if is_teacher %>
<% count = course_board ? course_board.messages.count : 0 %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% unless course_board.children.empty? %>
<ul>
<% course_board.children.reorder("position asc").each do |board| %>
<li id="board_children_<%= board.id %>" class="clearfix">
<% count = board ? board.messages.count : 0 %>
<a href="<%= course_boards_path(@course, :board_id => board.id) %>" class="fl"><span class="fl ml38 devide_class task-hide" data-tip-down="<%=board.name %>"><%=board.name %></span>
<% if is_teacher %>
<% count = board ? board.messages.count : 0 %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% end %>

@ -1,9 +1,11 @@
<li id="sy_08" class="clearfix">
<a href="<%= students_course_path(@course) %>" class="fl"><i class="iconfont icon-fenban mr20 fl"></i><span class="fl task-hide activity-left-name"><%= @course.course_modules.where(:module_type => "course_group").first.try(:module_name) %></span>
<% if is_teacher %>
<% group_count = @course.course_groups.size %>
<% if group_count > 0 %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= group_count %></span>
<% end %>
<% end %>
</a>
</li>
<% unless @course.course_groups.empty? %>
@ -13,17 +15,21 @@
<% if count > 0 %>
<li id="sy_09" class="clearfix">
<a href="<%= students_course_path(@course, :group_id => 0) %>" class="fl" style="color:000 !important;"><span class="fl ml38 devide_class task-hide" data-tip-down="未分班" style="color:000 !important;">未分班</span>
<% if is_teacher %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= count %></span>
<% end %>
</a>
</li>
<% end %>
<% @course.course_groups.each do |group| %>
<li id="course_group_<%=group.id %>" class="clearfix">
<% count = group.members.count %>
<a href="<%= students_course_path(@course, :group_id => group.id) %>" class="fl"><span class="fl ml38 devide_class task-hide" data-tip-down="<%=group.name %>"><%=group.name %></span>
<% if is_teacher %>
<% count = group.members.count %>
<% if count > 0 %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% end %>

@ -1,4 +1,3 @@
<% course_file_num = visable_attachemnts_incourse(@course).size %>
<% course_modules = @course.course_modules.where(:hidden => 0) %>
<%# is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<%# homework_num = visable_course_homework @course %>
@ -64,29 +63,35 @@
<% when "shixun_homework" %>
<li class="clearfix" id="sy_03_4">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 4) %>" class="fl"><i class="iconfont icon-daima mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if @is_teacher %>
<% homework_count = visable_course_homework(@course, 4, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% end %>
<% end %>
</a>
</li>
<%= render :partial => "courses/course_homework_catagories", :locals => {:is_teacher => @is_teacher} %>
<% when "common_homework" %>
<li class="clearfix" id="sy_03_1">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 1) %>" class="fl"><i class="iconfont icon-putongzuoye mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if @is_teacher %>
<% homework_count = visable_course_homework(@course, 1, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% end %>
<% end %>
</a>
</li>
<% when "group_homework" %>
<li class="clearfix" id="sy_03_3">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 3) %>" class="fl"><i class="iconfont icon-fenzuzuoye mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if @is_teacher %>
<% homework_count = visable_course_homework(@course, 3, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% end %>
<% end %>
</a>
</li>
<% when "graduation" %>
@ -96,53 +101,65 @@
</li>
<ul>
<li id="sy_07_01" class="clearfix">
<% count = @course.graduation_topics.count %>
<a href="<%= graduation_topics_path(:course => @course.id) %>" class="fl">
<span class="fl ml38 devide_class task-hide">毕设选题</span>
<% if @is_teacher %>
<% count = @course.graduation_topics.count %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<li id="sy_07_02" class="clearfix">
<% count = visible_task_count @course, @is_teacher %>
<a href="<%= graduation_tasks_path(:course => @course.id) %>" class="fl">
<span class="fl ml38 devide_class task-hide">毕设任务</span>
<% if @is_teacher %>
<% count = visible_task_count @course, @is_teacher %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
</ul>
<% when "exercise" %>
<% count = visable_course_exercise @course, @is_teacher %>
<li class="clearfix" id="sy_04">
<a href="<%= exercise_index_path(:course_id => @course.id) %>" class="fl"><i class="iconfont icon-shijuan mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if @is_teacher %>
<% count = visable_course_exercise @course, @is_teacher %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% when "poll" %>
<% count = visable_course_poll @course, @is_teacher %>
<li class="clearfix" id="sy_06">
<a href="<%= poll_index_path(:course_id => @course.id) %>" class="fl"><i class="iconfont icon-wenjuan mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if @is_teacher %>
<% count = visable_course_poll @course, @is_teacher %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% when "attachment" %>
<li class="clearfix" id="sy_05">
<a href="<%= course_files_path(@course) %>" class="fl"><i class="iconfont icon-ziyuan mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if @is_teacher %>
<% course_file_num = visable_attachemnts_incourse(@course).size %>
<% if course_file_num > 0 %>
<span class="fr mr30 courseNewNum"><%= course_file_num %></span>
<% end %>
<% end %>
</a>
</li>
<% when "board" %>
<div id="board_children_list">
<%= render :partial => 'layouts/board_children_list', :locals => {:course_module => course_module} %>
<%= render :partial => 'layouts/board_children_list', :locals => {:course_module => course_module,
:is_teacher => @is_teacher} %>
</div>
<% when "course_group" %>
<div id="group_children_list">

@ -1,5 +1,14 @@
<% @partners.each_with_index do |partner,index| %>
<li>
<%= link_to "#{partner.name}", partners_managements_path(:partner => partner), :class => "#{partner.id == @current_partner.id ? 'active' : ''}" %>
<li class="clearfix">
<%= link_to "#{partner.name}", partners_managements_path(:partner => partner), :class => "#{partner.id == @current_partner.id ? 'active' : ''} fl" %>
<% if false %>
<div class="fr mr10 edu-menu-panel mt5">
<i class="iconfont icon-sandian color-grey-9 font-14"></i>
<ul class="edu-menuSmall-list edu-txt-center">
<li><a href="javascript:void(0)">查看</a></li>
<li><a href="javascript:void(0)" onclick="delPartners();">删除</a></li>
</ul>
</div>
<% end %>
</li>
<% end %>

@ -5,7 +5,7 @@
<a href="javascript:void(0)" class="fl task-btn ml10" onclick="$('#partner_search').val('')">清除</a>
</div>
<div class="clearfix mt20">
<div class="with25 fl edu-back-white">
<div class="with25 fl">
<%= link_to "+添加",all_partners_managements_path,remote:true,class:"color-blue addOperation" %>
<ul class="partnerList" id="partner_list">
<%= render :partial => "partner_list" %>
@ -29,4 +29,9 @@
function submit_search_partner(){
$.get("/managements/partners?search="+$("#partner_search").val());
}
function delPartners(){
delete_confirm_box_2("","确定删除合作伙伴?");
}
</script>

@ -15,6 +15,7 @@
<% end %>
<% end %>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -68,6 +69,8 @@
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<p>
<%= link_to activity.user.show_real_name, user_path(activity.user), :class => "color-grey-6 mr30" %>

@ -13,6 +13,7 @@
<span class="edu-filter-btn edu-filter-btn-no-late ml10 fl mt6">已确认</span>
<% end %>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -33,6 +34,7 @@
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= cancel_topic_select_graduation_topic_path(activity) %>', '确定要取消该选题吗')" class="edu-filter-btn edu-greyback-btn fl mt7 pl3 pr3 ml10 pointer">取消选题</a>
<% end %>
<% end %>
<% end %>
</div>
<p>
<%= link_to activity.teacher.show_real_name, user_path(activity.teacher), :class => "color-grey-6 mr30" %>

@ -25,6 +25,7 @@
<% end %>
<% end %>
<% if false %>
<% if @is_teacher %>
<% comment_status = activity.homework_detail_manual.try(:comment_status) %>
<div class="fr mr20 edu-menu-panel">
@ -191,6 +192,7 @@
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<p>
<%= link_to activity.user.show_real_name, user_path(activity.user), :class => "color-grey-6 mr30" %>

@ -8,6 +8,8 @@
<% if activity.sticky == 1%>
<span class="fl btn-cir btn-cir-red mt5 ml15">置顶</span>
<% end%>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -25,6 +27,8 @@
</ul>
</div>
<% end%>
<% end %>
</div>
<p>
<%= link_to activity.author.show_real_name, user_path(activity.author), :class => "color-grey-6 mr30" %>

@ -16,6 +16,7 @@
<% end %>
<% end %>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -63,6 +64,8 @@
<%= link_to "开始答题", poll_path(activity,:user_id => User.current.id), :class => "edu-activity-blue edu-filter-btn ml15 fl mt5" %>
<% end %>
<% end%>
<% end %>
</div>
<p>
<%= link_to activity.user.show_real_name, user_path(activity.user), :class => "color-grey-6 mr30" %>

File diff suppressed because one or more lines are too long

@ -2974,15 +2974,18 @@ a.singlepublishtwo{
.edu-cooperation li{height: 60px;width: 210px;padding: 10px 0px;margin-left: 20px;float: left;margin-bottom: 20px;text-align: center;line-height: 40px;box-sizing: border-box}
.edu-cooperation li img{height: 40px;width: 210px;}
/*单位-合作伙伴*/
.addOperation{width: 100%;display: block;height: 56px;line-height: 56px;text-align: center;border-bottom: 1px solid #eee;}
.partnerList li a{
display: block;height: 40px;line-height: 40px;padding:0px 10px;width: 100%;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;
.addOperation{width: 100%;display: block;height: 56px;line-height: 56px;text-align: center;border-bottom: 1px solid #eee;background: #fff}
.partnerList>li{
background: #fff;
}
.partnerList>li>a{
display: block;height: 40px;line-height: 40px;padding:0px 10px;width: 87%;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;
box-sizing: border-box;position: relative;
}
.partnerList li a.active:after{
.partnerList>li>a.active:after{
position: absolute;left: 0px;height: 100%;width: 2px;content: '';background: #4cacff;
}
.partnerList{max-height: 500px;overflow-y: auto;}
/*.partnerList{max-height: 500px;overflow-y: auto;}*/
.manageList{float: left}
.manageList li{width: 60px;float: left;margin-right: 15px;border-radius: 50%;text-align: center;position: relative;margin-bottom: 10px;}
.manageList li>a.addManage,.manageList li>img{width: 60px;height: 60px;line-height: 49px;margin-right: 10px;border-radius: 50%;display: block}

Loading…
Cancel
Save