Merge branch 'cxt_course' into develop

Conflicts:
	app/views/users/_news_replies.html.erb
This commit is contained in:
cxt 2016-09-02 15:24:55 +08:00
commit aaefd8b4aa
50 changed files with 416 additions and 279 deletions

View File

@ -599,8 +599,19 @@ class AdminController < ApplicationController
#学校列表 #学校列表
def schools def schools
@order = ""
@sort = ""
@schools = School.find_by_sql("SELECT * FROM schools ORDER BY created_at DESC") @schools = School.find_by_sql("SELECT * FROM schools ORDER BY created_at DESC")
if params[:sort] && (params[:order] == 'num')
@order = params[:order]
@sort = params[:sort]
@schools.each do |school|
count = UserExtensions.where("school_id = #{school.id} or occupation = '#{school.name}'").count
school[:infocount] = count.to_i
end
@sort == 'asc' ? (@schools = @schools.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@schools = @schools.sort{|x,y| y[:infocount] <=> x[:infocount]})
end
@school_count = @schools.count @school_count = @schools.count
@school_pages = Paginator.new @school_count, 30, params['page'] || 1 @school_pages = Paginator.new @school_count, 30, params['page'] || 1

View File

@ -40,7 +40,7 @@ class AvatarController < ApplicationController
@urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file)) @urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file))
# 用户头像上传时进行特别处理 # 用户头像上传时进行特别处理
if @is_direct == '1' && (@source_type == 'User' || @source_type == 'Course' || @source_type == 'Project') if @is_direct == '1' && (@source_type == 'User' || @source_type == 'Course' || @source_type == 'Project' || @source_type == 'Organization')
diskfile += "temp" diskfile += "temp"
@urlfile += "temp" @urlfile += "temp"
end end

View File

@ -96,6 +96,9 @@ class MyController < ApplicationController
elsif params[:project] elsif params[:project]
@project = Project.find params[:project] @project = Project.find params[:project]
diskfile = disk_filename('Project', @project.id) diskfile = disk_filename('Project', @project.id)
elsif params[:organization]
@organization = Organization.find params[:organization]
diskfile = disk_filename('Organization', @organization.id)
else else
@user = User.current @user = User.current
diskfile = disk_filename('User', @user.id) diskfile = disk_filename('User', @user.id)
@ -116,6 +119,9 @@ class MyController < ApplicationController
when 'Project' when 'Project'
@project = Project.find params[:source_id] @project = Project.find params[:source_id]
diskfile = disk_filename('Project', @project.id) diskfile = disk_filename('Project', @project.id)
when 'Organization'
@organization = Organization.find params[:source_id]
diskfile = disk_filename('Organization', @organization.id)
end end
end end
diskfile1 = diskfile + 'temp' diskfile1 = diskfile + 'temp'

View File

@ -1402,7 +1402,7 @@ class StudentWorkController < ApplicationController
end end
def find_or_save_student_work(is_test) def find_or_save_student_work(is_test)
student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id, is_test: is_test).first
if student_work.nil? if student_work.nil?
@homework.student_works.build( @homework.student_works.build(
name: params[:title], name: params[:title],
@ -1413,7 +1413,7 @@ class StudentWorkController < ApplicationController
unless @homework.save unless @homework.save
logger.debug @homework.errors.full_messages logger.debug @homework.errors.full_messages
else else
student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id, is_test: is_test).first
end end
end end
student_work student_work

View File

@ -983,7 +983,7 @@ class UsersController < ApplicationController
@user = User.current @user = User.current
@homework = HomeworkCommon.find(params[:homework_id]) @homework = HomeworkCommon.find(params[:homework_id])
@is_test = params[:is_test] == 'true' @is_test = params[:is_test] == 'true'
@student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first @student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id, is_test: @is_test).first
if @student_work.nil? if @student_work.nil?
@student_work = StudentWork.new @student_work = StudentWork.new
end end
@ -1660,55 +1660,117 @@ class UsersController < ApplicationController
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
project_types = "('Message','Issue','Project')" project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage" principal_types = "JournalsForMessage"
container_type = ''
act_type = ''
if params[:type].present? if params[:type].present?
case params[:type] case params[:type]
when "course_homework" when "course_homework"
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Course'
act_type = 'HomeworkCommon'
when "course_news" when "course_news"
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Course'
act_type = 'News'
when "course_message" when "course_message"
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Course'
act_type = 'Message'
when "course_poll" when "course_poll"
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Course'
act_type = 'Poll'
when "course_journals" when "course_journals"
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Course'
act_type = 'JournalsForMessage'
when "project_issue" when "project_issue"
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Project'
act_type = 'Issue'
when "project_message" when "project_message"
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Course'
act_type = 'Message'
when "user_journals" when "user_journals"
@user_activities = UserActivity.where("container_type = 'Principal' and act_type= 'JournalsForMessage' and container_id = #{@user.id}").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Principal'
act_type = 'JournalsForMessage'
when "current_user" when "current_user"
@user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10) container_type = 'Principal'
else act_type = 'Principal'
if @user == User.current end
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" end
if container_type != '' && act_type != ''
if container_type == 'Course'
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
elsif container_type == 'Project'
sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'"
elsif container_type == 'Principal' && act_type == 'JournalsForMessage'
sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}"
elsif container_type == 'Principal' && act_type == 'Principal'
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
end
if User.current != @user
sql += "and user_id = #{@user.id}"
end
else else
if User.current != @user
blog_ids = "("+@user.blog.id.to_s+")" blog_ids = "("+@user.blog.id.to_s+")"
end sql = "user_id = #{@user.id} and((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10) "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids}))"
end
else else
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10) blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
end
end
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
# if params[:type].present?
# case params[:type]
# when "course_homework"
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
# when "course_news"
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
# when "course_message"
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
# when "course_poll"
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
# when "course_journals"
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
# when "project_issue"
# @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
# when "project_message"
# @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
# when "user_journals"
# @user_activities = UserActivity.where("container_type = 'Principal' and act_type= 'JournalsForMessage' and container_id = #{@user.id}").order('updated_at desc').limit(10).offset(@page * 10)
# when "current_user"
# @user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10)
# else
# if @user == User.current
# blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" # blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
# 减少数据库交互 # else
if @user == User.current # blog_ids = "("+@user.blog.id.to_s+")"
watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(',')) # end
user_ids = "(" + @user.id.to_s + watched_user_ids + ")" # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
else # "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
user_ids = "(" + @user.id.to_s + ")" # "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
end # "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}") # end
blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")" # else
# # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + # # blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ # # 减少数据库交互
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + # if @user == User.current
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10) # watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
end # user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
# else
# user_ids = "(" + @user.id.to_s + ")"
# end
# watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}")
# blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")"
#
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
# "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
# "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
# "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
# end
# @user_activities = paginateHelper @user_activities,500 # @user_activities = paginateHelper @user_activities,500
@type = params[:type] @type = params[:type]
respond_to do |format| respond_to do |format|

