Merge branch 'develop' into 'develop'

bug修复



See merge request !114
This commit is contained in:
黄井泉 2017-01-06 19:01:16 +08:00
commit 09bc9abfa7
7 changed files with 22 additions and 16 deletions

View File

@ -500,10 +500,6 @@ class ApplicationController < ActionController::Base
#<23><>ȡ<EFBFBD>γ<EFBFBD>
def find_course
@course= Course.find(params[:id])
if @course.is_delete == 1 and !User.current.admin?
render_404
return
end
rescue ActiveRecord::RecordNotFound
render_404
end

View File

@ -345,7 +345,7 @@ class MessagesController < ApplicationController
elsif @message.parent
redirect_to board_message_url(@board, @message.parent, :r => r)
else
redirect_to course_boards_path(@course)
redirect_to course_boards_path(@course, :board_id => @board.id)
end
elsif @contest
if params[:is_course] && params[:is_course].to_i == 0
@ -357,7 +357,7 @@ class MessagesController < ApplicationController
elsif @message.parent
redirect_to board_message_url(@board, @message.parent, :r => r)
else
redirect_to contest_boards_path(@contest)
redirect_to contest_boards_path(@contest, :board_id => @board.id)
end
elsif @org_subfield
if params[:is_board]

View File

@ -4193,7 +4193,7 @@ end
end
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}
format.html {render :layout => 'base_course_community'}
end
end
end

View File

@ -3,15 +3,16 @@
<div class="sy_new_tchbox clear undis" style="margin-left:10px; margin-right:10px;" id="add_sub_board">
<%= form_tag url_for(:controller => 'boards', :action => 'create', :contest_id => @contest.id, :board_id => board.id), :id=> 'add_board_form_subboard',:remote => true do %>
<ul class="pro_newsetting_con mb15">
<li class="mb10 clear">
<li>
<label class="fl">新增子栏目名称&nbsp;&nbsp;:&nbsp;</label>
<input id="subfield_name" name="name" placeholder="请输入子栏目名称" maxlength="30" class="w695 fl h28" type="text">
<div class="cl"></div>
<span id="new_notice" class="undis ml10 fl c_red">名称不能为空</span>
<input id="subfield_name" name="name" placeholder="请输入子栏目名称" maxlength="30" class="fl h28" style="width: 420px" type="text">
<a href="javascript:void(0);" class="fr sy_btn_grey" onclick="$('#add_sub_board').toggle();">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" id="subMenuSubmit">保存</a>
</li>
<div class="cl"></div>
<span id="new_notice" class="undis fl c_red">名称不能为空</span>
</ul>
<a href="javascript:void(0);" class="fr sy_btn_grey" onclick="$('#add_sub_board').toggle();">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" id="subMenuSubmit">保存</a>
<% end %>
</div>
<div class="clear ml10 mr10">
@ -33,7 +34,8 @@
<td class="game-text-left">
<div id="board_sub_show_<%= board.id %>" class="ml40 w350 hidden" title="<%=board.name %>"><%=board.name %></div>
<div id="board_sub_edit_<%= board.id %>" style="display:none;" class="ml40">
<input type="text" name="name" class="h28 w300" id="board_sub_name_<%=board.id %>" onblur="update_sub_board_name('#board_sub_show_<%= board.id %>','#board_sub_edit_<%= board.id %>','<%= board.id %>','<%= @contest.id %>',$(this).val());" value="<%= board.name %>"/>
<input type="text" name="name" class="h28 w300" id="board_sub_name_<%=board.id %>" maxlength="30"
onblur="update_sub_board_name('#board_sub_show_<%= board.id %>','#board_sub_edit_<%= board.id %>','<%= board.id %>','<%= @contest.id %>',$(this).val());" value="<%= board.name %>"/>
</div>
</td>
<td class="game-text-right">

View File

@ -6,7 +6,7 @@
</div>
<div class="">
<div style="margin: 10px 20px;">
<a type="button" class="BlueCirBtn" onclick="$('#upload_avatar').click();">上传图片</a>
<a class="BlueCirBtn" onclick="$('#upload_avatar').click();" style="cursor: pointer;">上传图片</a>
<%= file_field_tag 'avatar[image]',
:id => "upload_avatar",
:style => 'display:none;',#added by young

View File

@ -172,6 +172,14 @@
<% content = '<span class="shadowbox_news_user">'+User.find(ma.applied_user_id).show_name+' </span>申诉匿评成绩:'+"“"+homework.name+"”" %>
<%= link_to content.html_safe, student_work_index_path(:homework => homework.id, :show_work_id => ma.applied.student_works_score.student_work_id, :tab => 2), :title => "#{User.find(ma.applied_user_id).show_name}申诉匿评成绩:“#{homework.name}”", :target => '_blank' %>
</li>
<% elsif ma.applied_type == "AppliedContest" %>
<li>
<% applied_contest = ma.applied %>
<% contest = Contest.find applied_contest.contest_id %>
<% message_user = User.find(applied_contest.user_id) %>
<% content = '<span class="shadowbox_news_user">'+message_user.show_name+' </span>'+(message_user.user_extensions.school_id.blank? ? "" : "来自")+message_user.user_extensions.school.name+""+'申请以"'+ get_role_str(ma.role) + '"的身份加入竞赛:' + contest.name%>
<%= link_to content.html_safe, contest_path(contest.id), :title => "#{message_user.show_name} #{message_user.user_extensions.school_id.blank? ? '' : '来自'+message_user.user_extensions.school.name},申请以'#{get_role_str(ma.role)}'的身份加入竞赛:#{contest.name}", :target => '_blank' %>
</li>
<% end %>
<% elsif ma.class == ForgeMessage %>
<% if ma.forge_message_type == "AppliedProject" %>

View File

@ -1572,7 +1572,7 @@ function pop_box_new(value, Width, Height){
new Drag("popupWrap");
$("#popupWrap input, #popupWrap textarea, #popupWrap ul").mousedown(function(event){
$("#popupWrap input, #popupWrap textarea, #popupWrap ul, #popupWrap a").mousedown(function(event){
event.stopPropagation();
new Drag("popupWrap");
});