Merge branch 'develop' into cxt_course

Conflicts:
	app/controllers/homework_common_controller.rb
	app/views/student_work/show.js.erb
	public/javascripts/application.js
	public/stylesheets/base.css
	public/stylesheets/public_new.css
cxt_course
cxt 10 years ago
commit d72aa3a93c

@ -51,6 +51,37 @@ class AdminController < ApplicationController
end end
end end
#管理员界面精品课程列表
def excellent_courses
@courses = Course.where("is_excellent =? or excellent_option =?", 1, 1 )
respond_to do |format|
format.html
end
end
#管理员界面课程资源列表
def course_resource_list
@resource = Attachment.where(:container_type => 'Course')
@resource = paginateHelper @resource,30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
#管理员界面項目资源列表
def project_resource_list
@pro_resource = Attachment.where(:container_type => 'Project')
@pro_resource = paginateHelper @pro_resource,30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
def users def users
sort_init 'login', 'asc' sort_init 'login', 'asc'
sort_update %w(login firstname lastname mail admin created_on last_login_on) sort_update %w(login firstname lastname mail admin created_on last_login_on)

@ -91,8 +91,12 @@ class BlogCommentsController < ApplicationController
def edit def edit
@article = BlogComment.find(params[:id]) @article = BlogComment.find(params[:id])
respond_to do |format| if User.current.admin? || User.current.id == @article.author_id
format.html {render :layout=>'new_base_user'} respond_to do |format|
format.html { render :layout => 'new_base_user' }
end
else
render_403
end end
end end

@ -850,6 +850,8 @@ class CoursesController < ApplicationController
# render_403 # render_403
# return # return
# end # end
# 统计访问量
@course.update_attribute(:visits, @course.visits.to_i + 1)
#更新创建课程消息状态 #更新创建课程消息状态
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0) create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
create_course_messages.update_all(:viewed => true) create_course_messages.update_all(:viewed => true)

@ -854,9 +854,7 @@ class FilesController < ApplicationController
@result = visable_attachemnts @result @result = visable_attachemnts @result
if params[:other] if params[:other]
@result = @result.select{|attachment| @result = @result.select{|attachment|
attachment.tag_list.exclude?('软件') && attachment.tag_list.index{|tag|tag != '软件' and tag != '媒体' and tag != '代码'}.present?
attachment.tag_list.exclude?('媒体') &&
attachment.tag_list.exclude?('代码')
} }
else else
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank? @result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank?

@ -107,32 +107,18 @@ class NewsController < ApplicationController
def show def show
# 更新news对应的forge_messages的消息viewed字段 # 更新news对应的forge_messages的消息viewed字段
ids = @news.comments.map { |comment| comment.id }.join(",") unless @news.comments.nil?
if @project if @project
query_message_news = @news.forge_messages # 更新新闻
query_message_news = ForgeMessage.where("forge_message_id =? and user_id =? and viewed =?", @news.id, User.current.id, 0).first
# 更新新闻的时候一并更新回复
ForgeMessage.where("forge_message_id in (#{ids}) and forge_message_type = 'Comment' and user_id = #{User.current.id}").update_all(:viewed => true) unless ids.blank?
else else
query_message_news = @news.course_messages query_message_news = CourseMessage.where("course_message_id =? and user_id =? and viewed =?", @news.id, User.current.id, 0).first
CourseMessage.where("course_message_id in (#{ids}) and course_message_type = 'Comment' and user_id = #{User.current.id}").update_all(:viewed => true) unless ids.blank?
end end
query_message_news.each do |query| query_message_news.update_attribute(:viewed, true) unless query_message_news.nil?
if User.current.id == query.user_id # over
query.update_attributes(:viewed => true)
end
end
# 更新项目新闻的评阅的消息viewed字段
current_message_comments = @news.comments
current_message_comments.each do |current_message_comment|
if @project
query_message_comment = current_message_comment.forge_messages
else
query_message_comment = current_message_comment.course_messages
end
query_message_comment.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
end
# end
cs = CoursesService.new cs = CoursesService.new
result = cs.show_course_news params,User.current result = cs.show_course_news params,User.current
@news = result[:news] @news = result[:news]

@ -69,6 +69,8 @@ class OrganizationsController < ApplicationController
def show def show
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@organization = Organization.find(params[:id]) @organization = Organization.find(params[:id])
# 统计访问量
@organization.update_attribute(:visits, @organization.visits.to_i + 1)
if params[:org_subfield_id] if params[:org_subfield_id]
@org_subfield = OrgSubfield.find(params[:org_subfield_id]) @org_subfield = OrgSubfield.find(params[:org_subfield_id])
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0

@ -298,6 +298,8 @@ class ProjectsController < ApplicationController
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump]) if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
return return
end end
# 统计访问量
@project.update_attribute(:visits, @project.visits.to_i + 1)
=begin =begin
cond = @project.project_condition(Setting.display_subprojects_issues?) cond = @project.project_condition(Setting.display_subprojects_issues?)
has = { has = {

@ -425,7 +425,7 @@ class UsersController < ApplicationController
end end
def choose_user_course def choose_user_course
homework = HomeworkCommon.find params[:homework].to_i homework = HomeworkCommon.find params[:send_id].to_i
if !params[:search].nil? if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%" search = "%#{params[:search].to_s.strip.downcase}%"
@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)} @course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
@ -1199,6 +1199,10 @@ class UsersController < ApplicationController
end end
def show def show
# 统计访问量
unless User.current == @user
@user.update_attribute(:visits, @user.visits.to_i + 1)
end
#更新用户申请成为课程老师或教辅消息的状态 #更新用户申请成为课程老师或教辅消息的状态
if params[:course_id] != nil if params[:course_id] != nil
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",
@ -1568,7 +1572,7 @@ class UsersController < ApplicationController
@user = User.find(params[:id]) @user = User.find(params[:id])
#@user.save_attachments(params[:attachments],User.current) #@user.save_attachments(params[:attachments],User.current)
# Container_type为Principal # Container_type为Principal
Attachment.attach_filesex(@user, params[:attachments], params[:attachment_type]) attach = Attachment.attach_filesex_public(@user, params[:attachments], params[:attachment_type], is_public = true)
if(params[:type].blank? || params[:type] == "1") # 我的资源 if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == 2 if params[:status] == 2
@ -2353,9 +2357,7 @@ class UsersController < ApplicationController
# 获取公共资源 # 获取公共资源
def get_public_resources user_course_ids, user_project_ids def get_public_resources user_course_ids, user_project_ids
attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) "+ attachments = Attachment.where("(is_publish = 1 and is_public =1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("created_on desc")
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("created_on desc")
end end
# 获取我的资源 # 获取我的资源
@ -2372,7 +2374,7 @@ class UsersController < ApplicationController
# 获取公共资源课程 # 获取公共资源课程
def get_course_resources_public user_course_ids def get_course_resources_public user_course_ids
attchments = Attachment.where("(container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc") attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("created_on desc")
end end
# 获取我的项目资源 # 获取我的项目资源
@ -2382,7 +2384,7 @@ class UsersController < ApplicationController
# 获取公共资源的项目资源 # 获取公共资源的项目资源
def get_project_resources_public user_project_ids def get_project_resources_public user_project_ids
attchments = Attachment.where("(container_type = 'Project') or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1) ").order("created_on desc") attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("created_on desc")
end end
# 获取我上传的附件 # 获取我上传的附件
@ -2392,7 +2394,7 @@ class UsersController < ApplicationController
# 获取公共资源中我上传的附件 # 获取公共资源中我上传的附件
def get_attch_resources_public def get_attch_resources_public
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc") attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') and container_id is not null and is_public =1").order("created_on desc")
end end
# 获取我的用户类型资源 # 获取我的用户类型资源
@ -2402,7 +2404,7 @@ class UsersController < ApplicationController
# 获取我的用户类型资源 # 获取我的用户类型资源
def get_principal_resources_public def get_principal_resources_public
attchments = Attachment.where("container_type = 'Principal'").order("created_on desc") attchments = Attachment.where("container_type = 'Principal'and container_id is not null and is_public =1").order("created_on desc")
end end
# 资源库 分为全部 课程资源 项目资源 附件 # 资源库 分为全部 课程资源 项目资源 附件
@ -2634,9 +2636,7 @@ class UsersController < ApplicationController
end end
elsif params[:type] == "6" #全部资源 elsif params[:type] == "6" #全部资源
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = Attachment.where("((is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) "+ @attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)" ,:p => search).order("created_on desc")
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("created_on desc")
end end
@type = params[:type] @type = params[:type]
@limit = 25 @limit = 25

@ -2945,9 +2945,35 @@ end
def user_url_in_org(user_id) def user_url_in_org(user_id)
if Rails.env.development? if Rails.env.development?
return "http://localhost:3000/users/" + user_id.to_s return "http://localhost:3000/users/" + user_id.to_s
else
return "https://" + Setting.host_name + "/users/" + user_id.to_s
end
end
def logout_url_without_domain
if Rails.env.development?
return "http://localhost:3000/logout"
else
return "https://" + Setting.host_name + "/logout"
end
end
def signin_url_without_domain
if Rails.env.development?
return "http://localhost:3000/login?login=true"
elsif Rails.env.test?
return "https://test.forge.trustie.net/login?login=true"
else
return "https://www.trustie.net/login?login=true"
end
end
def register_url_without_domain
if Rails.env.development?
return "http://localhost:3000/login?login=false"
elsif Rails.env.test? elsif Rails.env.test?
return "https://www.test.forge.trustie.net/users/" + user_id.to_s return "https://test.forge.trustie.net/login?login=false"
else else
return "https://www.trustie.net/users/" + user_id.to_s return "https://www.trustie.net/login?login=false"
end end
end end

@ -71,6 +71,11 @@ module CoursesHelper
project.members.count project.members.count
end end
# 统计课程中作品的数量
def student_works_num course
StudentWork.find_by_sql("SELECT * FROM student_works WHERE homework_common_id IN (SELECT id FROM homework_commons WHERE course_id = '#{course.id}')").count
end
# 返回教师数量即roles表中定义的Manager # 返回教师数量即roles表中定义的Manager
def teacherCount project def teacherCount project
project ? project.members.count - studentCount(project).to_i : 0 project ? project.members.count - studentCount(project).to_i : 0

@ -499,6 +499,12 @@ class Attachment < ActiveRecord::Base
result result
end end
def self.attach_filesex_public(obj, attachments,attachment_type, is_public)
result = obj.save_attachmentsex_public(attachments, User.current,attachment_type, is_public)
obj.attach_saved_attachments
result
end
def self.latest_attach(attachments, filename) def self.latest_attach(attachments, filename)
attachments.sort_by(&:created_on).reverse.detect { attachments.sort_by(&:created_on).reverse.detect {
|att| att.filename.downcase == filename.downcase |att| att.filename.downcase == filename.downcase

@ -71,7 +71,8 @@ class CourseActivity < ActiveRecord::Base
name = lead_message.subject name = lead_message.subject
content = lead_message.content content = lead_message.content
# message的status状态为0为正常为1表示创建课程时发送的message # message的status状态为0为正常为1表示创建课程时发送的message
message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) # author_id 默认为课程使者创建
message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => 1 , :sticky => true, :status => true )
# 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直
message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) if message.course_acts.first message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) if message.course_acts.first
end end

@ -1,185 +1,185 @@
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Member < ActiveRecord::Base class Member < ActiveRecord::Base
belongs_to :user belongs_to :user
belongs_to :principal, :foreign_key => 'user_id' belongs_to :principal, :foreign_key => 'user_id'
has_many :member_roles, :dependent => :destroy has_many :member_roles, :dependent => :destroy
has_many :roles, :through => :member_roles has_many :roles, :through => :member_roles
belongs_to :project belongs_to :project
belongs_to :course belongs_to :course
belongs_to :course_group belongs_to :course_group
validates_presence_of :principal validates_presence_of :principal
validates_uniqueness_of :user_id, :scope => [:project_id,:course_id] validates_uniqueness_of :user_id, :scope => [:project_id,:course_id]
validate :validate_role validate :validate_role
before_destroy :set_issue_category_nil before_destroy :set_issue_category_nil
# 删除项目成员一并删除该成员的邀请记录 # 删除项目成员一并删除该成员的邀请记录
after_destroy :delete_ivite_list after_destroy :delete_ivite_list
def role def role
end end
def role= def role=
end end
def name def name
self.user.name self.user.name
end end
alias :base_role_ids= :role_ids= alias :base_role_ids= :role_ids=
def role_ids=(arg) def role_ids=(arg)
ids = (arg || []).collect(&:to_i) - [0] ids = (arg || []).collect(&:to_i) - [0]
# Keep inherited roles # Keep inherited roles
ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id) ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id)
new_role_ids = ids - role_ids new_role_ids = ids - role_ids
# Add new roles # Add new roles
new_role_ids.each {|id| member_roles << MemberRole.new(:role_id => id) } new_role_ids.each {|id| member_roles << MemberRole.new(:role_id => id) }
# Remove roles (Rails' #role_ids= will not trigger MemberRole#on_destroy) # Remove roles (Rails' #role_ids= will not trigger MemberRole#on_destroy)
member_roles_to_destroy = member_roles.select {|mr| !ids.include?(mr.role_id)} member_roles_to_destroy = member_roles.select {|mr| !ids.include?(mr.role_id)}
if member_roles_to_destroy.any? if member_roles_to_destroy.any?
member_roles_to_destroy.each(&:destroy) member_roles_to_destroy.each(&:destroy)
end end
end end
def <=>(member) def <=>(member)
a, b = roles.sort.first, member.roles.sort.first a, b = roles.sort.first, member.roles.sort.first
if a == b if a == b
if principal if principal
principal <=> member.principal principal <=> member.principal
else else
1 1
end end
elsif a elsif a
a <=> b a <=> b
else else
1 1
end end
end end
def deletable? def deletable?
member_roles.detect {|mr| mr.inherited_from}.nil? member_roles.detect {|mr| mr.inherited_from}.nil?
end end
def include?(user) def include?(user)
if principal.is_a?(Group) if principal.is_a?(Group)
!user.nil? && user.groups.include?(principal) !user.nil? && user.groups.include?(principal)
else else
self.user == user self.user == user
end end
end end
def set_issue_category_nil def set_issue_category_nil
if user if user
# remove category based auto assignments for this member # remove category based auto assignments for this member
#modify by nwb #modify by nwb
if project if project
IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id] IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id]
elsif course elsif course
#IssueCategory.update_all "assigned_to_id = NULL", ["course_id = ? AND assigned_to_id = ?", course.id, user.id] #IssueCategory.update_all "assigned_to_id = NULL", ["course_id = ? AND assigned_to_id = ?", course.id, user.id]
end end
end end
end end
# 删除成员一并删除该成员的邀请信息 # 删除成员一并删除该成员的邀请信息
def delete_ivite_list def delete_ivite_list
member_invite_lists = InviteList.where("user_id =? and project_id =?", self.user_id, self.project_id) member_invite_lists = InviteList.where("user_id =? and project_id =?", self.user_id, self.project_id)
unless member_invite_lists.nil? unless member_invite_lists.nil?
member_invite_lists.each do |member_invite_list| member_invite_lists.each do |member_invite_list|
member_invite_list.destroy member_invite_list.destroy
end end
end end
end end
# Find or initilize a Member with an id, attributes, and for a Principal # Find or initilize a Member with an id, attributes, and for a Principal
def self.edit_membership(id, new_attributes, principal=nil) def self.edit_membership(id, new_attributes, principal=nil)
@membership = id.present? ? Member.find(id) : Member.new(:principal => principal) @membership = id.present? ? Member.find(id) : Member.new(:principal => principal)
@membership.attributes = new_attributes @membership.attributes = new_attributes
@membership @membership
end end
# Finds or initilizes a Member for the given project and principal # Finds or initilizes a Member for the given project and principal
def self.find_or_new(project, principal) def self.find_or_new(project, principal)
project_id = project.is_a?(Project) ? project.id : project project_id = project.is_a?(Project) ? project.id : project
principal_id = principal.is_a?(Principal) ? principal.id : principal principal_id = principal.is_a?(Principal) ? principal.id : principal
member = Member.find_by_project_id_and_user_id(project_id, principal_id) member = Member.find_by_project_id_and_user_id(project_id, principal_id)
member ||= Member.new(:project_id => project_id, :user_id => principal_id) member ||= Member.new(:project_id => project_id, :user_id => principal_id)
member member
end end
# 查找每个学生每个作业的评分 # 查找每个学生每个作业的评分
def student_homework_score def student_homework_score
homework_score = StudentWork.find_by_sql("SELECT homework_commons.name,student_works.final_score as score homework_score = StudentWork.find_by_sql("SELECT homework_commons.name,student_works.final_score as score
FROM student_works,homework_commons FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{self.course_id} AND homework_commons.course_id = #{self.course_id}
AND student_works.user_id = #{self.user_id}") AND student_works.user_id = #{self.user_id}")
score_count = StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f score_count = StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
[homework_score, format("%0.2f", score_count)] [homework_score, format("%0.2f", score_count)]
end end
def student_work_score def student_work_score
StudentWork.select("homework_commons.name, student_works.final_score").joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}") StudentWork.select("homework_commons.name, student_works.final_score").joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}")
end end
#当前课程的作业列表 #当前课程的作业列表
def homework_common_list def homework_common_list
HomeworkCommon.where(:course_id => self.course_id) HomeworkCommon.where(:course_id => self.course_id)
end end
#当前学生在指定作业内的得分 #当前学生在指定作业内的得分
def homework_common_score homework_common def homework_common_score homework_common
StudentWork.select("IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as final_score").where(:homework_common_id => homework_common.id,:user_id => self.user_id) StudentWork.select("IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as final_score").where(:homework_common_id => homework_common.id,:user_id => self.user_id)
end end
def student_work_score_avg def student_work_score_avg
StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
end end
def student_work_score_sum def student_work_score_sum
sql_select = "SELECT (SUM(IF(student_works.final_score IS NULL,NULL,IF(student_works.final_score =0,0,student_works.final_score - student_works.absence_penalty - student_works.late_penalty)))) as score sql_select = "SELECT (SUM(IF(student_works.final_score IS NULL,NULL,IF(student_works.final_score =0,0,student_works.final_score - student_works.absence_penalty - student_works.late_penalty)))) as score
FROM student_works,homework_commons FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{self.course_id} AND homework_commons.course_id = #{self.course_id}
AND student_works.user_id = #{self.user_id}" AND student_works.user_id = #{self.user_id}"
score = StudentWork.find_by_sql(sql_select) score = StudentWork.find_by_sql(sql_select)
end end
protected protected
def validate_role def validate_role
errors.add_on_empty :role if member_roles.empty? && roles.empty? errors.add_on_empty :role if member_roles.empty? && roles.empty?
end end
def searchTeacherAndAssistant project def searchTeacherAndAssistant project
#searchPeopleByRoles(project, TeacherRoles) #searchPeopleByRoles(project, TeacherRoles)
members = [] members = []
project.members.each do |m| project.members.each do |m|
members << m if m && m.user && m.user.allowed_to?(:as_teacher,project) members << m if m && m.user && m.user.allowed_to?(:as_teacher,project)
end end
members members
end end
end end

@ -0,0 +1,64 @@
<h3><%=l(:label_course_resource_list)%></h3>
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 60px;">
资源名称
</th>
<th style="width: 30px;">
资源大小
</th>
<th style="width: 25px;">
资源类型
</th>
<th style="width: 23px;">
上传时间
</th>
<th style="width: 15px;">
下载次数
</th>
<th style="width: 20px;">
上传者
</th>
<th style="width: 35px;">
所属课程
</th>
</tr>
</thead>
<tbody>
<% @resource.each do |resource| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: left;">
<%= link_to truncate(resource.filename, :length => 18), download_named_attachment_path(resource.id, resource.filename ), :title => resource.filename,:class=>'resourcesBlack'%>
</td>
<td style=" text-align: center;">
<%= number_to_human_size(resource.filesize)%>
</td>
<td style=" text-align: center;">
课程资源
</td>
<td style=" text-align: center;">
<%= format_date(resource.created_on)%>
</td>
<td style=" text-align: center;">
<%= resource.downloads %>
</td>
<td style=" text-align: center;">
<%= link_to(User.find(resource.author_id).realname, user_path(User.find(resource.author_id)) ) %>
</td>
<td style=" text-align: center;">
<%=link_to truncate(Course.find(resource.container_id).name, :length => 10), course_path(Course.find(resource.container_id)), :title => Course.find(resource.container_id).name, :class => "hidden fl w170" %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>

