Conflicts:
	app/views/student_work/_programing_work_show.html.erb
	db/schema.rb
This commit is contained in:
cxt 2016-01-29 15:44:26 +08:00
commit b5cf138f43
8 changed files with 62 additions and 18 deletions

View File

@ -34,6 +34,12 @@ class AtController < ApplicationController
find_homework(id)
when 'Topic'
find_topic(id)
when 'JournalsForMessage'
find_journals_for_message(id)
when 'Principal'
find_principal(id)
when 'All'
nil
else
nil
end
@ -120,7 +126,11 @@ class AtController < ApplicationController
#JournalsForMessage
def find_journals_for_message(id)
jounrnal = JournalsForMessage.find(id)
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
if jounrnal.jour_type == 'Principal'
[jounrnal.user] + (JournalsForMessage.where(m_reply_id: id).map(&:user) || [])
else
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
end
end
#Poll
@ -129,8 +139,6 @@ class AtController < ApplicationController
#Journal
def find_journal(id)
journal = Journal.find(id)
find_at_users(journal.journalized_type, journal.journalized_id)
end
#Document
@ -145,7 +153,6 @@ class AtController < ApplicationController
#Principal
def find_principal(id)
end
#BlogComment

View File

@ -47,7 +47,11 @@ class AtMessage < ActiveRecord::Base
"回复帖子: "
end + at_message.subject
when 'JournalsForMessage'
"作业: #{at_message.jour.name} 中留言"
if at_message.jour_type == 'Principal'
"留言: 在#{at_message.at_user.show_name}主页中留言"
else
"作业: #{at_message.jour.name} 中留言"
end
else
logger.error "error type: #{at_message_type}"
end
@ -92,7 +96,12 @@ class AtMessage < ActiveRecord::Base
when 'Message'
{controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board}
when 'JournalsForMessage'
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
if at_message.jour_type == 'Principal'
{controller: :users, action: :user_messages, id: at_message.at_user}
else
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
end
else
logger.error "error type: #{at_message_type}"
end

View File

@ -59,9 +59,9 @@
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="width150"><%=x["result"]%></span>
<span class="width150"><pre><%=x["result"]%></pre></span>
<span class="w60">正确输出:</span>
<span class="width150"><%=x["output"]%></span>
<span class="width150"><pre><%=x["output"]%></pre></span>
<div class="cl"></div>
<% else %>
<span class="w150 c_green">测试正确!</span>

View File

@ -12,7 +12,8 @@
:minHeight=>100,
:input_html => { :id => 'jour_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
:maxlength => 5000 }
%>
<div class="cl"></div>
<p id="jour_content_span"></p>
</li>

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<%#= javascript_include_tag "init_KindEditor","user" %>
<% end %>
<style type="text/css">

View File

@ -22,9 +22,9 @@
<! if(results[i]["status"]!=0){ !>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><!=results[i]["result"]!></span>
<span class="W200"><pre><!=results[i]["result"]!></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><!=results[i]["output"]!></span>
<span class="W200"><pre><!=results[i]["output"]!></pre></span>
<div class="cl"></div>
</li>
<!}else{!>
@ -121,9 +121,9 @@
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><%=x["result"]%></span>
<span class="W200"><pre><%=x["result"]%></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><%=x["output"]%></span>
<span class="W200"><pre><%= x["output"] %></pre></span>
<div class="cl"></div>
</li>
<% else %>

View File

@ -17,9 +17,9 @@
<! if(results[i]["status"]!=0){ !>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><!=results[i]["result"]!></span>
<span class="W200"><pre><!=results[i]["result"]!></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><!=results[i]["output"]!></span>
<span class="W200"><pre><!=results[i]["output"]!></pre></span>
<div class="cl"></div>
</li>
<!}else{!>
@ -95,9 +95,9 @@
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><%=x["result"]%></span>
<span class="W200"><pre><%=x["result"]%></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><%=x["output"]%></span>
<span class="W200"><pre><%=x["output"]%></pre></span>
<div class="cl"></div>
</li>
<% else %>

View File

@ -1862,6 +1862,25 @@ ActiveRecord::Schema.define(:version => 20160128024452) do
add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade"
add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
create_table "user_wechats", :force => true do |t|
t.integer "subscribe"
t.string "openid"
t.string "nickname"
t.integer "sex"
t.string "language"
t.string "city"
t.string "province"
t.string "country"
t.string "headimgurl"
t.string "subscribe_time"
t.string "unionid"
t.string "remark"
t.integer "groupid"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "users", :force => true do |t|
t.string "login", :default => "", :null => false
t.string "hashed_password", :limit => 40, :default => "", :null => false
@ -1937,6 +1956,14 @@ ActiveRecord::Schema.define(:version => 20160128024452) do
t.datetime "updated_at", :null => false
end
create_table "wechat_logs", :force => true do |t|
t.string "openid", :null => false
t.text "request_raw"
t.text "response_raw"
t.text "session_raw"
t.datetime "created_at", :null => false
end
create_table "wiki_content_versions", :force => true do |t|
t.integer "wiki_content_id", :null => false
t.integer "page_id", :null => false