海工调整

dev_haigong
cxt 6 years ago
parent 23753d8977
commit 39dee9d928

@ -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)

@ -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">

@ -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" %>

Loading…
Cancel
Save