View File

@ -1,6 +1,6 @@
module SchoolHelper module SchoolHelper
def schoolMember_num school def schoolMember_num school
count = student_num(school) + teacher_num(school) count = UserExtensions.where("school_id = #{school.id} or occupation = '#{school.name}'").count
count.to_s count.to_s
end end

View File

@ -22,9 +22,13 @@ module StudentWorkHelper
end end
#获取指定用户对某一作业的评分结果 #获取指定用户对某一作业的评分结果
def student_work_score work,user def student_work_score work,user,reviewer_role=0
if reviewer_role != 0
StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id,:reviewer_role => reviewer_role).last
else
StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id).last StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id).last
end end
end
#获取指定评分的角色 #获取指定评分的角色
def student_work_score_role score def student_work_score_role score

View File

@ -184,8 +184,10 @@ class AtMessage < ActiveRecord::Base
when 'JournalsForMessage' when 'JournalsForMessage'
if at_message.jour_type == 'Principal' if at_message.jour_type == 'Principal'
{controller: :users, action: :user_messages, id: at_message.at_user} {controller: :users, action: :user_messages, id: at_message.at_user}
else elsif at_message.jour_type == 'HomeworkCommon'
{controller: :homework_common, action: :index, course: at_message.jour.course_id} {controller: :homework_common, action: :index, course: at_message.jour.course_id}
elsif at_message.jour_type == 'Course'
{controller: :courses, action: :feedback, id: at_message.jour_id}
end end
else else

View File

@ -20,8 +20,8 @@
<th style="width: 100px;"> <th style="width: 100px;">
学校名称 学校名称
</th> </th>
<th style="width: 35px;"> <th style="width: 35px;" class = "<%= @order == 'num' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
用户数 <%= link_to '用户数', admin_schools_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'num') %>
</th> </th>
<th style="width: 90px;"> <th style="width: 90px;">
创建时间 创建时间

View File

@ -1,4 +1,4 @@
<% if @is_direct == '1' && (@source_type=='User'|| @source_type == 'Course' || @source_type == 'Project') %> <% if @is_direct == '1' && (@source_type=='User'|| @source_type == 'Course' || @source_type == 'Project' || @source_type == 'Organization') %>
var imgSpan = $("img[nhname='avatar_image']"); var imgSpan = $("img[nhname='avatar_image']");
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'}); imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% else %> <% else %>

View File

@ -134,7 +134,7 @@
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id%>').show();" onmouseout="$('#delete_reply_<%=comment.id%>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %> <% if !comment.content_detail.blank? %>
@ -161,7 +161,8 @@
l(:button_delete), l(:button_delete),
{:controller => 'blog_comments', :action => 'destroy', :id => comment.id}, {:controller => 'blog_comments', :action => 'destroy', :id => comment.id},
:method => :delete, :method => :delete,
:class => 'fr mr20', :id => "delete_reply_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) %> ) %>

View File

@ -11,27 +11,27 @@
$("#relateProject,.relatePInfo").mouseout(function(){ $("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none"); $(".relatePInfo").css("display","none");
}) })
$(".homepagePostPortrait").mouseover(function(){ // $(".homepagePostPortrait").mouseover(function(){
onImage = true; // onImage = true;
$(this).children(".userCard").css("display","block"); // $(this).children(".userCard").css("display","block");
}) // })
$(".homepagePostPortrait").mouseout(function(){ // $(".homepagePostPortrait").mouseout(function(){
var cur = $(this); // var cur = $(this);
onImage = false; // onImage = false;
setTimeout(function(){ // setTimeout(function(){
if (onUserCard == false && onImage == false){ // if (onUserCard == false && onImage == false){
$(cur).children(".userCard").css("display", "none"); // $(cur).children(".userCard").css("display", "none");
} // }
}, 500); // }, 500);
}) // })
$(".userCard").mouseover(function(){ // $(".userCard").mouseover(function(){
onUserCard = true; // onUserCard = true;
$(this).css("display","block"); // $(this).css("display","block");
}) // })
$(".userCard").mouseout(function(){ // $(".userCard").mouseout(function(){
onUserCard = false; // onUserCard = false;
$(this).css("display","none"); // $(this).css("display","none");
}) // });
$(".coursesLineGrey").mouseover(function(){ $(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff"); $(this).css("color","#ffffff");
}) })

