Merge branch 'dev_shixun_project' of https://git.trustie.net/jacknudt/trustieforge into dev_shixun_project

Conflicts:
	app/views/games/_tree.html.erb
This commit is contained in:
daiao 2017-03-21 12:38:04 +08:00
commit d7d47629ce
8 changed files with 68 additions and 66 deletions

View File

@ -48,7 +48,7 @@ class GamesController < ApplicationController
@g = Gitlab.client
@g.edit_file(@myshixun.gpid, :content => params[:content], :file_path => @path, :branch_name => @rev, :commit_message => "shixun exec")
respond_to do |format|
format.js{redirect_to entry_myshixun_game_path(@game, :myshixun_id => @myshixun)}
format.js{redirect_to entry_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path)}
end
rescue Exception => e
puts e.message

View File

@ -58,7 +58,7 @@
<h3 >操作</h3>
</div>
<div class="content-submitbox">
<a href="javascript:void(0)" class="task-btn mb10" onclick="file_edit_submit()">保存</a>
<a href="javascript:void(0)" class="task-btn mb10" onclick="file_edit_submit()">保存修改</a>
<! if(status == 0){ !>
<div id="game_commit">
<a href="javascript:void(0)" class="task-btn task-btn-green" onclick="training_task_submmit();">提交评测</a>

View File

@ -2,10 +2,9 @@
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<form action="/myshixuns/<%= @myshixun.id %>/games/<%= @game.id %>/file_update?path=<%= @path %>" method="post" id="file_update_id">
<form action="/myshixuns/<%= @myshixun.id %>/games/<%= @game.id %>/file_update?path=<%= @path %>" method="post" id="file_update_id" data-remote="true">
<li class="clearfix" xmlns="http://www.w3.org/1999/html">
<textarea class = "panel-form-width-690 fl task-textarea-pd" id="challenge-answer" name="content">
<textarea class = "" id="challenge-answer" name="content">
<%= Redmine::CodesetUtil.replace_invalid_utf8(@content) %>
</textarea>
<script>

View File

@ -45,57 +45,3 @@
<%= render :partial => 'exec_results' %>
</div>
</div>
<script type="text/javascript" language="javascript">
var web_h = window.innerHeight;
$(document).ready(function(){
if($.browser.msie) {
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px"); //IE
$(".content-editor").css("height", web_h * 0.55 + 100 + "px");
}
else if($.browser.safari)
{
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px"); //Safari
$(".content-editor").css("height", web_h * 0.55 + 105 + "px");
}
else if($.browser.mozilla)
{
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.48 + 50 + "px"); //Firefox
$(".content-editor").css("height", web_h * 0.48 + 155 + "px");
}
else if($.browser.opera) {
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px"); //Opera
$(".content-editor").css("height", web_h * 0.55 + 105 + "px");
}else if($.browser.chrome){
if(window.navigator.userAgent.indexOf("MetaSr") == -1){
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px");
$(".content-editor").css("height", web_h * 0.55 + 105 + "px");
}else{
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.52 + "px");
$(".content-editor").css("height", web_h * 0.52 + 105 + "px");
}
}
});
//课程大纲tab
function g(o){return document.getElementById(o);}
function HoverLi(n){
for(var i=1;i<=3;i++){
g('tab_nav_'+i).className='tab_nomal';
g('tab_con_'+i).className='undis';
}
g('tab_con_'+n).className='dis';
g('tab_nav_'+n).className='tab_hover';
}
$("#close_myshixun_tip").click(function(){
$("#myshixun_tip").hide();
});
function extend_game_description(){
$(".content-all-fix").show();
}
</script>

View File

@ -1,5 +1,5 @@
<div class=" col-width fl ml15 mt15 content-half-fix02 undis">
<div class="panel-header clearfix">
<div class="col-width fl ml15 mt15 content-half-fix02 undis" style="border: none">
<div class="panel-header clearfix" style="border: none">
<h3 class="fl">测试输出</h3>
<div class="fr mt5">
<a href="#"><i class="fa fa-minus font-14 mr10 fl color-grey"></i></a>
@ -11,8 +11,8 @@
Engryg=74
</div>
</div>
<div class="content-editor col-width fl">
<div class="panel-header clearfix">
<div class="content-editor col-width2 fl">
<div class="panel-header2 clearfix">
<h3 class="fl">
<%= render :partial => 'myshixun_breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
</h3>