@ -0,0 +1,75 @@
<h3>
<%=l(:label_excellent_courses_list)%>
</h3>
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 25px;">
序号
</th>
<th style="width: 120px;">
课程名
</th>
<th style="width: 50px;">
主讲老师
</th>
<th style="width: 30px;">
学生数
</th>
<th style="width: 25px;">
作业数
</th>
<th style="width: 25px;">
作品数
</th>
<th style="width: 25px;">
资源数
</th>
<th style="width: 70px;">
帖子数
</th>
<th style="width: 70px;">
动态数
</th>
</tr>
</thead>
<tbody>
<% @courses.each do |course| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center;">
<%= course.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
<span>
<%= link_to(course.name, course_path(course.id)) %>
</span>
</td>
<td align="center">
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
</td>
<td align="center">
<%= studentCount(course) %>
</td>
<td class="center">
<%= course.homework_commons.count%>
</td>
<td class="center">
<%= student_works_num(course) %>
</td>
<td class="center">
<%= visable_attachemnts_incourse(course).count%>
</td>
<td class="center">
<%= course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", course.boards.first.id, nil).count %>
</td>
<td class="center">
<%= course.course_activities.count%>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>

@ -0,0 +1,64 @@
<h3><%=l(:label_project_resource_list)%></h3>
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 60px;">
资源名称
</th>
<th style="width: 30px;">
资源大小
</th>
<th style="width: 25px;">
资源类型
</th>
<th style="width: 23px;">
上传时间
</th>
<th style="width: 15px;">
下载次数
</th>
<th style="width: 20px;">
上传者
</th>
<th style="width: 35px;">
所属项目
</th>
</tr>
</thead>
<tbody>
<% @pro_resource.each do |pro_resource| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: left;">
<%= link_to truncate(pro_resource.filename, :length => 18), download_named_attachment_path(pro_resource.id, pro_resource.filename ), :title => pro_resource.filename,:class=>'resourcesBlack'%>
</td>
<td style=" text-align: center;">
<%= number_to_human_size(pro_resource.filesize)%>
</td>
<td style=" text-align: center;">
项目资源
</td>
<td style=" text-align: center;">
<%= format_date(pro_resource.created_on)%>
</td>
<td style=" text-align: center;">
<%= pro_resource.downloads %>
</td>
<td style=" text-align: center;">
<%= link_to(User.find(pro_resource.author_id).realname, user_path(User.find(pro_resource.author_id)) ) %>
</td>
<td style=" text-align: center;">
<%=link_to truncate(Project.find(pro_resource.container_id).name, :length => 10), project_path(Project.find(pro_resource.container_id)), :title => Project.find(pro_resource.container_id).name, :class => "hidden fl w170" %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>

@ -1,21 +1,21 @@
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>"> <div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="ReplyToMessageInputContainer mb10"> <div class="ReplyToMessageInputContainer mb10">
<div nhname='new_message_<%= reply.id%>'> <div nhname='new_message_<%= reply.id%>'>
<%= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %> <%= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
<input type="hidden" name="quote[quote]" id="quote_quote"> <input type="hidden" name="quote[quote]" id="quote_quote">
<% if course_id%> <% if course_id%>
<input type="hidden" name="course_id" id="" value="<%= course_id%>"> <input type="hidden" name="course_id" id="" value="<%= course_id%>">
<% end %> <% end %>
<input type="hidden" name="blog_comment[title]" id="reply_subject"> <input type="hidden" name="blog_comment[title]" id="reply_subject">
<div nhname='toolbar_container_<%= reply.id%>'></div> <div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a> <a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p> <p nhname='contentmsg_<%= reply.id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -1,6 +1,5 @@
<% if User.current.logged? && User.current.id == @user.id %>
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT', <%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %> :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %> <%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
<% end %> <% end %>
<% end %>

@ -38,7 +38,7 @@
<%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %>
</div> </div>
<div class="postThemeWrap"> <div class="postThemeWrap">
<% if @article.author.id == User.current.id%> <% if @article.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="display: none"> <div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="display: none">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
@ -48,7 +48,7 @@
l(:button_edit), l(:button_edit),
{:action => 'edit', :id => @article.id,:in_act => params[:in_act]}, {:action => 'edit', :id => @article.id,:in_act => params[:in_act]},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %> ) if User.current.admin? || User.current.id == @article.author.id %>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
@ -57,7 +57,7 @@
:method => :delete, :method => :delete,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %> ) if User.current.admin? || User.current.id == @article.author.id %>
</li> </li>
<li> <li>
<% if @article.id == @article.blog.homepage_id %> <% if @article.id == @article.blog.homepage_id %>

@ -1,226 +1,226 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" > <div class="resources mt10" id="user_activity_<%= user_activity_id%>" >
<div class="homepagePostBrief" onmouseover="$('#message_setting_<%=activity.id%>').show();" onmouseout="$('#message_setting_<%= activity.id%>').hide();"> <div class="homepagePostBrief" onmouseover="$('#message_setting_<%=activity.id%>').show();" onmouseout="$('#message_setting_<%= activity.id%>').hide();">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<% if activity.author.id == User.current.id%> <% if activity.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none"> <div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id}, {:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %> ) if User.current.admin? || User.current.id == activity.author.id %>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller => 'blog_comments',:action => 'destroy',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id}, {:controller => 'blog_comments',:action => 'destroy',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
:method => :delete, :method => :delete,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %> ) if User.current.admin? || User.current.id == activity.author.id %>
</li> </li>
<li> <li>
<% if activity.id == activity.blog.homepage_id %> <% if activity.id == activity.blog.homepage_id %>
<%= link_to( <%= link_to(
l(:button_cancel_homepage), l(:button_cancel_homepage),
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id}, {:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post, :method => :post,
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %> ) if User.current && User.current.id == activity.blog.author_id %>
<% else %> <% else %>
<%= link_to( <%= link_to(
l(:button_set_homepage), l(:button_set_homepage),
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id}, {:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post, :method => :post,
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %> ) if User.current && User.current.id == activity.blog.author_id %>
<% end %> <% end %>
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<%end%> <%end%>
<div class="homepagePostTo mt-4 fl"> <div class="homepagePostTo mt-4 fl">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%> <%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%>
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %> <% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
<span class="red_homework_btn_cir ml5">已设为首页</span> <span class="red_homework_btn_cir ml5">已设为首页</span>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostTitle hidden m_w530 fl"> <div class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"--> <% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey" %> <%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey" %>
<% else %> <% else %>
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey"%> <%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey"%>
<% end %> <% end %>
</div> </div>
<% if activity.sticky == 1%> <% if activity.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span> <span class="sticky_btn_cir ml10">置顶</span>
<% end%> <% end%>
<% if activity.locked%> <% if activity.locked%>
<span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发帖时间:<%= format_time(activity.created_on) %> 发帖时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(activity.updated_on) %> 更新时间:<%= format_time(activity.updated_on) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<% content= activity.content%> <% content= activity.content%>
<% else %> <% else %>
<% content= activity.parent.content%> <% content= activity.parent.content%>
<% end %> <% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<div class="cl"></div> <div class="cl"></div>
<!--<div class=" fl" style="width: 600px"> <!--<div class=" fl" style="width: 600px">
<%# if activity.attachments.any?%> <%# if activity.attachments.any?%>
<%# options = {:author => true, :deletable => false } %> <%# options = {:author => true, :deletable => false } %>
<%#= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %> <%#= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
<%# end %> <%# end %>
</div> </div>
<div class="cl"></div>--> <div class="cl"></div>-->
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden"> <div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li> <li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li> <li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li> <li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=0 %> <% count=0 %>
<% if activity.parent %> <% if activity.parent %>
<% count=activity.parent.children.count%> <% count=activity.parent.children.count%>
<% else %> <% else %>
<% count=activity.children.count%> <% count=activity.children.count%>
<% end %> <% end %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div> <div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count > 3 %> <%if count > 3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% activity= activity.parent ? activity.parent : activity%> <% activity= activity.parent ? activity.parent : activity%>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.children.reorder("created_on desc").each do |reply|%> <% activity.children.reorder("created_on desc").each do |reply|%>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');
}); });
</script> </script>
<% replies_all_i=replies_all_i+1 %> <% replies_all_i=replies_all_i+1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:author).try(:realname) == ' ' %> <% if reply.try(:author).try(:realname) == ' ' %>
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %> <% if reply.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= reply.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %> <%= reply.content.html_safe %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<% if !activity.locked? %> <% if !activity.locked? %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller=>'blog_comments',:action => 'reply', :id => activity.id, :blog_id => activity.blog.id, :user_id => activity.author_id},:method => "post",:remote=>true) do |f|%> <%= form_for('new_form',:url => {:controller=>'blog_comments',:action => 'reply', :id => activity.id, :blog_id => activity.blog.id, :user_id => activity.author_id},:method => "post",:remote=>true) do |f|%>
<input type="hidden" name="quote[quote]" value=""> <input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="blog_comment[sticky]" value="0"> <input type="hidden" name="blog_comment[sticky]" value="0">
<input type="hidden" name="blog_comment[locked]" value="0"> <input type="hidden" name="blog_comment[locked]" value="0">
<input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>"> <input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$("#moreProject_<%=user_activity_id %>").click(function(){ $("#moreProject_<%=user_activity_id %>").click(function(){
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap'); $("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#relatePWrap_<%=user_activity_id %>").css("height","auto"); $("#relatePWrap_<%=user_activity_id %>").css("height","auto");
$(this).hide(); $(this).hide();
}); });
$("#hideProject_<%=user_activity_id %>").click(function(){ $("#hideProject_<%=user_activity_id %>").click(function(){
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap'); $("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#moreProject_<%=user_activity_id %>").show(); $("#moreProject_<%=user_activity_id %>").show();
}); });
</script> </script>

@ -1,218 +1,218 @@
<%= content_for(:header_tags) do %> <%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'blog' %> <%= javascript_include_tag 'blog' %>
<% end %> <% end %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#RSide").removeAttr("id"); $("#RSide").removeAttr("id");
$("#Container").css("width","1000px"); $("#Container").css("width","1000px");
}); });
</script> </script>
<script> <script>
function expand_reply(container,btnid){ function expand_reply(container,btnid){
var target = $(container).children(); var target = $(container).children();
var btn = $(btnid); var btn = $(btnid);
if(btn.data('init')=='0'){ if(btn.data('init')=='0'){
btn.data('init',1); btn.data('init',1);
btn.html('收起回复'); btn.html('收起回复');
target.show(); target.show();
}else{ }else{
btn.data('init',0); btn.data('init',0);
btn.html('展开更多'); btn.html('展开更多');
target.hide(); target.hide();
target.eq(0).show(); target.eq(0).show();
target.eq(1).show(); target.eq(1).show();
target.eq(2).show(); target.eq(2).show();
} }
} }
$(function() { $(function() {
//init_activity_KindEditor_data(<%= @article.id%>,null,"87%", "<%=@article.class.to_s%>"); //init_activity_KindEditor_data(<%= @article.id%>,null,"87%", "<%=@article.class.to_s%>");
sd_create_editor_from_data(<%= @article.id%>,null,"100%", "<%=@article.class.to_s%>"); sd_create_editor_from_data(<%= @article.id%>,null,"100%", "<%=@article.class.to_s%>");
showNormalImage('message_description_<%= @article.id %>'); showNormalImage('message_description_<%= @article.id %>');
}); });
</script> </script>
<div class="postRightContainer ml10" > <div class="postRightContainer ml10" >
<div class="postThemeContainer"> <div class="postThemeContainer">
<div class="postDetailPortrait"> <div class="postDetailPortrait">
<%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %>
</div> </div>
<div class="postThemeWrap"> <div class="postThemeWrap">
<% if User.current && @article.author.id == User.current.id%> <% if User.current && @article.author.id == User.current.id%>
<div class="homepagePostSetting" id="message_setting_<%= @article.id%>" > <div class="homepagePostSetting" id="message_setting_<%= @article.id%>" >
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li> <li>
<a class="postOptionLink " onclick="course_outline('<%= @course.id%>','Y')" >重设大纲</a> <a class="postOptionLink " onclick="course_outline('<%= @course.id%>','Y')" >重设大纲</a>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
'取消大纲', '取消大纲',
{:controller => 'blog_comments',:action => 'destroy',:user_id=>BlogComment.find(@course.outline).author_id,:blog_id=>BlogComment.find(@course.outline).blog_id, :id => @course.outline,:course_id=>@course.id}, {:controller => 'blog_comments',:action => 'destroy',:user_id=>BlogComment.find(@course.outline).author_id,:blog_id=>BlogComment.find(@course.outline).blog_id, :id => @course.outline,:course_id=>@course.id},
:method => :delete, :method => :delete,
:data => {:confirm => '您确定要取消么?'}, :data => {:confirm => '您确定要取消么?'},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %> ) if User.current && User.current.id == @article.author.id %>
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<!--<div class="homepagePostSetting" id="message_setting_<%#= @article.id%>" >--> <!--<div class="homepagePostSetting" id="message_setting_<%#= @article.id%>" >-->
<!--<ul>--> <!--<ul>-->
<!--<li class="syllabusSettingIcon" >--> <!--<li class="syllabusSettingIcon" >-->
<!--</li>--> <!--</li>-->
<!--</ul>--> <!--</ul>-->
<!--</div>--> <!--</div>-->
<!--<a class="syllabusSettingIcon fr" style="width: 100px" onclick="course_outline('<%= @course.id%>')" ><span class="f14 fontGrey2" style="padding-left: 20px">[设置大纲]</span>--> <!--<a class="syllabusSettingIcon fr" style="width: 100px" onclick="course_outline('<%= @course.id%>')" ><span class="f14 fontGrey2" style="padding-left: 20px">[设置大纲]</span>-->
<!--</a>--> <!--</a>-->
<%end%> <%end%>
<div class="postDetailTitle fl" style="width: 550px !important;"> <div class="postDetailTitle fl" style="width: 550px !important;">
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @article.title%></a> <a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @article.title%></a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="postDetailCreater"> <div class="postDetailCreater">
<% if @article.try(:author).try(:realname) == ' ' %> <% if @article.try(:author).try(:realname) == ' ' %>
<%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> <%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% else %> <% else %>
<%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> <%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% end %> <% end %>
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @article.content.html_safe%> <%= @article.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class=" fl" style="width: 600px"> <div class=" fl" style="width: 600px">
<%#= link_to_attachments_course @topic, :author => false %> <%#= link_to_attachments_course @topic, :author => false %>
<% if @article.attachments.any?%> <% if @article.attachments.any?%>
<% options = {:author => true, :deletable => false} %> <% options = {:author => true, :deletable => false} %>
<%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => @article.attachments, :options => options, :is_float => true} %> <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => @article.attachments, :options => options, :is_float => true} %>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% count=0 %> <% count=0 %>
<% if @article.parent %> <% if @article.parent %>
<% count=@article.parent.children.count%> <% count=@article.parent.children.count%>
<% else %> <% else %>
<% count=@article.children.count%> <% count=@article.children.count%>
<% end %> <% end %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<% unless count == 0 %> <% unless count == 0 %>
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复(<%=count %></div> <div class="homepagePostReplyBannerCount">回复(<%=count %></div>
<div class="homepagePostReplyBannerTime"></div> <div class="homepagePostReplyBannerTime"></div>
<!-- <div class="homepagePostReplyBannerMore"> <!-- <div class="homepagePostReplyBannerMore">
<%# if @reply_count > 2%> <%# if @reply_count > 2%>
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @topic.id%>" onclick="expand_reply('#reply_div_<%#= @topic.id %>','#reply_btn_<%#= @topic.id%>')" data-count="<%#= @reply_count %>" data-init="0" >点击展开更多回复</a> <a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @topic.id%>" onclick="expand_reply('#reply_div_<%#= @topic.id %>','#reply_btn_<%#= @topic.id%>')" data-count="<%#= @reply_count %>" data-init="0" >点击展开更多回复</a>
<%# end %> <%# end %>
</div>--> </div>-->
</div> </div>
<div class="" id="reply_div_<%= @article.id %>"> <div class="" id="reply_div_<%= @article.id %>">
<%@article.children.reorder('created_on desc').each_with_index do |reply,i| %> <%@article.children.reorder('created_on desc').each_with_index do |reply,i| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_message_description_<%= reply.id %>'); showNormalImage('reply_message_description_<%= reply.id %>');
}); });
</script> </script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();"> <div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"> <div class="homepagePostReplyPublisher">
<% if reply.try(:author).try(:realname) == ' ' %> <% if reply.try(:author).try(:realname) == ' ' %>
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>"> <div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%> <%= reply.content.html_safe%>
</div> </div>
<div style="margin-top: -7px; margin-bottom: 5px"> <div style="margin-top: -7px; margin-bottom: 5px">
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none"> <div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
<%= link_to( <%= link_to(
l(:button_reply), l(:button_reply),
{:controller => 'blog_comments',:action => 'quote',:user_id=>reply.author_id,:blog_id=>reply.blog_id, :id => reply.id,:course_id=>@course.id}, {:controller => 'blog_comments',:action => 'quote',:user_id=>reply.author_id,:blog_id=>reply.blog_id, :id => reply.id,:course_id=>@course.id},
:remote => true, :remote => true,
:method => 'get', :method => 'get',
:class => 'fr newsBlue', :class => 'fr newsBlue',
:title => l(:button_reply)) if !@article.locked? && User.current.logged? %> :title => l(:button_reply)) if !@article.locked? && User.current.logged? %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller => 'blog_comments',:action => 'destroy',:user_id=>reply.author_id,:blog_id=>reply.blog_id, :id => reply.id,:course_id=>@course.id}, {:controller => 'blog_comments',:action => 'destroy',:user_id=>reply.author_id,:blog_id=>reply.blog_id, :id => reply.id,:course_id=>@course.id},
:method => :delete, :method => :delete,
:class => 'fr newsGrey mr10', :class => 'fr newsGrey mr10',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if reply.author.id == User.current.id %> ) if reply.author.id == User.current.id %>
</div> </div>
</div> </div>
<p id="reply_message_<%= reply.id%>"></p> <p id="reply_message_<%= reply.id%>"></p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<% if !@article.locked? && User.current.logged?%> <% if !@article.locked? && User.current.logged?%>
<!--<div class="talkWrapMsg" nhname="about_talk_reply">--> <!--<div class="talkWrapMsg" nhname="about_talk_reply">-->
<!--<em class="talkWrapArrow"></em>--> <!--<em class="talkWrapArrow"></em>-->
<!--<div class="cl"></div>--> <!--<div class="cl"></div>-->
<!--<div class="talkConIpt ml5 mb10" id="reply<%#= @article.id %>">--> <!--<div class="talkConIpt ml5 mb10" id="reply<%#= @article.id %>">-->
<!--<%#= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %>--> <!--<%#= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %>-->
<!--<input type="hidden" name="course_id" value="<%#= @course.id%>">--> <!--<input type="hidden" name="course_id" value="<%#= @course.id%>">-->
<!--<%#= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %>--> <!--<%#= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %>-->
<!--<%#= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'canel_message_replay();', :class => " grey_btn fr c_white mt10 mr5" %>--> <!--<%#= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'canel_message_replay();', :class => " grey_btn fr c_white mt10 mr5" %>-->
<!--<%#= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-right: 5px;" %>--> <!--<%#= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-right: 5px;" %>-->
<!--<%# end %>--> <!--<%# end %>-->
<!--<div class="cl"></div>--> <!--<div class="cl"></div>-->
<!--</div>--> <!--</div>-->
<!--</div>--> <!--</div>-->
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @article.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@article.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @article.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@article.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer" style="margin-top: 8px"> <div class="homepagePostReplyInputContainer" style="margin-top: 8px">
<div nhname='new_message_<%= @article.id%>' style="display:none;"> <div nhname='new_message_<%= @article.id%>' style="display:none;">
<%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%> <%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%>
<input type="hidden" name="course_id" value="<%= @course.id%>"> <input type="hidden" name="course_id" value="<%= @course.id%>">
<input type="hidden" name="blog_comment[title]" value="RE:<%= @article.title%>"> <input type="hidden" name="blog_comment[title]" value="RE:<%= @article.title%>">
<input type="hidden" name="blog_comment[sticky]" value="0"> <input type="hidden" name="blog_comment[sticky]" value="0">
<input type="hidden" name="quote[quote]" value=""> <input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="blog_comment[locked]" value="0"> <input type="hidden" name="blog_comment[locked]" value="0">
<div nhname='toolbar_container_<%= @article.id%>'></div> <div nhname='toolbar_container_<%= @article.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @article.id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @article.id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= @article.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a> <a id="new_message_submit_btn_<%= @article.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= @article.id%>'></p> <p nhname='contentmsg_<%= @article.id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#message_description_<%= @article.id %> p,#message_description_<%= @article.id %> span,#message_description_<%= @article.id %> em").each(function(){ $("#message_description_<%= @article.id %> p,#message_description_<%= @article.id %> span,#message_description_<%= @article.id %> em").each(function(){
var postContent = $(this).html(); var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," "); postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; "); postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;"); postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; "); postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent); $(this).html(postContent);
}); });
}); });
</script> </script>