View File

@ -5,7 +5,7 @@
<div class="ping_dispic"> <div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %> <%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
</div> </div>
<div class="ping_discon upload_img" style="width: 610px;"> <div class="ping_discon upload_img" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_distop f14"> <div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span> <span>
@ -28,17 +28,17 @@
<span id="reply_praise_count_<%=journal.id %>"> <span id="reply_praise_count_<%=journal.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
</span> </span>
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %> <% if reply_allow %>
<%#= link_to l(:label_bid_respond_quote),'', <%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>"reply_btn"} %> <%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>"reply_btn"} %>
<% end %> <% end %>
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :id => "delete_reply_#{journal.id}",
:class => "delete undis", :title => l(:button_delete)) %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>

View File

@ -218,8 +218,12 @@
<% end %> <% end %>
</div> </div>
<div class="ur_buttons"> <div class="ur_buttons">
<% if exercise.time == -1 %>
<%= link_to "保存",commit_exercise_exercise_path(exercise,:save => 1),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:format => 'js',:remote=>true %> <%= link_to "保存",commit_exercise_exercise_path(exercise,:save => 1),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:format => 'js',:remote=>true %>
<%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:20px;",:format => 'js',:remote=>true %> <%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:20px;",:format => 'js',:remote=>true %>
<% else %>
<%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:84px;",:format => 'js',:remote=>true %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<!--contentbox end--> <!--contentbox end-->

View File

@ -10,7 +10,7 @@
<div class="homepagePostReplyPortrait" > <div class="homepagePostReplyPortrait" >
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%> <%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
<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 %>">
@ -40,7 +40,8 @@
l(:button_delete), l(:button_delete),
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>comment.id}, {:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>comment.id},
:method => :get, :method => :get,
:class => 'fr mr20', :id => "delete_reply_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if comment.user_id == User.current.id %> ) if comment.user_id == User.current.id %>

View File

