Merge branch 'dev_shixun_project' of https://git.trustie.net/jacknudt/trustieforge into dev_shixun_project
This commit is contained in:
commit
fbcae752ae
|
@ -451,6 +451,8 @@ class AccountController < ApplicationController
|
|||
def change_email
|
||||
user = User.find params[:user_id].to_i
|
||||
user.update_attributes(:mail => params[:value])
|
||||
token = Token.create(:user => user, :action => "register")
|
||||
Mailer.run.register(token)
|
||||
result = {:email => user.mail, :email_link => user.mail.split("@")[1]}
|
||||
|
||||
render :json => result
|
||||
|
|
|
@ -91,9 +91,9 @@ class ChallengesController < ApplicationController
|
|||
respond_to do |format|
|
||||
if @challenge.update_attributes(params[:challenge])
|
||||
ActiveRecord::Base.transaction do
|
||||
@challenge_samples.destroy unless @challenge_samples.blank?
|
||||
@test_sets.destroy unless @test_sets.blank?
|
||||
@challenge_tags.destroy unless @challenge_tags.blank?
|
||||
@challenge_samples.delete_all unless @challenge_samples.blank?
|
||||
@test_sets.delete_all unless @test_sets.blank?
|
||||
@challenge_tags.delete_all unless @challenge_tags.blank?
|
||||
if params[:sample][:input].length > 0
|
||||
params[:sample][:input].each_with_index do |value, index|
|
||||
unless (value == params[:sample][:output][index] && value.blank?)
|
||||
|
|
|
@ -124,7 +124,7 @@ class User < Principal
|
|||
has_many :contestant_work_scores
|
||||
has_many :contestant_work_projects
|
||||
|
||||
has_many :shixuns, :through => :shixun_members, :dependent => :destroy
|
||||
has_many :shixun_members, :dependent => :destroy
|
||||
has_many :challenges, :dependent => :destroy
|
||||
|
||||
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
|
||||
<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" style="height: 700px">
|
||||
<textarea class = "" id="challenge-answer" name="content">
|
||||
<textarea class = "" id="challenge-file-edit" name="content">
|
||||
<%= Redmine::CodesetUtil.replace_invalid_utf8(@content) %>
|
||||
</textarea>
|
||||
<script>
|
||||
var text = document.getElementById("challenge-answer");
|
||||
var text = document.getElementById("challenge-file-edit");
|
||||
</script>
|
||||
</li>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("challenge-answer"), {
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("challenge-file-edit"), {
|
||||
mode: {name: 'text/x-java',
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
|
@ -23,10 +23,7 @@
|
|||
matchBrackets: true
|
||||
});
|
||||
|
||||
editor.on('change',function(cMirror){
|
||||
// get value right from instance
|
||||
$('#challenge-answer').val(cMirror.getValue());
|
||||
});
|
||||
|
||||
var web_h = window.innerHeight;
|
||||
$(document).ready(function(){
|
||||
if($.browser.msie) {
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="code_content">
|
||||
<%= render :partial => 'repository' %>
|
||||
<%= render :partial => 'games/repository' %>
|
||||
</div>
|
||||
<%= render :partial => 'exec_results' %>
|
||||
<%= render :partial => 'games/exec_results' %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<div class="col-width fl ml15 mt15 content-half-fix02 undis" style="border: none" id="myshixun_extend_repository">
|
||||
<%= render :partial => 'myshixun_extend_repository' %>
|
||||
</div>
|
||||
<div class="content-editor col-width2 fl" id="myshixun_repository">
|
||||
<%= render :partial => 'myshixun_repository' %>
|
||||
</div>
|
||||
<div class="col-width fl ml15 mt15 content-half-fix02 undis" style="border: none" id="myshixun_extend_repository">
|
||||
<%= render :partial => 'myshixun_extend_repository' %>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<script>
|
||||
var web_h = window.innerHeight;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$("#file_entry_content").replaceWith('<%= escape_javascript(render :partial => 'games/file_edit_form') %>');
|
||||
$("#file_entry_content").html('<%= escape_javascript(render :partial => 'games/file_edit_form') %>');
|
||||
$("#file_entry_content_inner").html('<%= escape_javascript(render :partial => 'games/extend_file_edit_form') %>');
|
||||
$("#sava_edit_btn1").show();
|
||||
$("#sava_edit_btn").show();
|
||||
|
|
|
@ -656,9 +656,7 @@ function set_footer(){
|
|||
if ( ($(document.body).height()) < $(window).height()) {
|
||||
$footer.css({
|
||||
position: "absolute"
|
||||
}).stop().animate({
|
||||
top: footerTop
|
||||
});
|
||||
}).stop().css("top", footerTop);
|
||||
} else {
|
||||
$footer.css({
|
||||
position: "static"
|
||||
|
|
|
@ -145,4 +145,11 @@ a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px;
|
|||
.handler_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWx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YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==") no-repeat center;}
|
||||
.drag_slider .drag_bg{ background-color: #29bd8b; height: 45px; width: 0px;}
|
||||
.drag_slider .drag_text{ position: absolute; top: 0px; width: 350px; -moz-user-select: none; -webkit-user-select: none; user-select: none; -o-user-select:none; -ms-user-select:none;}
|
||||
.drag_slider .drag_text{ position: absolute; top: 0px; width: 350px; -moz-user-select: none; -webkit-user-select: none; user-select: none; -o-user-select:none; -ms-user-select:none;}
|
||||
|
||||
/*头像下拉弹框*/
|
||||
.my_account_info{ width:160px; background-color:#fff; border-radius: 3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:absolute; font-size: 14px; top:46px; left:-97px;display: none; z-index:999;}
|
||||
.my_account_info li a{ color: #888;}
|
||||
.my_account_info font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
|
||||
.my_account_info li{ padding-left: 5px; line-height: 1.5;}
|
||||
.li_bottom_border{ border-bottom:1px solid #eee;}
|
|
@ -151,10 +151,10 @@ a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px;
|
|||
a.menuGreyNew {color:#808080;}
|
||||
a.menuGreyNew:hover {color:#297fb8;}
|
||||
/*头像下拉弹框*/
|
||||
.my_account_info{ width:160px; background-color:#fff; border-radius: 3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:absolute; font-size: 14px; top:50px; left:-97px;display: none; z-index:999;}
|
||||
.my_account_info{ width:160px; background-color:#fff; border-radius: 3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:absolute; font-size: 14px; top:46px; left:-97px;display: none; z-index:999;}
|
||||
.my_account_info li a{ color: #888;}
|
||||
.my_account_info font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
|
||||
.my_account_info li{ padding-left: 5px;}
|
||||
.my_account_info li{ padding-left: 5px; line-height: 1.5;}
|
||||
.li_bottom_border{ border-bottom:1px solid #eee;}
|
||||
|
||||
.inner-user-info{ border-radius:3px; background:#fff; padding:15px;box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); width:305px; display:block; width:300px; display: none;}
|
||||
|
|
|
@ -549,10 +549,10 @@ input.new-search{border-radius:3px; width:300px; height:30px; margin-top: 10px;
|
|||
.inner-nav-user{ width: 40px; height: 40px; margin-top:5px; position: relative;}
|
||||
.inner-nav-user-img{ width: 40px; height: 40px; border-radius:50px;}
|
||||
.inner-nav-user font{border: 1px solid #dddddd; display: block; border-width: 6px; position: absolute; top:18px;left:45px; border-style:solid; border-color:#fff transparent transparent transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5);}
|
||||
.my_account_info{ width:160px; background-color:#fff; border-radius: 3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:absolute; font-size: 14px; top:50px; left:-97px;display: none; z-index:999;}
|
||||
.my_account_info{ width:160px; background-color:#fff; border-radius: 3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:absolute; font-size: 14px; top:46px; left:-97px;display: none; z-index:999;}
|
||||
.my_account_info li a{ color: #888;}
|
||||
.my_account_info font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
|
||||
.my_account_info li{ padding-left: 5px;}
|
||||
.my_account_info li{ padding-left: 5px; line-height: 1.5;}
|
||||
.li_bottom_border{ border-bottom:1px solid #eee;margin-top: 2px;margin-bottom: 2px;}
|
||||
.inner-footer-p-big{ display: block; height: 50px; line-height: 50px; color:#888; font-size: 16px; border-left:2px solid #888; padding-left:15px;}
|
||||
a.new-btn{display: inline-block;border:none; padding:0 10px;color: #666;background: #e1e1e1; text-align:center;font-size: 12px; height: 30px;border-radius: 3px; line-height: 30px;}
|
||||
|
|
Loading…
Reference in New Issue