@ -9,7 +9,7 @@
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTitle break_word mt-4"> <div class="homepagePostTitle break_word mt-4">
<%= link_to file.is_public? ? truncate(file.filename, length: 70) : truncate(file.filename,length: 50, omission: '...'), <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename), download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14 f_l" %> :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14 f_l" %>
<%= file_preview_eye(file, class: 'preview') %> <%= file_preview_eye(file, class: 'preview') %>

@ -25,7 +25,7 @@
<div class="mb5"> <div class="mb5">
<label class="fl c_dark f14" style="margin-top: 4px;">附件描述:</label> <label class="fl c_dark f14" style="margin-top: 4px;">附件描述:</label>
<div class="fl"> <div class="fl">
<input type="text" name="description" placeholder="文件描述" class="fl W120 "> <input type="text" name="description" placeholder="文件描述" class="InputBox fl W160">
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -1,86 +1,86 @@
<ul> <ul>
<% issue.journals.reorder("created_on desc").each do |reply| %> <% issue.journals.reorder("created_on desc").each do |reply| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');
}); });
</script> </script>
<% replies_all_i=replies_all_i + 1 %> <% replies_all_i=replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();" > <li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();" >
<div class="homepagePostReplyPortrait" > <div class="homepagePostReplyPortrait" >
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:user).try(:realname) == ' ' %> <% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%#= format_time(reply.created_on) %> <%#= format_time(reply.created_on) %>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %> <% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %> <% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p> <p><%= string %></p>
<% end %> <% end %>
<% end %> <% end %>
<P><%= reply.notes.html_safe %></P> <P><%= reply.notes.html_safe %></P>
</div> </div>
<div style="margin-top: 7px"> <div style="margin-top: 7px">
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none"> <div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
<%= link_to( <%= link_to(
l(:button_reply), l(:button_reply),
{:controller => 'issues', :action => 'reply', :user_id => reply.user_id, :id => issue.id, :journal_id => reply.id}, {:controller => 'issues', :action => 'reply', :user_id => reply.user_id, :id => issue.id, :journal_id => reply.id},
:remote => true, :remote => true,
:method => 'get', :method => 'get',
:class => 'fr newsBlue', :class => 'fr newsBlue',
:title => l(:button_reply)) if User.current.logged? %> :title => l(:button_reply)) if User.current.logged? %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id}, {:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id},
:method => :get, :method => :get,
:remote=>true, :remote=>true,
:class => 'fr newsGrey mr10', :class => 'fr newsGrey mr10',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if reply.user_id == User.current.id %> ) if reply.user_id == User.current.id %>
</div> </div>
</div> </div>
<p id="reply_message_<%= reply.id%>"></p> <p id="reply_message_<%= reply.id%>"></p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>"> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= @issue.id %>' style="display:none;"> <div nhname='new_message_<%= @issue.id %>' style="display:none;">
<%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f| %> <%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f| %>
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> <%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
<!--<div class="cl"></div>--> <!--<div class="cl"></div>-->
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/> <input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
<div nhname='toolbar_container_<%= @issue.id %>' ></div> <div nhname='toolbar_container_<%= @issue.id %>' ></div>
<div class="cl"></div> <div class="cl"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id %>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id %>' name="notes"></textarea>
<div class="cl"></div> <div class="cl"></div>
<div class="mt5 fl"> <div class="mt5 fl">
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %> <%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
</div> </div>
<span nhname='contentmsg_<%= @issue.id %>' class="fl"></span> <span nhname='contentmsg_<%= @issue.id %>' class="fl"></span>
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" class="blue_n_btn fr mt5" style="display:none;">发送</a> <a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr mt5" style="display:none;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<% end %> <% end %>
</div> </div>
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>--> <!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -1,27 +1,27 @@
<div class="ReplyToMessageContainer borderBottomNone " id="reply_to_message_<%= @issue.id%>"> <div class="ReplyToMessageContainer borderBottomNone " id="reply_to_message_<%= @issue.id%>">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>"> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
</div> </div>
<div class="ReplyToMessageInputContainer mb10"> <div class="ReplyToMessageInputContainer mb10">
<div nhname='new_message_<%= @issue.id%>' style="display:none;"> <div nhname='new_message_<%= @issue.id%>' style="display:none;">
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%>
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> <%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
<!--<div class="cl"></div>--> <!--<div class="cl"></div>-->
<input type="hidden" name="quote" value=""/> <input type="hidden" name="quote" value=""/>
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/> <input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
<div nhname='toolbar_container_<%= @issue.id%>' ></div> <div nhname='toolbar_container_<%= @issue.id%>' ></div>
<div class="cl"></div> <div class="cl"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea>
<div class="cl"></div> <div class="cl"></div>
<span nhname='contentmsg_<%= @issue.id%>' class="fl"></span> <span nhname='contentmsg_<%= @issue.id%>' class="fl"></span>
<a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<% end %> <% end %>
</div> </div>
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>--> <!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

@ -100,7 +100,7 @@
</li> </li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>--> <!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li> <li>
<%= link_to "退出",signout_path,:class => "menuGrey",:method => "post"%> <%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
</li> </li>
</ul> </ul>
</li> </li>

@ -77,10 +77,10 @@
</div> </div>
<div id="loginInButton" class="fr ml20"> <div id="loginInButton" class="fr ml20">
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a> <a href="<%= signin_url_without_domain %>" class="c_white db">登录</a>
</div> </div>
<div id="loginSignButton" class="fr"> <div id="loginSignButton" class="fr">
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a> <a href="<%= register_url_without_domain %>" class="c_white db">注册</a>
</div> </div>
</div> </div>

@ -250,7 +250,7 @@
</div><!--项目标签 end--> </div><!--项目标签 end-->
<!--课程推荐--> <!--课程推荐-->
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %> <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
<div class="fontGrey5 mt10 ml10 mb10">访问计数 100</div> <div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @course.visits.to_i %></div>
</div><!--LSide end--> </div><!--LSide end-->
<div id="RSide" class="fl"> <div id="RSide" class="fl">

@ -46,7 +46,7 @@
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;"> <li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;">
<%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), request.local? ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %> <%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), request.local? ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %>
<%= link_to User.current, (request.local? || request.subdomain.blank?) ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %> <%= link_to User.current, (request.local? || request.subdomain.blank?) ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %>
<%= link_to "退出",(request.local? || request.subdomain.blank?) ? signout_path():"https://www.trustie.net/logout", :class =>"menuGrey", :method => 'post', :rel => "nofollow" %> <%= link_to "退出",logout_url_without_domain, :class =>"menuGrey", :method => 'post', :rel => "nofollow" %>
</li> </li>
<!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>--> <!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>-->
<% else %> <% else %>
@ -132,7 +132,7 @@
<div class="homepageLeftMenuContainer" id="sub_field_left_lists"> <div class="homepageLeftMenuContainer" id="sub_field_left_lists">
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %> <%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
</div> </div>
<div class="fontGrey5 mt10 ml20">访问计数 100</div> <div class="fontGrey5 mt10 ml20">访问计数 <%= @organization.visits.to_i %></div>
</div> </div>
<div class="homepageRight" style="margin-top:<%= (params[:show_homepage].nil? && User.current.logged?) ? '10px':'0px' %>;"> <div class="homepageRight" style="margin-top:<%= (params[:show_homepage].nil? && User.current.logged?) ? '10px':'0px' %>;">
<%= render_flash_messages %> <%= render_flash_messages %>

@ -159,7 +159,7 @@
<div class="cl"></div> <div class="cl"></div>
</div><!--项目标签 end--> </div><!--项目标签 end-->
<div class="fontGrey5 mt10 ml10 mb10">访问计数 100</div> <div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @project.visits.to_i %></div>
</div> </div>
</div> </div>

@ -226,7 +226,7 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
<div class="fontGrey5 mt10 ml20">访问计数 100</div> <div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %></div>
</div> </div>
<div class="homepageRight"> <div class="homepageRight">
<%= yield %> <%= yield %>

@ -61,7 +61,7 @@
<%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div> <%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div> <div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostIntro memo-content" id="message_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content" id="activity_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%> <%= @memo.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -95,8 +95,21 @@
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div> <div class="homepagePostReplyPublisher mt-4"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div> <div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= reply.content.html_safe%></div>
</div> </div>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description__<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
description_show_hide(<%= reply.id %>);
});
</script>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
@ -113,7 +126,7 @@
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<div nhname='toolbar_container_<%= @memo.id%>'></div> <div nhname='toolbar_container_<%= @memo.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id%>' name="memo[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id%>' name="memo[content]"></textarea>
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= @memo.id%>'></p> <p nhname='contentmsg_<%= @memo.id%>'></p>
<% end%> <% end%>
@ -126,7 +139,7 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#message_description_<%= @memo.id %> p,#message_description_<%= @memo.id %> span,#message_description_<%= @memo.id %> em").each(function(){ $("#activity_description_<%= @memo.id %> p,#activity_description__<%= @memo.id %> span,#activity_description_<%= @memo.id %> em").each(function(){
var postContent = $(this).html(); var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," "); postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; "); postContent= postContent.replace(/ {2}/g,"&nbsp; ");
@ -134,5 +147,6 @@
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; "); postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent); $(this).html(postContent);
}); });
description_show_hide(<%= @memo.id %>);
}); });
</script> </script>

@ -34,11 +34,7 @@
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();"> <div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
<div class="postThemeContainer"> <div class="postThemeContainer">
<div class="postDetailPortrait"> <div class="postDetailPortrait">
<% if @topic.status == 1 %> <%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %>
<% else %>
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
<% end %>
</div> </div>
<div class="postThemeWrap"> <div class="postThemeWrap">
<% if User.current.logged? %> <% if User.current.logged? %>
@ -74,16 +70,11 @@
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a> <a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="postDetailCreater"> <div class="postDetailCreater">
<% if @topic.status == 1 %> <% if @topic.try(:author).try(:realname) == ' ' %>
<span class="fontBlue2">确实团队</span> <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% else %> <% else %>
<% if @topic.try(:author).try(:realname) == ' ' %> <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% else %>
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% end %>
<% end %> <% end %>
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>

@ -1,19 +1,19 @@
<div class="ReplyToMessageContainer borderBottomNone" id="reply_to_message_<%= reply.id%>"> <div class="ReplyToMessageContainer borderBottomNone" id="reply_to_message_<%= reply.id%>">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="ReplyToMessageInputContainer mb10"> <div class="ReplyToMessageInputContainer mb10">
<div nhname='new_message_<%= reply.id%>'> <div nhname='new_message_<%= reply.id%>'>
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'new_form'} do |f| %> <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
<input type="hidden" name="quote[quote]" id="quote_quote"> <input type="hidden" name="quote[quote]" id="quote_quote">
<input type="hidden" name="reply[subject]" id="reply_subject"> <input type="hidden" name="reply[subject]" id="reply_subject">
<div nhname='toolbar_container_<%= reply.id%>'></div> <div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p> <p nhname='contentmsg_<%= reply.id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -1,18 +1,18 @@
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>"> <div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="ReplyToMessageInputContainer mb10"> <div class="ReplyToMessageInputContainer mb10">
<div nhname='new_message_<%= reply.id%>'> <div nhname='new_message_<%= reply.id%>'>
<%= form_for @org_comment, :as => :reply, :url => {:controller => 'org_document_comments',:action => 'reply', :id => @org_comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %> <%= form_for @org_comment, :as => :reply, :url => {:controller => 'org_document_comments',:action => 'reply', :id => @org_comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %>
<input type="hidden" name="quote[quote]" id="quote_quote"> <input type="hidden" name="quote[quote]" id="quote_quote">
<input type="hidden" name="org_document_comment[title]" id="reply_subject"> <input type="hidden" name="org_document_comment[title]" id="reply_subject">
<div nhname='toolbar_container_<%= reply.id%>'></div> <div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="org_document_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="org_document_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a> <a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p> <p nhname='contentmsg_<%= reply.id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -356,7 +356,7 @@
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -144,7 +144,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -1,123 +1,123 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if @ctivity.try(:author).try(:realname) == ' ' %> <% if @ctivity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)"--> <% end %> TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %> <%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %> <%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
</div> </div>
<% if activity.sticky == 1%> <% if activity.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span> <span class="sticky_btn_cir ml10">置顶</span>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=activity.comments.count %> <% count=activity.comments.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.comments.reorder("created_on desc").each do |comment| %> <% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= comment.id %>'); showNormalImage('reply_content_<%= comment.id %>');
}); });
</script> </script>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if comment.try(:author).try(:realname) == ' ' %> <% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %> <% if comment.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div> <%= comment.comments.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

@ -1,141 +1,141 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <% end %> TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div> </div>
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>
<span class='<%#= get_issue_priority(activity.priority_id)[0] %>'> <span class='<%#= get_issue_priority(activity.priority_id)[0] %>'>
<%#= get_issue_priority(activity.priority_id)[1] %> <%#= get_issue_priority(activity.priority_id)[1] %>
</span> </span>
</div> </div>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">
<div class="homepagePostAssignTo">指派给&nbsp;&nbsp; <div class="homepagePostAssignTo">指派给&nbsp;&nbsp;
<% unless activity.assigned_to_id.nil? %> <% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname) == ' ' %> <% if activity.try(:assigned_to).try(:realname) == ' ' %>
<%= link_to activity.try(:assigned_to), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:assigned_to), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:assigned_to).try(:realname), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostDeadline fl"> <div class="homepagePostDeadline fl">
发布时间: 发布时间:
<%=format_time(activity.created_on) %> <%=format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count = activity.journals.count %> <% count = activity.journals.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<% if count > 3 %> <% if count > 3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help"> <a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.journals.reorder("created_on desc").each do |reply| %> <% activity.journals.reorder("created_on desc").each do |reply| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');
}); });
</script> </script>
<% replies_all_i=replies_all_i + 1 %> <% replies_all_i=replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:user).try(:realname) == ' ' %> <% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span id="reply_praise_count_<%=reply.id %>">
<% if reply.user == User.current %> <% if reply.user == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %> <% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %> <% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p> <p><%= string %></p>
<% end %> <% end %>
<% end %> <% end %>
<P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P> <P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

@ -1,161 +1,161 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%> <%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%>
</div> </div>
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
%> %>
<% else %> <% else %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
%> %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{activity.class}' and org_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(OrgActivity.where("org_act_type='#{activity.class}' and org_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<% content = activity.content%> <% content = activity.content%>
<% else %> <% else %>
<% content = activity.parent.content%> <% content = activity.parent.content%>
<% end %> <% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
<div class="homepagePostSetting"> <div class="homepagePostSetting">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %> <% if User.current.logged? %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'message')") %></li> <li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'message')") %></li>
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),
{:controller => 'messages', :action => 'edit', :id => activity, :board_id => activity.board_id}, {:controller => 'messages', :action => 'edit', :id => activity, :board_id => activity.board_id},
:class => 'postOptionLink' :class => 'postOptionLink'
) if activity.org_subfield_editable_by?(User.current) %> ) if activity.org_subfield_editable_by?(User.current) %>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => activity, :board_id => activity.board_id}, {:controller => 'messages', :action => 'destroy', :id => activity, :board_id => activity.board_id},
:method => 'post', :method => 'post',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if activity.org_subfield_editable_by?(User.current) %> ) if activity.org_subfield_editable_by?(User.current) %>
</li> </li>
</ul> </ul>
<% end %> <% end %>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count = 0 %> <% count = 0 %>
<% if activity.parent %> <% if activity.parent %>
<% count=activity.parent.children.count%> <% count=activity.parent.children.count%>
<% else %> <% else %>
<% count=activity.children.count%> <% count=activity.children.count%>
<% end %> <% end %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div> <div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<% end %> <% end %>
</div> </div>
<% activity= activity.parent_id.nil? ? activity : activity.parent %> <% activity= activity.parent_id.nil? ? activity : activity.parent %>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.children.reorder("created_on desc").each do |reply| %> <% activity.children.reorder("created_on desc").each do |reply| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');
}); });
</script> </script>
<% replies_all_i=replies_all_i+1 %> <% replies_all_i=replies_all_i+1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:author).try(:realname) == ' ' %> <% if reply.try(:author).try(:realname) == ' ' %>
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %> <% if reply.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %></div> <%= reply.content.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="quote[quote]" value=""> <input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

@ -1,146 +1,146 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id %>"> <div class="resources mt10" id="user_activity_<%= user_activity_id %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)"--> <% end %> TO <!--+"(课程名称)"-->
<%= link_to activity.org_subfield.name.to_s+" | 帖子栏目通知", organization_path(activity.org_subfield.organization, :org_subfield_id => activity.org_subfield.id), :class => "newsBlue ml15" %> <%= link_to activity.org_subfield.name.to_s+" | 帖子栏目通知", organization_path(activity.org_subfield.organization, :org_subfield_id => activity.org_subfield.id), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %> <%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
<div class="homepagePostSetting"> <div class="homepagePostSetting">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %> <% if User.current.logged? %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li> <li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),
{:controller => 'news', :action => 'edit', :id => activity}, {:controller => 'news', :action => 'edit', :id => activity},
:class => 'postOptionLink' :class => 'postOptionLink'
) if activity.author == User.current %> ) if activity.author == User.current %>
</li> </li>
<li> <li>
<%= delete_link( <%= delete_link(
news_path(activity), news_path(activity),
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if activity.author == User.current %> ) if activity.author == User.current %>
</li> </li>
</ul> </ul>
<% end %> <% end %>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=activity.comments.count %> <% count=activity.comments.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%= user_activity_id %>"> <span id="praise_count_<%= user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.comments.reorder("created_on desc").each do |comment| %> <% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= comment.id %>'); showNormalImage('reply_content_<%= comment.id %>');
}); });
</script> </script>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if comment.try(:author).try(:realname) == ' ' %> <% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %> <% if comment.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div> <%= comment.comments.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>)); $(description_show_hide(<%=user_activity_id %>));
</script> </script>

@ -1,136 +1,136 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%> <%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>--> <!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
</div> </div>
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
%> %>
<% else %> <% else %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
%> %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发帖时间:<%= format_time(activity.created_on) %> 发帖时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<% content = activity.content%> <% content = activity.content%>
<% else %> <% else %>
<% content = activity.parent.content%> <% content = activity.parent.content%>
<% end %> <% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count = 0 %> <% count = 0 %>
<% if activity.parent %> <% if activity.parent %>
<% count=activity.parent.children.count%> <% count=activity.parent.children.count%>
<% else %> <% else %>
<% count=activity.children.count%> <% count=activity.children.count%>
<% end %> <% end %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div> <div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div> <div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<% end %> <% end %>
</div> </div>
<% activity= activity.parent_id.nil? ? activity : activity.parent %> <% activity= activity.parent_id.nil? ? activity : activity.parent %>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.children.reorder("created_on desc").each do |reply| %> <% activity.children.reorder("created_on desc").each do |reply| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');
}); });
</script> </script>
<% replies_all_i=replies_all_i+1 %> <% replies_all_i=replies_all_i+1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:author).try(:realname) == ' ' %> <% if reply.try(:author).try(:realname) == ' ' %>
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span id="reply_praise_count_<%=reply.id %>">
<% if reply.author == User.current %> <% if reply.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %></div> <%= reply.content.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="quote[quote]" value=""> <input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