@ -6,7 +6,7 @@ $("#issue_detail").show();
$("#issue_edit").hide(); $("#issue_edit").hide();
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); $("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>"); sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)') $(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
//edit里的编辑器貌似显示不出来所以手动js生成。 //edit里的编辑器貌似显示不出来所以手动js生成。
issue_desc_editor = KindEditor.create('#issue_description', issue_desc_editor = KindEditor.create('#issue_description',
{"width":"85%", {"width":"85%",

View File

@ -31,7 +31,7 @@
<div class="cl"></div> <div class="cl"></div>
<div class="sy_class_logo fl"> <div class="sy_class_logo fl">
<div class="pr" style="width: 96px; height:96px;"> <div class="pr" style="width: 96px; height:96px;">
<% if User.current.logged? && (User.current == @course.teacher || User.current.admin?)%> <% if is_teacher%>
<%=link_to image_tag(url_to_avatar(@course),width:"96", height: "96", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @course.id), :remote => true%> <%=link_to image_tag(url_to_avatar(@course),width:"96", height: "96", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @course.id), :remote => true%>
<div class="homepageEditProfile undis"> <div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:course => @course.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %> <%=link_to '', my_clear_user_avatar_temp_path(:course => @course.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>

View File

@ -115,7 +115,7 @@
<%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%> <%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
</li> </li>
<% end %> <% end %>
<% elsif ma.class == ForgeMessage %> <% elsif ma.class == ForgeMessage && ma.forge_message %>
<% if ma.forge_message_type == "AppliedProject" %> <% if ma.forge_message_type == "AppliedProject" %>
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li> <li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "JoinProject" %> <% elsif ma.forge_message_type == "JoinProject" %>

View File

@ -1,9 +1,9 @@
<p style="position:relative; display:inline;"><% if syllabus.eng_name && !syllabus.eng_name.empty? %> <p style="position:relative; display:inline;"><% if syllabus.eng_name && !syllabus.eng_name.empty? %>
<span><%=syllabus.eng_name %></span> <span><%=syllabus.eng_name %></span>
<% else%> <% else%>
<span style="color: #888">课程英文名称</span> <span style="color: #888"></span>
<% end %> <% end %>
<% if User.current == syllabus.user || User.current.admin? %> <% if User.current == syllabus.user || User.current.admin? %>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :style => "width:15px; position:absolute; right: -20px; top: 5px;", :class => "none", :onclick => "show_edit_eng_name('#{syllabus.eng_name}');"%> <%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :style => "width:15px; position:absolute; right: -20px; top: 5px;", :class => "none", :onclick => "show_edit_eng_name('#{syllabus.eng_name}');", :title => '编辑课程英文名称'%>
<% end %> <% end %>
</p> </p>

View File

@ -1,5 +1,6 @@
<h2 style="position:relative; display:inline;">课程名称:<%=syllabus.title %> <h2 style="position:relative; display:inline;">
<%=syllabus.title %>
<% if User.current == syllabus.user || User.current.admin? %> <% if User.current == syllabus.user || User.current.admin? %>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :style => "width:15px; position:absolute; right: -20px; top: 15px;", :onclick => "show_edit_title('#{syllabus.title}');"%> <%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :style => "width:15px; position:absolute; right: -20px; top: 15px;", :onclick => "show_edit_title('#{syllabus.title}');", :title => '编辑课程名称'%>
<% end %> <% end %>
</h2> </h2>

View File

@ -13,7 +13,7 @@
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= stylesheet_link_tag 'prettify','jquery/jquery-ui-1.9.2','css/common','css/structure','css/public','repository','css/courses','css/org','css/project', 'css/popup' %> <%= stylesheet_link_tag 'prettify','jquery/jquery-ui-1.9.2','css/common','css/structure','css/public','repository','css/courses','css/org','css/project', 'css/popup' %>
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%> <%= javascript_include_tag 'cookie','project',"avatars", 'organization','header','prettify','select_list_move','org'%>
<%= javascript_include_tag 'attachments' %> <%= javascript_include_tag 'attachments' %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
@ -77,16 +77,14 @@
<!--<div class="pr_info_logo fl mr10 mb5">--> <!--<div class="pr_info_logo fl mr10 mb5">-->
<!--<%#= image_tag(url_to_avatar(@organization), :width=>"60", :height=>"60", :alt=>"组织logo") %>--> <!--<%#= image_tag(url_to_avatar(@organization), :width=>"60", :height=>"60", :alt=>"组织logo") %>-->
<!--</div>--> <!--</div>-->
<div class="pr_info_logo fl fl mr10 mb5" id="homepage_portrait_image"> <div class="pr_info_logo fl fl mr10 mb5 pr" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %> <% if User.current.logged? && User.current.admin_of_org?(@organization)%>
<% if User.current.logged?%> <%=link_to image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true%>
<% if User.current.id == @organization.creator_id%> <div class="homepageEditProfile undis">
<div id="edit_org_file_btn" class="none"> <%=link_to '', my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
<div class="homepageEditProfile">
<a href="<%= clear_org_avatar_temp_organization_path(@organization) %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div> </div>
</div> <% else %>
<% end %> <%= image_tag(url_to_avatar(@organization), :width => "60", :height => "60", :alt => "组织logo") %>
<% end %> <% end %>
</div> </div>
<!--<div class="orgName fl mb5 f14">组织id<%#= @organization.id %></div>--> <!--<div class="orgName fl mb5 f14">组织id<%#= @organization.id %></div>-->
@ -172,6 +170,10 @@
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @organization} %>
</div>
<script type="text/javascript"> <script type="text/javascript">
$("#courseMenu").mouseenter(function(){ $("#courseMenu").mouseenter(function(){
$("#topnav_course_menu").show(); $("#topnav_course_menu").show();

View File

@ -34,9 +34,12 @@
<%# 弹框 %> <%# 弹框 %>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div> <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @organization} %>
</div>
<%= call_hook :view_layouts_base_body_bottom %> <%= call_hook :view_layouts_base_body_bottom %>
<%# JS提前加载 %> <%# JS提前加载 %>
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%> <%= javascript_include_tag 'cookie','project',"avatars", 'organization','header','prettify','select_list_move','org'%>
<%= javascript_include_tag 'attachments' %> <%= javascript_include_tag 'attachments' %>
</body> </body>
</html> </html>

View File

@ -33,31 +33,31 @@
$(document).ready(function(){ $(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){ $("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block"); $(".relatePInfo").css("display","block");
}) });
$("#relateProject,.relatePInfo").mouseout(function(){ $("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none"); $(".relatePInfo").css("display","none");
}) });
$(".homepagePostPortrait").mouseover(function(){ // $(".homepagePostPortrait").mouseover(function(){
onImage = true; // onImage = true;
$(this).children(".userCard").css("display","block"); // $(this).children(".userCard").css("display","block");
}) // });
$(".homepagePostPortrait").mouseout(function(){ // $(".homepagePostPortrait").mouseout(function(){
var cur = $(this); // var cur = $(this);
onImage = false; // onImage = false;
setTimeout(function(){ // setTimeout(function(){
if (onUserCard == false && onImage == false) { // if (onUserCard == false && onImage == false) {
$(cur).children(".userCard").css("display","none"); // $(cur).children(".userCard").css("display","none");
} // }
},500); // },500);
}) // });
$(".userCard").mouseover(function(){ // $(".userCard").mouseover(function(){
onUserCard = true; // onUserCard = true;
$(this).css("display","block"); // $(this).css("display","block");
}) // });
$(".userCard").mouseout(function(){ // $(".userCard").mouseout(function(){
onUserCard = false; // onUserCard = false;
$(this).css("display","none"); // $(this).css("display","none");
}) // });
$(".coursesLineGrey").mouseover(function(){ $(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff"); $(this).css("color","#ffffff");
}) })

View File

@ -33,34 +33,34 @@
$(document).ready(function(){ $(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){ $("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block"); $(".relatePInfo").css("display","block");
}) });
$("#relateProject,.relatePInfo").mouseout(function(){ $("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none"); $(".relatePInfo").css("display","none");
}) });
$(".homepagePostPortrait").mouseover(function(){ // $(".homepagePostPortrait").mouseover(function(){
onImage = true; // onImage = true;
$(this).children(".userCard").css("display","block"); // $(this).children(".userCard").css("display","block");
}) // });
$(".homepagePostPortrait").mouseout(function(){ // $(".homepagePostPortrait").mouseout(function(){
var cur = $(this); // var cur = $(this);
onImage = false; // onImage = false;
setTimeout(function(){ // setTimeout(function(){
if (onUserCard == false && onImage == false) { // if (onUserCard == false && onImage == false) {
$(cur).children(".userCard").css("display","none"); // $(cur).children(".userCard").css("display","none");
} // }
},500); // },500);
}) // });
$(".userCard").mouseover(function(){ // $(".userCard").mouseover(function(){
onUserCard = true; // onUserCard = true;
$(this).css("display","block"); // $(this).css("display","block");
}) // });
$(".userCard").mouseout(function(){ // $(".userCard").mouseout(function(){
onUserCard = false; // onUserCard = false;
$(this).css("display","none"); // $(this).css("display","none");
}) // });
$(".coursesLineGrey").mouseover(function(){ $(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff"); $(this).css("color","#ffffff");
}) });
$(".coursesLineGrey").mouseout(function(){ $(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080"); $(this).css("color","#808080");
}); });

