Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq

This commit is contained in:
huang 2015-06-06 11:40:03 +08:00
commit 5a9e3c685b
2 changed files with 17 additions and 9 deletions

View File

@ -199,8 +199,8 @@ class Mailer < ActionMailer::Base
@title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
@issue_author_url = url_for(user_activities_url(@user))
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
when :Bid
course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
# when :Bid
# course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
@ -236,12 +236,12 @@ class Mailer < ActionMailer::Base
mail :to => @recipients,
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} ",
:filter => true
elsif journals_for_message.jour.class.to_s.to_sym == :Bid
if !journals_for_message.jour.author.notify_about? journals_for_message
return -1
end
mail :to => recipients, :subject => @title,:filter => true
# elsif journals_for_message.jour.class.to_s.to_sym == :Bid
# if !journals_for_message.jour.author.notify_about? journals_for_message
# return -1
# end
#
# mail :to => recipients, :subject => @title,:filter => true
elsif journals_for_message.jour.class.to_s.to_sym == :Contest
if !journals_for_message.jour.author.notify_about? journals_for_message
return -1

View File

@ -470,7 +470,15 @@ $(function(){
//老师提交 新建/修改 作业
function submit_homework(id)
{
if(regex_homework_name()&&regex_evaluation_num())
if(!regex_homework_name())
{
$("#homework_name").focus();
}
else if(!regex_evaluation_num())
{
$("#evaluation_num").focus();
}
else
{
homework_description_editor.sync();
$("#"+id).submit();