@ -1,152 +1,152 @@
<div class="resources mt10" id="organization_document_<%= document.id %>"> <div class="resources mt10" id="organization_document_<%= document.id %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %> <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo">
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %> <%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
| |
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span> <span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
</div> </div>
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div> <div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %> 发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %> 更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% unless document.content.blank? %> <% unless document.content.blank? %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
</div> </div>
<!-- <%# if defined?(home_id) %> <!-- <%# if defined?(home_id) %>
<div style="float:right;">最后编辑:<%#= User.find() %></div> <div style="float:right;">最后编辑:<%#= User.find() %></div>
<%# end %>--> <%# end %>-->
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %> <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
<div class="homepagePostSetting"> <div class="homepagePostSetting">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li> <li>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %> <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a> <a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
<% end %> <% end %>
</li> </li>
<li> <li>
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %> <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %>
</li> </li>
<li> <li>
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete', <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:remote => true, :class => 'postOptionLink' %> :remote => true, :class => 'postOptionLink' %>
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% end %> <% end %>
</div> </div>
</div> </div>
<% comments_for_doc = document.children.reorder("created_at desc") %> <% comments_for_doc = document.children.reorder("created_at desc") %>
<% count = document.children.count() %> <% count = document.children.count() %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>"> <div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=document.id %>"> <span id="praise_count_<%=document.id %>">
<% if document.creator_id.to_i == User.current.id.to_i %> <% if document.creator_id.to_i == User.current.id.to_i %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "#{get_praise_num(document)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "#{get_praise_num(document)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<% if count > 3 %> <% if count > 3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help"> <a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>"> <div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
<ul> <ul>
<% reply_id = 0 %> <% reply_id = 0 %>
<% comments_for_doc.each do |comment| %> <% comments_for_doc.each do |comment| %>
<% reply_id += 1 %> <% reply_id += 1 %>
<li style="display:<%= reply_id > 3 ? 'none' : '' %>"> <li style="display:<%= reply_id > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div> <div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"> <div class="homepagePostReplyPublisher">
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %> <%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.creator_id.to_i == User.current.id.to_i %> <% if comment.creator_id.to_i == User.current.id.to_i %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<% unless comment.content.blank? %> <% unless comment.content.blank? %>
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div> <div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>"> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current) %> <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current) %>
</div> </div>
<div class="homepagePostReplyInputContainer"> <div class="homepagePostReplyInputContainer">
<div nhname='new_message_<%= act.id %>' style="display:none;"> <div nhname='new_message_<%= act.id %>' style="display:none;">
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/> <input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div> <div nhname='toolbar_container_<%= act.id %>'></div>
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea> <textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a> <a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p> <p nhname='contentmsg_<%= act.id %>'></p>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function expand_reply(container, btnid) { function expand_reply(container, btnid) {
var target = $(container); var target = $(container);
var btn = $(btnid); var btn = $(btnid);
if (btn.data('init') == '0') { if (btn.data('init') == '0') {
btn.data('init', 1); btn.data('init', 1);
btn.html('收起回复'); btn.html('收起回复');
target.show(); target.show();
} else { } else {
btn.data('init', 0); btn.data('init', 0);
btn.html('展开更多'); btn.html('展开更多');
target.hide(); target.hide();
target.eq(0).show(); target.eq(0).show();
target.eq(1).show(); target.eq(1).show();
target.eq(2).show(); target.eq(2).show();
} }
} }
</script> </script>

@ -1,123 +1,123 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id %>"> <div class="resources mt10" id="user_activity_<%= user_activity_id %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <% end %> TO
<%= link_to activity.project.name.to_s+" | 项目新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %> <%= link_to activity.project.name.to_s+" | 项目新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %> <%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
</div> </div>
<% if activity.sticky == 1%> <% if activity.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span> <span class="sticky_btn_cir ml10">置顶</span>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=activity.comments.count %> <% count=activity.comments.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.comments.reorder("created_on desc").each do |comment| %> <% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= comment.id %>'); showNormalImage('reply_content_<%= comment.id %>');
}); });
</script> </script>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if comment.try(:author).try(:realname) == ' ' %> <% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %> <% if comment.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div> <%= comment.comments.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

@ -1,81 +1,81 @@
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %> <%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<div class="project_r_h"> <div class="project_r_h">
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div> <div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
</div> </div>
<div class="repository_con" style="line-height:1.9;"> <div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %> <% if @entries.nil? %>
<%# 未提交代码提示 %> <%# 未提交代码提示 %>
<div class=" repository-url light-well"> <div class=" repository-url light-well">
<% if @entries.nil? && authorize_for('repositories', 'browse') %> <% if @entries.nil? && authorize_for('repositories', 'browse') %>
<div class="page-title"> <div class="page-title">
该版本库还没有上传代码! 该版本库还没有上传代码!
</div> </div>
<% end %> <% end %>
<% if @repository.type.to_s=="Repository::Gitlab" %> <% if @repository.type.to_s=="Repository::Gitlab" %>
版本库地址:<%= @repos_url %> 版本库地址:<%= @repos_url %>
<% else %> <% else %>
版本库地址:<%= h @repository.url %> 版本库地址:<%= h @repository.url %>
<% end %> <% end %>
<!-- added by bai --> <!-- added by bai -->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% else %> <% else %>
<%= render :partial => 'navigation' %> <%= render :partial => 'navigation' %>
<div class="fl c_grey02 mt5 mr5">克隆网址:</div> <div class="fl c_grey02 mt5 mr5">克隆网址:</div>
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea> <textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a> <a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
<div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div> <div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div>
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %> <%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
<% if User.current.id != @project.user_id %> <% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %> <div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span> <span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div> </div>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div class="recordBanner mt10"> <div class="recordBanner mt10">
<% if @changesets && !@changesets.empty? %> <% if @changesets && !@changesets.empty? %>
<% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %> <% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %>
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> <%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div> <span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div> <div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div> <div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span> </span>
<% else %> <% else %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=@changesets_latest_coimmit.author_email %></div> <span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=@changesets_latest_coimmit.author_email %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div> <div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div> <div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span> </span>
<%end%> <%end%>
<% end %> <% end %>
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2"> <span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2">
<%= @repository.branches.count %></font> 个分支 <%= @repository.branches.count %></font> 个分支
</span> </span>
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit"> <span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font> 提交 <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font> 提交
</span> </span>
</div> </div>
<% end %> <% end %>
<!--contextual end--> <!--contextual end-->
<% if !@entries.nil? && authorize_for('repositories', 'browse') %> <% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%# 数据统计 %> <%# 数据统计 %>
<%#= render :partial => 'summary' %> <%#= render :partial => 'summary' %>
<%# end %> <%# end %>
<%= render :partial => 'dir_list' %> <%= render :partial => 'dir_list' %>
<% end %> <% end %>
<%#= render_properties(@properties) %> <%#= render_properties(@properties) %>
<!-- 代码修订 --> <!-- 代码修订 -->
<%#= render_properties(@properties) %> <%#= render_properties(@properties) %>
<a href="https://<%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a> <a href="https://<%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
</div> </div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %> <%= stylesheet_link_tag "scm" %>
<% end %> <% end %>
<% html_title(l(:label_repository)) -%> <% html_title(l(:label_repository)) -%>

@ -1,102 +1,102 @@
<!-- 匿评作品列表,显示某一个作品的信息 --> <!-- 匿评作品列表,显示某一个作品的信息 -->
<ul class="hworkListRow" id="student_work_<%= student_work.id%>"> <ul class="hworkListRow" id="student_work_<%= student_work.id%>">
<li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>"> <li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
<ul> <ul>
<li class="hworkPortrait mt15 mr10"> <li class="hworkPortrait mt15 mr10">
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40"),user_activities_path(student_work.user)) %> <%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40"),user_activities_path(student_work.user)) %>
</li> </li>
<div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;" class="student_work_<%= student_work.id%>"> <div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;" class="student_work_<%= student_work.id%>">
<li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>"> <li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<div> <div>
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
</div> </div>
</li> </li>
<li> <li>
<% if @homework.homework_type != 3 %> <% if @homework.homework_type != 3 %>
<ul class="mt10 fl"> <ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="<%= student_work.user.show_name%>"> <li class="hworkStName mr10 mt16" title="<%= student_work.user.show_name%>">
<%= student_work.user.show_name%> <%= student_work.user.show_name%>
</li> </li>
<li class="hworkStID mt16" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>"> <li class="hworkStID mt16" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>">
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</li> </li>
</ul> </ul>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<ul class="mt10 fl"> <ul class="mt10 fl">
<li class="hworkPrName mr10 mt12" title="项目名称"> <li class="hworkPrName mr10 mt12" title="项目名称">
<%= student_work.project.name %> <%= student_work.project.name %>
</li> </li>
</ul> </ul>
<% end %> <% end %>
</li> </li>
</div> </div>
</ul> </ul>
</li> </li>
<li class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;"> <li class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<% if student_work.created_at && @homework.end_time%> <% if student_work.created_at && @homework.end_time%>
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp; <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span> <span class="c_red">[迟交]</span>
<% end %> <% end %>
<% end %> <% end %>
</li> </li>
<li class="hworkList50 <%= score_color student_work.teacher_score%>"> <li class="hworkList50 <%= score_color student_work.teacher_score%>">
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
</li> </li>
<li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>"> <li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
</li> </li>
<% if @homework.homework_type == 2%> <% if @homework.homework_type == 2%>
<!-- 系统评分 --> <!-- 系统评分 -->
<li class="hworkList50 <%= score_color student_work.system_score%>"> <li class="hworkList50 <%= score_color student_work.system_score%>">
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%> <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
</li> </li>
<% end%> <% end%>
<% if @homework.anonymous_comment == 0%> <% if @homework.anonymous_comment == 0%>
<li class="hworkList50 <%= score_color student_work.student_score%> student_score_info"> <li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
<%= student_work.student_score.nil? ? "未参与" : format("%.1f",student_work.student_score)%> <%= student_work.student_score.nil? ? "未参与" : format("%.1f",student_work.student_score)%>
<% unless student_work.student_score.nil?%> <% unless student_work.student_score.nil?%>
<span class="linkBlue"> <span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>) (<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
</span> </span>
<div class="infoNi none"> <div class="infoNi none">
现共有 现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>&nbsp;</span> <span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>&nbsp;</span>
名学生进行了匿评,平均分为 名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f",student_work.student_score)%>&nbsp;</span>分。 <span class="c_red">&nbsp;<%= format("%.1f",student_work.student_score)%>&nbsp;</span>分。
</div> </div>
<% end%> <% end%>
</li> </li>
<% end %> <% end %>
<!-- 成绩 --> <!-- 成绩 -->
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%> <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
<li class="hworkList50 <%= score_color score%> student_final_scor_info"> <li class="hworkList50 <%= score_color score%> student_final_scor_info">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%> <% unless score.nil?%>
<div class="infoNi none width180"> <div class="infoNi none width180">
作品最终评分为 作品最终评分为
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。 <span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。
迟交扣分 迟交扣分
<span class="c_red">&nbsp;<%= student_work.late_penalty%>&nbsp;</span>分, <span class="c_red">&nbsp;<%= student_work.late_penalty%>&nbsp;</span>分,
缺评扣分 缺评扣分
<span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分, <span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分,
最终成绩为 最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。 <span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div> </div>
<% end%> <% end%>
</li> </li>
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li> <li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
</ul> </ul>
<script type="text/javascript"> <script type="text/javascript">
$(".student_work_<%= student_work.id%>").mouseenter(function(){ $(".student_work_<%= student_work.id%>").mouseenter(function(){
if($("#about_hwork_<%= student_work.id%>").html().trim() == "") { if($("#about_hwork_<%= student_work.id%>").html().trim() == "") {
$("#work_click_<%= student_work.id%>").show(); $("#work_click_<%= student_work.id%>").show();
} }
}).mouseleave(function(){ }).mouseleave(function(){
$("#work_click_<%= student_work.id%>").hide(); $("#work_click_<%= student_work.id%>").hide();
}).mouse; }).mouse;
</script> </script>

@ -356,7 +356,7 @@
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -1,110 +1,110 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:user).try(:realname) == ' ' %> <% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %>
<% end %> TO <% end %> TO
<% course=Course.find(activity.jour_id) %> <% course=Course.find(activity.jour_id) %>
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %> <%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word list_style upload_img"> <div class="homepagePostTitle break_word list_style upload_img">
<% if activity.parent %> <% if activity.parent %>
<%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% else %> <% else %>
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %> 留言时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count = fetch_user_leaveWord_reply(activity).count %> <% count = fetch_user_leaveWord_reply(activity).count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div> <div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>"> <div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount"> <div class="homepagePostReplyBannerCount">
回复(<%= count %> 回复(<%= count %>
</div> </div>
<div class="homepagePostReplyBannerTime"></div> <div class="homepagePostReplyBannerTime"></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% fetch_user_leaveWord_reply(activity).each do |comment| unless fetch_user_leaveWord_reply(activity).nil? %> <% fetch_user_leaveWord_reply(activity).each do |comment| unless fetch_user_leaveWord_reply(activity).nil? %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= comment.id %>'); showNormalImage('reply_content_<%= comment.id %>');
}); });
</script> </script>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"> <div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %> <% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %> <%= comment.notes.html_safe %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id}, :method => "post", :remote => true) do |f|%> <%= 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_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_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 'reference_message_id', params[:reference_message_id], :value => activity.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %> <%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

@ -1,23 +1,15 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<% if activity.status == 1 %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
<% else %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
<% end %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.status == 1 %> <% if activity.try(:author).try(:realname) == ' ' %>
<span class="fontBlue2">确实团队</span> <%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %> <% else %>
<% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% end %>
<% end %> <% end %>
TO TO
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%> <%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
@ -178,7 +170,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -1,148 +1,148 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if @ctivity.try(:author).try(:realname) == ' ' %> <% if @ctivity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)"--> <% end %> TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %> <%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %> <%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
</div> </div>
<% if activity.sticky == 1%> <% if activity.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span> <span class="sticky_btn_cir ml10">置顶</span>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
<div class="homepagePostSetting"> <div class="homepagePostSetting">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %> <% if User.current.logged? %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li> <li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),
{controller:'news', :action => 'edit', :id => activity.id}, {controller:'news', :action => 'edit', :id => activity.id},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current.allowed_to?(:manage_news, activity.course) %> ) if User.current.allowed_to?(:manage_news, activity.course) %>
</li> </li>
<li> <li>
<%= delete_link( <%= delete_link(
news_path(activity), news_path(activity),
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current.allowed_to?(:manage_news, activity.course) %> ) if User.current.allowed_to?(:manage_news, activity.course) %>
</li> </li>
</ul> </ul>
<% end %> <% end %>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=activity.comments.count %> <% count=activity.comments.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.comments.reorder("created_on desc").each do |comment| %> <% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= comment.id %>'); showNormalImage('reply_content_<%= comment.id %>');
}); });
</script> </script>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if comment.try(:author).try(:realname) == ' ' %> <% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %> <% if comment.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div> <%= comment.comments.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

@ -1,89 +1,89 @@
<% count = activity.journals.count %> <% count = activity.journals.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<% if count > 3 %> <% if count > 3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help"> <a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.journals.reorder("created_on desc").each do |reply| %> <% activity.journals.reorder("created_on desc").each do |reply| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');
}); });
</script> </script>
<% replies_all_i=replies_all_i + 1 %> <% replies_all_i=replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:user).try(:realname) == ' ' %> <% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span id="reply_praise_count_<%=reply.id %>">
<% if reply.user == User.current %> <% if reply.user == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %> <% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %> <% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p> <p><%= string %></p>
<% end %> <% end %>
<% end %> <% end %>
<P><%= reply.notes.html_safe %></P> <P><%= reply.notes.html_safe %></P>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id %>' style="display:none;"> <div nhname='new_message_<%= user_activity_id %>' style="display:none;">
<%= form_for('new_form',:url => add_journal_issue_path(activity.id, :user_activity_id => user_activity_id),:method => "post", :remote => true) do |f| %> <%= form_for('new_form',:url => add_journal_issue_path(activity.id, :user_activity_id => user_activity_id),:method => "post", :remote => true) do |f| %>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

@ -154,7 +154,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -132,7 +132,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -1,6 +1,6 @@
<div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>"> <div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>">
<div class="userAvatarWrap fl"> <div class="userAvatarWrap fl">
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user), :alt => "用户头像", :target => '_blank' %> <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user.id), :alt => "用户头像", :target => '_blank' %>
<%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %> <%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %>
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />--> <!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />-->
</div> </div>

@ -1,33 +1,33 @@
<% if AtMessage === ma && ma.at_valid? %> <% if AtMessage === ma && ma.at_valid? %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %></a></li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher"><%= ma.author.login %></span><span class="homepageNewsType fl">提到了你:</span> <span class="newsBlue homepageNewsPublisher"><%= ma.author.login %></span><span class="homepageNewsType fl">提到了你:</span>
</li> </li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %> <% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
<%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course, <%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course,
:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id),
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}",
:onmouseover =>"message_titile_show($(this),event)", :onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %> :onmouseout => "message_titile_hide($(this))" %>
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %> <% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
<%= link_to ma.subject.html_safe, project_boards_path(ma.at_message.project, <%= link_to ma.subject.html_safe, project_boards_path(ma.at_message.project,
:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id),
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}",
:onmouseover =>"message_titile_show($(this),event)", :onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %> :onmouseout => "message_titile_hide($(this))" %>
<% else %> <% else %>
<%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> <%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %>
<% end %> <% end %>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>标题:</strong><%= ma.subject %></p> <p><strong>标题:</strong><%= ma.subject %></p>
<% unless ma.description.nil? %> <% unless ma.description.nil? %>
<div class="fl"><strong>内容:</strong></div> <div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.description.html_safe %></div> <div class="ml36"><%= ma.description.html_safe %></div>
<% end %> <% end %>
</div> </div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>

@ -1,147 +1,147 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if @ctivity.try(:author).try(:realname) == ' ' %> <% if @ctivity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)"--> <% end %> TO <!--+"(课程名称)"-->
<%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author_id), :class => "newsBlue ml15" %> <%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author_id), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word"> <!--+"(通知标题)"-->
<div class="fl"> <div class="fl">
<%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %> <%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %>
</div> </div>
<% if activity.sticky == 1%> <% if activity.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span> <span class="sticky_btn_cir ml10">置顶</span>
<% end%> <% end%>
<% if activity.locked%> <% if activity.locked%>
<span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(UserActivity.where("act_type='#{activity.class}' and act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(UserActivity.where("act_type='#{activity.class}' and act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.content} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=activity.children.count %> <% count=activity.children.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.children.reorder("created_on desc").each do |comment| %> <% activity.children.reorder("created_on desc").each do |comment| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= comment.id %>'); showNormalImage('reply_content_<%= comment.id %>');
}); });
</script> </script>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if comment.try(:author).try(:realname) == ' ' %> <% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %> <% if comment.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.content.html_safe %></div> <%= comment.content.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<% if activity.locked == false && User.current.logged?%> <% if activity.locked == false && User.current.logged?%>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="quote[quote]" value=""> <input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="in_user_center" value="true"> <input type="hidden" name="in_user_center" value="true">
<input type="hidden" name="blog_comment[sticky]" value="0"> <input type="hidden" name="blog_comment[sticky]" value="0">
<input type="hidden" name="blog_comment[locked]" value="0"> <input type="hidden" name="blog_comment[locked]" value="0">
<input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>"> <input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$("#moreProject_<%=user_activity_id %>").click(function(){ $("#moreProject_<%=user_activity_id %>").click(function(){
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap'); $("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#relatePWrap_<%=user_activity_id %>").css("height","auto"); $("#relatePWrap_<%=user_activity_id %>").css("height","auto");
$(this).hide(); $(this).hide();
}); });
$("#hideProject_<%=user_activity_id %>").click(function(){ $("#hideProject_<%=user_activity_id %>").click(function(){
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap'); $("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#moreProject_<%=user_activity_id %>").show(); $("#moreProject_<%=user_activity_id %>").show();
}); });
</script> </script>

@ -360,7 +360,7 @@
<%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %> <%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
<div nhname='toolbar_container_<%= homework_common.id%>'></div> <div nhname='toolbar_container_<%= homework_common.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea>
<a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= homework_common.id%>'></p> <p nhname='contentmsg_<%= homework_common.id%>'></p>
<% end%> <% end%>