View File

@ -107,7 +107,7 @@
<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" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%> <%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>"> <div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
@ -132,7 +132,8 @@
l(:button_delete), l(:button_delete),
{:action => 'destroy', :id => reply}, {:action => 'destroy', :id => reply},
:method => :post, :method => :post,
:class => 'fr mr20', :id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %> ) if reply.course_destroyable_by?(User.current) %>

View File

@ -171,7 +171,7 @@
<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" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%> <%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>"> <div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
@ -196,7 +196,8 @@
l(:button_delete), l(:button_delete),
{:action => 'destroy', :id => reply}, {:action => 'destroy', :id => reply},
:method => :post, :method => :post,
:class => 'fr mr20', :id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if reply.destroyable_by?(User.current) %> ) if reply.destroyable_by?(User.current) %>

View File

@ -10,5 +10,15 @@ if($("#course_avatar_form").length > 0) {
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>'); $("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>');
if($("#project_avatar_form").length > 0) { if($("#project_avatar_form").length > 0) {
window.location.href = "<%=settings_project_path(@project) %>"; window.location.href = "<%=settings_project_path(@project) %>";
}<% end %> }
<% elsif @organization %>
<% if @organization.show_mode == 1 %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@organization), :id=>'nh_source_tx',:style=>"width:51px;height:51px;overflow:hidden",:alt=>"组织logo") %>');
<% else %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@organization), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"组织logo") %>');
<% end %>
if($("#org_avatar_form").length > 0) {
window.location.href = "<%=setting_organization_path(@organization) %>";
}
<% end %>
hideModal(); hideModal();

View File

@ -19,7 +19,7 @@
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%> <%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %> <% if !comment.content_detail.blank? %>
@ -47,7 +47,8 @@
:action => 'destroy', :id => @news, :action => 'destroy', :id => @news,
:comment_id => comment}, :comment_id => comment},
:method => :delete, :method => :delete,
:class => 'fr mr20', :id => "delete_reply_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if User.current.allowed_to?(:manage_news, object) %> ) if User.current.allowed_to?(:manage_news, object) %>

View File

@ -102,7 +102,7 @@
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id%>').show();" onmouseout="$('#delete_reply_<%=comment.id%>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %> <% if !comment.content_detail.blank? %>
@ -129,7 +129,8 @@
l(:button_delete), l(:button_delete),
{:controller => 'org_document_comments',:action => 'delete_reply', :id => comment.id}, {:controller => 'org_document_comments',:action => 'delete_reply', :id => comment.id},
:method => :delete, :method => :delete,
:class => 'fr mr20', :id => "delete_reply_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)) %> :title => l(:button_delete)) %>
<% end %> <% end %>

View File

@ -24,7 +24,8 @@
:upload_path => upload_avatar_path(:format => 'js'), :upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description) :description_placeholder => nil ,# l(:label_optional_description)
:source_type => source.class.to_s, :source_type => source.class.to_s,
:source_id => source.id.to_s :source_id => source.id.to_s,
:is_direct => 0
} %> } %>
<!--</span>--> <!--</span>-->
<% content_for :header_tags do %> <% content_for :header_tags do %>

View File

@ -1,7 +1,17 @@
<div class="por_header_top"> <div class="por_header_top">
<div class="por_header_con"> <div class="por_header_con">
<%= image_tag(url_to_avatar(@organization), width:"51", height: "51", :id => 'nh_user_tx', :class => "por_logo fl mt1", :target => "_blank") %> <div class="pr fl">
<% if User.current.logged? && User.current.admin_of_org?(@organization)%>
<%=link_to image_tag(url_to_avatar(@organization),width:"51", height: "51", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@organization), :width => "51", :height => "51", :alt => "组织logo") %>
<% end %>
</div>
<%#= image_tag(url_to_avatar(@organization), width:"51", height: "51", :id => 'nh_user_tx', :class => "por_logo fl mt1", :target => "_blank") %>
<% if User.current.logged? %> <% if User.current.logged? %>
<div class="navHomepageProfile" id="navHomepageProfile"> <div class="navHomepageProfile" id="navHomepageProfile">
<ul> <ul>

