Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
lizanle 2015-10-08 10:00:23 +08:00
commit 88ddaaaaf5
13 changed files with 55 additions and 39 deletions

View File

@ -271,6 +271,7 @@ class StudentWorkController < ApplicationController
end end
@is_new = false @is_new = false
else else
@is_last_a = @work.student_works_scores.empty?
@score = StudentWorksScore.new @score = StudentWorksScore.new
@score.score = params[:score] if params[:score] @score.score = params[:score] if params[:score]
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" @score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""

View File

@ -79,7 +79,7 @@ class Memo < ActiveRecord::Base
receivers << self.forum.creator receivers << self.forum.creator
end end
# 添加发帖人 # 添加发帖人
if self.author_id != self.parent.author_id if self.author_id != self.parent.author_id && self.parent.author_id != self.forum.creator_id
receivers << self.parent.author receivers << self.parent.author
end end
end end

View File

@ -94,11 +94,13 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="navHomepageNews"> <div class="navHomepageNews">
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon" %> <%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon" %>
<% if User.current.count_new_message >0 %> <% if User.current.count_new_message >0 %>
<div ><%= link_to "" , user_message_path(User.current), :class => "newsActive" %></div> <div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive" %></div>
<% end %> <% end %>
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
</div> </div>
</div> </div>

View File

@ -26,9 +26,11 @@
</ul> </ul>
</li> </li>
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;"> <li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp; <% if student_work.created_at && @homework.end_time%>
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<span class="c_red">[迟交]</span> <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span>
<% end %>
<% end %> <% end %>
</li> </li>
<li class="hworkList50 <%= score_color student_work.teacher_score%>"> <li class="hworkList50 <%= score_color student_work.teacher_score%>">

View File

@ -2,8 +2,7 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
$('#score_<%= @work.id%>').peSlider({range: 'min'}); $('#score_<%= @work.id%>').peSlider({range: 'min'});
<% if @is_new%> <% if @is_new%>
$("#score_list_<%= @work.id%>").find("div:last").find("ul").addClass("ping_line"); $("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last_a}) %></div>");
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => true}) %></div>");
<% else %> <% else %>
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>"); $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>");
<% end%> <% end%>

View File

@ -14,10 +14,10 @@
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %> <%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word list_style upload_img"> <div class="homepagePostTitle break_word list_style upload_img">
<% if activity.m_parent_id.nil? %> <% if activity.parent %>
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% else %> <% else %>
<%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostDate"> <div class="homepagePostDate">

View File

@ -105,7 +105,10 @@
<% @student_work.student_work_tests.each_with_index do |test, index| %> <% @student_work.student_work_tests.each_with_index do |test, index| %>
<div class="ProResultTop"> <div class="ProResultTop">
<p class="c_blue fl">第<%= @student_work.student_work_tests.count - index%>次测试</p><span class="fr c_grey"><%= test.created_at.to_s(:db) %></span> <p class="c_blue fl">
第<%= @student_work.student_work_tests.count - index%>次测试
</p>
<span class="fr c_grey"><%= format_time(test.created_at).to_s%></span>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% if test.status.to_i == -2 %> <% if test.status.to_i == -2 %>

View File

@ -1,10 +1,10 @@
class AlterUserActivitiesNews < ActiveRecord::Migration class AlterUserActivitiesNews < ActiveRecord::Migration
def up def up
UserActivity.all.each do |activity| UserActivity.all.each do |activity|
if activity.act_type = 'News' if activity.act_type == 'News'
if activity.act if activity.act
activity.created_at = activity.act.created_on activity.created_at = activity.act.created_on
activity.updated_at = activity.act.updated_on ? activity.act.updated_on : activity.act.created_on activity.updated_at = activity.act.respond_to?("updated_on") ? activity.act.updated_on : activity.act.created_on
activity.save activity.save
else else
activity.destroy activity.destroy

View File

@ -476,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "documents", :force => true do |t| create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false
@ -490,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id" add_index "documents", ["project_id"], :name => "documents_project_id"
create_table "dts", :force => true do |t| create_table "dts", :primary_key => "Num", :force => true do |t|
t.string "IPLineCode" t.string "Defect", :limit => 50
t.string "Description" t.string "Category", :limit => 50
t.string "Num"
t.string "Variable"
t.string "TraceInfo"
t.string "Method"
t.string "File" t.string "File"
t.string "IPLine" t.string "Method"
t.string "Review" t.string "Module", :limit => 20
t.string "Category" t.string "Variable", :limit => 50
t.string "Defect" t.integer "StartLine"
t.string "PreConditions" t.integer "IPLine"
t.string "StartLine" t.string "IPLineCode", :limit => 200
t.string "Judge", :limit => 15
t.integer "Review", :limit => 1
t.string "Description"
t.text "PreConditions", :limit => 2147483647
t.text "TraceInfo", :limit => 2147483647
t.text "Code", :limit => 2147483647
t.integer "project_id" t.integer "project_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "id", :null => false
end end
create_table "enabled_modules", :force => true do |t| create_table "enabled_modules", :force => true do |t|
@ -911,7 +921,6 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
t.datetime "created_on" t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false t.integer "comments_count", :default => 0, :null => false
t.integer "course_id" t.integer "course_id"
t.datetime "updated_on"
end end
add_index "news", ["author_id"], :name => "index_news_on_author_id" add_index "news", ["author_id"], :name => "index_news_on_author_id"

View File

@ -873,7 +873,7 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f
.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
.evaluation{position: relative;} .evaluation{position: relative;}
.evaluation_submit{position: absolute;right: 0px;bottom: 5px;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;}
.student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; } .student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; }
/* 与我相关 */ /* 与我相关 */

View File

@ -14,7 +14,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
#navSearchAlert {display:none;} #navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} .navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;}
.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} .newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 2px;padding-right: 1px;font-weight: bold;}
.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} .navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;}
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;} .homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;}
.homepageProfileMenuIconhover {background:url(../images/nav_icon.png) 30px -122px no-repeat;} .homepageProfileMenuIconhover {background:url(../images/nav_icon.png) 30px -122px no-repeat;}

View File

@ -528,7 +528,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
#navSearchAlert {display:none;} #navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} .navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;}
.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} .newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 2px;padding-right: 1px;font-weight: bold;}
.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} .navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;}
.portraitRadius {border-radius: 3px;} .portraitRadius {border-radius: 3px;}
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;} .homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;}
@ -741,9 +741,9 @@ ul.list_watch{
.referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;}
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
.searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;}
.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;} .referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;}
.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;} .referenceSearchIcon:hover {background:url(../images/homepage_icon2.png) -180px -311px no-repeat;}
.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} .referenceResourceType {font-size:14px; width:460px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;}
.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;}
a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}

View File

@ -451,7 +451,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
#navSearchAlert {display:none;} #navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} .navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;}
.newsActive {width:8px; height:8px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} .newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 2px;padding-right: 1px;font-weight: bold;}
.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} .navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;}
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block;} .homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block;}
.homepageProfileMenuIcon:hover {background:url(../images/nav_icon.png) 30px -122px no-repeat;} .homepageProfileMenuIcon:hover {background:url(../images/nav_icon.png) 30px -122px no-repeat;}
@ -627,9 +627,9 @@ a.loginChooseTab {color:#484848; height:30px; display:block;}
.referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;}
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
.searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;}
.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;} .referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;}
.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;} .referenceSearchIcon:hover {background:url(../images/homepage_icon2.png) -180px -311px no-repeat;}
.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} .referenceResourceType {font-size:14px; width:460px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;}
.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;}
a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}