@ -1,152 +1,152 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %>
TO TO
<% if activity.jour %> <% if activity.jour %>
<%= link_to activity.jour.show_name+""+(activity.jour.login ? activity.jour.login : activity.jour.show_name ).to_s+")的"+ (activity.private == 1? "私信":"留言"), <%= link_to activity.jour.show_name+""+(activity.jour.login ? activity.jour.login : activity.jour.show_name ).to_s+")的"+ (activity.private == 1? "私信":"留言"),
feedback_path(activity.jour, :host=> Setting.host_user), :class => "newsBlue ml15" %> feedback_path(activity.jour, :host=> Setting.host_user), :class => "newsBlue ml15" %>
<% if activity.private == 1 %> <% if activity.private == 1 %>
<span class="PMTag ml15 f12">私信</span> <span class="PMTag ml15 f12">私信</span>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% if is_activity.to_i == 1 %> <% if is_activity.to_i == 1 %>
<div class="homepagePostTitle break_word list_style upload_img"> <div class="homepagePostTitle break_word list_style upload_img">
<% if activity.parent %> <% if activity.parent %>
<%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> <%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% else %> <% else %>
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> <%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% end %> <% end %>
</div> </div>
<% else %> <% else %>
<% if activity.parent %> <% if activity.parent %>
<% content = activity.parent.notes %> <% content = activity.parent.notes %>
<% else %> <% else %>
<% content = activity.notes %> <% content = activity.notes %>
<% end %> <% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<% end %> <% end %>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %> 留言时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(PrincipalActivity.where("principal_act_type='#{activity.class}' and principal_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(PrincipalActivity.where("principal_act_type='#{activity.class}' and principal_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if activity.user == User.current || User.current.admin?%> <% if activity.user == User.current || User.current.admin?%>
<div class="homepagePostSetting"> <div class="homepagePostSetting">
<ul> <ul>
<li class="<%= activity.private == 1 ? 'whiteSettingIcon' : 'homepagePostSettingIcon' %>"> <li class="<%= activity.private == 1 ? 'whiteSettingIcon' : 'homepagePostSettingIcon' %>">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li> <li>
<%= link_to(l(:label_bid_respond_delete), <%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user,:user_activity_id => user_activity_id,:is_activity=>is_activity}, {:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user,:user_activity_id => user_activity_id,:is_activity=>is_activity},
:confirm => l(:text_are_you_sure), :method => 'delete', :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "postOptionLink", :title => l(:button_delete)) %> :class => "postOptionLink", :title => l(:button_delete)) %>
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=fetch_user_leaveWord_reply(activity).count %> <% count=fetch_user_leaveWord_reply(activity).count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.user == User.current %> <% if activity.user == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"></div> <div class="homepagePostReplyBannerTime"></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% fetch_user_leaveWord_reply(activity).reorder("created_on desc").each do |comment| %> <% fetch_user_leaveWord_reply(activity).reorder("created_on desc").each do |comment| %>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_delete_<%= comment.id%>').show();" onmouseout="$('#message_delete_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_delete_<%= comment.id%>').show();" onmouseout="$('#message_delete_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"> <div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %> <% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.user == User.current %> <% if comment.user == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
<div id="message_delete_<%=comment.id %>" style="display: none" class="mr10 fr"> <div id="message_delete_<%=comment.id %>" style="display: none" class="mr10 fr">
<% if comment.user == User.current|| User.current.admin? %> <% if comment.user == User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), <%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id,:is_activity=>is_activity}, {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id,:is_activity=>is_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= user_activity_id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= user_activity_id %>">
<%= comment.notes.html_safe %> <%= comment.notes.html_safe %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%> <%= 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_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_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 'reference_message_id', params[:reference_message_id], :value => activity.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %> <%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
<%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %> <%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

File diff suppressed because it is too large Load Diff

@ -1,30 +1,30 @@
<% if ma.class == UserFeedbackMessage %> <% if ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %> <% if ma.journals_for_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %> <%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl">
<%= link_to ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)", :onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></a> :onmouseout => "message_titile_hide($(this))" %>
</li> </li>
<div style="display: none" class="message_title_red system_message_style" > <div style="display: none" class="message_title_red system_message_style" >
<% if ma.journals_for_message.reply_id == 0 %> <% if ma.journals_for_message.reply_id == 0 %>
<%= ma.journals_for_message.notes.html_safe %> <%= ma.journals_for_message.notes.html_safe %>
<% else %> <% else %>
<div class="fl"><strong>您的留言:</strong></div> <div class="fl"><strong>您的留言:</strong></div>
<div class="ml60"><%= JournalsForMessage.find(ma.journals_for_message.m_reply_id).notes.html_safe %></div> <div class="ml60"><%= JournalsForMessage.find(ma.journals_for_message.m_reply_id).notes.html_safe %></div>
<div class="fl"><strong>回复内容:</strong></div> <div class="fl"><strong>回复内容:</strong></div>
<div class="ml60"><%= ma.journals_for_message.notes.html_safe %></div> <div class="ml60"><%= ma.journals_for_message.notes.html_safe %></div>
<% end %> <% end %>
</div> </div>
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>

@ -21,6 +21,6 @@
</ul> </ul>
<% end %> <% end %>
<div class="pageRoll"> <div class="pageRoll">
<%= paginate attachments,:params => {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%> <!%= paginate attachments,:params => {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%>
</div> </div>
<% end %> <% end %>

@ -1520,6 +1520,9 @@ en:
label_submit_comments: Submit_comments label_submit_comments: Submit_comments
label_course_empty_select: You have not selected course label_course_empty_select: You have not selected course
label_enterprise_page_made: enterprise_page label_enterprise_page_made: enterprise_page
label_excellent_courses_list: excellent_courses
label_course_resource_list: course_resource_list
label_project_resource_list: project_resource_list
#api #api
label_recently_updated_notification: Recently updated notification label_recently_updated_notification: Recently updated notification

@ -483,6 +483,9 @@ zh:
label_requirement: 需求 label_requirement: 需求
label_new_course: 课程列表 label_new_course: 课程列表
label_course_all: 课程列表 label_course_all: 课程列表
label_excellent_courses_list: 精品课程列表
label_course_resource_list: 课程资源列表
label_project_resource_list: 項目资源列表
label_teacher_all: 所有教师 label_teacher_all: 所有教师
label_requirement_enterprise_list: 众包列表 label_requirement_enterprise_list: 众包列表
label_new_homework: 作业 label_new_homework: 作业

@ -939,6 +939,9 @@ RedmineApp::Application.routes.draw do
match 'admin', :to => 'admin#index', :via => :get match 'admin', :to => 'admin#index', :via => :get
match 'admin/projects', :via => :get match 'admin/projects', :via => :get
get 'admin/courses' get 'admin/courses'
get 'admin/excellent_courses'
get 'admin/course_resource_list'
get 'admin/project_resource_list'
match 'admin/users', :via => :get match 'admin/users', :via => :get
match 'admin/messages', :via => :get match 'admin/messages', :via => :get
match 'admin/first_page_made', as: :first_page_made match 'admin/first_page_made', as: :first_page_made

@ -1,18 +1,18 @@
class UpdateHomeworkCommonUpdatedAt < ActiveRecord::Migration class UpdateHomeworkCommonUpdatedAt < ActiveRecord::Migration
def up def up
count = HomeworkCommon.all.count / 30 + 2 count = HomeworkCommon.all.count / 30 + 2
transaction do transaction do
for i in 1 ... count do i for i in 1 ... count do i
HomeworkCommon.page(i).per(30).each do |hw| HomeworkCommon.page(i).per(30).each do |hw|
ca = CourseActivity.where("course_act_type = 'HomeworkCommon' and course_act_id = #{hw.id}").first ca = CourseActivity.where("course_act_type = 'HomeworkCommon' and course_act_id = #{hw.id}").first
unless ca.nil? unless ca.nil?
hw.update_attributes(:updated_at => ca.updated_at) hw.update_attributes(:updated_at => ca.updated_at)
end end
end end
end end
end end
end end
def down def down
end end
end end

@ -1,50 +1,50 @@
class UpdateContributorAfterDelete < ActiveRecord::Migration class UpdateContributorAfterDelete < ActiveRecord::Migration
def up def up
Course.all.each do |course| Course.all.each do |course|
if course.course_activities.count > 1 if course.course_activities.count > 1
course.members.each do |s| course.members.each do |s|
puts course.id puts course.id
puts course.name puts course.name
puts s.user_id puts s.user_id
# board_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?",s.student_id, course.id, "Message").count * 2 # board_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?",s.student_id, course.id, "Message").count * 2
# 发帖数 # 发帖数
board_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.user_id} and me.parent_id is null;").count board_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.user_id} and me.parent_id is null;").count
# 回帖数 # 回帖数
message_reply_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.user_id} and me.parent_id is not null").count * 1 message_reply_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.user_id} and me.parent_id is not null").count * 1
# 新闻回复 # 新闻回复
common_reply_count = Comment.find_by_sql("select cm.* from comments cm, news n where cm.author_id = #{s.user_id} and n.course_id = #{course.id} and cm.commented_id = n.id and cm.commented_type ='News'").count * 1 common_reply_count = Comment.find_by_sql("select cm.* from comments cm, news n where cm.author_id = #{s.user_id} and n.course_id = #{course.id} and cm.commented_id = n.id and cm.commented_type ='News'").count * 1
# 通知 # 通知
common_count = News.find_by_sql("select n.* from news n where n.author_id = #{s.user_id} and n.course_id = #{course.id} ").count * 1 common_count = News.find_by_sql("select n.* from news n where n.author_id = #{s.user_id} and n.course_id = #{course.id} ").count * 1
# attachment_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "Attachment").count * 5 # attachment_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "Attachment").count * 5
# 附件数 # 附件数
attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.user_id} and container_type ='Course'").count attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.user_id} and container_type ='Course'").count
# 课程留言数 # 课程留言数
journal_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ", s.user_id, course.id, "Course").count * 1 journal_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ", s.user_id, course.id, "Course").count * 1
# 作业留言 # 作业留言
journal_homework_count = JournalsForMessage.find_by_sql("SELECT jfm.* FROM `journals_for_messages` jfm, homework_commons hc where hc.id = jfm.jour_id and hc.course_id =#{course.id} and jfm.user_id =#{s.user_id} and jfm.jour_type ='HomeworkCommon';").count * 1 journal_homework_count = JournalsForMessage.find_by_sql("SELECT jfm.* FROM `journals_for_messages` jfm, homework_commons hc where hc.id = jfm.jour_id and hc.course_id =#{course.id} and jfm.user_id =#{s.user_id} and jfm.jour_type ='HomeworkCommon';").count * 1
# journal_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "JournalsForMessage").count * 1 # journal_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "JournalsForMessage").count * 1
# journal_reply_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? and status =?", s.student_id, course.id, "Course",1).count * 1 # journal_reply_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? and status =?", s.student_id, course.id, "Course",1).count * 1
total = board_count + message_reply_count + common_reply_count + attachment_count + journal_count total = board_count + message_reply_count + common_reply_count + attachment_count + journal_count
course_contributor = CourseContributorScore.where("course_id =? and user_id =?", course.id, s.user_id).first course_contributor = CourseContributorScore.where("course_id =? and user_id =?", course.id, s.user_id).first
if course_contributor.nil? if course_contributor.nil?
CourseContributorScore.create(:course_id => course.id, :user_id => s.user_id, :message_num => board_count, :message_reply_num => message_reply_count, CourseContributorScore.create(:course_id => course.id, :user_id => s.user_id, :message_num => board_count, :message_reply_num => message_reply_count,
:news_reply_num => common_reply_count, :news_num => common_count, :resource_num => attachment_count, :journal_num => journal_count, :news_reply_num => common_reply_count, :news_num => common_count, :resource_num => attachment_count, :journal_num => journal_count,
:homework_journal_num => journal_homework_count, :journal_reply_num => 0, :total_score => total) :homework_journal_num => journal_homework_count, :journal_reply_num => 0, :total_score => total)
else else
course_contributor.message_num = board_count course_contributor.message_num = board_count
course_contributor.message_reply_num = message_reply_count course_contributor.message_reply_num = message_reply_count
course_contributor.news_reply_num = common_reply_count course_contributor.news_reply_num = common_reply_count
course_contributor.news_num = common_count course_contributor.news_num = common_count
course_contributor.resource_num = attachment_count course_contributor.resource_num = attachment_count
course_contributor.journal_num = journal_count course_contributor.journal_num = journal_count
course_contributor.homework_journal_num = journal_homework_count course_contributor.homework_journal_num = journal_homework_count
course_contributor.save course_contributor.save
end end
end end
end end
end end
end end
def down def down
end end
end end

@ -1,8 +1,8 @@
class DeleteStudentWorkData < ActiveRecord::Migration class DeleteStudentWorkData < ActiveRecord::Migration
def up def up
StudentWork.where("homework_common_id = 2604 AND user_id = 10763 AND final_score = 0").destroy_all StudentWork.where("homework_common_id = 2604 AND user_id = 10763 AND final_score = 0").destroy_all
end end
def down def down
end end
end end

@ -0,0 +1,5 @@
class AddVisitsToUser < ActiveRecord::Migration
def change
add_column :users, :visits, :integer, :default => 0
end
end

@ -0,0 +1,5 @@
class AddVisitsToProject < ActiveRecord::Migration
def change
add_column :projects, :visits, :integer, :default => 0
end
end

@ -0,0 +1,5 @@
class AddVisitsToCourse < ActiveRecord::Migration
def change
add_column :courses, :visits, :integer, :default => 0
end
end

@ -0,0 +1,5 @@
class AddVisitsToOrganization < ActiveRecord::Migration
def change
add_column :organizations, :visits, :integer, :default => 0
end
end

@ -0,0 +1,8 @@
class UpdateCourseLead < ActiveRecord::Migration
def up
Message.where("status =? ", 1).update_all(:author_id => 1)
end
def down
end
end

@ -11,8 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160310033019) do ActiveRecord::Schema.define(:version => 20160225031230) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
t.string "act_type", :null => false t.string "act_type", :null => false
@ -508,6 +507,7 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
t.integer "is_excellent", :default => 0 t.integer "is_excellent", :default => 0
t.integer "excellent_option", :default => 0 t.integer "excellent_option", :default => 0
t.integer "is_copy", :default => 0 t.integer "is_copy", :default => 0
t.integer "visits", :default => 0
end end
create_table "custom_fields", :force => true do |t| create_table "custom_fields", :force => true do |t|
@ -1284,6 +1284,7 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.boolean "allow_guest_download", :default => true t.boolean "allow_guest_download", :default => true
t.integer "visits", :default => 0
end end
create_table "phone_app_versions", :force => true do |t| create_table "phone_app_versions", :force => true do |t|
@ -1443,6 +1444,7 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
t.integer "acts_count", :default => 0 t.integer "acts_count", :default => 0
t.integer "journals_count", :default => 0 t.integer "journals_count", :default => 0
t.integer "boards_reply_count", :default => 0 t.integer "boards_reply_count", :default => 0
t.integer "visits", :default => 0
end end
add_index "projects", ["lft"], :name => "index_projects_on_lft" add_index "projects", ["lft"], :name => "index_projects_on_lft"
@ -1902,6 +1904,7 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
t.string "mail_notification", :default => "", :null => false t.string "mail_notification", :default => "", :null => false
t.string "salt", :limit => 64 t.string "salt", :limit => 64
t.integer "gid" t.integer "gid"
t.integer "visits", :default => 0
end end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"

@ -99,6 +99,13 @@ module Redmine
result result
end end
def save_attachmentsex_public(attachments, author=User.current,attachment_type, is_public)
@curattachment_type = attachment_type
@is_public = true
result = save_attachments(attachments,author)
result
end
def save_attachments(attachments, author=User.current) def save_attachments(attachments, author=User.current)
# 清除临时文件 # 清除临时文件
if attachments if attachments
@ -142,7 +149,11 @@ module Redmine
end end
if a && !attachment['is_public_checkbox'] if a && !attachment['is_public_checkbox']
a.is_public = false if @is_public
a.is_public = true
else
a.is_public = false
end
elsif a && attachment['is_public_checkbox'] elsif a && attachment['is_public_checkbox']
a.is_public = true a.is_public = true
end end

@ -391,6 +391,9 @@ Redmine::MenuManager.map :admin_menu do |menu|
menu.push :messages_list, {:controller => 'admin', :action => 'messages_list'}, :caption => :label_message_plural menu.push :messages_list, {:controller => 'admin', :action => 'messages_list'}, :caption => :label_message_plural
menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list
menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list
menu.push :excellent_courses, {:controller => 'admin', :action => 'excellent_courses'}, :caption => :label_excellent_courses_list
menu.push :course_resource_list, {:controller => 'admin', :action => 'course_resource_list'}, :caption => :label_course_resource_list
menu.push :project_resource_list, {:controller => 'admin', :action => 'project_resource_list'}, :caption => :label_project_resource_list
menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework
end end

@ -1,73 +1,78 @@
#coding=utf-8 #coding=utf-8
module Trustie module Trustie
module Gitlab module Gitlab
module Helper module Helper
GUEST = 10 GUEST = 10
REPORTER = 20 REPORTER = 20
DEVELOPER = 30 DEVELOPER = 30
MASTER = 40 MASTER = 40
OWNER = 50 OWNER = 50
# 项目公开和私有 # 项目公开和私有
PUBLIC = 20 PUBLIC = 20
PRIVATE = 0 PRIVATE = 0
def change_password(uid, en_pwd, salt) def change_password(uid, en_pwd, salt)
return unless uid return unless uid
options = {:encrypted_password=>en_pwd, :password_salt=>salt} options = {:encrypted_password=>en_pwd, :password_salt=>salt}
self.g.put("/users/ext/#{uid}", :body => options) self.g.put("/users/ext/#{uid}", :body => options)
# g.edit_user(uid, :encrypted_password=>en_pwd, :password_salt=>salt) # g.edit_user(uid, :encrypted_password=>en_pwd, :password_salt=>salt)
end end
def find_user(user) def find_user(user)
us = self.g.get("/users?search=#{user.mail}") us = self.g.get("/users?search=#{user.mail}")
if Array === us if Array === us
us.each do |u| us.each do |u|
return u if u.email == user.mail return u if u.email == user.mail
end end
end end
return nil return nil
end end
def add_user(user) def add_user(user)
u = nil u = nil
begin begin
u = find_user(user) u = find_user(user)
unless u unless u
u = self.g.create_user(user.mail, u = self.g.create_user(user.mail,
user.hashed_password, user.hashed_password,
name: user.show_name, name: user.show_name,
username: user.login, username: user.login,
confirm: "true") confirm: "true")
user.gid = u.id user.gid = u.id
end user.save
change_password(u.id, user.hashed_password, user.salt) end
rescue => e if user.gid.nil?
puts e user.gid = u.id
end user.save
return u end
end change_password(u.id, user.hashed_password, user.salt)
rescue => e
def del_user(user) puts e
return unless user.gid end
self.g.delete_user(user.gid) return u
end end
def get_gitlab_role m def del_user(user)
case m.roles.first.position return unless user.gid
when 1,2 self.g.delete_user(user.gid)
GUEST end
when 5
REPORTER def get_gitlab_role m
when 4 case m.roles.first.position
DEVELOPER when 1,2
when 3 GUEST
MASTER when 5
else REPORTER
GUEST when 4
end DEVELOPER
end when 3
MASTER
end else
end GUEST
end
end
end
end
end end

File diff suppressed because it is too large Load Diff