View File

@ -1,5 +1,5 @@
<div class="autoscroll_new">
<table class="list entries mt5" id="browser" style="table-layout: fixed;">
<table class="list entries" id="browser" style="table-layout: fixed;">
<tbody style="line-height: 1.9;">
<% @entries.each do |entry| %>
<% tr_id = Digest::MD5.hexdigest(entry.path)
@ -9,7 +9,7 @@
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
<td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">
<td class="filename_no_report hidden">
<%= link_to h(ent_name),
{:action => (entry.is_dir? ? 'show' : 'entry'), :id => @game, :myshixun_id => @myshixun, :path => to_path_param(ent_path), :rev => @rev},
:remote => true,

View File

@ -1,3 +1,58 @@
<div id="content_list">
<%= render :partial => "game_show" %>
</div>
<script type="text/javascript" language="javascript">
var web_h = window.innerHeight;
$(document).ready(function(){
if($.browser.msie) {
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px"); //IE
$(".content-editor").css("height", web_h * 0.55 + 100 + "px");
}
else if($.browser.safari)
{
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px"); //Safari
$(".content-editor").css("height", web_h * 0.55 + 105 + "px");
}
else if($.browser.mozilla)
{
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.48 + 50 + "px"); //Firefox
$(".content-editor").css("height", web_h * 0.48 + 155 + "px");
}
else if($.browser.opera) {
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px"); //Opera
$(".content-editor").css("height", web_h * 0.55 + 105 + "px");
}else if($.browser.chrome){
if(window.navigator.userAgent.indexOf("MetaSr") == -1){
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.55 + "px");
$(".content-editor").css("height", web_h * 0.55 + 105 + "px");
}else{
$(".content").css("height", web_h - 75 + "px");
$(".tab-info-inner").css("height", web_h * 0.52 + "px");
$(".content-editor").css("height", web_h * 0.52 + 105 + "px");
}
}
});
//课程大纲tab
function g(o){return document.getElementById(o);}
function HoverLi(n){
for(var i=1;i<=3;i++){
g('tab_nav_'+i).className='tab_nomal';
g('tab_con_'+i).className='undis';
}
g('tab_con_'+n).className='dis';
g('tab_nav_'+n).className='tab_hover';
}
$("#close_myshixun_tip").click(function(){
$("#myshixun_tip").hide();
});
function extend_game_description(){
$(".content-all-fix").show();
}
</script>

View File

@ -39,6 +39,7 @@ a.link-color-green{color:#29bd8b;}
.pr5{ padding-right:5px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px;}
/*块*/
.col-width{background: #fff; border:1px solid #e8e8e8;}
.col-width2{background: #fff;}
.col-width-10{ max-width: 100%; background: #fff; border:1px solid #e8e8e8;}
.col-width-9{ max-width: 90%; background: #fff; border:1px solid #e8e8e8;}
.col-width-8{ max-width: 80%; background: #fff; border:1px solid #e8e8e8;}
@ -101,6 +102,7 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:245px; margin-top
.content-info{ width:49%; min-width:450px;}
.content-editor{ width:49%; min-width:450px; margin-left:15px; }
.panel-header{ border-bottom:1px solid #eee; padding:10px 15px;}
.panel-header2{padding:10px 15px;}
/* tab */
.tab_content{ width: 100%; margin: 0 auto; background:#fff; }
#tab_nav {height:40px;background: #eff0f4; }
@ -165,4 +167,4 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f
.content-half-fix{ min-width:450px; margin:0; position: absolute; top:15px; z-index:99;}
.content-half-fix02{margin:0; position: absolute; top:65px; z-index:99; right:45px;}
.autoscroll_new{ overflow:auto; }
.autoscroll_new{ overflow:auto; }