View File

@ -4,45 +4,45 @@
$(document).ready(function(){ $(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){ $("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block"); $(".relatePInfo").css("display","block");
}) });
$("#relateProject,.relatePInfo").mouseout(function(){ $("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none"); $(".relatePInfo").css("display","none");
}) });
$(".homepagePostPortrait").mouseover(function(){ // $(".homepagePostPortrait").mouseover(function(){
onImage = true; // onImage = true;
$(this).children(".userCard").css("display","block"); // $(this).children(".userCard").css("display","block");
}) // });
$(".homepagePostPortrait").mouseout(function(){ // $(".homepagePostPortrait").mouseout(function(){
var cur = $(this); // var cur = $(this);
onImage = false; // onImage = false;
setTimeout(function(){ // setTimeout(function(){
if (onUserCard == false && onImage == false) { // if (onUserCard == false && onImage == false) {
$(cur).children(".userCard").css("display", "none"); // $(cur).children(".userCard").css("display", "none");
} // }
}, 500); // }, 500);
}) // });
$(".userCard").mouseover(function(){ // $(".userCard").mouseover(function(){
onUserCard = true; // onUserCard = true;
$(this).css("display","block"); // $(this).css("display","block");
}) // });
$(".userCard").mouseout(function(){ // $(".userCard").mouseout(function(){
onUserCard = false; // onUserCard = false;
$(this).css("display","none"); // $(this).css("display","none");
}) // });
$(".coursesLineGrey").mouseover(function(){ $(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff"); $(this).css("color","#ffffff");
}) });
$(".coursesLineGrey").mouseout(function(){ $(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080"); $(this).css("color","#808080");
}) });
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){ $(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff"); $(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999"); $(this).css("z-index", "9999");
}) });
$(".homepagePostSetting").mouseout(function(){ $(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080"); $(this).prev().css("color","#808080");
$(this).css("z-index", "1"); $(this).css("z-index", "1");
}) });
//二级菜单滑动时箭头方向控制 //二级菜单滑动时箭头方向控制
$(".homepageLeftMenuMoreIcon").toggle(function(){ $(".homepageLeftMenuMoreIcon").toggle(function(){

View File

@ -47,7 +47,9 @@
<!--<a href="javascript:void(0);" class="logoEnter fl linkGrey4">上传图片</a>--> <!--<a href="javascript:void(0);" class="logoEnter fl linkGrey4">上传图片</a>-->
<%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %> <%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %>
<%= labelled_form_for @organization do |f|%> <%= labelled_form_for @organization do |f|%>
<div id="org_avatar_form">
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %> <%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
</div>
<!--<div class="cl"></div>--> <!--<div class="cl"></div>-->
<!--</div>--> <!--</div>-->
<div class="orgRow mb10"><span class="c_red">*&nbsp;</span>组织名称:<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" /> <div class="orgRow mb10"><span class="c_red">*&nbsp;</span>组织名称:<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" />

View File

@ -3,7 +3,7 @@
<% for journal in journals %> <% for journal in journals %>
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'> <div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %></div> <div class="ping_dispic"><%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %></div>
<div class="ping_discon" style="width: 610px;"> <div class="ping_discon" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_distop f14"> <div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %> <span><%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %>
@ -20,17 +20,17 @@
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
</span> </span>
<% if journal.user == User.current|| User.current.admin? %> <% if journal.user == User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %> <% if reply_allow %>
<%#= link_to l(:label_bid_respond_quote),'', <%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %> <%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %>
<% end %> <% end %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :id => "delete_reply_#{journal.id}",
:class => "delete undis", :title => l(:button_delete)) %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>

View File

@ -5,41 +5,41 @@
$(document).ready(function(){ $(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){ $("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block"); $(".relatePInfo").css("display","block");
}) });
$("#relateProject,.relatePInfo").mouseout(function(){ $("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none"); $(".relatePInfo").css("display","none");
}) });
$(".homepagePostPortrait").mouseover(function(){ // $(".homepagePostPortrait").mouseover(function(){
onImage = true; // onImage = true;
$(this).children(".userCard").css("display","block"); // $(this).children(".userCard").css("display","block");
}) // });
$(".homepagePostPortrait").mouseout(function(){ // $(".homepagePostPortrait").mouseout(function(){
var cur = $(this); // var cur = $(this);
onImage = false; // onImage = false;
setTimeout(function(){ // setTimeout(function(){
if (onUserCard == false && onImage == false) { // if (onUserCard == false && onImage == false) {
$(cur).children(".userCard").css("display", "none"); // $(cur).children(".userCard").css("display", "none");
} // }
}, 500); // }, 500);
}) // });
$(".userCard").mouseover(function(){ // $(".userCard").mouseover(function(){
onUserCard = true; // onUserCard = true;
$(this).css("display","block"); // $(this).css("display","block");
}) // });
$(".userCard").mouseout(function(){ // $(".userCard").mouseout(function(){
onUserCard = false; // onUserCard = false;
$(this).css("display","none"); // $(this).css("display","none");
}) // });
$(".coursesLineGrey").mouseover(function(){ $(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff"); $(this).css("color","#ffffff");
}) });
$(".coursesLineGrey").mouseout(function(){ $(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080"); $(this).css("color","#808080");
}) });
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){ $(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff"); $(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999"); $(this).css("z-index", "9999");
}) });
$(".homepagePostSetting").mouseout(function(){ $(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080"); $(this).prev().css("color","#808080");
$(this).css("z-index", "1"); $(this).css("z-index", "1");

View File

@ -81,7 +81,7 @@
</td> </td>
<% end%> <% end%>
<% my_score = student_work_score(student_work,User.current) %> <% my_score = student_work_score(student_work,User.current,3) %>
<td class="hworkList70 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10"> <td class="hworkList70 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
</td> </td>

View File

@ -1,5 +1,5 @@
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl"> <ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
<% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) %> <% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) || score.reviewer_role != 3 %>
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %> <%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
<div class="pingBoxTit"> <div class="pingBoxTit">
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %> <%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>

View File

@ -27,7 +27,7 @@
<span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl mr20 mt3"></span> <span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl mr20 mt3"></span>
<div class="cl"></div> <div class="cl"></div>
<p class="sy_cgrey"> <p class="sy_cgrey">
<span class=" mr15">主讲老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %></span> <span class=" mr15">创建老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %></span>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,course) %> <% if User.current.admin? || User.current.allowed_to?(:as_teacher,course) %>
<% homework_num = course.homework_commons.count %> <% homework_num = course.homework_commons.count %>
<% else %> <% else %>