@ -1,49 +1,51 @@
.ke-content { .ke-content {
font-size: 10pt; font-size: 12px;
} font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢ÈíÑźÚ, ËÎÌå;
.ke-content pre { font-family:Tahoma;
font-size:9pt; }
font-family:Courier New,Arial; .ke-content pre {
border:1px solid #ddd; font-size:9pt;
border-left:5px solid #6CE26C; font-family:Courier New,Arial;
background:#f6f6f6; border:1px solid #ddd;
padding:5px; border-left:5px solid #6CE26C;
} background:#f6f6f6;
padding:5px;
.ke-content code { }
margin: 0 2px;
padding: 0 5px; .ke-content code {
white-space: nowrap; margin: 0 2px;
border: 1px solid #DDD; padding: 0 5px;
background-color: #F6F6F6; white-space: nowrap;
border-radius: 3px; border: 1px solid #DDD;
} background-color: #F6F6F6;
border-radius: 3px;
.ke-content pre>code { }
margin: 0;
padding: 0; .ke-content pre>code {
white-space: pre; margin: 0;
border: none; padding: 0;
background: transparent; white-space: pre;
} border: none;
background: transparent;
.ke-content pre code { }
background-color: transparent;
border: none; .ke-content pre code {
} background-color: transparent;
border: none;
.ke-content p { }
/*margin: 0 0 15px 0;*/
/*margin-bottom:15pt;*/ .ke-content p {
line-height:1.5; /*margin: 0 0 15px 0;*/
/*letter-spacing: 1px;*/ /*margin-bottom:15pt;*/
} line-height:1.5;
/*letter-spacing: 1px;*/
.ke-content div.ref {border:1px solid #ddd;margin:0 0 10px 0;padding:2px;font-size:9pt;background:#ffe;} }
.ke-content div.ref h4 {margin:0;padding:1px 3px;background:#CC9966;color:#fff;font-size:9pt;font-weight:normal;}
.ke-content div.ref .ref_body {margin:0;padding:2px;line-height:20px;color:#666;font-size:9pt;} .ke-content div.ref {border:1px solid #ddd;margin:0 0 10px 0;padding:2px;font-size:9pt;background:#ffe;}
.ke-content div.ref h4 {margin:0;padding:1px 3px;background:#CC9966;color:#fff;font-size:9pt;font-weight:normal;}
.ke-content div.ref .ref_body {margin:0;padding:2px;line-height:20px;color:#666;font-size:9pt;}
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;}
span.at {color:#269ac9;}
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;}
span.at {color:#269ac9;}
span.at a{color:#269ac9;text-decoration: none;} span.at a{color:#269ac9;text-decoration: none;}

@ -98,6 +98,9 @@ KindEditor.plugin('image', function(K) {
yesBtn : { yesBtn : {
name : self.lang('yes'), name : self.lang('yes'),
click : function(e) { click : function(e) {
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){
self.edit.html('');
}
// Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319 // Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319
if (dialog.isLoading) { if (dialog.isLoading) {
return; return;

@ -1,38 +1,40 @@
/******************************************************************************* /*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet * KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net * Copyright (C) 2006-2011 kindsoft.net
* *
* @author Roddy <luolonghao@gmail.com> * @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/ * @site http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php * @licence http://www.kindsoft.net/license.php
*******************************************************************************/ *******************************************************************************/
KindEditor.plugin('lineheight', function(K) { KindEditor.plugin('lineheight', function(K) {
var self = this, name = 'lineheight', lang = self.lang(name + '.'); var self = this, name = 'lineheight', lang = self.lang(name + '.');
self.clickToolbar(name, function() { self.clickToolbar(name, function() {
var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'}); var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'});
if (commonNode) { if (commonNode) {
curVal = commonNode.css('line-height'); curVal = commonNode.css('line-height');
} }
var menu = self.createMenu({ var menu = self.createMenu({
name : name, name : name,
width : 150 width : 150
}); });
K.each(lang.lineHeight, function(i, row) { K.each(lang.lineHeight, function(i, row) {
K.each(row, function(key, val) { K.each(row, function(key, val) {
menu.addItem({ menu.addItem({
title : val, title : val,
checked : curVal === key, checked : curVal === key,
click : function() { click : function() {
self.cmd.toggle('<span style="line-height:' + key + ';"></span>', { self.cmd.toggle('<span style="line-height:' + key + ';"></span>', {
span : '.line-height=' + key span : '.line-height=' + key
}); });
self.updateState(); self.updateState();
self.addBookmark(); self.addBookmark();
self.hideMenu(); //curVal = key;
} //self.cmd.doc.body.style.lineHeight = key;
}); self.hideMenu();
}); }
}); });
}); });
}); });
});
});

@ -47,6 +47,9 @@ KindEditor.plugin('media', function(K) {
yesBtn : { yesBtn : {
name : self.lang('yes'), name : self.lang('yes'),
click : function(e) { click : function(e) {
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){
self.edit.html('');
}
var url = K.trim(urlBox.val()), var url = K.trim(urlBox.val()),
width = widthBox.val(), width = widthBox.val(),
height = heightBox.val(); height = heightBox.val();

@ -25,7 +25,7 @@ KindEditor.plugin('preview', function(K) {
doc.open(); doc.open();
doc.write(self.fullHtml()); doc.write(self.fullHtml());
doc.close(); doc.close();
K(doc.body).css('background-color', '#FFF'); K(doc.body).css({'background-color': '#FFF','word-break':'break-all','word-wrap':'wrap-all'});
iframe[0].contentWindow.focus(); iframe[0].contentWindow.focus();
}); });
}); });

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

@ -1011,6 +1011,13 @@ function showNormalImage(id) {
if (description_images.length>0) { if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){ for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]); var image=$(description_images[i]);
var _path = getRootPath();
//如果图片是视频图片,不处理。
if($(image).hasClass("mediaIco")){
var _src = _path+"/"+$(image).attr('src');
$(image).attr('src',_src);
return;
}
var element=$("<a></a>").attr("href",image.attr('src')); var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element); image.wrap(element);
$(image).parent().colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); $(image).parent().colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
@ -1020,6 +1027,7 @@ function showNormalImage(id) {
} }
//文件、帖子、通知分享 //文件、帖子、通知分享
function org_id_click(){ function org_id_click(){
var sendText = $("input[name='org_id']:checked").next().text(); var sendText = $("input[name='org_id']:checked").next().text();
@ -1153,6 +1161,19 @@ function disable_down(source, des, hint){
} }
} }
function getRootPath(){
//获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp
var curWwwPath=window.document.location.href;
//获取主机地址之后的目录,如: uimcardprj/share/meun.jsp
var pathName=window.document.location.pathname;
var pos=curWwwPath.indexOf(pathName);
//获取主机地址,如: http://localhost:8083
var localhostPaht=curWwwPath.substring(0,pos);
//获取带"/"的项目名,如:/uimcardprj
// var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
var projectName="";
return(localhostPaht+projectName);
}
//自动保存草稿 //自动保存草稿
var editor2; var editor2;
function elocalStorage(editor,mdu){ function elocalStorage(editor,mdu){

@ -1,177 +1,183 @@
//需求:表情栏可以隐藏显示,高度只要一点高 //需求:表情栏可以隐藏显示,高度只要一点高
function sd_create_editor(params){ function sd_create_editor(params){
// var minHeight; //最小高度 // var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度 var paramsHeight = params.height; //设定的高度
var id = arguments[1] ? arguments[1] : undefined; var id = arguments[1] ? arguments[1] : undefined;
var type = arguments[2] ? arguments[2] : ''; var type = arguments[2] ? arguments[2] : '';
var paramsWidth = params.width == undefined ? "100%" : params.width; var paramsWidth = params.width == undefined ? "100%" : params.width;
var editor = params.kindutil.create(params.textarea, { var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"94%", resizeType : 1,minWidth:"1px",width:"94%",
height:"33px",// == undefined ? "30px":paramsHeight+"px", height:"33px",// == undefined ? "30px":paramsHeight+"px",
minHeight:"33px",// == undefined ? "30px":paramsHeight+"px", minHeight:"33px",// == undefined ? "30px":paramsHeight+"px",
width:params.width, width:params.width,
items:['emoticons','fontname', /*
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', items:['emoticons','fontname',
'formatblock', 'fontsize', '|','indent', 'outdent', 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'|','imagedirectupload','more'], 'formatblock', 'fontsize', '|','indent', 'outdent',
afterChange:function(){//按键事件 '|','imagedirectupload','more'],*/
var edit = this.edit; items : ['code','emoticons','fontname',
var body = edit.doc.body; 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
edit.iframe.height(paramsHeight); 'formatblock', 'fontsize', '|','indent', 'outdent',
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight)); '|','imagedirectupload','table', 'media', 'preview',"more"
}, ],
afterBlur:function(){ afterChange:function(){//按键事件
//params.toolbar_container.hide(); var edit = this.edit;
sd_check_editor_form_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); var body = edit.doc.body;
if(this.isEmpty()) { edit.iframe.height(paramsHeight);
this.edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>"); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight));
} },
//params.toolbar_container.hide(); afterBlur:function(){
$('#reply_image_' + id).addClass('imageFuzzy'); //params.toolbar_container.hide();
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){ sd_check_editor_form_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
params.submit_btn.hide(); if(this.isEmpty()) {
params.toolbar_container.hide(); this.edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
this.resize("100%", null); }
}else if(this.edit.html().trim() != ""){ //params.toolbar_container.hide();
params.submit_btn.show(); $('#reply_image_' + id).addClass('imageFuzzy');
params.toolbar_container.show(); if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){
} params.submit_btn.hide();
params.toolbar_container.hide();
//params.submit_btn.css("display","none"); this.resize("100%", null);
}, }else if(this.edit.html().trim() != ""){
afterFocus: function(){ params.submit_btn.show();
var edit = this.edit; params.toolbar_container.show();
var body = edit.doc.body; }
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){
edit.html(''); //params.submit_btn.css("display","none");
} },
params.submit_btn.show(); afterFocus: function(){
params.contentmsg.hide(); var edit = this.edit;
params.toolbar_container.show(); var body = edit.doc.body;
// params.toolbar_container.show(); if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){
$('#reply_image_' + id).removeClass('imageFuzzy'); edit.html('');
//edit.iframe.width(paramsWidth); }
this.resize(paramsWidth, null); params.submit_btn.show();
//params.submit_btn.show(); params.contentmsg.hide();
}, params.toolbar_container.show();
// params.toolbar_container.show();
afterCreate:function(){ $('#reply_image_' + id).removeClass('imageFuzzy');
//params.submit_btn.hide(); //edit.iframe.width(paramsWidth);
var toolbar = $("div[class='ke-toolbar']",params.div_form); this.resize(paramsWidth, null);
toolbar.css('display','inline'); //params.submit_btn.show();
toolbar.css('padding',0); },
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar); afterCreate:function(){
params.toolbar_container.hide(); //params.submit_btn.hide();
//init var toolbar = $("div[class='ke-toolbar']",params.div_form);
var edit = this.edit; toolbar.css('display','inline');
var body = edit.doc.body; toolbar.css('padding',0);
edit.iframe[0].scroll = 'no'; $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
body.style.overflowY = 'hidden'; params.toolbar_container.append(toolbar);
//reset height params.toolbar_container.hide();
paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; //init
edit.iframe.height(paramsHeight); var edit = this.edit;
edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>"); var body = edit.doc.body;
this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight) edit.iframe[0].scroll = 'no';
// params.toolbar_container.hide(); body.style.overflowY = 'hidden';
if(typeof enableAt === 'function'){ //reset height
enableAt(this, id, type); paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight;
} edit.iframe.height(paramsHeight);
} edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
}).loadPlugin('paste'); this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
return editor; // params.toolbar_container.hide();
} if(typeof enableAt === 'function'){
enableAt(this, id, type);
function sd_check_editor_form_field(params){ }
var result=true; }
if(params.content!=undefined){ }).loadPlugin('paste');
if(params.content.isEmpty()){ return editor;
result=false; }
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){ function sd_check_editor_form_field(params){
params.textarea.html(params.content.html()); var result=true;
params.content.sync(); if(params.content!=undefined){
if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())){ if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空'); result=false;
params.contentmsg.css({color:'#ff0000'}); }
}else{ if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.contentmsg.html('填写正确'); params.textarea.html(params.content.html());
params.contentmsg.css({color:'#008000'}); params.content.sync();
} if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())){
params.contentmsg.show(); params.contentmsg.html('内容不能为空');
} params.contentmsg.css({color:'#ff0000'});
} }else{
return result; params.contentmsg.html('填写正确');
} params.contentmsg.css({color:'#008000'});
function sd_create_form(params){ }
params.form.submit(function(){ params.contentmsg.show();
var flag = false; }
if(params.form.attr('data-remote') != undefined ){ }
flag = true return result;
} }
var is_checked = sd_check_editor_form_field({ function sd_create_form(params){
issubmit:true, params.form.submit(function(){
content:params.editor, var flag = false;
contentmsg:params.contentmsg, if(params.form.attr('data-remote') != undefined ){
textarea:params.textarea flag = true
}); }
if(is_checked){ var is_checked = sd_check_editor_form_field({
if(flag){ issubmit:true,
return true; content:params.editor,
}else{ contentmsg:params.contentmsg,
$(this)[0].submit(); textarea:params.textarea
return false; });
} if(is_checked){
} if(flag){
return false; return true;
}); }else{
} $(this)[0].submit();
function sd_reset_editor_form(params){ return false;
params.form[0].reset(); }
params.textarea.empty(); }
if(params.editor != undefined){ return false;
params.editor.html(params.textarea.html()); });
} }
params.contentmsg.hide(); function sd_reset_editor_form(params){
} params.form[0].reset();
//第二个参数是高度,可以传,可以不传 params.textarea.empty();
function sd_create_editor_from_data(id){ if(params.editor != undefined){
var height = arguments[1] ? arguments[1] : undefined; params.editor.html(params.textarea.html());
var width = arguments[2] ? arguments[2] : undefined; }
var type = arguments[3] ? arguments[3] : undefined; params.contentmsg.hide();
KindEditor.ready(function (K) { }
$("div[nhname='new_message_" + id + "']").each(function () { //第二个参数是高度,可以传,可以不传
var params = {}; function sd_create_editor_from_data(id){
params.kindutil = K; var height = arguments[1] ? arguments[1] : undefined;
params.div_form = $(this); var width = arguments[2] ? arguments[2] : undefined;
params.form = $("form", params.div_form); var type = arguments[3] ? arguments[3] : undefined;
if (params.form == undefined || params.form.length == 0) { KindEditor.ready(function (K) {
return; $("div[nhname='new_message_" + id + "']").each(function () {
} var params = {};
params.textarea = $("textarea[nhname='new_message_textarea_" + id + "']", params.div_form); params.kindutil = K;
params.contentmsg = $("span[nhname='contentmsg_" + id + "']", params.div_form); params.div_form = $(this);
params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form); params.form = $("form", params.div_form);
params.cancel_btn = $("#new_message_cancel_btn_" + id); if (params.form == undefined || params.form.length == 0) {
params.submit_btn = $("#new_message_submit_btn_" + id); return;
params.height = height; }
params.width = width; params.textarea = $("textarea[nhname='new_message_textarea_" + id + "']", params.div_form);
if (params.textarea.data('init') == undefined) { params.contentmsg = $("span[nhname='contentmsg_" + id + "']", params.div_form);
params.editor = sd_create_editor(params,id, type); params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form);
sd_create_form(params); params.cancel_btn = $("#new_message_cancel_btn_" + id);
params.cancel_btn.click(function () { params.submit_btn = $("#new_message_submit_btn_" + id);
sd_reset_editor_form(params); params.height = height;
}); params.width = width;
params.submit_btn.click(function () { if (params.textarea.data('init') == undefined) {
params.form.submit(); params.editor = sd_create_editor(params,id, type);
}); sd_create_form(params);
params.textarea.data('init', 1); params.cancel_btn.click(function () {
$(this).show(); sd_reset_editor_form(params);
} });
}); params.submit_btn.click(function () {
}); params.form.submit();
});
div_form = $("div[nhname='new_message_" + id + "']"); params.textarea.data('init', 1);
$(".ke-edit", div_form).css("height","33px"); $(this).show();
$(".ke-edit-iframe",div_form).css("height","33px"); }
});
});
div_form = $("div[nhname='new_message_" + id + "']");
$(".ke-edit", div_form).css("height","33px");
$(".ke-edit-iframe",div_form).css("height","33px");
} }

