Conflicts:
	app/controllers/projects_controller.rb
	app/views/users/user_messages.html.erb
解决冲突
guange_homework
huang 10 years ago
commit fb034090d7

@ -162,7 +162,7 @@ class MessagesController < ApplicationController
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
@topic.children << @reply
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
user_activity.updated_at = @reply.created_on
user_activity.updated_at = Time.now
user_activity.save
#@topic.update_attribute(:updated_on, Time.now)
if !@reply.new_record?

@ -78,11 +78,7 @@
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
<div class="fl">
<% if homework.homework_detail_programing.language.to_i == 1%>
C
<% elsif homework.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
<%= homework.language_name%>
</div>
</div>
<div class="cl"></div>

@ -1,4 +1,3 @@
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.tramples')%> * (-2) = <%= option_num.tread %> * (-2) = <%= option_num.tread * (-2) %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.like.level1')%> * 4 = <%= option_num.praise_by_one %> * 4 = <%= option_num.praise_by_one * 4 %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.like.level2')%> * 6 = <%= option_num.praise_by_two %> * 6 = <%= option_num.praise_by_two * 6 %></div>

@ -36,11 +36,7 @@
<% if activity.homework_type == 2%>
<div class="homepagePostDeadline mr15">
语言:
<% if activity.homework_detail_programing.language.to_i == 1%>
C
<% elsif activity.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
<%= activity.language_name%>
</div>
<% end %>

@ -34,11 +34,7 @@
<% if homework_common.homework_type == 2%>
<div class="homepagePostDeadline mr15">
语言:
<% if homework_common.homework_detail_programing.language.to_i == 1%>
C
<% elsif homework_common.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
<%= homework_common.language_name%>
</div>
<% end %>
<div class="homepagePostDeadline">

@ -1,6 +1,8 @@
<% content_for :header_tags do %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<% end %>
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
@ -75,6 +77,7 @@
<input type="hidden" name="is_test" value="<%=@is_test%>">
<div class="mt15">
<span>请使用 <%= @homework.language_name %> 语言编写</span>
<span data-language=<%=@homework.language%> style="display-hidden" id="data-language"></span>
</div>
<div class="mt10">
<%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能" %>

@ -43,9 +43,11 @@
<span style="color:#0781b4; max-width:470px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;vertical-align: top;"><%= system_message.subject.nil? ? "系统消息" : system_message.subject %></span>
</div>
<div class="cl"></div>
<p class="homepagePostIntro break_word upload_img">
<%= system_message.content.nil? ? system_message.description.html_safe : system_message.content.html_safe %>
</p>
<div class="homepagePostIntro break_word upload_img">
<p>
<%= system_message.content.nil? ? system_message.description.html_safe : system_message.content.html_safe %>
</p>
</div>
<div class="cl"></div>
<p class="homepagePostDeadline">截止时间:<%= format_time(system_message.created_at) %></p>
</div>

@ -103,7 +103,7 @@ default:
# autologin_cookie_name: the name of the cookie (default: autologin)
# autologin_cookie_path: the cookie path (default: /)
# autologin_cookie_secure: true sets the cookie secure flag (default: false)
autologin_cookie_name:
autologin_cookie_name: "autologin_trustie"
autologin_cookie_path:
autologin_cookie_secure:
@ -197,11 +197,17 @@ default:
#max_concurrent_ajax_uploads: 2
#pic_types: "bmp,jpeg,jpg,png,gif"
repository_root_path: '/tmp/htdocs'
judge_server: 'http://judge.trustie.net/'
# specific configuration options for production environment
# that overrides the default ones
production:
# CJK support
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
judge_server: 'http://192.168.80.21:8080/'
repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs'
cookie_domain: ".trustie.net"
email_delivery:
delivery_method: :smtp
smtp_settings:

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150918005722) do
ActiveRecord::Schema.define(:version => 20150918134804) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -572,6 +572,7 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
t.integer "viewed"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "secret_key"
end
create_table "forums", :force => true do |t|
@ -683,6 +684,7 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "mail"
end
create_table "issue_categories", :force => true do |t|
@ -1304,9 +1306,9 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
create_table "student_work_tests", :force => true do |t|
t.integer "student_work_id"
t.integer "status"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "status", :default => 9
t.text "results"
t.text "src"
end
@ -1359,8 +1361,10 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
create_table "system_messages", :force => true do |t|
t.integer "user_id"
t.string "content"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "description"
t.string "subject"
end
create_table "taggings", :force => true do |t|
@ -1552,7 +1556,6 @@ ActiveRecord::Schema.define(:version => 20150918005722) do
t.string "identity_url"
t.string "mail_notification", :default => "", :null => false
t.string "salt", :limit => 64
t.integer "gid"
end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -95,9 +95,9 @@ $(function(){
//发布作业
//$('#program-src').focus(function(){
// $(this).css('height', '100px');
//});
$('#program-src').focus(function(){
$(this).css('height', '100px');
});
var datepickerOptions={dateFormat:'yy-mm-dd',firstDay:0,showWeek:true,showOtherMonths:true,selectOtherMonths:true};
@ -115,7 +115,7 @@ $(function(){
minWidth: 753
});
$('a.ProBtn').live('click', function(){
$('a.ProBtn').on('click', function(){
$("#BluePopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
@ -124,6 +124,7 @@ $(function(){
$('#textarea_input_test').focus();
});
var saveProgramAnswers = function() {
var test_numbers = 0;
var valid = true;
@ -145,7 +146,14 @@ $(function(){
test_numbers += 1;
});
var language = $('select.language_type').val() == 1 ? 'C语言' : 'C++语言';
var language = '';
if($('select.language_type').val() == 1){
language = 'C';
}else if($('select.language_type').val() == 2){
language = 'C++';
}else if($('select.language_type').val() == 3){
language = 'Python';
}
if (valid) {
$("input[name=homework_type]").val(2);
@ -163,7 +171,7 @@ $(function(){
return valid;
}
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
$("#BluePopupBox a.BlueCirBtn").on('click', function(){
if(saveProgramAnswers()){
if($( "#BluePopupBox" ).dialog( "isOpen" )){
$("#BluePopupBox").dialog( "close" );
@ -174,16 +182,40 @@ $(function(){
$("#BluePopupBox").on('click', 'a.icon_add', function(){
var html = bt('t:test-answer-list', null);
$(this).parent('.mt10').after(html);
var inputs = document.getElementsByName("program[input][]");
var outputs = document.getElementsByName("program[output][]");
if (inputs.length == outputs.length) {
for (var i=0; i<inputs.length; i++) {
autoTextarea2(inputs[i], outputs[i]);
autoTextarea2(outputs[i], inputs[i]);
}
}
});
$("#BluePopupBox").on('click', 'a.icon_remove', function(){
$(this).parent('.mt10').remove();
});
});
//代码编辑器
if (typeof CodeMirror != "undefined") {
var program_name = "text/x-csrc";
var language = $('#data-language').attr('data-language');
if (language == 1) {
program_name = 'text/x-csrc';
} else if(language==2){
program_name = 'text/x-c++src';
}else if(language==3){
program_name = 'text/x-cython';
}
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
mode: {name: program_name,
version: 2,
singleLineStringErrors: false},
lineNumbers: true,
indentUnit: 2,
matchBrackets: true
});
editor.on('change',function(cMirror){
// get value right from instance
$('#program-src').val(cMirror.getValue());
});
}
});

@ -151,4 +151,6 @@ function init_activity_KindEditor_data(id){
}
});
});
$(".ke-edit").css("height","25px");
}
Loading…
Cancel
Save