Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop
This commit is contained in:
commit
879104fd16
|
|
@ -92,6 +92,11 @@ class ChallengesController < ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
challenge_num = Challenge.where(:shixun_id => @shixun).count
|
||||
challenge_pos = @challenge.position
|
||||
if challenge_pos < challenge_num
|
||||
@next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first
|
||||
end
|
||||
@tab = params[:tab].blank? ? 1 : params[:tab].to_i
|
||||
@editor = params[:editor] # 编辑模式
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@
|
|||
</li>
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="$('#challenge_shixun_answer_update').submit();">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="answer_cancel">取消</a>
|
||||
<% if @challenge.answer %>
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3) %>" class="task-btn fr mr10" id="answer_cancel">取消</a>
|
||||
<% end %>
|
||||
</li>
|
||||
</div>
|
||||
<script>
|
||||
|
|
@ -70,8 +72,8 @@
|
|||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
};
|
||||
$("#answer_cancel").click(function(){
|
||||
/* $("#answer_cancel").click(function(){
|
||||
$("#answer_edit").hide();
|
||||
$("#edit_answer_show").show();
|
||||
})
|
||||
})*/
|
||||
</script>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>奖励经验值:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<%= @challenge.score %>分
|
||||
<%= @challenge.score.nil? ? 0 : @challenge.score %>分
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@
|
|||
</li>
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="submit_shixun_evaluating();">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="evaluating_cancel">取消</a>
|
||||
<% if @challenge.evaluation_way != 0 %>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="evaluating_cancel">取消</a>
|
||||
<% end %>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@
|
|||
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_score_update();">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="score_cancel">取消</a>
|
||||
<% if !@challenge.score.nil? %>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="score_cancel">取消</a>
|
||||
<% end %>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="task-tag tag-grey mt5 mr10 fl" id="add_shixun_skill">
|
||||
<div class="task-tag tag-grey mt5 mr10 fl <%= @challenge_tags.count > 0 ? "undis" : "" %>" id="add_shixun_skill">
|
||||
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_shixun_skill').slideToggle();">×</button>
|
||||
<input type="text" class="task-tag-input" onblur="add_tag();" id="shixun_skill_input" placeholder="请输入知识/技能点" />
|
||||
</div>
|
||||
|
|
@ -44,16 +44,18 @@
|
|||
$(".task-tag-input").attr("value","");
|
||||
}
|
||||
$("#shixun_skill_input").val("");
|
||||
$("#add_shixun_skill").hide();
|
||||
}
|
||||
|
||||
function close_tag(thisObj){
|
||||
// 获取父节点的id
|
||||
var obj = thisObj.parentNode.id;
|
||||
$("#"+obj).remove();
|
||||
var obj = $(thisObj).parent();
|
||||
$(obj).remove();
|
||||
}
|
||||
|
||||
function challenge_skill_update(){
|
||||
var nSkill = $(".knowledge_frame");
|
||||
add_tag();
|
||||
if (nSkill.length > 0){
|
||||
$("#challenge_skill_update").submit();
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<% if params[:action] == "new" %>
|
||||
<a href="<%= shixun_challenges_url(@shixun) %>" class="task-btn fr mr10" id="task_pass_cancel">取消</a>
|
||||
<% else %>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="task_pass_cancel">取消</a>
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" class="task-btn fr mr10" >取消</a>
|
||||
<% end %>
|
||||
</li>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@
|
|||
<div class="task-pm-box mt20">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl mt5">阶段编辑(第<%= @challenge.position %>关)</h3>
|
||||
<% unless @next_challenge.blank? %>
|
||||
<a href="<%= edit_shixun_challenge_path(@next_challenge, :shixun_id => @shixun) %>" class="shixun-task-btn task-btn-green fr ml10">下一阶段</a>
|
||||
<% end %>
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="<%= new_shixun_challenge_path(@shixun) %>" class="shixun-task-btn task-btn-green fr">新建阶段</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav_check_item clearfix mt20" style="margin-bottom: 0;">
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<ul class="nav_check_item clearfix">
|
||||
<li class="fl <%= @order == 'created_at' ? 'check_nav' : "" %>">
|
||||
<%= link_to "最新", search_shixuns_path(:order => "created_at", :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
|
||||
<%= link_to "最新", search_shixuns_path(:order => "created_at", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
|
||||
</li>
|
||||
<li class="fl <%= @order == 'myshixun_count' ? 'check_nav' : "" %>">
|
||||
<%= link_to "最热", search_shixuns_path(:order => "myshixun_count", :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
|
||||
<%= link_to "最热", search_shixuns_path(:order => "myshixun_count", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="task-index-list clearfix mb20">
|
||||
|
|
|
|||
Loading…
Reference in New Issue