View File

@ -1,3 +1,4 @@
$("#syllabus_eng_name_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus} %>"); $("#syllabus_eng_name_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus} %>");
$("#syllabus_eng_name_show").show(); $("#syllabus_eng_name_show").show();
$("#syllabus_edit_ng_name_png").show();
$("#syllabus_eng_name_edit").hide(); $("#syllabus_eng_name_edit").hide();

View File

@ -215,15 +215,18 @@
</script> </script>
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;"> <div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
<% end %>
<% com_time = project.project_score.commit_time %> <% com_time = project.project_score.commit_time %>
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p> <% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>&nbsp;&nbsp;<%= project.project_score.changeset_num %>提交</p> <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像", :target => '_blank' %>
<p class="mh18 hidden"><%=link_to (User.find project.user_id).show_name+"(组长)", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{(User.find project.user_id).show_name}(组长)" %></p>
<% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
<p class="mh18 hidden"><%=link_to update_time+" "+project.project_score.changeset_num.to_s+"提交", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{update_time} #{project.project_score.changeset_num.to_s}提交" %></p>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %>
<p class="mh18 hidden" title="私有项目不可访问"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p class="mh18 hidden" title="私有项目不可访问"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>&nbsp;&nbsp;<%= project.project_score.changeset_num %>提交</p>
<% end %>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>"> <div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br /> 项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br /> 创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
@ -295,7 +298,7 @@
<% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %> <% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %> <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id, :activity_id => activity.id} %>
</div> </div>
<% end %> <% end %>

View File

@ -10,7 +10,7 @@
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %> <% if !comment.content_detail.blank? %>
@ -39,7 +39,8 @@
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board), delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board),
:method => :post, :method => :post,
:remote => true, :remote => true,
:class => 'fr mr20', :id => "delete_reply_#{activity_id}_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) %> ) %>
@ -56,7 +57,7 @@
</span> </span>
<% if comment.creator_user == User.current || User.current.admin? %> <% if comment.creator_user == User.current || User.current.admin? %>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id}, <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> :id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
<% end %> <% end %>
<% elsif type == 'OrgDocumentComment' %> <% elsif type == 'OrgDocumentComment' %>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">
@ -74,7 +75,8 @@
{:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id}, {:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
:method => :delete, :method => :delete,
:remote => true, :remote => true,
:class => 'fr mr20', :id => "delete_reply_#{activity_id}_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)) %> :title => l(:button_delete)) %>
<% end %> <% end %>
@ -94,7 +96,8 @@
{:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage, :user_id => user_id}, {:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage, :user_id => user_id},
:method => :delete, :method => :delete,
:remote => true, :remote => true,
:class => 'fr mr20', :id => "delete_reply_#{activity_id}_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)) %> :title => l(:button_delete)) %>
<% end %> <% end %>

View File

@ -10,7 +10,7 @@
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%> <%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? || comment.class == Journal %> <% if !comment.content_detail.blank? || comment.class == Journal %>
@ -44,7 +44,7 @@
</span> </span>
<% if User.current.admin? ||is_teacher || comment.user == User.current%> <% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> :id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
<% end %> <% end %>
<% elsif type == 'News' %> <% elsif type == 'News' %>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">
@ -75,7 +75,8 @@
:method => 'get', :method => 'get',
:confirm => l(:text_are_you_sure), :confirm => l(:text_are_you_sure),
:remote=>true, :remote=>true,
:class => 'fr mr20', :id => "delete_reply_#{activity_id}_#{comment.id}",
:class => 'fr mr20 undis',
:title => l(:button_delete) :title => l(:button_delete)
) if comment.user_id == User.current.id %> ) if comment.user_id == User.current.id %>
<% elsif type == 'Syllabus' %> <% elsif type == 'Syllabus' %>
@ -89,8 +90,8 @@
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span> <span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span> </span>
<% if User.current.admin? || User.current == Syllabus.find(activity_id).user || comment.user == User.current%> <% if User.current.admin? || User.current == Syllabus.find(activity_id).user || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user}, <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user},:id => "delete_reply_#{activity_id}_#{comment.id}",
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
<% end %> <% end %>
<% end %> <% end %>
</span> </span>

