diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index 6b421bf2a..1efbc9c48 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -49,8 +49,11 @@ class CommentsController < ApplicationController
# end
# # ������ض�̬�ļ�¼add end
flash[:notice] = l(:label_comment_added)
+ course_activity = CourseActivity.where("course_act_type='News' and course_act_id =#{@news.id}").first
+ course_activity.updated_at = Time.now
+ course_activity.save
user_activity = UserActivity.where("act_type='News' and act_id =#{@news.id}").first
- user_activity.updated_at = @comment.created_on
+ user_activity.updated_at = Time.now
user_activity.save
end
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index b30715a1f..e12d4886a 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -8,7 +8,7 @@ class CoursesController < ApplicationController
helper :attachments
helper :activity_notifys
- before_filter :auth_login1, :only => [:show, :feedback]
+ before_filter :auth_login1, :only => [:show, :course_activity, :feedback]
menu_item :overview
menu_item :feedback, :only => :feedback
menu_item :homework, :only => :homework
@@ -610,11 +610,37 @@ class CoursesController < ApplicationController
end
end
+ def course_activity
+ redirect_to course_url(@course, type: params[:type], page: params[:page])
+ end
+
def show
- course_activities = @course.course_activities.order("created_at desc")
+ course_activities = @course.course_activities
@canShowRealName = User.current.member_of_course? @course
- @course_activities = paginateHelper course_activities,10
+ @page = params[:page] ? params[:page].to_i + 1 : 0
+ if params[:type].present?
+ case params[:type]
+ when "homework"
+ @course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
+ when "news"
+ @course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
+ when "message"
+ @course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
+ when "poll"
+ @course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
+ when "attachment"
+ @course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc').limit(10).offset(@page * 10)
+ when "journalsForMessage"
+ @course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
+ else
+ @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
+ end
+ else
+ @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
+ end
+ @type = params[:type]
respond_to do |format|
+ format.js
format.html{render :layout => 'base_courses'}
format.api
end
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 00d814bd3..9e3a4b836 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -11,11 +11,16 @@ class HomeworkCommonController < ApplicationController
before_filter :member_of_course, :only => [:index]
def index
- homeworks = @course.homework_commons.order("created_at desc")
+ @new_homework = HomeworkCommon.new
+ @new_homework.homework_detail_manual = HomeworkDetailManual.new
+ @new_homework.course = @course
+ @page = params[:page] ? params[:page].to_i + 1 : 0
+ @homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10)
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
- @homeworks = paginateHelper homeworks,20
+ @is_new = params[:is_new]
respond_to do |format|
+ format.js
format.html
end
end
@@ -32,7 +37,7 @@ class HomeworkCommonController < ApplicationController
def edit
@user = User.current
- @is_in_course = params[:is_in_course]
+ @is_in_course = params[:is_in_course].to_i
respond_to do |format|
format.html{render :layout => 'new_base_user'}
end
@@ -148,9 +153,9 @@ class HomeworkCommonController < ApplicationController
# 开启/关闭匿评消息通知
def send_message_anonymous_comment(homework, m_status )
# status 标记匿评状态 1为关闭 0为开启
- course = @homework.course
- course.student.each do |st|
- @homework.course_messages << CourseMessage.new(:user_id => st.student_id, :course_id => course.id, :viewed => false, :status => m_status)
+ course = homework.course
+ course.members.each do |m|
+ @homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => m_status)
end
end
#提示
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index 2c7df84cf..c6ac8b906 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -162,6 +162,9 @@ class MessagesController < ApplicationController
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
# @reply.reply_id = params[:id]
@topic.children << @reply
+ course_activity = CourseActivity.where("course_act_type='Message' and course_act_id =#{@topic.id}").first
+ course_activity.updated_at = Time.now
+ course_activity.save
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
user_activity.updated_at = Time.now
user_activity.save
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 2d7bf02b1..d39d8fe3b 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -173,6 +173,12 @@ class StudentWorkController < ApplicationController
end
if student_work.save
+ course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first
+ course_activity.updated_at = Time.now
+ course_activity.save
+ user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework.id}").first
+ user_activity.updated_at = Time.now
+ user_activity.save
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 9a6f72e2e..4f3df3bd4 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -346,6 +346,7 @@ class UsersController < ApplicationController
user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
@homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc").limit(10).offset(@page * 10)
@is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)
+ @is_in_course = params[:is_in_course].to_i || 0
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}
@@ -508,7 +509,13 @@ class UsersController < ApplicationController
if homework.save
homework_detail_manual.save if homework_detail_manual
homework_detail_programing.save if homework_detail_programing
- redirect_to user_homeworks_user_path(User.current.id)
+
+ if params[:is_in_course] == "1"
+ redirect_to homework_common_index_path(:course => homework.course_id)
+ else
+ redirect_to user_homeworks_user_path(User.current.id)
+ end
+
end
end
else
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 77304c1b1..a0ce8d18e 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -53,7 +53,15 @@ class WordsController < ApplicationController
:notes => content,
:is_readed => false}
@jfm = add_reply_adapter options
-
+ @save_succ = true if @jfm.errors.empty?
+ if @save_succ
+ course_activity = CourseActivity.where("course_act_type='JournalsForMessage' and course_act_id =#{parent_id}").first
+ course_activity.updated_at = Time.now
+ course_activity.save
+ user_activity = UserActivity.where("act_type='JournalsForMessage' and act_id =#{parent_id}").first
+ user_activity.updated_at = Time.now
+ user_activity.save
+ end
respond_to do |format|
# format.html {
# if @jfm.errors.empty?
@@ -63,10 +71,12 @@ class WordsController < ApplicationController
# end
# render 'test/index'
# }
- format.js{
- @save_succ = true if @jfm.errors.empty?
+ format.js {
+ @user_activity_id = params[:user_activity_id] if
+ @activity = JournalsForMessage.find(parent_id)
}
end
+
end
def destroy
diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb
index 1a0b9ca0d..3591a0168 100644
--- a/app/helpers/journals_helper.rb
+++ b/app/helpers/journals_helper.rb
@@ -119,7 +119,7 @@ module JournalsHelper
content << textAreailizable(journal, :notes)
css_classes = "wiki"
css_classes << " editable" if editable
- content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes ,:style => "width:510px")
+ content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes)
end
def link_to_in_place_notes_editor(text, field_id, url, options={})
diff --git a/app/models/course_message.rb b/app/models/course_message.rb
index eae880380..65e91141c 100644
--- a/app/models/course_message.rb
+++ b/app/models/course_message.rb
@@ -1,4 +1,7 @@
class CourseMessage < ActiveRecord::Base
+ # status说明: status在课程不同的类型,区分不同的功能
+ # HomeworkCommon:status:
+ # nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status
# 多态 虚拟关联
diff --git a/app/models/forge_message.rb b/app/models/forge_message.rb
index 0dce57598..8bf754719 100644
--- a/app/models/forge_message.rb
+++ b/app/models/forge_message.rb
@@ -1,14 +1,7 @@
class ForgeMessage < ActiveRecord::Base
- # 公共表中活动类型,命名规则:TYPE_OF_{类名}_ACT
- TYPE_OF_ISSUE_ACT = "Issue"
- TYPE_OF_MESSAGE_ACT = "Message"
- TYPE_OF_ATTACHMENT_ACT = "Attachment"
- TYPE_OF_DOCUMENT_ACT = "Document"
- TYPE_OF_JOURNAL_ACT = "Journal"
- TYPE_OF_WIKI_ACT = "Wiki"
- TYPE_OF_NEWS_ACT = "News"
-
- attr_accessible :forge_message_id, :forge_message_type, :project_id, :user_id, :viewed, :secret_key
+ # status在不同的类中,作用不同
+ # Isseu: satus nil:发布了缺陷;:1:缺陷计划完成日志到了提醒
+ attr_accessible :forge_message_id, :forge_message_type, :project_id, :user_id, :viewed, :secret_key, :status
belongs_to :forge_message ,:polymorphic => true
belongs_to :project
diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb
index 81ada2f80..dde34abfd 100644
--- a/app/models/journals_for_message.rb
+++ b/app/models/journals_for_message.rb
@@ -185,7 +185,7 @@ class JournalsForMessage < ActiveRecord::Base
#课程动态公共表记录
def act_as_course_activity
- if self.jour_type == 'Course'
+ if self.jour_type == 'Course' && self.m_parent_id.nil?
self.course_acts << CourseActivity.new(:user_id => self.user_id,:course_id => self.jour_id)
end
end
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index b820e6d54..52b7242dd 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -51,9 +51,9 @@ class Mailer < ActionMailer::Base
def send_mail_anonymous_comment_open(homework_common)
course = homework_common.course
recipients ||= []
- course.student.each do |student|
- user = User.find(student.student_id)
- @subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
+ course.members.each do |member|
+ user = User.find(member.user_id)
+ # @subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
@token = Token.get_token_from_user(user, 'autologin')
@anonymous_comment_close_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
@anonymous_comment_close_name = homework_common.name
@@ -62,16 +62,16 @@ class Mailer < ActionMailer::Base
recipients << user.mail
end
mail :to => recipients,
- :subject => @subject
+ :subject => "[#{l(:mail_homework)}#{homework_common.name}] #{l(:mail_anonymous_comment_open)}"
end
# 作业匿评关闭
def send_mail_anonymous_comment_close(homework_common)
course = homework_common.course
recipients ||= []
- course.student.each do |student|
- user = User.find(student.student_id)
- @subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
+ course.members.each do |member|
+ user = User.find(member.user_id)
+ #@subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}"
@token = Token.get_token_from_user(user, 'autologin')
@anonymous_comment_close_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
@anonymous_comment_close_name = homework_common.name
@@ -80,7 +80,28 @@ class Mailer < ActionMailer::Base
recipients << user.mail
end
mail :to => recipients,
- :subject => @subject
+ :subject => "[#{l(:mail_homework)}#{homework_common.name}] #{l(:mail_anonymous_comment_open)}"
+ end
+
+ # 匿评失败给老师发送邮件通知
+ def send_mail_anonymous_comment_fail(homework_common)
+ course = homework_common.course
+ recipients ||= []
+ # 只给该课程的老师发送邮件提醒
+ course.members.each do |member|
+ if m.user.allowed_to?(:as_teacher,course)
+ user = User.find(member.user_id)
+ #@subject = "[#{l(:mail_homework)} #{homework_common.name}] #{l(:mail_anonymous_comment_failed)}"
+ @token = Token.get_token_from_user(user, 'autologin')
+ @anonymous_comment_fail_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value))
+ @anonymous_comment_fail_name = homework_common.name
+ @author = homework_common.user
+ #收件人邮箱
+ recipients << user.mail
+ end
+ end
+ mail :to => recipients,
+ :subject => "[#{l(:mail_homework)} #{homework_common.name}] #{l(:mail_anonymous_comment_failed)}"
end
# author: alan
@@ -247,6 +268,7 @@ class Mailer < ActionMailer::Base
has_content = [@issues,@issues_journals,@course_messages,@project_messages,@course_news,@course_news_comments,@project_news,@project_news_comments,@project_attachments,
@course_journal_messages,@user_journal_messages,@project_journal_messages,@forums,@memos,@attachments,@bids,@wiki_contents].any? {|o| !o.empty?}
+
mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}"
#有内容才发,没有不发
mail :to => user.mail,:subject => subject if has_content
@@ -263,7 +285,7 @@ class Mailer < ActionMailer::Base
#收件人邮箱
recipient = user.mail
mail :to => recipient,
- :subject => "#{l(:mail_homework)}#{homework_common.name}#{l(:mail_homework_endtime)} "
+ :subject => @subject
end
# 公共讨论区发帖、回帖添加邮件发送信息
diff --git a/app/models/message.rb b/app/models/message.rb
index 2c46857f8..7af59815b 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -194,7 +194,7 @@ class Message < ActiveRecord::Base
#课程动态公共表记录
def act_as_course_activity
- if self.course
+ if self.course && self.parent_id.nil?
self.course_acts << CourseActivity.new(:user_id => self.author_id,:course_id => self.board.course_id)
end
end
diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb
new file mode 100644
index 000000000..1a033b372
--- /dev/null
+++ b/app/views/courses/_course_activity.html.erb
@@ -0,0 +1,108 @@
+<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
+
+<% course_activities.each do |activity| if course_activities %>
+
+ <% if activity %>
+ <% act = activity.course_act %>
+ <% case activity.course_act_type.to_s %>
+ <% when 'HomeworkCommon' %>
+ <%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id} %>
+ <% when 'News' %>
+ <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %>
+ <% when 'Message' %>
+ <%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id} %>
+ <% when 'Poll' %>
+ <%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %>
+ <% when 'JournalsForMessage' %>
+ <%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id} %>
+ <% when 'Attachment' %>
+ <%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %>
+ <% when 'Course' %>
+ <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id} %>
+ <% end %>
+ <% end %>
+ <% end %>
+<% end %>
+
+<% if course_activities.count == 10 %>
+
展开更多<%= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %>
+<% end %>
+
+
\ No newline at end of file
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index eceb29f34..bb8bb546a 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -1,83 +1,31 @@
-
-
<%= l(:label_activity)%>
-
-
-<%@course_activities.each do |activity|%>
-
-
- <%= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %>
-
-
- <%= link_to_user_header(activity.user,false,:class => 'problem_name c_orange fl') %>
-
-
<%= activity.course_act_type == "Course" ? "创建了课程" : l(:label_new_activity) %>:
- <%#= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), link,
- :class => "problem_tit c_dblue fl fb",'data-type'=>e.event_type,
- 'data-notify-id'=>(e.respond_to?('get_notify_id') ? e.get_notify_id : ''),:nhname=>"nh_act_link",
- 'data-href'=>(course_activity_notifys_path(@course)+"/chang_read_flag?an_id="+(e.respond_to?('get_notify_id') ? e.get_notify_id : '').to_s)%>
- <%#if @controller_name=='ActivityNotifys' && e.get_notify_is_read!=1%>
-
- <%#end%>
- <%= link_to course_activity_link activity%>
-
-
- <%= course_activity_desc activity%>
-
-
- <%= activity.course_act_type == "Course" ? l(:label_create_time) : l(:label_activity_time) %> : <%= format_time(activity.created_at) %>
-
- <%= link_to_attachments_course(activity.course_act) if activity.course_act_type.to_s == "News" %>
-
-
-
-<% end%>
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
-
-
+
+
+
\ No newline at end of file
diff --git a/app/views/courses/show.js.erb b/app/views/courses/show.js.erb
new file mode 100644
index 000000000..3f82dcf3a
--- /dev/null
+++ b/app/views/courses/show.js.erb
@@ -0,0 +1 @@
+$("#show_more_course_activities").replaceWith("<%= escape_javascript( render :partial => 'courses/course_activity',:locals => {:course_activities => @course_activities, :page => @page,:type => @type} )%>");
diff --git a/app/views/courses/show_old.html.erb b/app/views/courses/show_old.html.erb
new file mode 100644
index 000000000..608d41f9d
--- /dev/null
+++ b/app/views/courses/show_old.html.erb
@@ -0,0 +1,83 @@
+
+
<%= l(:label_activity)%>
+
+
+<%@course_activities.each do |activity|%>
+
+
+ <%= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %>
+
+
+ <%= link_to_user_header(activity.user,false,:class => 'problem_name c_orange fl') %>
+
+
<%= activity.course_act_type == "Course" ? "创建了课程" : l(:label_new_activity) %>:
+ <%#= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), link,
+ :class => "problem_tit c_dblue fl fb",'data-type'=>e.event_type,
+ 'data-notify-id'=>(e.respond_to?('get_notify_id') ? e.get_notify_id : ''),:nhname=>"nh_act_link",
+ 'data-href'=>(course_activity_notifys_path(@course)+"/chang_read_flag?an_id="+(e.respond_to?('get_notify_id') ? e.get_notify_id : '').to_s)%>
+ <%#if @controller_name=='ActivityNotifys' && e.get_notify_is_read!=1%>
+
+ <%#end%>
+ <%= link_to course_activity_link activity%>
+
+
+ <%= course_activity_desc activity%>
+
+
+ <%= activity.course_act_type == "Course" ? l(:label_create_time) : l(:label_activity_time) %> : <%= format_time(activity.created_at) %>
+
+ <%= link_to_attachments_course(activity.course_act) if activity.course_act_type.to_s == "News" %>
+
+
+
+<% end%>
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
+
+
+
diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb
index 286219356..7934a80fe 100644
--- a/app/views/forums/_forum_list.html.erb
+++ b/app/views/forums/_forum_list.html.erb
@@ -2,15 +2,15 @@
<% if forums.any? %>
<% forums.each do |forum| %>
-
+
<%= link_to image_tag(url_to_avatar(forum.creator),:width=>75,:height => 75 ),user_path( forum.creator) %>
-
- <%= link_to forum.name, forum_path(forum),:class=>"f16 linkBlue" %>
+
<%=forum.name.gsub(/(\r\n)/,' ').html_safe %>
+ <%#= link_to forum.name.gsub(/(\r\n|\s+)/,'
'), forum_path(forum),:class=>"f16 linkBlue" %>
-
<%= textAreailizable forum.description%>
+
<%= textAreailizable forum.description%>
创建时间:<%= format_date(forum.created_at) %>
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 48ac057a0..714d364a4 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag 'new_user' %>
+<%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor' %>
@@ -99,11 +103,7 @@
-
-
+ <%= kindeditor_tag 'memo[content]','',:height=>300,:editor_id=>'memo_content'%>
diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb
index 8799bcab9..0c3dd6d8e 100644
--- a/app/views/homework_common/index.html.erb
+++ b/app/views/homework_common/index.html.erb
@@ -1,129 +1,55 @@
-
-
- <%= l(:label_homework)%>
-
-
-
-
- <%= l(:label_totle)%>
- <%= @obj_count%>
- <%= l(:label_homework_count)%>
-
- <%#= link_to( l(:label_course_homework_new), new_homework_common_path(:course => @course.id), :class => 'problem_new_btn fl c_dorange') if @is_teacher %>
-
-
-<% @homeworks.each do |homework|%>
-
- <%= link_to(image_tag(url_to_avatar(homework.user), :width => "42", :height => "42"), user_path(homework.user), :class => "problem_pic fl") %>
-
- <%= link_to(homework.user.lastname+homework.user.firstname, user_path(homework.user),:class => 'problem_name fl',:target => "_blank") %>
-
<%= l(:label_user_create_project_homework) %>:
- <%= link_to(homework.name, student_work_index_path(:homework => homework.id), :class => 'problem_tit fl fb c_dblue',:target => "_blank") %>
-
-
- <%= l(:lebel_homework_commit)%>
- ( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> )
-
- <% if @is_teacher%>
- <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework,:is_in_course => 1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
- <%= link_to(l(:button_edit),edit_homework_common_path(homework,:is_in_course => 1), :class => "fr mr10 work_edit ml10") %>
- <%= homework_anonymous_comment(homework)%>
- <% elsif @is_student%>
- <%= student_anonymous_comment homework %>
- <%= student_new_homework homework %>
- <% end %>
-
-
-
-
- <%= homework.description.html_safe %>
-
-
-
+
+
-
-
开发语言:
-
- <%= homework.language_name%>
-
-
-
- <% end%>
+
-<% end%>
+ <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0,:is_in_course => 1,:course_id => @course.id} %>
+
+
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
-
\ No newline at end of file
diff --git a/app/views/homework_common/index.js.erb b/app/views/homework_common/index.js.erb
new file mode 100644
index 000000000..7a038eb5c
--- /dev/null
+++ b/app/views/homework_common/index.js.erb
@@ -0,0 +1 @@
+$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id} )%>");
\ No newline at end of file
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index fe0b5ef84..4dd5b0b27 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -17,7 +17,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
- <%= stylesheet_link_tag 'public', 'leftside', 'jquery/jquery-ui-1.9.2','prettify', 'courses','header'%>
+ <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','public', 'leftside','prettify', 'courses','header'%>
<%= javascript_include_tag "course","header","attachments",'prettify' %>
<%= yield :header_tags -%>
@@ -93,7 +93,7 @@
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02"%>
<%= link_to "(#{@course.homework_commons.count})", homework_common_index_path(:course => @course.id), :class => "subnav_num c_orange"%>
- <%= link_to( "+#{l(:label_course_homework_new)}", "javascript:void(0)", :class => 'subnav_green c_white', :onclick => "new_homework_alert();") if is_teacher %>
+ <%= link_to( "+#{l(:label_course_homework_new)}", homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'subnav_green c_white') if is_teacher %>
<%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f14 c_blue02" %>
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb
index 366291691..52309912e 100644
--- a/app/views/layouts/base_forums.html.erb
+++ b/app/views/layouts/base_forums.html.erb
@@ -21,7 +21,7 @@
function edit_desc(){
if(<%=@forum.creator.id == User.current.id%>) {
desc = $("#forum_desc_span").html();
- $("#forum_desc_span").html("");
+ $("#forum_desc_span").html("");
$("#forum_desc_input").focus();
}
}
@@ -149,15 +149,14 @@
-
<%= @forum.name%>
+
<%= @forum.name%>
-
<%= @forum.description%>
+
<%= @forum.description.html_safe%>
<%if @forum.creator.id == User.current.id%>
-
<%= image_tag('signature_edit.png',{:width=>12,:height=>12})%>
<%end%>
diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb
index 807fb2caa..9f77b248d 100644
--- a/app/views/layouts/base_users_new.html.erb
+++ b/app/views/layouts/base_users_new.html.erb
@@ -14,7 +14,7 @@
<%= csrf_meta_tag %>
<%= favicon %>
-<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new',prettify,'users', :media => 'all' %>
+<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new','prettify','users', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "avatars",'prettify'%>
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb
index b86838c0b..7583eb4a4 100644
--- a/app/views/layouts/new_base_user.html.erb
+++ b/app/views/layouts/new_base_user.html.erb
@@ -25,7 +25,7 @@
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
-
+
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index 6fc742c99..3f761fbd4 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -7,7 +7,7 @@
<%= l(:label_course_overview)%>
- <% unless @course_news.first.nil? || @course_news_comments.first.nil? %>
+ <% if !@course_news.first.nil? || !@course_news_comments.first.nil? %>
<%= l(:label_course_news) %>
@@ -190,7 +190,7 @@
@project_attachments.first %>
<%= l(:label_project_overview_new)%>
- <% unless @issues.first.nil? || @issues_journals.first.nil? %>
+ <% if !@issues.first.nil? || !@issues_journals.first.nil? %>
<%= l(:label_issue_tracking) %>
@@ -302,7 +302,7 @@
<% end %>
- <% unless @project_news.first.nil? || @project_news_comments.first.nil? %>
+ <% if !@project_news.first.nil? || !@project_news_comments.first.nil? %>
<%= l(:label_project_news) %>
diff --git a/app/views/mailer/send_mail_anonymous_comment_close.text.erb b/app/views/mailer/send_mail_anonymous_comment_close.text.erb
index e69de29bb..8ba50ff53 100644
--- a/app/views/mailer/send_mail_anonymous_comment_close.text.erb
+++ b/app/views/mailer/send_mail_anonymous_comment_close.text.erb
@@ -0,0 +1,3 @@
+<%= l(:mail_issue_content)%>
+<%=link_to @author, user_url(@author) %>
+<%=link_to @anonymous_comment_close_name, @anonymous_comment_close_url%>
diff --git a/app/views/mailer/send_mail_anonymous_comment_fail.html.erb b/app/views/mailer/send_mail_anonymous_comment_fail.html.erb
new file mode 100644
index 000000000..60f86ba18
--- /dev/null
+++ b/app/views/mailer/send_mail_anonymous_comment_fail.html.erb
@@ -0,0 +1,10 @@
+
+
+ <%= l(:mail_issue_content)%>
+
+ <%=link_to @author, user_url(@author) %> 发布的作业:<%=link_to @anonymous_comment_fail_name, @anonymous_comment_fail_url%> 匿评开启失败!
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/mailer/send_mail_anonymous_comment_fail.text.erb b/app/views/mailer/send_mail_anonymous_comment_fail.text.erb
new file mode 100644
index 000000000..e69de29bb
diff --git a/app/views/memos/_attachments_links.html.erb b/app/views/memos/_attachments_links.html.erb
index 15473e6e7..ca0f41d16 100644
--- a/app/views/memos/_attachments_links.html.erb
+++ b/app/views/memos/_attachments_links.html.erb
@@ -1,4 +1,4 @@
-
+
<% for attachment in attachments %>
@@ -20,43 +20,13 @@
<% else %>
- <%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 32 -%>
+ <%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 45 -%>
(<%= number_to_human_size attachment.filesize , :precision => 0 %>)
<% if options[:deletable] %>
- <%#= link_to image_tag('delete.png'), attachment_path(attachment),
- :data => {:confirm => l(:text_are_you_sure)},
- :method => :delete,
- :class => 'delete',
- #:remote => true,
- #:id => "attachments_" + attachment.id.to_s,
- :title => l(:button_delete) %>
<% end %>
<% end %>
-
- <%# if attachment.is_text? %>
- <%#= link_to image_tag('magnifier.png'),
- :controller => 'attachments',
- :action => 'show',
- :id => attachment,
- :filename => attachment.filename%>
- <%# end %>
-
-
-
-
-
-
-
-
-
-
- <%#= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>
-
-
-
-
<% end %>
<% if defined?(thumbnails) && thumbnails %>
<% images = attachments.select(&:thumbnailable?) %>
diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb
index 310cdb6ad..1ac86cf55 100644
--- a/app/views/memos/edit.html.erb
+++ b/app/views/memos/edit.html.erb
@@ -1,21 +1,24 @@
-<%= javascript_include_tag 'new_user'%>
+<%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor'%>
@@ -35,11 +38,7 @@
-
-
+ <%= kindeditor_tag 'memo[content]',@memo.content,:height=>300,:editor_id=>'memo_content'%>
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index 133a90547..ceb2b8cb1 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -30,6 +30,14 @@
$(function() {
init_activity_KindEditor_data(<%= @memo.id%>,null,"87%");
});
+
+ function del_confirm(){
+ if(confirm('确认删除么?')){
+ $("#del_link").click();
+ }else{
+
+ }
+ }
<%end%>
-
+
<%= format_date( @memo.created_at)%>
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
-
+
<%= @memo.content.html_safe%>
-
+
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 5f279f2c2..242b87a74 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -29,79 +29,6 @@
-
-
-
-
-
git 克隆和提交的用户名和密码为登录用户名和密码
-
项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码。
-
通过cmd命令提示符进入代码对应文件夹的根目录,
- 如果是首次提交代码,执行如下命令:
-
-
-
git init
-
-
git add *
-
-
git commit -m "first commit"
-
-
git remote add origin
- <%= @repos_url %>
-
-
-
git config http.postBuffer 524288000 #设置本地post缓存为500MB
-
-
git push -u origin master
-
-
-
-
已经有本地库,还没有配置远程地址,打开命令行执行如下:
-
-
-
git remote add origin <%= @repos_url %>
-
-
git add .
-
-
git commit -m "first commit"
-
-
git config http.postBuffer 524288000 #设置本地post缓存为500MB
-
-
git push -u origin master
-
-
-
-
已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:
-
-
-
git clone <%= @repos_url %>
-
-
git push
-
-
git checkout -b branch_name
-
-
git push origin branch_name
-
-
-
-
从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:
-
-
-
git remote add trustie
- <%= @repos_url %>
-
-
-
git add .
-
-
git commit -m "first commit"
-
-
git config http.postBuffer 524288000 #设置本地post缓存为500MB
-
-
git push -u trustie branch:branch
-
-
李海 提供
-
-
-
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %>
<% end %>
diff --git a/app/views/users/_course_attachment.html.erb b/app/views/users/_course_attachment.html.erb
index 41961f05b..386e6d177 100644
--- a/app/views/users/_course_attachment.html.erb
+++ b/app/views/users/_course_attachment.html.erb
@@ -1,28 +1,29 @@
-
+
-
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %>
- TO
- <%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.container_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
-
+ TO
+ <%= link_to activity.course.name.to_s+" | 课程资源", course_files_path(activity.course), :class => "newsBlue ml15" %>
-
-
<%=activity.filename.to_s(附件名称)%>
+
+ <%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %>
-
时间:<%= format_date(activity.created_on) %>
+
+ 文件大小:
+ <%= number_to_human_size activity.filesize%>
+
+
上传时间:<%= format_time(activity.created_on) %>
-
(附件描述)<%=activity.description.to_s%>
-
+
diff --git a/app/views/users/_course_create.html.erb b/app/views/users/_course_create.html.erb
index b69e6ee86..699b20216 100644
--- a/app/views/users/_course_create.html.erb
+++ b/app/views/users/_course_create.html.erb
@@ -1,18 +1,25 @@
-
+
-
+ <%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.tea_id), :alt => "用户头像" %>
+
-
-
-
-
-
截止时间:2015-08-20
+
+ <% if activity.try(:teacher).try(:realname) == ' ' %>
+ <%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:teacher).try(:realname), user_path(activity.tea_id), :class => "newsBlue mr15" %>
+ <% end %>
+ TO
+ <%= link_to activity.name.to_s+" | 课程", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
+
+
+ <%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
+
+
+ 创建时间:<%= format_time(activity.created_at) %>
-
(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
-
+
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index afd2f142b..868f952fa 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -1,3 +1,4 @@
+<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
@@ -45,18 +46,29 @@
<%= activity.description.html_safe %>
-
-
-
-
- 编辑
- 复制
- 删除
+ <%# if is_teacher%>
+
-
\ No newline at end of file
diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb
index 12c082dfa..1fcd3797e 100644
--- a/app/views/users/_course_journalsformessage.html.erb
+++ b/app/views/users/_course_journalsformessage.html.erb
@@ -1,29 +1,125 @@
-
-
+
+
-
+ <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
+
-
-
-
-
-
截止时间:2015-08-20
+
+ <% if @ctivity.try(:user).try(:realname) == ' ' %>
+ <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %>
+ <% end %> TO
+ <% course=Course.find(activity.jour_id) %>
+ <%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
+
+
+ <% if activity.m_parent_id.nil? %>
+ <%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
+ <% else %>
+ <%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
+ <% end %>
-
(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
-
-
+
+ 留言时间:<%= format_time(activity.created_on) %>
+ <% count=course.journals_for_messages.where('m_parent_id IS NULL').count %>
+
+
+
+
+ 回复(<%= count %>)
+
+
+ <%if count>2 %>
+
+ <% end %>
+
+
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% course.journals_for_messages.where('m_parent_id IS NULL').reorder("created_on desc").each do |comment| %>
+ <% replies_all_i = replies_all_i + 1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
+
+
+
+ <% if comment.try(:user).try(:realname) == ' ' %>
+ <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(comment.created_on) %>
+
+
+ <%= comment.notes.html_safe %>
+ <% fetch_user_leaveWord_reply(comment).each do |reply| unless fetch_user_leaveWord_reply(comment).nil? %>
+
+
+ <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33", :class =>"mt8"), user_path(reply.user_id), :alt => "用户头像" %>
+
+
+
+ <% if reply.try(:user).try(:realname) == ' ' %>
+ <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= l(:label_reply_to)%>
+ <% if comment.try(:user).try(:realname) == ' ' %>
+ <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14 ml10" %>
+ <% else %>
+ <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14 ml10" %>
+ <% end %>
+ <%= format_time reply.created_on %>
+
+
+ <%= reply.notes.html_safe %>
+
+
+
+
+ <% end %>
+ <% end %>
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
+
+
+ <%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%>
+ <%= hidden_field_tag 'reference_id', params[:reference_id], :value => activity.id %>
+ <%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => activity.user.id %>
+ <%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
+ <%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
+ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
+
+
+
发送
+
+
+ <% end%>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index fd9ae05e8..8ec605567 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -87,7 +87,7 @@
<% end %>
<%= format_time(reply.created_on) %>
-
+
<%= reply.content.html_safe %>
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb
index 99e85fc73..4b5b73ceb 100644
--- a/app/views/users/_course_news.html.erb
+++ b/app/views/users/_course_news.html.erb
@@ -60,7 +60,8 @@
<% end %>
<%= format_time(comment.created_on) %>
-
<%= comment.comments.html_safe %>
+
+ <%= comment.comments.html_safe %>
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb
index 0b86dc3eb..2c429a93f 100644
--- a/app/views/users/_project_issue.html.erb
+++ b/app/views/users/_project_issue.html.erb
@@ -97,7 +97,7 @@
<% end %>
<%= format_time(reply.created_on) %>
-
+
<% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %>
<%= string %>
@@ -133,17 +133,3 @@
-
\ No newline at end of file
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index 2856d6ed1..ead43d7e4 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -74,7 +74,8 @@
<% end %>
<%= format_time(reply.created_on) %>
-
<%= reply.content.html_safe %>
+
+ <%= reply.content.html_safe %>
diff --git a/app/views/users/_show_user_resource.html.erb b/app/views/users/_show_user_resource.html.erb
index 24d81a787..929cea75b 100644
--- a/app/views/users/_show_user_resource.html.erb
+++ b/app/views/users/_show_user_resource.html.erb
@@ -60,7 +60,7 @@
<% end %>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index ea9c572d9..29752121f 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -37,6 +37,26 @@
$(function() {
init_activity_KindEditor_data(<%= user_activity.id%>,null,"87%");
+ var description_images=$("div#activity_description_<%= user_activity.id %>").find("img");
+ if (description_images.length>0) {
+ for (var i=0; i
").attr("href",image.attr('src'));
+ image.wrap(element);
+ }
+ }
+ $('#activity_description_<%= user_activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
+
+ var reply_images=$("div#reply_content_<%= user_activity.id %>").find("img");
+ if (reply_images.length>0) {
+ for (var i=0; i").attr("href",image.attr('src'));
+ image.wrap(element);
+ }
+ }
+ $('#reply_content_<%= user_activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
+
});
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index 6e07e7122..fe320992a 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -36,8 +36,7 @@
-
-
+
<%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %>
diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb
index f7017deab..336a62d37 100644
--- a/app/views/users/_user_homework_list.html.erb
+++ b/app/views/users/_user_homework_list.html.erb
@@ -58,10 +58,10 @@
- <%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => 0), :class => "postOptionLink"%>
+ <%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => is_in_course), :class => "postOptionLink"%>
- <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => 0),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
+ <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%>
@@ -80,5 +80,11 @@
<% end%>
<% if homework_commons.count == 10%>
- <%= link_to "加载更多",user_homeworks_user_path(User.current.id,:page => page),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
+ <% if is_in_course == 1%>
+
+ <%= link_to "加载更多",homework_common_index_path(:course => course_id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
+ <% else%>
+
+ <%= link_to "加载更多",user_homeworks_user_path(User.current.id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
+ <% end%>
<% end%>
\ No newline at end of file
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
new file mode 100644
index 000000000..7d6044e64
--- /dev/null
+++ b/app/views/users/_user_message_course.html.erb
@@ -0,0 +1,338 @@
+<% if ma.class == CourseMessage %>
+ <% if ma.course_message_type == "News" %>
+
+ <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %>
+ <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">发布了通知:
+
+ <%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
+ :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
标题: <%= ma.course_message.title %>
+ <% unless ma.course_message.description.nil? %>
+
内容:
+
<%= ma.course_message.description.html_safe %>
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.course_message_type == "Comment" %>
+
+ <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
+ <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">评论了通知:
+
+ <%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
+ :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
标题: <%= ma.course_message.commented.title %>
+ <% unless ma.course_message.comments.nil? %>
+
内容:
+
<%= ma.course_message.comments.html_safe %>
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
+
+ <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+ <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">发布了课程作业:
+
+
+ <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
+ :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+ <% if User.current.allowed_to?(:as_teacher,ma.course_message.course) %>
+
+ <%= User.current.lastname + User.current.firstname %>老师您好!
+ <%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
+
+
课程名称:<%= ma.course_message.course.name %>
+ (<%= ma.course_message.course.term %>)
+
作业标题:<%= ma.course_message.name %>
+
提交截止:<%= ma.course_message.end_time %> 24点
+
匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
+
匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+
迟交扣分:<%= ma.course_message.late_penalty %>分
+
缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
+ 您可以修改作业内容、评分规则、匿评过程等,谢谢!
+
+ <% else %>
+
<%= User.current.lastname + User.current.firstname %>同学你好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
+
课程名称:<%= ma.course_message.course.name %>
+ (<%= ma.course_message.course.term %>)
+
作业标题:<%= ma.course_message.name %>
+
提交截止:<%= ma.course_message.end_time %> 24点
+
匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+
迟交扣分:<%= ma.course_message.late_penalty %>分
+
+ 请抓紧时间提交自己的作品,谢谢!
+
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
+
+ <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+ <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布的作业:
+
+ <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
+ :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <% if !User.current.allowed_to?(:as_teacher,ma.course_message.course) %>
+
+ <%= User.current.lastname + User.current.firstname %>同学您好!
+ <%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
+
+
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
+
作业标题:<%= ma.course_message.name %>
+
提交截止:<%= ma.course_message.end_time %>@nbsp; 24点
+
匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %>@nbsp;@nbsp;24点
+
迟交扣分:<%= ma.course_message.late_penalty %>分
+
请同学们抓紧时间提交自己的作品,谢谢!
+ <% else %>
+
<%= User.current.lastname + User.current.firstname %>老师您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
+
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
+
作业标题:<%= ma.course_message.name %>
+
提交截止:<%= ma.course_message.end_time %>@nbsp;@nbsp;24点
+
匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %>@nbsp;@nbsp;24点
+
匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %>@nbsp;@nbsp;24点
+
迟交扣分:<%= ma.course_message.late_penalty %>分
+
缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
您可以修改作业内容、评分规则、匿评过程等,谢谢!
+ <% end %>
+
+ 截止时间快到了!
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
+
+
+ <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+
+
+ <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
+ user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">启动了作业匿评:
+
+
+ <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
+ <%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师' : '同学' %>您好!
+ <%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师开启了匿评,作业详情如下:
+
+
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
+
作业标题:<%= ma.course_message.name %>
+
+ 截止日期:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
+
+ <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+
+ <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
+ user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">关闭了作业匿评:
+
+ <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))"%>
+
+
+
+ <%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
+ <%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师关闭了匿评,作业详情如下:
+
+
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
+
作业标题:<%= ma.course_message.name %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
+
+
+ <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+
+
+ <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
+ user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">启动作业匿评失败
+
+
+ <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
+ <%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好!
+ <%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败,作业详情如下:
+
+
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
+
作业标题:<%= ma.course_message.name %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+
+ <% if ma.course_message_type == "Poll" %>
+
+ <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+ <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布了问卷:
+
+ <%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
+ :class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+ <%= ma.course_message.polls_name %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.course_message_type == "Message" %>
+
+ <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
+ <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>"><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %>
+ <% if ma.course_message.parent_id.nil? %>
+
+ <%= link_to ma.course_message.subject, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
+ :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
主题: <%= ma.course_message.subject %>
+ <% unless ma.course_message.content.nil? %>
+
内容:
+
<%= ma.course_message.content.html_safe %>
+ <% end %>
+
+ <% else %>
+
+ <%= link_to ma.course_message.content.html_safe, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
+ :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
主题: <%= ma.course_message.subject %>
+ <% unless ma.course_message.content.nil? %>
+
内容:
+
<%= ma.course_message.content.html_safe %>
+ <% end %>
+
+ <% end %>
+ <%= time_tag(ma.created_at).html_safe %>
+
+
+ <% end %>
+ <% if ma.course_message_type == "StudentWorksScore" %>
+
+
+ <% if ma.course_message.reviewer_role == 3 %>
+ <%=link_to image_tag(url_to_avatar(""), :width => "30", :height => "30") %>
+ <% else %>
+ <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+ <% end %>
+
+
+ <% if ma.course_message.reviewer_role == 3 %>
+ 匿名用户
+ <% else %>
+ <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
+ user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ <% end %>
+ ">
+ <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %>
+
+
+
+ <% unless ma.content.nil? %>
+ <%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),
+ :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+ <%= ma.content.html_safe %>
+
课程名称:<%= ma.course.name %>(<%= ma.course.term %>)
+
作业标题:<%=ma.course_message.student_work.homework_common.name %>
+
+ <% end %>
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.course_message_type == "JournalsForMessage" %>
+ <% if ma.course_message.jour_type == 'Course' %>
+ <% if params[:type] != 'homework' %>
+
+
+ <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+
+ <%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">在课程中留言了:
+
+
+ <%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
+ :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <%= ma.course_message.notes.html_safe %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% else %>
+
+
+ <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+
+
+ <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname +
+ "#{ma.course_message.user.members.where("course_id=?", ma.course.id).first.roles.first.name=='Student'?"同学":"老师"}",
+ user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">回复了作品评论:
+
+
+ <%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
回复内容:
+
<%= ma.course_message.notes %>
+
您的评论:
+
<%= ma.course_message.jour.comment %>
+
课程名称:<%= ma.course.name %>(<%= ma.course.term %>)
+
作业标题:<%=ma.course_message.jour.student_work.homework_common.name %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_message_forge.html.erb b/app/views/users/_user_message_forge.html.erb
new file mode 100644
index 000000000..641fb9269
--- /dev/null
+++ b/app/views/users/_user_message_forge.html.erb
@@ -0,0 +1,213 @@
+<% if ma.class == ForgeMessage %>
+
+ <% if ma.forge_message_type == "AppliedProject" %>
+
+
+ <%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %>
+
+
+ <%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">申请加入项目:
+
+
+ <%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <%= ma.project %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+
+ <% if ma.forge_message_type == "ProjectInvite" %>
+ <% inviter = User.find(ma.forge_message_id) %>
+
+
+ <%=link_to image_tag(url_to_avatar(inviter), :width => "30", :height => "30"), user_path(inviter) %>
+
+
+ <%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
+ '>邀请你加入项目
+
+ <% if ma.user.member_of?(ma.project) %>
+
+ <% else %>
+
+ <% end %>
+ <%= link_to ma.project, project_path(ma.project),
+ :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <%= ma.project %>
+
+ <% unless User.current.member_of?(ma.project) %>
+
+ <%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
+ :value => ma.secret_key,
+ :class => "green_btn_cir ml10",
+ :style => "color:#fff" %>
+
+ <% end %>
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.forge_message_type == "Issue" %>
+ <% if ma.status == 1%>
+
+
+ <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
+
+
+ <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
+ "><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%>
+
+
+ <%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
主题: <%= ma.forge_message.subject %>
+ <% unless ma.forge_message.description.nil? || ma.forge_message.description == "" %>
+
描述:
+
<%= ma.forge_message.description.html_safe %>
+ <% end %>
+
+ 截止时间快到了!
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% else %>
+
+
+ <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
+
+
+ <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
+ "><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%>
+
+
+ <%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
主题: <%= ma.forge_message.subject %>
+ <% unless ma.forge_message.description.nil? || ma.forge_message.description == "" %>
+
描述:
+
<%= ma.forge_message.description.html_safe %>
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% end %>
+ <% if ma.forge_message_type == "Journal" %>
+
+
+ <%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %>
+
+
+ <%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">
+ 更新了问题状态:
+
+
+ <%= link_to ma.forge_message.journalized.subject,
+ issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
问题标题: <%= ma.forge_message.journalized.subject %>
+
更新内容:
+
<%= get_issue_des_update(ma.forge_message).html_safe %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.forge_message_type == "Message" %>
+
+ <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
+ <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
+ "><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %>
+ <% if ma.forge_message.parent_id.nil? %>
+
+ <%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
+ :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
+ :topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
主题: <%= ma.forge_message.subject %>
+ <% unless ma.forge_message.content.nil? %>
+
内容:
+
<%= ma.forge_message.content.html_safe %>
+ <% end %>
+
+ <% else %>
+
+ <%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
+ :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
+ :topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
帖子主题: <%= ma.forge_message.subject %>
+ <% unless ma.forge_message.content.nil? %>
+
评论内容:
+
<%= ma.forge_message.content.html_safe %>
+ <% end %>
+
+ <% end %>
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.forge_message_type == "News" %>
+
+
+ <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
+
+
+ <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
+ ">发布了新闻:
+
+
+ <%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id},
+ :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
标题: <%= ma.forge_message.title %>
+ <% unless ma.forge_message.description.nil? %>
+
内容:
+
<%= ma.forge_message.description.html_safe %>
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+ <% if ma.forge_message_type == "Comment" %>
+
+ <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
+ <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
+ ">评论了新闻:
+
+ <%= link_to "#{ma.forge_message.comments.html_safe}",
+ {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
新闻标题: <%= ma.forge_message.commented.title %>
+
评论内容:
+
<%= ma.forge_message.comments.html_safe %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_message_forum.html.erb b/app/views/users/_user_message_forum.html.erb
new file mode 100644
index 000000000..102b4a155
--- /dev/null
+++ b/app/views/users/_user_message_forum.html.erb
@@ -0,0 +1,41 @@
+<% if ma.class == MemoMessage %>
+ <% if ma.memo_type == "Memo" %>
+
+
+ <%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author) %>
+
+
+ <%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue homepageNewsPublisher" %>
+ " ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %>
+
+ <% if ma.memo.parent_id.nil? %>
+
+ <%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
标题: <%= ma.memo.subject %>
+ <% unless ma.memo.content.nil? %>
+
内容:
+
<%= ma.memo.content.html_safe %>
+ <% end %>
+
+ <% else %>
+
+ <%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+
标题: <%= ma.memo.subject %>
+ <% unless ma.memo.content.nil? %>
+
内容:
+
<%= ma.memo.content.html_safe %>
+ <% end %>
+
+ <% end %>
+ <%= time_tag(ma.memo.created_at).html_safe %>
+
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_message_userfeedaback.html.erb b/app/views/users/_user_message_userfeedaback.html.erb
new file mode 100644
index 000000000..672dfda64
--- /dev/null
+++ b/app/views/users/_user_message_userfeedaback.html.erb
@@ -0,0 +1,30 @@
+<% if ma.class == UserFeedbackMessage %>
+ <% if ma.journals_for_message_type == "JournalsForMessage" %>
+
+
+ <%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %>
+
+
+ <%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ "><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %>
+
+
+ <%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <% if ma.journals_for_message.reply_id == 0 %>
+ <%= ma.journals_for_message.notes.html_safe %>
+ <% else %>
+
您的留言:
+
<%= JournalsForMessage.find(ma.journals_for_message.m_reply_id).notes.html_safe %>
+
回复内容:
+
<%= ma.journals_for_message.notes.html_safe %>
+ <% end %>
+
+ <%= time_tag(ma.journals_for_message.created_on).html_safe %>
+
+
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/import_resources_to_homework.js.erb b/app/views/users/import_resources_to_homework.js.erb
index b77590095..61fcd294d 100644
--- a/app/views/users/import_resources_to_homework.js.erb
+++ b/app/views/users/import_resources_to_homework.js.erb
@@ -12,5 +12,5 @@
'
')
<% end %>
- hideModal();
+ hideResource();
<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb
index a37709b69..7b212101c 100644
--- a/app/views/users/user_homeworks.html.erb
+++ b/app/views/users/user_homeworks.html.erb
@@ -26,4 +26,4 @@
<% end%>
-<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0} %>
+<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0,:is_in_course => 0} %>
diff --git a/app/views/users/user_homeworks.js.erb b/app/views/users/user_homeworks.js.erb
index b6703dd43..cc1bc051a 100644
--- a/app/views/users/user_homeworks.js.erb
+++ b/app/views/users/user_homeworks.js.erb
@@ -1,2 +1,2 @@
-$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homework_commons, :page => @page} )%>");
+$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homework_commons, :page => @page,:is_in_course => 0} )%>");
diff --git a/app/views/users/user_import_resource.js.erb b/app/views/users/user_import_resource.js.erb
index 32a2cd697..0e35acd95 100644
--- a/app/views/users/user_import_resource.js.erb
+++ b/app/views/users/user_import_resource.js.erb
@@ -3,6 +3,6 @@ showModal('ajax-modal', '730px');
$('#ajax-modal').css('height','500px').css("width","730px");
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
-$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed").css("padding-left","16px").css("padding-bottom","16px").css("padding-right","16px");
+" ");
+$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed");
$('#ajax-modal').parent().addClass("popbox").addClass("referenceResourcesPopup");
\ No newline at end of file
diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb
index d207150b8..bd794438c 100644
--- a/app/views/users/user_messages.html.erb
+++ b/app/views/users/user_messages.html.erb
@@ -31,698 +31,73 @@
-
-<% if @message_alls.count >0 || @user_system_messages.count >0 %>
- <% if params[:type].nil? || params[:type] == "unviewed" %>
-
- <% end %>
- <%# 系统消息 %>
- <% if params[:type] != 'system_messages' %>
- <% @user_system_messages.each do |usm| %>
-
-
- <%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %>
-
-
- Trustie平台 发布新消息:
-
- 【系统消息】
-
-
- <%= link_to usm.subject.blank? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current),
- :id => "content_link_#{usm.id}",
- :onmouseover =>"message_titile_show($(this),event);",
- :onmouseout => "message_titile_hide($(this));"
- %>
-
-
- <% unless usm.subject.blank? %>
-
标题: <%= usm.subject %>
- <% end %>
- <% if (!usm.description.blank?) || (!usm.content.blank?) %>
-
内容:
<%= usm.description.nil? ? usm.content.html_safe : usm.description.html_safe %>
- <% end %>
-
- <%= time_tag(usm.created_at).html_safe %>
-
+
+ <% if @message_alls.count >0 || @user_system_messages.count >0 %>
+ <% if params[:type].nil? || params[:type] == "unviewed" %>
+
<% end %>
- <% end %>
-
- <% unless @message_alls.nil? %>
- <% @message_alls.each do |ma| %>
- <%# 课程消息 %>
- <% if ma.class == CourseMessage %>
- <% if ma.course_message_type == "News" %>
-
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">发布了通知:
-
- <%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
- :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
标题: <%= ma.course_message.title %>
- <% unless ma.course_message.description.nil? %>
-
内容:
-
<%= ma.course_message.description.html_safe %>
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.course_message_type == "Comment" %>
-
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">评论了通知:
-
- <%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
- :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
标题: <%= ma.course_message.commented.title %>
- <% unless ma.course_message.comments.nil? %>
-
内容:
-
<%= ma.course_message.comments.html_safe %>
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
-
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">发布了课程作业:
-
-
- <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
- :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
- <% if User.current.members.where("course_id = ?", ma.course_message.course.id).first.roles.first.name == 'Student' %>
-
<%= User.current.lastname + User.current.firstname %>同学你好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
-
课程名称:<%= ma.course_message.course.name %>
- (<%= ma.course_message.course.term %>)
-
作业标题:<%= ma.course_message.name %>
-
提交截止:<%= ma.course_message.end_time %> 24点
-
匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
-
迟交扣分:<%= ma.course_message.late_penalty %>分
-
- 请抓紧时间提交自己的作品,谢谢!
-
- <% else %>
-
- <%= User.current.lastname + User.current.firstname %>老师您好!
- <%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
-
-
课程名称:<%= ma.course_message.course.name %>
- (<%= ma.course_message.course.term %>)
-
作业标题:<%= ma.course_message.name %>
-
提交截止:<%= ma.course_message.end_time %> 24点
-
匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
-
匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
-
迟交扣分:<%= ma.course_message.late_penalty %>分
-
缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
-
- 您可以修改作业内容、评分规则、匿评过程等,谢谢!
-
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
-
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布的作业:
-
- <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
- :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
- <% if User.current.members.where("course_id = ?", ma.course_message.course.id).first.roles.first.name == 'Student' %>
-
- <%= User.current.lastname + User.current.firstname %>同学您好!
- <%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
-
-
-
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
-
-
作业标题:<%= ma.course_message.name %>
-
-
提交截止:<%= ma.course_message.end_time %>@nbsp; 24点
-
-
匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %>
- @nbsp;@nbsp;24点
-
-
迟交扣分:<%= ma.course_message.late_penalty %>分
-
-
- 请同学们抓紧时间提交自己的作品,谢谢!
-
- <% else %>
-
<%= User.current.lastname + User.current.firstname %>您好!
- <%= ma.course_message.user.lastname + ma.course_message.user.firstname %>
- 老师发布的作业截止日期快到了:
-
-
课程名称: <%= ma.course_message.course.name %>
- (<%= ma.course_message.course.term %>)
-
-
作业标题: <%= ma.course_message.name %>
-
-
提交截止: <%= ma.course_message.end_time %>@nbsp;@nbsp;24点
-
-
匿评开始: <%= ma.course_message.homework_detail_manual.evaluation_start %>
- @nbsp;@nbsp;24点
-
-
匿评关闭: <%= ma.course_message.homework_detail_manual.evaluation_end %>
- @nbsp;@nbsp;24点
-
-
迟交扣分: <%= ma.course_message.late_penalty %>分
-
-
缺评扣分: <%= ma.course_message.homework_detail_manual.absence_penalty %>分
-
+ <%# 系统消息 %>
+ <% if params[:type] != 'system_messages' %>
+ <% @user_system_messages.each do |usm| %>
+
+
+ <%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %>
+
+
+ Trustie平台 发布新消息:
+
+ 【系统消息】
+
+
+ <%= link_to usm.subject.blank? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current),
+ :id => "content_link_#{usm.id}",
+ :onmouseover =>"message_titile_show($(this),event);",
+ :onmouseout => "message_titile_hide($(this));"
+ %>
+
+
+ <% unless usm.subject.blank? %>
+
标题: <%= usm.subject %>
+ <% end %>
+ <% if (!usm.description.blank?) || (!usm.content.blank?) %>
+
内容:
<%= usm.description.nil? ? usm.content.html_safe : usm.description.html_safe %>
+ <% end %>
+
+ <%= time_tag(usm.created_at).html_safe %>
+
+ <% end %>
+ <% end %>
+
+ <% unless @message_alls.nil? %>
+ <% @message_alls.each do |ma| %>
+ <%# 课程消息 %>
+ <%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>
-
- 您可以修改作业内容、评分规则、匿评过程等,谢谢!
-
- <% end %>
-
- 截止时间快到了!
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
-
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
-
-
- <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
-
-
- <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
- user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">启动了作业匿评:
-
-
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师开启了匿评,作业详情如下:
-
课程: <%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
-
作业标题: <%= ma.course_message.name %>
- <% unless ma.course_message.description.blank? %>
-
作业内容:
-
<%= ma.course_message.description.html_safe %>
- <% end %>
-
匿评自动关闭日期: <%= ma.course_message.homework_detail_manual.evaluation_end %>
-
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
-
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
-
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
-
- <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
- user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">关闭了作业匿评:
-
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))"%>
-
-
-
您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师关闭了匿评,作业详情如下:
-
课程: <%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
-
作业标题: <%= ma.course_message.name %>
- <% unless ma.course_message.description.blank? %>
-
作业内容:
-
<%= ma.course_message.description.html_safe %>
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
+
+ <%= render :partial => 'users/user_message_forge', :locals => {:ma => ma} %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
-
-
- <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
-
-
- <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
- user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">启动作业匿评失败
-
-
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师启动作业匿评失败,作业详情如下:
-
课程: <%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)
-
作业标题: <%= ma.course_message.name %>
- <% unless ma.course_message.description.blank? %>
-
作业内容:
-
<%= ma.course_message.description.html_safe %>
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
+
+ <%= render :partial => 'users/user_message_forum', :locals => {:ma => ma} %>
- <% if ma.course_message_type == "Poll" %>
-
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布了问卷:
-
- <%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
- :class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
- <%= ma.course_message.polls_name %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.course_message_type == "Message" %>
-
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>"><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %>
- <% if ma.course_message.parent_id.nil? %>
-
- <%= link_to ma.course_message.subject, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
- :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
主题: <%= ma.course_message.subject %>
- <% unless ma.course_message.content.nil? %>
-
内容:
-
<%= ma.course_message.content.html_safe %>
- <% end %>
-
- <% else %>
-
- <%= link_to ma.course_message.content.html_safe, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
- :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
主题: <%= ma.course_message.subject %>
- <% unless ma.course_message.content.nil? %>
-
内容:
-
<%= ma.course_message.content.html_safe %>
- <% end %>
-
- <% end %>
- <%= time_tag(ma.created_at).html_safe %>
+
+ <%= render :partial => 'users/user_message_userfeedaback', :locals => {:ma => ma} %>
-
- <% end %>
- <% if ma.course_message_type == "StudentWorksScore" %>
-
-
- <% if ma.course_message.reviewer_role == 3 %>
- <%=link_to image_tag(url_to_avatar(""), :width => "30", :height => "30") %>
- <% else %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <% end %>
-
-
- <% if ma.course_message.reviewer_role == 3 %>
- 匿名用户
- <% else %>
- <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
- user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
- <% end %>
- ">
- <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %>
-
-
-
- <% unless ma.content.nil? %>
- <%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),
- :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
- <%= ma.content.html_safe %>
-
课程: <%= ma.course.name %>
- (<%= ma.course.term %>)
-
作业标题: <%=ma.course_message.student_work.homework_common.name %>
- <% unless ma.course_message.student_work.homework_common.description.blank? %>
-
作业内容:
-
<%= ma.course_message.student_work.homework_common.description.html_safe %>
- <% end %>
-
- <% end %>
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.course_message_type == "JournalsForMessage" %>
- <% if ma.course_message.jour_type == 'Course' %>
- <% if params[:type] != 'homework' %>
-
-
- <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
-
- <%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">在课程中留言了:
-
-
- <%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
- :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
- <%= ma.course_message.notes.html_safe %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% else %>
-
-
- <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
-
-
- <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname +
- "#{ma.course_message.user.members.where("course_id=?", ma.course.id).first.roles.first.name=='Student'?"同学":"老师"}",
- user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">回复了作品评论:
-
-
- <%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
回复内容:
-
<%= ma.course_message.notes %>
-
您的作品评论:
-
<%= ma.course_message.jour.comment %>
-
课程: <%= ma.course.name %>(<%= ma.course.term %>)
-
作业标题: <%=ma.course_message.jour.student_work.homework_common.name %>
- <% unless ma.course_message.jour.student_work.homework_common.description.blank? %>
-
作业内容:
-
<%= ma.course_message.jour.student_work.homework_common.description.html_safe %>
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% end %>
- <% end %>
-
- <% if ma.class == ForgeMessage %>
-
- <% if ma.forge_message_type == "AppliedProject" %>
-
-
- <%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %>
-
-
- <%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">申请加入项目:
-
-
- <%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
- <%= ma.project %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
-
- <% if ma.forge_message_type == "ProjectInvite" %>
- <% inviter = User.find(ma.forge_message_id) %>
-
-
- <%=link_to image_tag(url_to_avatar(inviter), :width => "30", :height => "30"), user_path(inviter) %>
-
-
- <%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
- '>邀请你加入项目
-
- <% if ma.user.member_of?(ma.project) %>
-
- <% else %>
-
- <% end %>
- <%= link_to ma.project, project_path(ma.project),
- :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
- <%= ma.project %>
-
- <% unless User.current.member_of?(ma.project) %>
-
- <%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
- :value => ma.secret_key,
- :class => "green_btn_cir ml10",
- :style => "color:#fff" %>
-
- <% end %>
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.forge_message_type == "Issue" %>
-
-
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
-
-
- <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
- ">指派了问题给你:
-
-
- <%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
主题: <%= ma.forge_message.subject %>
- <% unless ma.forge_message.description.nil? || ma.forge_message.description == "" %>
-
描述:
-
<%= ma.forge_message.description.html_safe %>
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.forge_message_type == "Journal" %>
-
-
- <%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %>
-
-
- <%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">
- 更新了问题状态:
-
-
- <%= link_to ma.forge_message.journalized.subject,
- issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
问题标题: <%= ma.forge_message.journalized.subject %>
-
更新内容:
-
<%= get_issue_des_update(ma.forge_message).html_safe %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.forge_message_type == "Message" %>
-
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
- <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
- "><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %>
- <% if ma.forge_message.parent_id.nil? %>
-
- <%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
- :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
- :topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
主题: <%= ma.forge_message.subject %>
- <% unless ma.forge_message.content.nil? %>
-
内容:
-
<%= ma.forge_message.content.html_safe %>
- <% end %>
-
- <% else %>
-
- <%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
- :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
- :topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
帖子主题: <%= ma.forge_message.subject %>
- <% unless ma.forge_message.content.nil? %>
-
评论内容:
-
<%= ma.forge_message.content.html_safe %>
- <% end %>
-
- <% end %>
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.forge_message_type == "News" %>
-
-
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
-
-
- <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
- ">发布了新闻:
-
-
- <%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id},
- :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
标题: <%= ma.forge_message.title %>
- <% unless ma.forge_message.description.nil? %>
-
内容:
-
<%= ma.forge_message.description.html_safe %>
- <% end %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% if ma.forge_message_type == "Comment" %>
-
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
- <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
- ">评论了新闻:
-
- <%= link_to "#{ma.forge_message.comments.html_safe}",
- {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
新闻标题: <%= ma.forge_message.commented.title %>
-
评论内容:
-
<%= ma.forge_message.comments.html_safe %>
-
- <%= time_tag(ma.created_at).html_safe %>
-
- <% end %>
- <% end %>
-
- <% if ma.class == MemoMessage %>
- <% if ma.memo_type == "Memo" %>
-
-
- <%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author) %>
-
-
- <%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue homepageNewsPublisher" %>
- " ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %>
-
- <% if ma.memo.parent_id.nil? %>
-
- <%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
标题: <%= ma.memo.subject %>
- <% unless ma.memo.content.nil? %>
-
内容:
-
<%= ma.memo.content.html_safe %>
- <% end %>
-
- <% else %>
-
- <%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
-
标题: <%= ma.memo.subject %>
- <% unless ma.memo.content.nil? %>
-
内容:
-
<%= ma.memo.content.html_safe %>
- <% end %>
-
- <% end %>
- <%= time_tag(ma.memo.created_at).html_safe %>
-
- <% end %>
- <% end %>
-
- <% if ma.class == UserFeedbackMessage %>
- <% if ma.journals_for_message_type == "JournalsForMessage" %>
-
-
- <%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %>
-
-
- <%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
- "><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %>
-
-
- <%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover =>"message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
- <% if ma.journals_for_message.reply_id == 0 %>
- <%= ma.journals_for_message.notes.html_safe %>
- <% else %>
-
您的留言:
-
<%= JournalsForMessage.find(ma.journals_for_message.m_reply_id).notes.html_safe %>
-
回复内容:
-
<%= ma.journals_for_message.notes.html_safe %>
- <% end %>
-
- <%= time_tag(ma.journals_for_message.created_on).html_safe %>
-
-
- <% end %>
<% end %>
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
<% end %>
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
+
+ <% else %>
+
您目前还没有相关消息!
<% end %>
-
-
-<% else %>
-
您目前还没有相关消息!
-<% end %>
-
-
+
+