@ -1,354 +1,354 @@
/* /*
# Code Review plugin for Redmine # Code Review plugin for Redmine
# Copyright (C) 2009-2013 Haruyuki Iida # Copyright (C) 2009-2013 Haruyuki Iida
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
var topZindex = 1000; var topZindex = 1000;
var action_type = ''; var action_type = '';
var rev = ''; var rev = '';
var rev_to = ''; var rev_to = '';
var path = ''; var path = '';
var urlprefix = ''; var urlprefix = '';
var review_form_dialog = null; var review_form_dialog = null;
var add_form_title = null; var add_form_title = null;
var review_dialog_title = null; var review_dialog_title = null;
var repository_id = null; var repository_id = null;
var filenames = []; var filenames = [];
var ReviewCount = function(total, open, progress){ var ReviewCount = function(total, open, progress){
this.total = total; this.total = total;
this.open = open; this.open = open;
this.closed = total - open; this.closed = total - open;
this.progress = progress this.progress = progress
}; };
var CodeReview = function(id) { var CodeReview = function(id) {
this.id = id; this.id = id;
this.path = ''; this.path = '';
this.line = 0; this.line = 0;
this.url = ''; this.url = '';
this.is_closed = false; this.is_closed = false;
}; };
var review_counts = new Array(); var review_counts = new Array();
var code_reviews_map = new Array(); var code_reviews_map = new Array();
var code_reviews_dialog_map = new Array(); var code_reviews_dialog_map = new Array();
function UpdateRepositoryView(title) { function UpdateRepositoryView(title) {
var header = $("table.changesets thead tr:first"); var header = $("table.changesets thead tr:first");
var th = $('<th></th>'); var th = $('<th></th>');
th.html(title); th.html(title);
header.append(th); header.append(th);
$('tr.changeset td.id a').each(function(i){ $('tr.changeset td.id a').each(function(i){
var revision = this.getAttribute("href"); var revision = this.getAttribute("href");
revision = revision.substr(revision.lastIndexOf("/") + 1); revision = revision.substr(revision.lastIndexOf("/") + 1);
var review = review_counts['revision_' + revision]; var review = review_counts['revision_' + revision];
var td = $('<td/>',{ var td = $('<td/>',{
'class':'progress' 'class':'progress'
}); });
td.html(review.progress); td.html(review.progress);
$(this.parentNode.parentNode).append(td); $(this.parentNode.parentNode).append(td);
}); });
} }
//add function $.down //add function $.down
if(! $.fn.down) if(! $.fn.down)
(function($) { (function($) {
$.fn.down = function() { $.fn.down = function() {
var el = this[0] && this[0].firstChild; var el = this[0] && this[0].firstChild;
while (el && el.nodeType != 1) while (el && el.nodeType != 1)
el = el.nextSibling; el = el.nextSibling;
return $(el); return $(el);
}; };
})(jQuery); })(jQuery);
function UpdateRevisionView() { function UpdateRevisionView() {
$('li.change').each(function(){ $('li.change').each(function(){
var li = $(this); var li = $(this);
if (li.hasClass('folder')) return; if (li.hasClass('folder')) return;
var a = li.down('a'); var a = li.down('a');
if (a.size() == 0) return; if (a.size() == 0) return;
var path = a.attr('href').replace(urlprefix, '').replace(/\?.*$/, ''); var path = a.attr('href').replace(urlprefix, '').replace(/\?.*$/, '');
var reviewlist = code_reviews_map[path]; var reviewlist = code_reviews_map[path];
if (reviewlist == null) return; if (reviewlist == null) return;
var ul = $('<ul></ul>'); var ul = $('<ul></ul>');
for (var j = 0; j < reviewlist.length; j++) { for (var j = 0; j < reviewlist.length; j++) {
var review = reviewlist[j]; var review = reviewlist[j];
var icon = review.is_closed? 'icon-closed-review': 'icon-review'; var icon = review.is_closed? 'icon-closed-review': 'icon-review';
var item = $('<li></li>', { var item = $('<li></li>', {
'class': 'icon ' + icon + ' code_review_summary' 'class': 'icon ' + icon + ' code_review_summary'
}); });
item.html(review.url); item.html(review.url);
ul.append(item); ul.append(item);
} }
li.append(ul); li.append(ul);
}); });
} }
function setAddReviewButton(url, change_id, image_tag, is_readonly, is_diff, attachment_id){ function setAddReviewButton(url, change_id, image_tag, is_readonly, is_diff, attachment_id){
var filetables = []; var filetables = [];
var j = 0; var j = 0;
$('table').each(function(){ $('table').each(function(){
if($(this).hasClass('filecontent')){ if($(this).hasClass('filecontent')){
filetables[j++] = this; filetables[j++] = this;
} }
}); });
j = 0; j = 0;
$('table.filecontent th.filename').each(function(){ $('table.filecontent th.filename').each(function(){
filenames[j] = $.trim($(this).text()); filenames[j] = $.trim($(this).text());
j++; j++;
}); });
addReviewUrl = url + '?change_id=' + change_id + '&action_type=' + action_type + addReviewUrl = url + '?change_id=' + change_id + '&action_type=' + action_type +
'&rev=' + rev + '&rev_to=' + rev_to + '&rev=' + rev + '&rev_to=' + rev_to +
'&attachment_id=' + attachment_id + '&repository_id=' + encodeURIComponent(repository_id); '&attachment_id=' + attachment_id + '&repository_id=' + encodeURIComponent(repository_id);
if (path != null && path.length > 0) { if (path != null && path.length > 0) {
addReviewUrl = addReviewUrl + '&path=' + encodeURIComponent(path); addReviewUrl = addReviewUrl + '&path=' + encodeURIComponent(path);
} }
var num = 0; var num = 0;
if (is_diff) { if (is_diff) {
num = 1; num = 1;
} }
var i, l, tl; var i, l, tl;
for (i = 0, tl = filetables.length; i < tl; i++) { for (i = 0, tl = filetables.length; i < tl; i++) {
var table = filetables[i]; var table = filetables[i];
var trs = table.getElementsByTagName('tr'); var trs = table.getElementsByTagName('tr');
for (j = 0,l = trs.length; j < l; j++) { for (j = 0,l = trs.length; j < l; j++) {
var tr = trs[j]; var tr = trs[j];
var ths = tr.getElementsByTagName('th'); var ths = tr.getElementsByTagName('th');
var th = ths[num]; var th = ths[num];
if (th == null) { if (th == null) {
continue; continue;
} }
var th_html = th.innerHTML; var th_html = th.innerHTML;
var line = th_html.match(/[0-9]+/); var line = th_html.match(/[0-9]+/);
if (line == null) { if (line == null) {
continue; continue;
} }
var span_html = '<span white-space="nowrap" id="review_span_' + line + '_' + i + '">'; var span_html = '<span white-space="nowrap" id="review_span_' + line + '_' + i + '">';
if (!is_readonly) { if (!is_readonly) {
span_html += image_tag; span_html += image_tag;
} }
span_html += '</span>'; span_html += '</span>';
th.innerHTML = th_html + span_html; th.innerHTML = th_html + span_html;
var img = th.getElementsByTagName('img')[0]; var img = th.getElementsByTagName('img')[0];
if (img != null ) { if (img != null ) {
img.id = 'add_revew_img_' + line + '_' + i; img.id = 'add_revew_img_' + line + '_' + i;
$(img).click(clickPencil); $(img).click(clickPencil);
} }
} }
} }
} }
function clickPencil(e) function clickPencil(e)
{ {
// alert('$(e.target).attr("id") = ' + $(e.target).attr("id")); // alert('$(e.target).attr("id") = ' + $(e.target).attr("id"));
var result = $(e.target).attr("id").match(/([0-9]+)_([0-9]+)/); var result = $(e.target).attr("id").match(/([0-9]+)_([0-9]+)/);
var line = result[1]; var line = result[1];
var file_count = eval(result[2]); var file_count = eval(result[2]);
var url = addReviewUrl + '&line=' + line + '&file_count=' + file_count; var url = addReviewUrl + '&line=' + line + '&file_count=' + file_count;
if (path == null || path.length == 0) { if (path == null || path.length == 0) {
url = url + '&path=' + encodeURIComponent(filenames[file_count]) + '&diff_all=true'; url = url + '&path=' + encodeURIComponent(filenames[file_count]) + '&diff_all=true';
} }
addReview(url); addReview(url);
formPopup(e.pageX, e.pageY); formPopup(e.pageX, e.pageY);
e.preventDefault(); e.preventDefault();
} }
var addReviewUrl = null; var addReviewUrl = null;
var showReviewUrl = null; var showReviewUrl = null;
var showReviewImageTag = null; var showReviewImageTag = null;
var showClosedReviewImageTag = null; var showClosedReviewImageTag = null;
function setShowReviewButton(line, review_id, is_closed, file_count) { function setShowReviewButton(line, review_id, is_closed, file_count) {
//alert('file_count = ' + file_count); //alert('file_count = ' + file_count);
var span = $('#review_span_' + line + '_' + file_count); var span = $('#review_span_' + line + '_' + file_count);
if (span.size() == 0) { if (span.size() == 0) {
return; return;
} }
var innerSpan = $('<span></span>',{id: 'review_' + review_id}); var innerSpan = $('<span></span>',{id: 'review_' + review_id});
span.append(innerSpan); span.append(innerSpan);
innerSpan.html(is_closed? showClosedReviewImageTag : showReviewImageTag); innerSpan.html(is_closed? showClosedReviewImageTag : showReviewImageTag);
var div = $('<div></div>', { var div = $('<div></div>', {
'class':'draggable', 'class':'draggable',
id: 'show_review_' + review_id id: 'show_review_' + review_id
}); });
$('#code_review').append(div); $('#code_review').append(div);
innerSpan.down('img').click(function(e) { innerSpan.down('img').click(function(e) {
var review_id = $(e.target).parent().attr('id').match(/[0-9]+/)[0]; var review_id = $(e.target).parent().attr('id').match(/[0-9]+/)[0];
var span = $('#review_' + review_id); // span element of view review button var span = $('#review_' + review_id); // span element of view review button
var pos = span.offset(); var pos = span.offset();
showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top + 25); showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top + 25);
}); });
} }
function popupReview(review_id) { function popupReview(review_id) {
var span = $('#review_' + review_id); // span element of view review button var span = $('#review_' + review_id); // span element of view review button
var pos = span.offset(); var pos = span.offset();
$('html,body').animate({ scrollTop: pos.top }, $('html,body').animate({ scrollTop: pos.top },
{duration: 'fast', {duration: 'fast',
complete: function(){showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top)}}); complete: function(){showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top)}});
// position and show popup dialog // position and show popup dialog
// create popup dialog // create popup dialog
//var win = showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top); //var win = showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top);
// win.toFront(); // win.toFront();
} }
function showReview(url, review_id, x, y) { function showReview(url, review_id, x, y) {
if (code_reviews_dialog_map[review_id] != null) { if (code_reviews_dialog_map[review_id] != null) {
var cur_win = code_reviews_dialog_map[review_id]; var cur_win = code_reviews_dialog_map[review_id];
cur_win.hide(); cur_win.hide();
code_reviews_dialog_map[review_id] = null; code_reviews_dialog_map[review_id] = null;
} }
$('#show_review_' + review_id).load(url, {review_id: review_id}); $('#show_review_' + review_id).load(url, {review_id: review_id});
var review = getReviewObjById(review_id); var review = getReviewObjById(review_id);
var win = $('#show_review_' + review_id).dialog({ var win = $('#show_review_' + review_id).dialog({
show: {effect:'scale'},// ? 'top-left' show: {effect:'scale'},// ? 'top-left'
//position: [x, y + 5], //position: [x, y + 5],
width:640, width:640,
zIndex: topZindex, zIndex: topZindex,
title: review_dialog_title title: review_dialog_title
}); });
// win.getContent().style.color = "#484848"; // win.getContent().style.color = "#484848";
// win.getContent().style.background = "#ffffff"; // win.getContent().style.background = "#ffffff";
topZindex++; topZindex++;
code_reviews_dialog_map[review_id] = win; code_reviews_dialog_map[review_id] = win;
return win return win
} }
function getReviewObjById(review_id) { function getReviewObjById(review_id) {
for (var reviewlist in code_reviews_map) { for (var reviewlist in code_reviews_map) {
for (var i = 0; i < reviewlist.length; i++) { for (var i = 0; i < reviewlist.length; i++) {
var review = reviewlist[i]; var review = reviewlist[i];
if (review.id == review_id) { if (review.id == review_id) {
return review; return review;
} }
} }
} }
return null; return null;
} }
function formPopup(x, y){ function formPopup(x, y){
//@see http://docs.jquery.com/UI/Effects/Scale //@see http://docs.jquery.com/UI/Effects/Scale
var win = $('#review-form-frame').dialog({ var win = $('#review-form-frame').dialog({
show: {effect:'scale', direction: 'both'},// ? 'top-left' show: {effect:'scale', direction: 'both'},// ? 'top-left'
// position: [x, y + 5], // position: [x, y + 5],
width:640, width:640,
zIndex: topZindex, zIndex: topZindex,
title: add_form_title title: add_form_title
}); });
// win.getContent().style.background = "#ffffff"; // win.getContent().style.background = "#ffffff";
if (review_form_dialog != null) { if (review_form_dialog != null) {
review_form_dialog.destroy(); review_form_dialog.destroy();
review_form_dialog = null; review_form_dialog = null;
} }
review_form_dialog = win; review_form_dialog = win;
topZindex += 10; topZindex += 10;
return false; return false;
} }
function hideForm() { function hideForm() {
if (review_form_dialog == null) { if (review_form_dialog == null) {
return; return;
} }
review_form_dialog.dialog('close'); review_form_dialog.dialog('close');
review_form_dialog = null; review_form_dialog = null;
$('#review-form').html(''); $('#review-form').html('');
} }
function addReview(url) { function addReview(url) {
$('#review-form').load(url); $('#review-form').load(url);
} }
function deleteReview(review_id) { function deleteReview(review_id) {
$('show_review_' + review_id).remove(); $('show_review_' + review_id).remove();
$('review_' + review_id).remove(); $('review_' + review_id).remove();
} }
function changeImage(review_id, is_closed) { function changeImage(review_id, is_closed) {
var span = $('review_' + review_id); var span = $('review_' + review_id);
var new_image = null; var new_image = null;
var dummy = new Element('span'); var dummy = new Element('span');
if (is_closed) { if (is_closed) {
dummy.insert(showClosedReviewImageTag); dummy.insert(showClosedReviewImageTag);
} }
else { else {
dummy.insert(showReviewImageTag); dummy.insert(showReviewImageTag);
} }
new_image = dummy.down().getAttribute('src'); new_image = dummy.down().getAttribute('src');
//alert(new_image); //alert(new_image);
span.down('img').setAttribute('src', new_image); span.down('img').setAttribute('src', new_image);
} }
function make_addreview_link(project, link) { function make_addreview_link(project, link) {
var alist = $('#content p a'); var alist = $('#content p a');
if (alist == null) { if (alist == null) {
return; return;
} }
var a = alist[0]; var a = alist[0];
var p = a.parentNode; var p = a.parentNode;
p.innerHTML = p.innerHTML + " | " + link; p.innerHTML = p.innerHTML + " | " + link;
} }
function call_update_revisions(url) { function call_update_revisions(url) {
var changeset_ids = ''; var changeset_ids = '';
var links = $$('table.changesets tbody tr.changeset td.id a'); var links = $$('table.changesets tbody tr.changeset td.id a');
for (var i = 0; i < links.length; i++) { for (var i = 0; i < links.length; i++) {
var link = links[i]; var link = links[i];
var href = link.getAttribute('href'); var href = link.getAttribute('href');
var id = href.replace(/^.*\/revisions\//, ''); var id = href.replace(/^.*\/revisions\//, '');
if (i > 0) { if (i > 0) {
changeset_ids += ','; changeset_ids += ',';
} }
changeset_ids += id; changeset_ids += id;
} }
new Ajax.Updater('code_review_revisions', url, new Ajax.Updater('code_review_revisions', url,
{ {
evalScripts:true, evalScripts:true,
method:'get', method:'get',
parameters: 'changeset_ids=' + encodeURI(changeset_ids) parameters: 'changeset_ids=' + encodeURI(changeset_ids)
}); });
} }
$.fn.serialize2json = function() $.fn.serialize2json = function()
{ {
var o = {}; var o = {};
var a = this.serializeArray(); var a = this.serializeArray();
$.each(a, function() { $.each(a, function() {
if (o[this.name]) { if (o[this.name]) {
if (!o[this.name].push) { if (!o[this.name].push) {
o[this.name] = [o[this.name]]; o[this.name] = [o[this.name]];
} }
o[this.name].push(this.value || ''); o[this.name].push(this.value || '');
} else { } else {
o[this.name] = this.value || ''; o[this.name] = this.value || '';
} }
}); });
return o; return o;
}; };

@ -1,4 +1,4 @@
dt.code_review { dt.code_review {
background-image: url(../images/review.png); background-image: url(../images/review.png);
} }

@ -1,97 +1,97 @@
/* /*
# Code Review plugin for Redmine # Code Review plugin for Redmine
# Copyright (C) 2009 Haruyuki Iida # Copyright (C) 2009 Haruyuki Iida
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#review-form-frame { #review-form-frame {
height: 100%; height: 100%;
} }
.autoscroll table.filecontent th.line-num { .autoscroll table.filecontent th.line-num {
white-space: nowrap; white-space: nowrap;
vertical-align: bottom; vertical-align: bottom;
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
text-align:left; text-align:left;
} }
table.filecontent th.line-num img{ table.filecontent th.line-num img{
padding: 0; padding: 0;
margin: 0; margin: 0;
cursor: pointer; cursor: pointer;
} }
.code-review-form-title { .code-review-form-title {
background-color: #002059; background-color: #002059;
color: white; color: white;
padding-left: 2px; padding-left: 2px;
padding-right: 2px; padding-right: 2px;
cursor: default; cursor: default;
} }
.code_review_viewer { .code_review_viewer {
min-width: 300px; min-width: 300px;
/* /*
max-width: 60%; max-width: 60%;
*/ */
/* max-height: 400px; */ /* max-height: 400px; */
} }
.code_review_viewer .issue{ .code_review_viewer .issue{
} }
.code_review_body { .code_review_body {
background-color: white; background-color: white;
padding:2px; padding:2px;
} }
#code_review_list table.list td { #code_review_list table.list td {
text-align: center; text-align: center;
} }
#code_review_list table.list td.path { #code_review_list table.list td.path {
text-align: left; text-align: left;
} }
#code_review_list table.list td.subject { #code_review_list table.list td.subject {
text-align: left; text-align: left;
} }
.icon-review { .icon-review {
background-image: url(../images/review.png); background-image: url(../images/review.png);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.icon-closed-review { .icon-closed-review {
background-image: url(../images/closed_review.png); background-image: url(../images/closed_review.png);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.icon-settings { .icon-settings {
background-image: url(../../../images/changeset.png); background-image: url(../../../images/changeset.png);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
li.code_review_summary { li.code_review_summary {
list-style-type: none; list-style-type: none;
} }

@ -1,19 +1,19 @@
Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.com) Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.com)
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to permit persons to whom the Software is furnished to do so, subject to
the following conditions: the following conditions:
The above copyright notice and this permission notice shall be The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software. included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -1,119 +1,119 @@
.overlay_alert { .overlay_alert {
background-color: #85BBEF; background-color: #85BBEF;
filter:alpha(opacity=60); filter:alpha(opacity=60);
-moz-opacity: 0.6; -moz-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
.alert_nw { .alert_nw {
width: 5px; width: 5px;
height: 5px; height: 5px;
background: transparent url(alert/top_left.gif) no-repeat bottom left; background: transparent url(alert/top_left.gif) no-repeat bottom left;
} }
.alert_n { .alert_n {
height: 5px; height: 5px;
background: transparent url(alert/top.gif) repeat-x bottom left; background: transparent url(alert/top.gif) repeat-x bottom left;
} }
.alert_ne { .alert_ne {
width: 5px; width: 5px;
height: 5px; height: 5px;
background: transparent url(alert/top_right.gif) no-repeat bottom left background: transparent url(alert/top_right.gif) no-repeat bottom left
} }
.alert_e { .alert_e {
width: 5px; width: 5px;
background: transparent url(alert/right.gif) repeat-y 0 0; background: transparent url(alert/right.gif) repeat-y 0 0;
} }
.alert_w { .alert_w {
width: 5px; width: 5px;
background: transparent url(alert/left.gif) repeat-y 0 0; background: transparent url(alert/left.gif) repeat-y 0 0;
} }
.alert_sw { .alert_sw {
width: 5px; width: 5px;
height: 5px; height: 5px;
background: transparent url(alert/bottom_left.gif) no-repeat 0 0; background: transparent url(alert/bottom_left.gif) no-repeat 0 0;
} }
.alert_s { .alert_s {
height: 5px; height: 5px;
background: transparent url(alert/bottom.gif) repeat-x 0 0; background: transparent url(alert/bottom.gif) repeat-x 0 0;
} }
.alert_se, .alert_sizer { .alert_se, .alert_sizer {
width: 5px; width: 5px;
height: 5px; height: 5px;
background: transparent url(alert/bottom_right.gif) no-repeat 0 0; background: transparent url(alert/bottom_right.gif) no-repeat 0 0;
} }
.alert_close { .alert_close {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_minimize { .alert_minimize {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_maximize { .alert_maximize {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_title { .alert_title {
float:left; float:left;
height:1px; height:1px;
width:100%; width:100%;
} }
.alert_content { .alert_content {
overflow:visible; overflow:visible;
color: #000; color: #000;
font-family: Tahoma, Arial, sans-serif; font-family: Tahoma, Arial, sans-serif;
font: 12px arial; font: 12px arial;
background: #FFF; background: #FFF;
} }
/* For alert/confirm dialog */ /* For alert/confirm dialog */
.alert_window { .alert_window {
background: #FFF; background: #FFF;
padding:20px; padding:20px;
margin-left:auto; margin-left:auto;
margin-right:auto; margin-right:auto;
width:400px; width:400px;
} }
.alert_message { .alert_message {
font: 12px arial; font: 12px arial;
width:100%; width:100%;
color:#F00; color:#F00;
padding-bottom:10px; padding-bottom:10px;
} }
.alert_buttons { .alert_buttons {
text-align:center; text-align:center;
width:100%; width:100%;
} }
.alert_buttons input { .alert_buttons input {
width:20%; width:20%;
margin:10px; margin:10px;
} }
.alert_progress { .alert_progress {
float:left; float:left;
margin:auto; margin:auto;
text-align:center; text-align:center;
width:100%; width:100%;
height:16px; height:16px;
background: #FFF url('alert/progress.gif') no-repeat center center background: #FFF url('alert/progress.gif') no-repeat center center
} }

@ -1,88 +1,88 @@
.overlay_alert_lite { .overlay_alert_lite {
background-color: #85BBEF; background-color: #85BBEF;
filter:alpha(opacity=60); filter:alpha(opacity=60);
-moz-opacity: 0.6; -moz-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
.alert_lite_sizer { .alert_lite_sizer {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_lite_close { .alert_lite_close {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_lite_minimize { .alert_lite_minimize {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_lite_maximize { .alert_lite_maximize {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_lite_title { .alert_lite_title {
width:0px; width:0px;
height:0px; height:0px;
display:none; display:none;
} }
.alert_lite_content { .alert_lite_content {
overflow:auto; overflow:auto;
color: #000; color: #000;
font-family: Tahoma, Arial, sans-serif; font-family: Tahoma, Arial, sans-serif;
font-size: 10px; font-size: 10px;
background: #FFF; background: #FFF;
} }
/* For alert/confirm dialog */ /* For alert/confirm dialog */
.alert_lite_window { .alert_lite_window {
border:1px solid #F00; border:1px solid #F00;
background: #FFF; background: #FFF;
padding:20px; padding:20px;
margin-left:auto; margin-left:auto;
margin-right:auto; margin-right:auto;
width:400px; width:400px;
} }
.alert_lite_message { .alert_lite_message {
font-size:16px; font-size:16px;
text-align:center; text-align:center;
width:100%; width:100%;
color:#F00; color:#F00;
padding-bottom:10px; padding-bottom:10px;
} }
.alert_lite_buttons { .alert_lite_buttons {
text-align:center; text-align:center;
width:100%; width:100%;
} }
.alert_lite_buttons input { .alert_lite_buttons input {
width:20%; width:20%;
margin:10px; margin:10px;
} }
.alert_lite_progress { .alert_lite_progress {
float:left; float:left;
margin:auto; margin:auto;
text-align:center; text-align:center;
width:100%; width:100%;
height:16px; height:16px;
background: #FFF url('alert/progress.gif') no-repeat center center background: #FFF url('alert/progress.gif') no-repeat center center
} }
table.alert_lite_header { table.alert_lite_header {
border:1px solid #F00; border:1px solid #F00;
background:#FFF background:#FFF
} }

@ -1,150 +1,150 @@
.overlay_alphacube { .overlay_alphacube {
background-color: #85BBEF; background-color: #85BBEF;
filter:alpha(opacity=60); filter:alpha(opacity=60);
-moz-opacity: 0.6; -moz-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
.alphacube_nw { .alphacube_nw {
background: transparent url(alphacube/left-top.gif) no-repeat 0 0; background: transparent url(alphacube/left-top.gif) no-repeat 0 0;
width:10px; width:10px;
height:25px; height:25px;
} }
.alphacube_n { .alphacube_n {
background: transparent url(alphacube/top-middle.gif) repeat-x 0 0; background: transparent url(alphacube/top-middle.gif) repeat-x 0 0;
height:25px; height:25px;
} }
.alphacube_ne { .alphacube_ne {
background: transparent url(alphacube/right-top.gif) no-repeat 0 0; background: transparent url(alphacube/right-top.gif) no-repeat 0 0;
width:10px; width:10px;
height:25px; height:25px;
} }
.alphacube_w { .alphacube_w {
background: transparent url(alphacube/frame-left.gif) repeat-y top left; background: transparent url(alphacube/frame-left.gif) repeat-y top left;
width:7px; width:7px;
} }
.alphacube_e { .alphacube_e {
background: transparent url(alphacube/frame-right.gif) repeat-y top right; background: transparent url(alphacube/frame-right.gif) repeat-y top right;
width:7px; width:7px;
} }
.alphacube_sw { .alphacube_sw {
background: transparent url(alphacube/bottom-left-c.gif) no-repeat 0 0; background: transparent url(alphacube/bottom-left-c.gif) no-repeat 0 0;
width:7px; width:7px;
height:7px; height:7px;
} }
.alphacube_s { .alphacube_s {
background: transparent url(alphacube/bottom-middle.gif) repeat-x 0 0; background: transparent url(alphacube/bottom-middle.gif) repeat-x 0 0;
height:7px; height:7px;
} }
.alphacube_se, .alphacube_sizer { .alphacube_se, .alphacube_sizer {
background: transparent url(alphacube/bottom-right-c.gif) no-repeat 0 0; background: transparent url(alphacube/bottom-right-c.gif) no-repeat 0 0;
width:7px; width:7px;
height:7px; height:7px;
} }
.alphacube_sizer { .alphacube_sizer {
cursor:se-resize; cursor:se-resize;
} }
.alphacube_close { .alphacube_close {
width: 23px; width: 23px;
height: 23px; height: 23px;
background: transparent url(alphacube/button-close-focus.gif) no-repeat 0 0; background: transparent url(alphacube/button-close-focus.gif) no-repeat 0 0;
position:absolute; position:absolute;
top:0px; top:0px;
right:11px; right:11px;
cursor:pointer; cursor:pointer;
z-index:1000; z-index:1000;
} }
.alphacube_minimize { .alphacube_minimize {
width: 23px; width: 23px;
height: 23px; height: 23px;
background: transparent url(alphacube/button-min-focus.gif) no-repeat 0 0; background: transparent url(alphacube/button-min-focus.gif) no-repeat 0 0;
position:absolute; position:absolute;
top:0px; top:0px;
right:55px; right:55px;
cursor:pointer; cursor:pointer;
z-index:1000; z-index:1000;
} }
.alphacube_maximize { .alphacube_maximize {
width: 23px; width: 23px;
height: 23px; height: 23px;
background: transparent url(alphacube/button-max-focus.gif) no-repeat 0 0; background: transparent url(alphacube/button-max-focus.gif) no-repeat 0 0;
position:absolute; position:absolute;
top:0px; top:0px;
right:33px; right:33px;
cursor:pointer; cursor:pointer;
z-index:1000; z-index:1000;
} }
.alphacube_title { .alphacube_title {
float:left; float:left;
height:14px; height:14px;
font-size:14px; font-size:14px;
text-align:center; text-align:center;
margin-top:2px; margin-top:2px;
width:100%; width:100%;
color:#123456; color:#123456;
} }
.alphacube_content { .alphacube_content {
overflow:auto; overflow:auto;
color: #000; color: #000;
font-family: Tahoma, Arial, sans-serif; font-family: Tahoma, Arial, sans-serif;
font: 12px arial; font: 12px arial;
background:#FDFDFD; background:#FDFDFD;
} }
/* For alert/confirm dialog */ /* For alert/confirm dialog */
.alphacube_window { .alphacube_window {
border:1px solid #F00; border:1px solid #F00;
background: #FFF; background: #FFF;
padding:20px; padding:20px;
margin-left:auto; margin-left:auto;
margin-right:auto; margin-right:auto;
width:400px; width:400px;
} }
.alphacube_message { .alphacube_message {
font: 12px arial; font: 12px arial;
text-align:center; text-align:center;
width:100%; width:100%;
padding-bottom:10px; padding-bottom:10px;
} }
.alphacube_buttons { .alphacube_buttons {
text-align:center; text-align:center;
width:100%; width:100%;
} }
.alphacube_buttons input { .alphacube_buttons input {
width:20%; width:20%;
margin:10px; margin:10px;
} }
.alphacube_progress { .alphacube_progress {
float:left; float:left;
margin:auto; margin:auto;
text-align:center; text-align:center;
width:100%; width:100%;
height:16px; height:16px;
background: #FFF url('alert/progress.gif') no-repeat center center background: #FFF url('alert/progress.gif') no-repeat center center
} }
.alphacube_wired_frame { .alphacube_wired_frame {
background: #FFF; background: #FFF;
filter:alpha(opacity=60); filter:alpha(opacity=60);
-moz-opacity: 0.6; -moz-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }

@ -1,51 +1,51 @@
<public:component> <public:component>
<public:attach event="onpropertychange" onevent="propertyChanged()" /> <public:attach event="onpropertychange" onevent="propertyChanged()" />
<script> <script>
var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32"; var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32";
var realSrc; var realSrc;
var blankSrc = "blank.gif"; var blankSrc = "blank.gif";
if (supported) fixImage(); if (supported) fixImage();
function propertyChanged() { function propertyChanged() {
if (!supported) return; if (!supported) return;
var pName = event.propertyName; var pName = event.propertyName;
if (pName != "src") return; if (pName != "src") return;
// if not set to blank // if not set to blank
if ( ! new RegExp(blankSrc).test(src)) if ( ! new RegExp(blankSrc).test(src))
fixImage(); fixImage();
}; };
function fixImage() { function fixImage() {
// get src // get src
var src = element.src; var src = element.src;
// check for real change // check for real change
if (src == realSrc) { if (src == realSrc) {
element.src = blankSrc; element.src = blankSrc;
return; return;
} }
if ( ! new RegExp(blankSrc).test(src)) { if ( ! new RegExp(blankSrc).test(src)) {
// backup old src // backup old src
realSrc = src; realSrc = src;
} }
// test for png // test for png
if ( /\.png$/.test( realSrc.toLowerCase() ) ) { if ( /\.png$/.test( realSrc.toLowerCase() ) ) {
// set blank image // set blank image
element.src = blankSrc; element.src = blankSrc;
// set filter // set filter
element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
src + "',sizingMethod='scale')"; src + "',sizingMethod='scale')";
} }
else { else {
// remove filter // remove filter
element.runtimeStyle.filter = ""; element.runtimeStyle.filter = "";
} }
} }
</script> </script>
</public:component> </public:component>

@ -1,121 +1,121 @@
.overlay_darkX { .overlay_darkX {
background-color: #85BBEF; background-color: #85BBEF;
filter:alpha(opacity=60); filter:alpha(opacity=60);
-moz-opacity: 0.6; -moz-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
.darkX_nw { .darkX_nw {
background: transparent url(darkX/titlebar-left-focused.png) no-repeat 0 0; background: transparent url(darkX/titlebar-left-focused.png) no-repeat 0 0;
width:6px; width:6px;
height:21px; height:21px;
} }
.darkX_n { .darkX_n {
background: transparent url(darkX/titlebar-mid-focused.png) repeat-x 0 0; background: transparent url(darkX/titlebar-mid-focused.png) repeat-x 0 0;
height:21px; height:21px;
} }
.darkX_ne { .darkX_ne {
background: transparent url(darkX/titlebar-right-focused.png) no-repeat 0 0; background: transparent url(darkX/titlebar-right-focused.png) no-repeat 0 0;
width:6px; width:6px;
height:21px; height:21px;
} }
.darkX_w { .darkX_w {
background: transparent url(darkX/frame-left-focused.png) repeat-y top left; background: transparent url(darkX/frame-left-focused.png) repeat-y top left;
width:3px; width:3px;
} }
.darkX_e { .darkX_e {
background: transparent url(darkX/frame-right-focused.png) repeat-y top right; background: transparent url(darkX/frame-right-focused.png) repeat-y top right;
width:3px; width:3px;
} }
.darkX_sw { .darkX_sw {
background: transparent url(darkX/frame-bottom-left-focused.png) no-repeat 0 0; background: transparent url(darkX/frame-bottom-left-focused.png) no-repeat 0 0;
width:5px; width:5px;
height:3px; height:3px;
} }
.darkX_s { .darkX_s {
background: transparent url(darkX/frame-bottom-mid-focused.png) repeat-x 0 0; background: transparent url(darkX/frame-bottom-mid-focused.png) repeat-x 0 0;
height:3px; height:3px;
} }
.darkX_se, .darkX_sizer { .darkX_se, .darkX_sizer {
background: transparent url(darkX/frame-bottom-right-focused.png) no-repeat 0 0; background: transparent url(darkX/frame-bottom-right-focused.png) no-repeat 0 0;
width:5px; width:5px;
height:3px; height:3px;
} }
.darkX_sizer { .darkX_sizer {
cursor:se-resize; cursor:se-resize;
} }
.darkX_close { .darkX_close {
width: 21px; width: 21px;
height: 21px; height: 21px;
background: transparent url(darkX/button-close-focused.png) no-repeat 0 0; background: transparent url(darkX/button-close-focused.png) no-repeat 0 0;
position:absolute; position:absolute;
top:0px; top:0px;
right:5px; right:5px;
cursor:pointer; cursor:pointer;
z-index:1000; z-index:1000;
} }
.darkX_minimize { .darkX_minimize {
width: 21px; width: 21px;
height: 21px; height: 21px;
background: transparent url(darkX/button-minimize-focused.png) no-repeat 0 0; background: transparent url(darkX/button-minimize-focused.png) no-repeat 0 0;
position:absolute; position:absolute;
top:0px; top:0px;
right:26px; right:26px;
cursor:pointer; cursor:pointer;
z-index:1000; z-index:1000;
} }
.darkX_maximize { .darkX_maximize {
width: 21px; width: 21px;
height: 21px; height: 21px;
background: transparent url(darkX/button-maximize-focused.png) no-repeat 0 0; background: transparent url(darkX/button-maximize-focused.png) no-repeat 0 0;
position:absolute; position:absolute;
top:0px; top:0px;
right:47px; right:47px;
cursor:pointer; cursor:pointer;
z-index:1000; z-index:1000;
} }
.darkX_title { .darkX_title {
float:left; float:left;
height:14px; height:14px;
font-size:12px; font-size:12px;
text-align:center; text-align:center;
margin-top:2px; margin-top:2px;
width:100%; width:100%;
color:#FFF; color:#FFF;
} }
.darkX_content { .darkX_content {
overflow:auto; overflow:auto;
color: #E6DF2A; color: #E6DF2A;
font-family: Tahoma, Arial, sans-serif; font-family: Tahoma, Arial, sans-serif;
font-size: 14px; font-size: 14px;
background:#5E5148; background:#5E5148;
} }
/* FOR IE */ /* FOR IE */
* html .darkX_minimize { * html .darkX_minimize {
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-minimize-focused.png", sizingMethod="crop"); filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-minimize-focused.png", sizingMethod="crop");
} }
* html .darkX_maximize { * html .darkX_maximize {
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-maximize-focused.png", sizingMethod="scale"); filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-maximize-focused.png", sizingMethod="scale");
} }
* html .darkX_close { * html .darkX_close {
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-close-focused.png", sizingMethod="crop"); filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-close-focused.png", sizingMethod="crop");
} }

@ -1,25 +1,25 @@
div.inspector div.inspectable { div.inspector div.inspectable {
padding: 0.25em 0 0.25em 1em; padding: 0.25em 0 0.25em 1em;
background-color: Gray; background-color: Gray;
color: white; color: white;
border: outset 2px white; border: outset 2px white;
cursor: pointer; cursor: pointer;
} }
div.inspector div.child { div.inspector div.child {
margin: 0 0 0 1em; margin: 0 0 0 1em;
} }
#debug_window_content { /* DIV container for debug sizing*/ #debug_window_content { /* DIV container for debug sizing*/
width:250px; width:250px;
height:100px; height:100px;
background-color:#000; background-color:#000;
} }
#debug { /* DIV container for debug contents*/ #debug { /* DIV container for debug contents*/
padding:3px; padding:3px;
color:#0f0; color:#0f0;
font-family:monaco, Tahoma, Verdana, Arial, Helvetica, sans-serif; font-family:monaco, Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size:10px; font-size:10px;
} }

@ -1,155 +1,155 @@
.overlay_dialog { .overlay_dialog {
background-color: #666666; background-color: #666666;
filter:alpha(opacity=60); filter:alpha(opacity=60);
-moz-opacity: 0.6; -moz-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
.overlay___invisible__ { .overlay___invisible__ {
background-color: #666666; background-color: #666666;
filter:alpha(opacity=0); filter:alpha(opacity=0);
-moz-opacity: 0; -moz-opacity: 0;
opacity: 0; opacity: 0;
} }
.dialog_nw { .dialog_nw {
width: 9px; width: 9px;
height: 23px; height: 23px;
background: transparent url(default/top_left.gif) no-repeat 0 0; background: transparent url(default/top_left.gif) no-repeat 0 0;
} }
.dialog_n { .dialog_n {
background: transparent url(default/top_mid.gif) repeat-x 0 0; background: transparent url(default/top_mid.gif) repeat-x 0 0;
height: 23px; height: 23px;
} }
.dialog_ne { .dialog_ne {
width: 9px; width: 9px;
height: 23px; height: 23px;
background: transparent url(default/top_right.gif) no-repeat 0 0; background: transparent url(default/top_right.gif) no-repeat 0 0;
} }
.dialog_e { .dialog_e {
width: 2px; width: 2px;
background: transparent url(default/center_right.gif) repeat-y 0 0; background: transparent url(default/center_right.gif) repeat-y 0 0;
} }
.dialog_w { .dialog_w {
width: 2px; width: 2px;
background: transparent url(default/center_left.gif) repeat-y 0 0; background: transparent url(default/center_left.gif) repeat-y 0 0;
} }
.dialog_sw { .dialog_sw {
width: 9px; width: 9px;
height: 19px; height: 19px;
background: transparent url(default/bottom_left.gif) no-repeat 0 0; background: transparent url(default/bottom_left.gif) no-repeat 0 0;
} }
.dialog_s { .dialog_s {
background: transparent url(default/bottom_mid.gif) repeat-x 0 0; background: transparent url(default/bottom_mid.gif) repeat-x 0 0;
height: 19px; height: 19px;
} }
.dialog_se { .dialog_se {
width: 9px; width: 9px;
height: 19px; height: 19px;
background: transparent url(default/bottom_right.gif) no-repeat 0 0; background: transparent url(default/bottom_right.gif) no-repeat 0 0;
} }
.dialog_sizer { .dialog_sizer {
width: 9px; width: 9px;
height: 19px; height: 19px;
background: transparent url(default/sizer.gif) no-repeat 0 0; background: transparent url(default/sizer.gif) no-repeat 0 0;
cursor:se-resize; cursor:se-resize;
} }
.dialog_close { .dialog_close {
width: 14px; width: 14px;
height: 14px; height: 14px;
background: transparent url(default/close.gif) no-repeat 0 0; background: transparent url(default/close.gif) no-repeat 0 0;
position:absolute; position:absolute;
top:5px; top:5px;
left:8px; left:8px;
cursor:pointer; cursor:pointer;
z-index:2000; z-index:2000;
} }
.dialog_minimize { .dialog_minimize {
width: 14px; width: 14px;
height: 15px; height: 15px;
background: transparent url(default/minimize.gif) no-repeat 0 0; background: transparent url(default/minimize.gif) no-repeat 0 0;
position:absolute; position:absolute;
top:5px; top:5px;
left:28px; left:28px;
cursor:pointer; cursor:pointer;
z-index:2000; z-index:2000;
} }
.dialog_maximize { .dialog_maximize {
width: 14px; width: 14px;
height: 15px; height: 15px;
background: transparent url(default/maximize.gif) no-repeat 0 0; background: transparent url(default/maximize.gif) no-repeat 0 0;
position:absolute; position:absolute;
top:5px; top:5px;
left:49px; left:49px;
cursor:pointer; cursor:pointer;
z-index:2000; z-index:2000;
} }
.dialog_title { .dialog_title {
float:left; float:left;
height:14px; height:14px;
font-family: Tahoma, Arial, sans-serif; font-family: Tahoma, Arial, sans-serif;
font-size:12px; font-size:12px;
text-align:center; text-align:center;
width:100%; width:100%;
color:#000; color:#000;
} }
.dialog_content { .dialog_content {
overflow:auto; overflow:auto;
color: #DDD; color: #DDD;
font-family: Tahoma, Arial, sans-serif; font-family: Tahoma, Arial, sans-serif;
font-size: 10px; font-size: 10px;
background-color:#123; background-color:#123;
} }
.top_draggable, .bottom_draggable { .top_draggable, .bottom_draggable {
cursor:move; cursor:move;
} }
.status_bar { .status_bar {
font-size:12px; font-size:12px;
} }
.status_bar input{ .status_bar input{
font-size:12px; font-size:12px;
} }
.wired_frame { .wired_frame {
display: block; display: block;
position: absolute; position: absolute;
border: 1px #000 dashed; border: 1px #000 dashed;
} }
/* DO NOT CHANGE THESE VALUES*/ /* DO NOT CHANGE THESE VALUES*/
.dialog { .dialog {
display: block; display: block;
position: absolute; position: absolute;
} }
.dialog table.table_window { .dialog table.table_window {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
width: 100%; width: 100%;
margin: 0px; margin: 0px;
padding:0px; padding:0px;
} }
.dialog table.table_window td , .dialog table.table_window th { .dialog table.table_window td , .dialog table.table_window th {
padding: 0; padding: 0;
} }
.dialog .title_window { .dialog .title_window {
-moz-user-select:none; -moz-user-select:none;
} }

@ -1,3 +1,3 @@
/* PNG fix for all themes that uses PNG images on IE */ /* PNG fix for all themes that uses PNG images on IE */
td, div { behavior: url(../themes/iefix/iepngfix.htc) } td, div { behavior: url(../themes/iefix/iepngfix.htc) }

@ -1,54 +1,54 @@
<public:component> <public:component>
<public:attach event="onpropertychange" onevent="doFix()" /> <public:attach event="onpropertychange" onevent="doFix()" />
<script type="text/javascript"> <script type="text/javascript">
// IE5.5+ PNG Alpha Fix v1.0RC4 // IE5.5+ PNG Alpha Fix v1.0RC4
// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com // (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
// This is licensed under the CC-GNU LGPL, version 2.1 or later. // This is licensed under the CC-GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/ // For details, see: http://creativecommons.org/licenses/LGPL/2.1/
// Modified/Simplified on 04/23/2007 by Sebastien Gruhier (http://www.xilinus.com) // Modified/Simplified on 04/23/2007 by Sebastien Gruhier (http://www.xilinus.com)
// To work only on background and to handle repeat bg // To work only on background and to handle repeat bg
// This must be a path to a blank image. That's all the configuration you need. // This must be a path to a blank image. That's all the configuration you need.
if (typeof blankImg == 'undefined') var blankImg = 'blank.gif'; if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
var f = 'DXImageTransform.Microsoft.AlphaImageLoader'; var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
function filt(s, m) function filt(s, m)
{ {
if (filters[f]) if (filters[f])
{ {
filters[f].enabled = s ? true : false; filters[f].enabled = s ? true : false;
if (s) with (filters[f]) { src = s; sizingMethod = m } if (s) with (filters[f]) { src = s; sizingMethod = m }
} }
else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")'; else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
} }
function doFix() function doFix()
{ {
// Assume IE7 is OK. // Assume IE7 is OK.
if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) || if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
(event && !/(background|src)/.test(event.propertyName))) return; (event && !/(background|src)/.test(event.propertyName))) return;
var bgImg = currentStyle.backgroundImage || style.backgroundImage; var bgImg = currentStyle.backgroundImage || style.backgroundImage;
var bgRepeat = currentStyle.backgroundRepeat || style.backgroundRepeat; var bgRepeat = currentStyle.backgroundRepeat || style.backgroundRepeat;
if (bgImg && bgImg != 'none') if (bgImg && bgImg != 'none')
{ {
if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i)) if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
{ {
var s = RegExp.$1; var s = RegExp.$1;
if (currentStyle.width == 'auto' && currentStyle.height == 'auto') if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
style.width = offsetWidth + 'px'; style.width = offsetWidth + 'px';
style.backgroundImage = 'none'; style.backgroundImage = 'none';
filt(s, bgRepeat == "no-repeat" ? 'crop' : 'scale'); filt(s, bgRepeat == "no-repeat" ? 'crop' : 'scale');
} }
} }
} }
doFix(); doFix();
</script> </script>
</public:component> </public:component>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save