View File

@ -225,15 +225,18 @@
</script> </script>
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;"> <div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %>
<% end %>
<% com_time = project.project_score.commit_time %> <% com_time = project.project_score.commit_time %>
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p> <% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>&nbsp;&nbsp;<%= project.project_score.changeset_num %>提交</p> <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像", :target => '_blank' %>
<p class="mh18 hidden"><%=link_to (User.find project.user_id).show_name+"(组长)", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{(User.find project.user_id).show_name}(组长)" %></p>
<% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
<p class="mh18 hidden"><%=link_to update_time+" "+project.project_score.changeset_num.to_s+"提交", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{update_time} #{project.project_score.changeset_num.to_s}提交" %></p>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %>
<p class="mh18 hidden" title="私有项目不可访问"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p class="mh18 hidden" title="私有项目不可访问"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>&nbsp;&nbsp;<%= project.project_score.changeset_num %>提交</p>
<% end %>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>"> <div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
项目名称:<%=project.name %><br /> 项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br /> 创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
@ -307,7 +310,7 @@
<% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %> <% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= homework_common.id %>"> <div class="" id="reply_div_<%= homework_common.id %>">
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1} %> <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1, :activity_id => homework_common.id} %>
</div> </div>
<% end %> <% end %>

View File

@ -1,4 +1,4 @@
<% if ma.class == ForgeMessage %> <% if ma.class == ForgeMessage && ma.forge_message %>
<!--申请加入项目--> <!--申请加入项目-->
<% if ma.forge_message_type == "AppliedProject" %> <% if ma.forge_message_type == "AppliedProject" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">

View File

@ -1,5 +1,5 @@
<% if params[:type] == 'HomeworkCommon' %> <% if params[:type] == 'HomeworkCommon' %>
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>'); $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id, :activity_id => params[:id].to_i}) %>');
<% elsif params[:type] == 'JournalsForMessage' %> <% elsif params[:type] == 'JournalsForMessage' %>
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>'); $('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>');
<% elsif params[:type] == 'Message' %> <% elsif params[:type] == 'Message' %>

View File

@ -34,7 +34,9 @@
<ul class="homepagePostTypeProject fl"> <ul class="homepagePostTypeProject fl">
<li class="f14">更多</li> <li class="f14">更多</li>
<li class="mt-4"><%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%> <li class="mt-4"><%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%> <% if @user == User.current %>
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
<% end %>
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%> <li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
</ul> </ul>
</li> </li>

View File

@ -39,15 +39,15 @@
<span id="reply_praise_count_<%=reply.id %>"> <span id="reply_praise_count_<%=reply.id %>">
<%=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"}%>
</span> </span>
<% if User.current.admin? || reply.user.id == User.current.id || allow_delete%>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %> <% if reply_allow %>
<%#= link_to l(:button_reply),'', <%#= link_to l(:button_reply),'',
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<%= link_to l(:button_reply),'javascript:;',{:nhname=>"reply_btn"} %> <%= link_to l(:button_reply),'javascript:;',{:nhname=>"reply_btn"} %>
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: --> <% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
<% if User.current.admin? || reply.user.id == User.current.id || allow_delete%>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div id='<%=id%>' class="respond-form"> <div id='<%=id%>' class="respond-form">

View File

@ -1140,7 +1140,7 @@ $.fn.atwho["default"] = {
searchKey: "name", searchKey: "name",
suffix: void 0, suffix: void 0,
hideWithoutSuffix: false, hideWithoutSuffix: false,
startWithSpace: true, startWithSpace: false,
highlightFirst: true, highlightFirst: true,
limit: 5, limit: 5,
maxLen: 20, maxLen: 20,

View File

@ -25,28 +25,28 @@ function description_show_hide(id){
//名片的显示 //名片的显示
function user_card_show_hide() { function user_card_show_hide() {
$(".homepagePostPortrait").mouseover(function(){ // $(".homepagePostPortrait").mouseover(function(){
$(".userCard").css("display","none"); // $(".userCard").css("display","none");
onImage = true; // onImage = true;
$(this).children(".userCard").css("display","block"); // $(this).children(".userCard").css("display","block");
}); // });
$(".homepagePostPortrait").mouseout(function(){ // $(".homepagePostPortrait").mouseout(function(){
var cur = $(this); // var cur = $(this);
onImage = false; // onImage = false;
setTimeout(function(){ // setTimeout(function(){
if (onUserCard == false && onImage == false){ // if (onUserCard == false && onImage == false){
$(cur).children(".userCard").css("display", "none"); // $(cur).children(".userCard").css("display", "none");
} // }
}, 500); // }, 500);
}); // });
$(".userCard").mouseover(function(){ // $(".userCard").mouseover(function(){
onUserCard = true; // onUserCard = true;
$(this).css("display","block"); // $(this).css("display","block");
}); // });
$(".userCard").mouseout(function(){ // $(".userCard").mouseout(function(){
onUserCard = false; // onUserCard = false;
$(this).css("display","none"); // $(this).css("display","none");
}); // });
} }
function cleanArray (actual){ function cleanArray (actual){