个人主页

This commit is contained in:
yutao 2015-07-09 15:27:49 +08:00
parent 8d7faaced6
commit 5c011fd342
32 changed files with 2673 additions and 1656 deletions

View File

@ -25,6 +25,7 @@ class MyController < ApplicationController
helper :issues
helper :users
helper :custom_fields
helper :user_score
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
'issuesreportedbyme' => :label_reported_issues,
@ -88,6 +89,23 @@ class MyController < ApplicationController
end
end
def clear_user_avatar_temp
@user = User.current
diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp'
File.delete(diskfile1) if File.exist?(diskfile1)
end
def save_user_avatar
@user = User.current
diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp'
begin
FileUtils.mv diskfile1, diskfile, force: true if File.exist? diskfile1
ensure
File.delete(diskfile1) if File.exist?(diskfile1)
end
end
# Edit user's account
def account
@user = User.current
@ -119,6 +137,8 @@ class MyController < ApplicationController
@se.identity = params[:identity].to_i if params[:identity]
@se.technical_title = params[:technical_title] if params[:technical_title]
@se.student_id = params[:no] if params[:no]
@se.brief_introduction = params[:brief_introduction]
@se.description = params[:description]
if @user.save && @se.save
# 头像保存
@ -137,6 +157,7 @@ class MyController < ApplicationController
File.delete(diskfile1) if File.exist?(diskfile1)
end
render :layout=>'base_users_new'
end
# Destroys user's account
@ -159,6 +180,7 @@ class MyController < ApplicationController
# Manage user's password
def password
@act='password'
@user = User.current
unless @user.change_password_allowed?
flash.now[:error] = l(:notice_can_t_change_password)
@ -178,12 +200,14 @@ class MyController < ApplicationController
flash.now[:error] = l(:notice_account_wrong_password)
end
end
render :template => 'my/account',:layout=>'base_users_new'
rescue Exception => e
if e.message == 'wrong password'
flash.now[:error] = l(:notice_account_wrong_password)
else
flash.now[:error] = e.message
end
render :template => 'my/account',:layout=>'base_users_new'
end
# Create a new feeds key

View File

@ -39,13 +39,15 @@ class UsersController < ApplicationController
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_contests, :info,
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index]
:activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show]
#edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index]
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@ -76,6 +78,8 @@ class UsersController < ApplicationController
# fq
helper :words
helper :project_score
include UsersHelper
def refresh_changests
if !(@user.nil?) && !(@user.memberships.nil?)
@ -104,27 +108,41 @@ class UsersController < ApplicationController
#added by young
def user_projects
if User.current.admin?
@memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}")
else
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
@memberships = @user.memberships.all(:conditions => cond)
end
#events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
#@events_by_day = events.group_by(&:event_date)
@state = 0
#add by huang
#add by huang
unless User.current.admin?
if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?)
render_404
return
return
end
end
#end
#end
# if User.current.admin?
# @memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}")
# else
# cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
# @memberships = @user.memberships.all(:conditions => cond)
# end
#events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
#@events_by_day = events.group_by(&:event_date)
# @state = 0
limit = 10;
query = Project.joins("join members m on #{Project.table_name}.id=m.project_id")
query = query.where("m.user_id = ?",@user.id)
if(params[:status] == '1')
query = query.where("#{Project.table_name}.user_id = ?",@user.id);
elsif(params[:status] == '2')
query = query.where("#{Project.table_name}.user_id <> ?",@user.id);
end
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Project.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
respond_to do |format|
format.html
format.html{render :layout=>'base_users_new'}
format.api
end
end
@ -237,44 +255,59 @@ class UsersController < ApplicationController
include CoursesHelper
def user_courses
def user_courses
unless User.current.admin?
if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?)
render_404
return
return
end
end
#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
if User.current == @user || User.current.admin?
membership = @user.coursememberships.all
else
membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
limit = 10;
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
query = query.where("m.user_id = ?",@user.id)
if(params[:status] == '1')
query = query.where("endup_time >= ? or endup_time is null or endup_time=''",Time.now);
elsif(params[:status] == '2')
query = query.where("endup_time < ?",Time.now);
end
@obj_count = query.count();
membership.sort! {|older, newer| newer.created_on <=> older.created_on }
@memberships = []
membership.collect { |e|
@memberships.push(e)
}
## 判断课程是否过期 [需封装]
@memberships_doing = []
@memberships_done = []
#now_time = Time.now.year
@memberships.map { |e|
#end_time = e.course.get_time.year
isDone = course_endTime_timeout?(e.course)
if isDone
@memberships_done.push e
else
@memberships_doing.push e
end
}
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Course.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
render :layout=>'base_users_new'
# if User.current == @user || User.current.admin?
# membership = @user.coursememberships.all
# else
# membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
# end
#
# membership.sort! {|older, newer| newer.created_on <=> older.created_on }
# @memberships = []
# membership.collect { |e|
# @memberships.push(e)
# }
# ## 判断课程是否过期 [需封装]
# @memberships_doing = []
# @memberships_done = []
# #now_time = Time.now.year
# @memberships.map { |e|
# #end_time = e.course.get_time.year
# isDone = course_endTime_timeout?(e.course)
# if isDone
# @memberships_done.push e
# else
# @memberships_doing.push e
# end
# }
# respond_to do |format|
# format.html
# format.api
# format.html
# format.api
# end
end
@ -408,8 +441,149 @@ class UsersController < ApplicationController
format.api
end
end
def user_courses4show
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
query = query.where("m.user_id = ?",@user.id)
if User.current == @user #看自己
else
if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师
query = query.joins("join member_roles r on m.id = r.member_id")
query = query.where("r.role_id in(7,9)")
end
query = query.where(Course.table_name+".is_public = 1")
# TODO or exists (select 1 from courses c2,members m2 where c2.id=m2.course_id and c2.id=#{Course.table_name}.id and m2.user_id= User.current.id)
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{Course.table_name}.id < ?",params[:lastid])
end
@list = query.order("#{Course.table_name}.id desc").limit(8).all
render :layout=>nil
end
def user_projects4show
query = Project.joins("join members m on #{Project.table_name}.id=m.project_id")
query = query.where("m.user_id = ?",@user.id)
if User.current == @user #看自己
else
query = query.where(Project.table_name+".is_public = 1")
# TODO or exists (select 1 from project c2,members m2 where c2.id=m2.course_id and c2.id=#{Project.table_name}.id and m2.user_id= User.current.id)
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{Project.table_name}.id < ?",params[:lastid])
end
@list = query.order("#{Project.table_name}.id desc").limit(8).all
render :layout=>nil
end
def user_course_activities
@list = []
lastid = nil
if params[:lastid]!=nil && !params[:lastid].empty?
lastid = params[:lastid];
end
user_ids = []
if @user == User.current
watcher = User.watched_by(@user)
watcher.push(User.current)
user_ids = watcher.map{|x| x.id}
else
user_ids << @user.id
end
query_rec_count = 8
query_times = 10 #query_times次没查到query_rec_count条记录就不查了
query_i = 0;
while( true )
query_i = query_i+1
if(query_i>query_times)
break
end
query = Activity.where(user_id: user_ids)
if(lastid != nil)
query = query.where("id < ?",lastid)
end
lastid,item_list = query_activities(query,'course');
for item in item_list
@list << item
if @list.count() >= query_rec_count
break
end
end
if @list.count() >= query_rec_count
break
end
if lastid == nil
break
end
end
render :layout=>nil
end
def user_project_activities
@list = []
lastid = nil
if params[:lastid]!=nil && !params[:lastid].empty?
lastid = params[:lastid];
end
user_ids = []
if @user == User.current
watcher = User.watched_by(@user)
watcher.push(User.current)
user_ids = watcher.map{|x| x.id}
else
user_ids << @user.id
end
query_rec_count = 8
query_times = 10 #query_times次没查到query_rec_count条记录就不查了
query_i = 0;
while( true )
query_i = query_i+1
if(query_i>query_times)
break
end
query = Activity.where(user_id: user_ids)
if(lastid != nil)
query = query.where("id < ?",lastid)
end
lastid,item_list = query_activities(query,'project');
for item in item_list
@list << item
if @list.count() >= query_rec_count
break
end
end
if @list.count() >= query_rec_count
break
end
if lastid == nil
break
end
end
render :action=>'user_course_activities',:layout=>nil
end
def user_feedback4show
query = @user.journals_for_messages
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{JournalsForMessage.table_name}.id < ?",params[:lastid])
end
@list = query.order("#{JournalsForMessage.table_name}.id desc").limit(3).all
render :layout=>nil
end
def show
render :layout=>'base_users_new'
end
def show_old
pre_count = 10 #limit
# Time 2015-02-04 11:46:34
# Author lizanle
@ -830,11 +1004,24 @@ class UsersController < ApplicationController
end
end
###add by huang
def user_watchlist
def user_watchlist
limit = 10;
query = User.watched_by(@user.id);
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
render :template=>'users/user_fanslist',:layout=>'base_users_new'
end
###add by huang
def user_fanslist
def user_fanslist
limit = 10;
query = @user.watcher_users;
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@action = 'fans'
render :layout=>'base_users_new'
end
#william

View File

@ -16,12 +16,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WatchersController < ApplicationController
before_filter :require_login#, :find_watchables, :only => [:watch, :unwatch]
helper :users
def watch
s = WatchesService.new
watchables = s.watch params.merge(:current_user_id => User.current.id)
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (true ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables} }
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'add'} }
end
rescue Exception => e
if e.message == "404"
@ -37,7 +40,7 @@ class WatchersController < ApplicationController
watchables = s.unwatch params.merge(:current_user_id => User.current.id)
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (false ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables} }
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'add'} }
end
rescue Exception => e
if e.message == "404"

View File

@ -303,4 +303,159 @@ module UsersHelper
end
end
end
def get_watcher_users(obj)
count = User.watched_by(obj.id).count
if count == 0
return [0,[]]
end
list = User.watched_by(obj.id).order("#{Watcher.table_name}.id desc").limit(10).all
return [count,list];
end
def get_fans_users(obj)
count = obj.watcher_users.count
if count == 0
return [0,[]]
end
list = obj.watcher_users.order("#{Watcher.table_name}.id desc").limit(10).all
return [count,list];
end
def query_activities(query,type)
query_rec_count = 50
#query = query.where("act_type not in ('Contest','Contestnotifications','Principal')")
query = query.where("act_type='JournalsForMessage'")
#query = query.where("act_type not in (?)", ['JournalsForMessage','Message','HomeworkCommon','News','Issue','Journal','Poll'])
list = query.order("id desc").limit(query_rec_count).all
if( list == nil || list.count() < query_rec_count )
lastid = nil
else
lastid = list.last.id
end
result = [];
for item in list
container = get_activity_container(item,type)
if( activity_is_show(item,container) )
result << { :item=>item,:e=>container }
end
end
return [lastid,result]
end
def get_activity_container activity,type
e = nil;
if type == 'project'
if activity.act_type == 'Poll'
# 项目没有问卷
# e = Project.find_by_id(activity.act.polls_group_id)
else
e = activity.act.project if activity.act.respond_to?('project')
end
end
if type == 'course'
if activity.act_type == 'Poll'
e = Course.find_by_id(activity.act.polls_group_id)
else
e = activity.act.course if activity.act.respond_to?('course')
end
end
return e;
end
def activity_is_show(activity,e)
if(!e)
return false
end
if activity.user_id == User.current.id
return true
end
if( e.visible? )
return true
end
return false
end
def get_activity_act_showname(activity)
case activity.act_type
when "HomeworkCommon"
return activity.act.name
when "Issue"
return activity.act.subject
when "Journal"
return activity.act.notes
when "JournalsForMessage"
return activity.act.notes
when "Message"
return activity.act.subject
when "News"
return activity.act.title
when "Poll"
return activity.act.polls_name
when "Contest"
return ''
when "Contestnotification"
return ''
when "Principal"
return ''
else
return activity.act_type
end
end
def get_activity_act_createtime(activity)
case activity.act_type
when "HomeworkCommon"
return activity.act.created_at
when "Poll"
return activity.act.created_at
else
return activity.act.created_on
end
end
def get_activity_url(activity,e)
case activity.act_type
# when "Contest"
# when "Contestnotification"
# when "Principal"
when "HomeworkCommon"
return homework_common_index_path( :course=>e.id )
when "Issue"
return issue_path(activity.act.id)
when "Journal"
return issue_path( activity.act.journalized_id )
when "JournalsForMessage"
return e.class.to_s == 'Course' ? course_feedback_path(e) : project_feedback_path(e)
when "Message"
return e.class.to_s == 'Course' ? course_boards_path(e) : project_boards_path(e)
when "News"
return news_path(activity.act)
#return e.class.to_s == 'Course' ? course_news_index_path(e) : project_news_index_path(e)
when "Poll"
return poll_index_path( :polls_group_id=>activity.act.polls_group_id, :polls_type=>e.class.to_s )
else
return 'javascript:;'
end
end
def get_activity_opt(activity,e)
case activity.act_type
when "HomeworkCommon"
return '创建了作业'
when "News"
return e.class.to_s == 'Course' ? '发布了通知' : '添加了新闻'
when "Issue"
return '发表了问题'
when "Journal"
return '回复了问题'
when "JournalsForMessage"
return e.class.to_s == 'Course' ? '发表了留言' : '提交了反馈'
#return ( activity.act.reply_id == nil || activity.act.reply_id == 0 ) ? '' : ''
when "Message"
return ( activity.act.parent_id == nil || activity.act.parent_id == '' ) ? '发布了帖子' : '回复了帖子'
when "Poll"
return '发布了问卷'
else
return '有了新动态'
end
end
end

View File

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

View File

@ -1,8 +1,8 @@
<% if @save_flag %>
$('#finish_course_<%=@course.id%>').replaceWith("<%= escape_javascript(set_course_time(@course_prefs))%>");
$('#finish_course_<%=@course.id%>').replaceWith("<%= escape_javascript(set_course_time(@course_prefs))%>");
var html = "<%= escape_javascript( render( :partial => 'users/course_form', :locals => {:item => @course_prefs} ) )%>";
$('#nh_course_<%=@course.id%>').replaceWith(html);
// alert("关闭成功");
<% else %>
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
<% end %>
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
<% end %>

View File

@ -0,0 +1,13 @@
<div id="Footer">
<ul class="copyright" style="text-align:center;">
<li><%= @organizer.description.html_safe %></li>
</ul>
<div class="cl"></div>
<ul class="footlogo">
<% @companies && @companies.each do |company| %>
<li class="fl" style="margin:0 8px;">
<a href="<%= company.url %>" target="_blank" title="<%=company.name%>"><img src="<%= url_to_avatar(company) %>" width="100" height="30" alt="<%=company.name%>" /></a>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,76 @@
<div id="Header" >
<div class="logo fl" >
<%=link_to image_tag("/images/logo.png",weight:"35px", height: "30px")%>
</div>
<div id="TopNav" class="fl">
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
</div>
<div id="TopUser" class="fr">
<div id="menu">
<ul class="menu">
<% if User.current.logged? %>
<li>
<%=link_to_user(User.current)%><!--<a href="javascript:void(0);" class="parent">用户名称</a>-->
<ul>
<% hidden_non_project = Setting.find_by_name("hidden_non_project")
visiable = hidden_non_project && hidden_non_project.value == "0"%>
<% if @show_course == 1 && !visiable %>
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=false %>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<% hasCourse=true %>
<% end %>
<% end %>
<% if hasCourse %>
<li>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :id=>User.current.id, :host=>Setting.host_user) %>" class="parent">我的课程</a>
<ul>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<li title="<%=course.name%>"><a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>course.id, :host=>Setting.host_course) %>"><%= course.name %></a>
<% end %>
<% end %>
</ul>
</li>
<% end %>
<% end -%>
<% end %>
<% if User.current.projects.count>0 %>
<li>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :id=>User.current.id, :host=>Setting.host_user) %>" class="parent">我的项目</a>
<ul>
<% User.current.projects.each do |project| %>
<li title="<%=project.name%>"><a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>project.id, :host=>Setting.host_name) %>"><%=project.name%></a></li>
<% end %>
</ul>
</li>
<% end %>
<!--<li><a href="javascript:void(0);" class="parent">我的课程</a>-->
<!--<ul>-->
<!--<li><a href="javascript:void(0);">新建课程</a></li>-->
<!--<li><a href="javascript:void(0);">我的课程0我的课程我的课程01我的课程011</a></li>-->
<!--<li><a href="javascript:void(0);">我的课程02</a></li>-->
<!--<li><a href="javascript:void(0);">我的课程02</a></li>-->
<!--</ul>&lt;!&ndash;-level3 end-&ndash;&gt;-->
<!--</li>&lt;!&ndash;-level2 end-&ndash;&gt;-->
<!--<li><a href="javascript:void(0);" class="parent">我的项目</a>-->
<!--<ul>-->
<!--<li><a href="javascript:void(0);">新建项目</a></li>-->
<!--<li><a href="javascript:void(0);">我的项目01</a></li>-->
<!--<li><a href="javascript:void(0);">我的项目0</a></li>-->
<!--<li><a href="javascript:void(0);">我的项目02</a></li>-->
<!--</ul>&lt;!&ndash;-level3 end-&ndash;&gt;-->
<!--</li>&lt;!&ndash;-level2 end-&ndash;&gt;-->
<!--<li><a href="javascript:void(0);">我的主页</a></li>-->
</ul>
</li><!---level1 end--->
<!--<li ><a href="javascript:void(0);">退出</a></li>-->
<% end %>
</ul>
<%= render_menu :account_menu -%>
</div>
</div>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,12 @@
<% fans_count,fans_list = get_fans_users(user) %>
<div id="fans_nav_list" class="leftbox mt10" style="display:<%= fans_count==0 ? 'none' : 'block' %>">
<h4 class="fl">粉丝</h4><a href="<%=url_for(:controller => 'users', :action => 'user_fanslist', :id=>user.id)%>" data-count="<%= fans_count %>" style="display:<%= fans_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">
<% for fans in fans_list %>
<%= link_to image_tag(url_to_avatar(fans), :style => "width:38px;height:38px;"), user_path(fans), :class => "pic_members", :title => "#{fans.name}" %>
<% end %>
<div class="cl"></div>
</div>
</div><!--leftbox end-->

View File

@ -0,0 +1,8 @@
<% if(User.current.logged? && User.current!=target)%>
<%if(target.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=>
'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消</a>
<% else %>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">关注</a>
<% end %>
<% end %>

View File

@ -0,0 +1,11 @@
<% watcher_count,watcher_list = get_watcher_users(user) %>
<div id="watcher_nav_list" class="leftbox mt10" style="display:<%= watcher_count==0 ? 'none' : 'block' %>">
<h4 class="fl">关注</h4><a href="<%=url_for(:controller => 'users', :action => 'user_watchlist', :id=>user.id)%>" data-count="<%= watcher_count %>" style="display:<%= watcher_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">
<% for watcher in watcher_list %>
<%= link_to image_tag(url_to_avatar(watcher), :style => "width:38px;height:38px;"), user_path(watcher), :class => "pic_members", :title => "#{watcher.name}" %>
<% end %>
<div class="cl"></div>
</div>
</div><!--leftbox end-->

View File

@ -0,0 +1,337 @@
<% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<% @nav_dispaly_user_label = show_item_on_navbar(params) %>
<% @center_flag = (User.current == @user) %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new','users', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!--
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心st</title>
<link href="css/public.css" rel="stylesheet" type="text/css" />
<link href="css/leftside.css" rel="stylesheet" type="text/css" />
<link href="css/users.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" src="js/jQuery.peSlider.js"></script>
</script>
<script type="text/javascript">
//头部导航
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<script type="text/javascript">//侧导航
$(function(){
$(".subNav").click(function(){
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
// 修改数字控制速度, slideUp(500)控制卷起速度
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
})
})
</script>
<script type="text/javascript">
function show_window () {
$('#light').css('display','block');
$('#fade').css('display','block');
}
function close_window(){
$('#light').css('display','none');
$('#fade').css('display','none');
}
//弹框l
</script> -->
</head>
<body>
<div id="Container">
<%= render :partial => 'layouts/base_header_new'%>
<div id="TopBar">
<div class="topbar_info02 fl">
<h2><a href="javascript:void(0);" target="_blank" class="c_blue"><%= @center_flag ? '个人中心' : '个人主页' %></h2>
<p>当前位置 :
<%=link_to l(:field_homepage), home_path %> &gt; <%=link_to (@center_flag ? '个人中心' : '个人主页'), user_path(@user) %> &gt; <%=link_to @user.name, user_path(@user) %>
</p>
</div>
<!--<div class="search fl">-->
<!--<form class="search">-->
<!--<input type="text" name="serach" placeholder="输入关键词进行搜索" class="search_text fl">-->
<!--<a href="javascript:void(0);" class="search_btn fl f14 c_white" >搜 索</a>-->
<!--</form>-->
<!--</div>-->
</div><!--TopBar end-->
<div class="cl"></div>
<div id="content">
<div id="LSide" class="fl">
<div class="users_info">
<div class="pic_head">
<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>
<% if @center_flag %>
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="pic_edit usersphoto_edit"></a>
<% end %>
</div><!--pic_head end-->
<div class="users_name mt5">
<%=link_to @user.name, user_path(@user),:class=>"fl c_dark fb f14" %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender==1?'icon_female':'icon_male' %> fl mt3 ml5"></span>
<% end %>
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
<div class="cl"></div>
<div class="mt5 ">
<%=l(:label_user_watcher)%><%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"c_blue",:nh_name=>"watcher_count" %>
<span>|&nbsp;</span>
<%=l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)%><%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"c_blue",:nh_name=>"fans_count"%>
<span>|&nbsp;</span>积分(<%= link_to(format("%.2f" ,get_option_number(@user,1).total_score ).to_i,
{:controller => 'users', :action => 'show_new_score', :remote => true, :id => @user.id }, :class => 'c_blue',:id => 'user_score') %>
</div>
<div class="cl"></div>
<% if (@user.user_extensions) %>
<div class="pf_intro"><%= @user.user_extensions.brief_introduction %></div>
<% end %>
</div><!--uers_info end-->
<div class="leftbox mt10">
<ul class="leftbox_ul_left">
<li>加入时间&nbsp;:</li>
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
<li><%= l(:label_company_name) %>&nbsp;:</li>
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
<li>真实姓名&nbsp;:</li>
<% end %>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li>职称&nbsp;:</li>
<% end %>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<li>地区&nbsp;:</li>
<% end %>
<% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %>
<li>工作单位&nbsp;:</li>
<% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %>
<li>工作单位&nbsp;:</li>
<% elsif @user.user_extensions.identity == 2 %>
<li>工作单位&nbsp;:</li>
<% end %>
<% if (!@user.user_extensions.description.nil? && !@user.user_extensions.description.empty?) %>
<li>个人简介&nbsp;:</li>
<% end %>
<% end %>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<li><%= format_date(@user.created_on) %></li>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li><%= get_technical_title @user %></li>
<% end %>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<li><%= @user.user_extensions.location %>&nbsp;&nbsp;<%= @user.user_extensions.location_city %></li>
<% end %>
<% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %>
<li><a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => @user.user_extensions.school.id,:host=>Setting.host_course) %>"><%= @user.user_extensions.school.name %></li>
<% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %>
<li><%= @user.user_extensions.occupation %></li>
<% elsif @user.user_extensions.identity == 2 %>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% end %>
<% if (!@user.user_extensions.description.nil? && !@user.user_extensions.description.empty?) %>
<li><%= @user.user_extensions.description %></li>
<% end %>
<% end %>
</ul>
<div class="cl"></div>
</div>
<!--<div class="leftbox mt10">-->
<!--<ul class="leftbox_ul_left">-->
<!--<li>创建课程&nbsp;:</li>-->
<!--<li>发布作业&nbsp;:</li>-->
<!--<li>发布资源&nbsp;:</li>-->
<!--<li>创建项目&nbsp;:</li>-->
<!--<li>解决缺陷&nbsp;:</li>-->
<!--<li>加入课程&nbsp;:</li>-->
<!--<li>发布作品&nbsp;:</li>-->
<!--<li>参加匿评&nbsp;:</li>-->
<!--<li>加入项目&nbsp;:</li>-->
<!--<li>发布缺陷&nbsp;:</li>-->
<!--<li>解决缺陷&nbsp;:</li>-->
<!--</ul>-->
<!--<ul class="leftbox_ul_right c_dgrey">-->
<!--<li>10</li>-->
<!--<li>506</li>-->
<!--<li>50</li>-->
<!--<li>15</li>-->
<!--<li>1000</li>-->
<!--<li>10</li>-->
<!--<li>506</li>-->
<!--<li>50</li>-->
<!--<li>15</li>-->
<!--<li>1000</li>-->
<!--<li>1000</li>-->
<!--</ul>-->
<!--<div class="cl"></div>-->
<!--</div>-->
<% if @center_flag %>
<div class="subNavBox ">
<div class="subNav "><a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">动态</a></div>
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">我的课程<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">我的项目<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >Trustie-Forge</a></li>-->
<!--<li><a href="javascirpt:void();" >Trustie-weekly</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav "><a href="<%= url_for(:controller => 'my', :action => 'account') %>" class=" f14 c_blue02">编辑资料</a></div>
</div><!--侧导航 end-->
<% end %>
<div class="cl"></div>
<%= render :partial => 'layouts/user_watch_list', :locals => {:user => @user} %>
<%= render :partial => 'layouts/user_fans_list', :locals => {:user => @user} %>
<!--<div class="leftbox mt10" >-->
<!--<h4 class="fl">访客</h4><a href="javascirpt:void();" class="more fr mr10">更多</a>-->
<!--<div class="cl"></div>-->
<!--<div class="mt5">-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<a href="javascirpt:void();" class="pic_members"><img src="images/pic_users.jpg" width="38" height="38" alt="头像" /></a>-->
<!--<div class="cl"></div>-->
<!--</div>-->
<!--</div>&lt;!&ndash;leftbox end&ndash;&gt;-->
</div><!--LSide end-->
<%= yield %>
</div><!--Content end-->
<div class="cl"></div>
<%= render :partial => 'layouts/base_footer_new'%>
<div class="cl"></div>
</div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-modal" style="display:none;"></div>
<%= javascript_include_tag '/javascripts/avatars.js' %>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<%= file_field_tag 'avatar[image]',
:id => nil,
:class => 'uppic_btn',
:style => 'width:70px;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr2"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
$("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src'));
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
showModal('ajax-modal','460px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().removeClass("alert_praise");
//$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");

View File

@ -0,0 +1,2 @@
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>');
hideModal();

View File

@ -1,74 +1,46 @@
<div class="content_frame">
<ul class="user_course_sort">
<% for membership in memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50">
<%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %>
</td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<span>
<%= link_to_course(membership.course) %>
</span>
<span style="float: right">
<%= render :partial => 'courses/set_course_time', :locals => {:course => membership.course} %>
<% if (User.current == @user && (!@user.allowed_to?(:as_teacher,membership.course)))%>
<%= join_in_course(membership.course, User.current) %>
<% end %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= l(:label_x_base_courses_member, :count => membership.course.members.count) %>
(<%= "#{membership.course.members.count}" %>)
&nbsp;&nbsp;
<%= l(:label_homework) %>
(
<span class="">
<%= link_to (membership.course.homework_commons.count), homework_common_index_path(:course => membership.course.id) %>
</span>
)
&nbsp;&nbsp;
<%= l(:label_course_news) %>
(
<span style="color: #ed8924">
<%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %>
</span>)
</span>
</td>
</tr>
<tr>
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
<p class="font_description">
<%= textilizable membership.course.short_description %>
</p>
</td>
</tr>
<tr>
<td>
<% @course = Course.find_by_extra(membership.course.extra) %>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span class="font-lighter" style="float: left">
<%= l(:label_main_teacher) %>
: <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %>
</span>
<span style="float: right; padding-left: 8px">
<%= l(:label_course_term) %>
: <%= @course.time %><%= get_course_term_locales @course %>
</span>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
<% can_edit_flag = User.current.allowed_to?(:as_teacher,item) || User.current.admin? %>
<% course_end_flag = course_endTime_timeout?(item) %>
<div class="courses_list line" id="nh_course_<%=item.id%>">
<div class="courses_list_pic fl">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>">
<%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %>
</a>
</div>
<div class="courses_list_info fl ml10">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>" class="courses_list_title f14 fb <%=course_end_flag ? 'c_dark' : 'c_blue02'%> fl"><%= item.name %></a>
<% if(can_edit_flag) %>
<% if(course_end_flag) %>
<a href="<%=restartcourse_course_path(item)%>" class="pic_eye_grey fl ml5" title="重开课程" data-confirm="确定要重开课程?" data-method="post" data-remote="true"></a>
<% else %>
<a href="<%=finishcourse_course_path(item, format: :js)%>" class="pic_eye_blue fl ml5" title="关闭课程" data-confirm="确定要关闭课程?" data-method="post" data-remote="true"></a>
<% end %>
<% end %>
</ul>
</div>
<%= call_hook :view_account_left_bottom, :user => @user %>
<div class="cl"></div>
<div class="courses_list_table">
<table><tbody>
<tr>
<td class="td_w60 ">主讲老师:</td>
<td class="td_w70 ">
<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a>
</td>
<td class="td_w60 ">课程作业:</td>
<td class="td_w110 "><a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a></td>
</tr>
<tr>
<td>成员人数:</td>
<td><%= item.members.count %></td>
<td>开课学期:</td>
<td><%= item.time %><%= get_course_term_locales item %></td>
</tr>
</tbody></table>
</div>
</div>
<% if(course_end_flag) %>
<span class="grey_n_btn fr mt20">课程结束</span>
<% elsif(can_edit_flag) %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'new',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">发布作业</a>
<% else %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">提交作品</a>
<% end %>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,50 @@
<div class="courses_list line" id="fans_item_<%=item.id%>">
<div class="courses_list_pic fl">
<a href="javascirpt:void();">
<%= image_tag(url_to_avatar(item), :style=>"width:64px;height:64px;",:alt=>"头像") %>
</a>
</div>
<div class="courses_list_info fl ml10">
<a href="<%= user_path(item) %>" title="<%= item.show_name %>" class="courses_list_title f14 fb c_blue02 fl"><%= item.show_name %></a>
<div class="cl"></div>
<div class="courses_list_table ">
<% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
<p class="fans_sign" title="<%= item.user_extensions.brief_introduction %>">个性签名:<%= item.user_extensions.brief_introduction %></p>
<% end %>
<table><tbody><tr>
<td class="td_w60 ">加入时间:</td>
<td class="td_w110 "><%= format_date(item.created_on) %></td>
<% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
<td class="td_w60 ">工作单位:</td>
<td class="td_w110 ">
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.user_extensions.school.name %>">
<a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => item.user_extensions.school.id,:host=>Setting.host_course) %>"><%= item.user_extensions.school.name %></a>
</li>
</td>
<% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
<td class="td_w60 ">工作单位:</td>
<td class="td_w110 ">
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.user_extensions.occupation %>">
<%= item.user_extensions.occupation %>
</li>
</td>
<% elsif item.user_extensions.identity == 2 %>
<td class="td_w60 ">工作单位:</td>
<td class="td_w110 ">
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.show_name %>">
<%= item.show_name %>
</li>
</td>
<% end %>
</tr></tbody></table>
</div>
</div>
<% if(User.current.logged? && User.current != item )%>
<%if(item.watched_by?(User.current))%>
<a href="<%= watch_path(:object_type=>'user',:object_id=>item.id,:target_id=>target.id) %>" class="grey_n_btn fr mt20" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
<% else %>
<a href="<%= watch_path(:object_type=>'user',:object_id=>item.id,:target_id=>target.id) %>" class="blue_n_btn fr mt20" data-method="post" data-remote="true" title="添加关注">添加关注</a>
<% end %>
<% end %>
<div class="cl"></div>
</div>

View File

@ -1,661 +1,321 @@
<% if User.current.id == @user.id %>
<div class="menu-div">
<div class="menu">
<span style="color: #000; font-weight: bold;">
<%= l(:label_user_activities, :name => @user.name) %>
</span>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='all' class="<%= "on" if @state.eql?(0) %>">
<%= l :label_user_all_activity %>
</li>
<li mode='myself' class="<%= "on" if @state.eql?(1) %>">
<%= l :label_user_activity_myself %>
</li>
<li mode='respond' class="<%= "on" if @state.eql?(2) %>">
<%= l :label_user_all_respond %>
</li>
</ul>
</div>
<script type="text/javascript">
</script>
</div>
<div style="height:20px"></div>
<%= form_tag(:controller => 'users', :action => "show") do %>
<div class="user-search-block hidden" style="float:right;margin-top:-55px">
<table width="100%" valign="center">
<tr>
<td align="right">
<div class="project-search">
<%= text_field_tag 'user', params[:user], :size => 30 %>
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
</div>
</td>
</tr>
</table>
</div>
<% end %>
<% end %>
<%= render_flash_messages %>
<% unless @state == 2 %>
<% unless @activity.empty? %>
<div id="activity">
<% @activity.each do |e| %>
<%# 以下一行代码解决有未知的活动无法转换成Model报错%>
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
<% act = e.act %>
<% unless act.nil? %>
<% if e.act_type == 'JournalsForMessage' || e.act_type == 'HomeworkCommon' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest' %>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</td>
<td>
<table border="0" class="info-break" style="width:580px;">
<% case e.act_type %>
<% when 'JournalsForMessage' %>
<tr>
<td colspan="2" valign="top">
<% if User.current.login == e.user.try(:login) %>
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<% if User.current.language == "zh" %>
<span class="font_lighter">
<%= l(:label_i_have_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
<%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
</span>
<% else %>
<span class="font_lighter">
<%= l(:label_i_have_feedback) %>
<%= l(:label_layouts_feedback) + l(:label_of_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
</span>
<% end %>
<% else %>
<strong>
<%= link_to("#{e.user.name}", user_path(e.user_id)) %>
</strong>
<% if User.current.language == "zh" %>
<span class="font_lighter">
<%= l(:label_have_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
<%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
</span>
<% else %>
<span class="font_lighter">
<%= l(:label_have_feedback) %>
<%= l(:label_layouts_feedback) + l(:label_of_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
</span>
<% end %>
<% end %>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act.notes %>
</p>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= user_jour_feed_back_url e %>
</span>
</div>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'HomeworkCommon' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), student_work_index_path(:homework => e.act_id) %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), student_work_index_path(:homework => e.act_id) %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :description %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_at)).to_s %>
</span>
</div>
<!--<div style="display: inline-block; float: right; margin-top: 0px">-->
<!--<span>-->
<!--<%#= link_to l(:label_find_all_comments), respond_path(e.act_id) %>-->
<!--</span>-->
<!--<a class="font_lighter">-->
<!--<%#= l(:label_comments_count, :count => e.act.commit) %>-->
<!--</a>-->
<!--</div>-->
</td>
</tr>
<% when 'Journal' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to(l(:label_activity_project)+""+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to(l(:label_activity_project)+""+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% end %>
</tr>
<tr>
<% if act.notes.nil? %>
<% desStr = '' %>
<% else %>
<% desStr= textAreailizable(act, :notes) %>
<% end %>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= desStr %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'Changeset' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title(act.title),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title(act.title),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :long_comments %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= format_time(e.act.committed_on) %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} if e.act.count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.count) %>
</a>
</div>
</td>
</tr>
<% when 'Message' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
act.board.project ? project_boards_path(act.board.project,:topic_id => act.id) : course_boards_path(act.board.course,:topic_id => act.id),
:class => "problem_tit fl fb " %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable(act, :content) %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'Principal' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_user) %>
</span>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_user) %>
</span>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description"></p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'News' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title(" #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :description %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} if e.act.comments_count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.comments_count) %>
</a>
</div>
</td>
</tr>
<% when 'Issue' %>
<% if e.user == User.current %>
<tr>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<%= textAreailizable act, :description %>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} if e.act.journals.count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.journals.count) %>
</a>
</div>
</td>
</tr>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<%= textAreailizable act, :description %>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} if e.act.journals.count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.journals.count) %>
</a>
</div>
</td>
</tr>
<% end %>
<% when 'Contest' %>
<tr>
<% if e.user == User.current && @show_contest == 1 %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :description %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
</tr>
<% else %>
<% end %><!-- < % #case end %> -->
</table>
</td>
</tr>
</table>
<% end %>
<% end %><!-- < % #unless act.nil? end %> -->
<% end %><!-- < % #@activity.each do |e| end%> -->
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @activity_pages %> </ul>
</div>
<% else %> <!-- < %# unless @activity.empty? %> -->
<% if @user == User.current %>
<%= l(:label_user_activities_no) %>
<% else %>
<p class="font_description">
<%= l(:label_user_activities_other) %>
</p>
<% end %>
<% end %><!-- < %# unless @activity.empty? end %> -->
<% else %>
<% unless @message.empty? %>
<div id="activity">
<% @message.each do |e| -%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
<% if e.instance_of?(JournalsForMessage) %>
<% if e.reply_id == User.current.id %>
<% if e.jour_type == 'Bid' %>
<%= l(:label_in_bids) %><%= link_to(e.jour.name, respond_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'User' %>
<%= l(:label_in_users) %><%= link_to(e.jour.firstname, feedback_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'Project' %>
<%= l(:label_in_projects) %><%= link_to(e.jour.name, feedback_path(e.jour)) %>&nbsp;<%= l(:label_reply_plural) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id)) %>&nbsp;<%= l(:label_have_respond) %>
<% end %>
<% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id)) %><%= l(:label_have_respond) %>
<% else %>
<%= l(:label_in_issues) %><%= link_to(e.issue.subject, issue_path(e.issue)) %><%= l(:label_quote_my_words) %>
<% end %>
<% end %> </span>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable e.notes %>
</p>
</td>
</tr>
<tr>
<td align="left"><a class="font_lighter"></a></td>
<td width="200" align="right" class="a">
<span class="font_lighter">
<%= format_time e.created_on %>
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
</div>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @info_pages %>
</ul>
</div>
<style type="text/css">
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<% @center_flag = (User.current == @user) %>
<% if @center_flag %>
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new',:host=>Setting.host_name) %>" class="bgreen_n_btn fr ml10 mt2">新建项目</a>
<% else %>
<p class="font_description">
<%= l(:label_no_user_respond_you) %>
</p>
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
<% end %>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',:host=>Setting.host_course) %>" class="green_n_btn fr mt2">新建课程</a>
<% else %>
<!--<a href="<%#= url_for(:controller => 'courses', :action => 'join_private_courses',:host=>Setting.host_course) %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>-->
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function ($) {
$("#content .menu-div:first~ div").first().find("a").attr("target", "_blank");
$('[mode=all]').click(function (event) {
window.location.href = '<%=user_url(@user)%>';
});
$('[mode=myself]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 1)%>';
});
$('[mode=respond]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 2)%>';
<div id="RSide" class="fl">
<div class="message_box mb10" nhname='new_message'>
<form action="<%= url_for(:controller => 'words', :action => 'create', :user_id => @user.id) %>" data-remote="true" method="post">
<textarea nhname='new_message_textarea' name="new_form[user_message]" style="display:none;"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">发布</a>
</form>
<div class="cl"></div>
<div class="message_list_box" nhname="list_more_div">
<div id="jours_container" nhname="container" data-pagesize="3" data-url="<%=user_path(@user)%>/user_feedback4show" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr mr10">收起</a>
<div class="cl"></div>
</div>
</div>
</div>
<div class="users_courses_box line_box mb10" nhname="list_more_div">
<div class="users_top">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的课程' : 'TA的课程' %></a>
<% if @center_flag %>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',:host=>Setting.host_course) %>" class=" green_u_btn fr mt8 mr8">新建课程</a>
<% else %>
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class=" green_u_btn fr mt8 mr8">加入课程</a>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<div nhname="container" data-url="<%=user_path(@user)%>/user_courses4show" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="cl"></div>
<div class="message_list_more mt10">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="users_courses_box line_box mb10" nhname="list_more_div">
<h4 class="users_h4">课程动态</h4>
<div nhname="container" data-url="<%=user_path(@user)%>/user_course_activities" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
</div>
<div class="users_courses_box line_box mb10" nhname="list_more_div">
<div class=" users_top">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的项目' : 'TA的项目' %></a>
<% if @center_flag %>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new',:host=>Setting.host_name) %>" class=" green_u_btn fr mt8 mr8">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class=" green_u_btn fr mt8 mr8">加入项目</a>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<div nhname="container" data-url="<%=user_path(@user)%>/user_projects4show" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="cl"></div>
<div class="message_list_more mt10">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="users_courses_box line_box mb10" nhname="list_more_div">
<h4 class="users_h4">项目动态</h4>
<div nhname="container" data-url="<%=user_path(@user)%>/user_project_activities" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
function init_list_more_div(params){
var p=params;
p.exbtn.click(function(){
var isclose = p.container.data('isclose');
var hasmore = p.container.data('hasmore');
if(isclose == '1'){
$("div[nhname='rec']",p.container).show();
p.container.data('isclose','0');
p.clbtn.show();
if(hasmore == '0'){
p.exbtn.html('没有更多了');
}
return;
}
if(hasmore == '0'){
return;
}
var url = p.container.data('url');
if($("div[nhname='rec']",p.container).length > 0){
var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
url += "?lastid="+lastid;
}
$.ajax( {url:url,dataType:'text',success:function(data){
var html = $("<div>"+data+"</div>");
var lens = $("div[nhname='rec']",html).length;
if(lens < p.size){
p.container.data('hasmore','0');
p.exbtn.html('没有更多了');
}
if(lens>0){
var currpage = parseInt(p.container.data('currpage'))+1;
if(currpage>1){
p.clbtn.show();
}
p.container.data('currpage',currpage);
p.container.append(html.html())
}
}} );
});
p.clbtn.click(function(){
var i=0;
$("div[nhname='rec']",p.container).each(function(){
i++;
if(i> p.size){
$(this).hide();
}
});
p.container.data('isclose','1');
p.clbtn.hide();
p.exbtn.html('点击展开更多');
});
p.exbtn.click();
}
$("div[nhname='list_more_div']").each(function(){
var params = {};
params.container = $("div[nhname='container']",$(this));
params.exbtn = $("a[nhname='expand']",$(this));
params.clbtn = $("a[nhname='close']",$(this));
params.size = params.container.data('pagesize');
if( params.size == undefined ){
params.size = 8;
}
init_list_more_div(params)
});
});
</script>
<% html_title(l(:label_activity)) -%>
<script type="text/javascript">
$(function(){
function init_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
items:['emoticons'],
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.div_form);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
}
}).loadPlugin('paste');
return editor;
}
function nh_check_field(params){
var result=true;
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
}
params.contentmsg.show();
}
}
return result;
}
function init_form(params){
params.form.submit(function(){
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
}
return false;
});
}
function nh_reset_form(params){
params.form[0].reset();
params.textarea.empty();
if(params.editor != undefined){
params.editor.html(params.textarea.html());
}
params.contentmsg.hide();
}
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
params.kindutil = K;
if($(this).parent('span')==undefined || $(this).parent('span').length==0){
params.container = $(this).parent('div').parent('div');
}else{
params.container = $(this).parent('span').parent('div').parent('div');
}
params.div_form = $(">.respond-form",params.container);
params.form = $("form",params.div_form);
params.textarea = $("textarea[name='user_notes']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
}
params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);
setTimeout(function(){
if(!params.div_form.is(':hidden')){
params.textarea.show();
params.textarea.focus();
params.textarea.hide();
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
// $("#nhjump")[0].click();
}
},300);
params.textarea.data('init',1);
});
$("div[nhname='new_message']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("#new_message_cancel_btn");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
params.submit_btn.click(function(){
params.form.submit();
});
// $("a[nhname='cancel_btn']",params.div_form).click(function(){
// nh_reset_form(params);
// });
params.textarea.data('init',1);
}
});
});
});
</script>

View File

@ -0,0 +1,12 @@
<% for rec in @list %>
<div class="users_courses_list" nhname="rec" data-id="<%= rec[:item].id %>">
<a href="<%= rec[:e].class.to_s == 'Course' ? course_path(rec[:e]) : project_path(rec[:e]) %>" class=" fl users_coursename ml5" title="<%= rec[:e].name %>"><%= rec[:e].name %></a>
<a href="<%= user_path(rec[:item].user.id) %>" class="c_orange course_name fl mr5" title="<%= rec[:item].user.show_name %>"><%= rec[:item].user.show_name %></a>
<span class="fl mr5 c_grey"><%= get_activity_opt(rec[:item],rec[:e]) %></span>
<a href="<%= get_activity_url(rec[:item],rec[:e]) %>"
class="c_blue02 fl users_courses_txt hidepic" title="<%= get_activity_act_showname(rec[:item]) %>">
<%= get_activity_act_showname(rec[:item]).html_safe %>
</a>
<span class="fr c_grey mr10"><%= time_tag(get_activity_act_createtime(rec[:item])).html_safe %>前</span>
</div>
<% end %>

View File

@ -1,33 +1,31 @@
<% if @user.user_extensions.identity == UserExtensions::TEACHER %>
<%= render :partial => 'my_course' %>
<% else %> <!--for student-->
<%= render :partial => 'my_joinedcourse' %>
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$("#content .content_frame").find("a").attr("target", "_blank");
$("content-title-top p:first").find("a").attr("target", "_blank");
$("#content .content_frame [color=#666666]").find("a").removeAttr("target");
$('#content .content-title-top table[width=580] td:first span:eq(1)').find("a:first").removeAttr("target");
});
</script>
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',) %>" class="green_n_btn fr mt2">新建课程</a>
<% else %>
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>
<% end %>
<div class="cl"></div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var $menu = $('.user_course_list .menu');
var $li_tags = $menu.find('[mode]');
var $dyn_list = $('.dyn_list_wrapper');
$menu.find('[mode]').each(function(index, el) {
$(el).click(function() {
mode = $(el).attr('mode');
$menu.find('[mode]').removeClass( "on" );
$( this ).addClass( "on" );
var wrapper = $('[mode='+mode+']')
$dyn_list.addClass( "hidden" );
wrapper.removeClass('hidden')
})
});
});
</script>
<% html_title(l(:label_user_course)) -%>
<div id="RSide" class="fl">
<div class="courses_box">
<div class="courses_top mb10">
<h2 class="courses_h2 fl">所有课程</h2>
<div class="courses_select fr">
<a href="<%= url_for(:controller => 'users', :action => 'user_courses')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">正在进行</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 已经结束</a>
</div>
<div class="cl"></div>
</div>
<% for item in @list %>
<%= render :partial => 'course_form', :locals => {:item => item} %>
<% end %>
<p class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
</div>
<ul class="wlist" style=" border:none;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,14 @@
<% for item in @list %>
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>">
<div class="courses_list_pic fl ml10 mr10">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a>
</div>
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" class="home_list_title c_blue02 fl mb10" title="<%= item.name %>"><%= item.name %></a>
<div class="fl c_dgrey">
<p>主讲老师:<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a></p>
<p>课程作业:<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a> <span class="ml10"></span>成员:<%= item.members.count %></p>
</div>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1,52 +1,22 @@
<!--add by huang-->
<h3><%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %></h3>
<div class="inf_user_image">
<% for user in @user.watcher_users %>
<ul class="list_watch">
<li>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(user), :class => "avatar"),user_path(user),:title => "#{user.name}" %>
</td>
<td>
<table width="580px" border="0">
<tr> <!-- modified by bai -->
<td colspan="2" valign="top">
<strong><%= content_tag "div", link_to(user.name, user_path(user)), :class => "project_avatar_name" %></strong>
</td>
</tr>
<tr>
<!-- added by bai 区分了个人列表里的项目与课程 -->
<td colspan="2" width="580px"><p class="font_description">
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_contribute_to, :count => memberships.count) %>
<% for member in memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<p class="font_description">
<% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<%= "" unless user_courses.empty? %>
<% for course in user_courses %>
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : '' %>
<% end %>
</p>
</td>
</tr>
<!-- end -->
<tr>
<td width="200" align="right" class="font_lighter"><%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
</ul>
<% end %>
</div>
<div id="RSide" class="fl">
<div class="courses_box">
<div class="courses_top mb10" id="<%= @action == 'fans' ? 'nh_fans_list' : 'nh_wacth_list' %>">
<% if @action == 'fans'%>
<h2 class="courses_h2 fl">粉丝</h2>
<div class="courses_select fr">共有<span class="c_orange" nh_name="fans_count"><%=@obj_count%></span>名粉丝</div>
<% else %>
<h2 class="courses_h2 fl">关注</h2>
<div class="courses_select fr">一共关注<span class="c_orange" nh_name="watcher_count"><%=@obj_count%></span>人</div>
<% end %>
<div class="cl"></div>
</div>
<% for item in @list %>
<%= render :partial => 'users/user_fans_item', :locals => {:item => item,:target=>@user} %>
<% end %>
<p id="nodata" class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
</div>
<ul class="wlist" style=" border:none;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,22 @@
<% for item in @list %>
<div class="message_list" id="nh_jours_<%= item.id %>" nhname="rec" data-id="<%= item.id %>">
<a href="<%= user_path(item.user) %>" class="users_pic fl">
<%= image_tag url_to_avatar(item.user),:width => '27',:height => '27' %>
</a>
<a href="<%= user_path(item.user) %>" title="<%= item.user.show_name %>" class="course_name fl c_blue02 ml5 mt5"><%= item.user.show_name %></a>
<% if item.at_user %>
<span class="fl c_dark mt5">&nbsp;回复</span>
<a href="<%= user_path(item.at_user) %>" title="<%= item.at_user.show_name %>" class="course_name fl c_blue02 ml5 mt5"><%= item.at_user.show_name %></a>
<% end %>
<span class="fl c_dark mt5">&nbsp;:&nbsp;</span>
<p class="massage_txt fl mt5"><%=item.notes.html_safe%></p>
<% if JournalsForMessage.create_by_user? User.current %>
<a href="javascript:void(0)" class="fl mt5 c_purple ml5">回复</a>
<% end %>
<% if User.current.admin? || item.user.id == User.current.id %>
<a href="<%= url_for(:controller => 'words', :action=>"destroy", :object_id=>item.id,:user_id=>item.user.id) %>" data-confirm="您确定要删除吗?" data-remote="true" data-method="delete" class="fl mt5 c_purple ml5">删除</a>
<% end %>
<span class="massage_time fr"><%= time_tag(item.created_on).html_safe %>前</span>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1,66 +1,56 @@
<!--add by huang-->
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new') %>" class="bgreen_n_btn fr ml10 mt2">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
<% end %>
<div class="cl"></div>
</div>
<!--span class="font_lighter" >温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~</span-->
<div class="menu-div">
<div class="menu">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='take' class="<%= "on" if @state.eql?(0)%>"><%=l :label_project_take%></li>
<li mode='watched' class="<%= "on" if @state.eql?(1)%>"><%=l :label_has_watched_project%></li>
<div id="RSide" class="fl">
<div class="courses_box">
<div class="courses_top mb10">
<h2 class="courses_h2 fl">全部项目</h2>
<div class="courses_select fr">
<a href="<%= url_for(:controller => 'users', :action => 'user_projects')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">我创建</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 我参与</a>
</div>
<div class="cl"></div>
</div>
<% for item in @list %>
<% creator = User.find(item.user_id)%>
<div class="courses_list line">
<div class="courses_list_pic fl"><a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a></div>
<div class="courses_list_info fl ml10">
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>" class="courses_list_title f14 fb c_blue02 fl" title="<%= item.name %>"><%= item.name %></a>
<div class="cl"></div>
<div class="courses_list_table ">
<table>
<tbody><tr>
<td class="td_w60 ">创建者:</td>
<td class="td_w70 "><a href="<%= user_path(creator) %>" title="<%= creator.show_name %>"><%= creator.show_name %></a></td>
<td class="td_w60 ">创建时间:</td>
<td class="td_w110 "><%= format_date(item.created_on) %></td>
</tr>
<tr>
<td>成员人数:</td>
<td><a href="<%= url_for(:controller => 'projects', :action=>"member", :id=>item.id, :host=>Setting.host_name) %>"><%= item.members.count %></a></td>
<td>项目类型:</td>
<td><%= item.project_new_type == 1 ? l(:label_development_team) : (item.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%></td>
</tr>
</tbody></table>
</div>
</div>
<a href="<%= url_for(:controller => 'issues', :action=>"new", :project_id=>item.id, :host=>Setting.host_name) %>" class="blue_n_btn fr mt20">发布问题</a>
<div class="cl"></div>
</div>
<% end %>
<p class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
</div>
<ul class="wlist" style=" border:none;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
</div>
</div>
<div style="height:20px"></div>
<%#= watch_projects @state %>
<% unless @memberships.empty? %>
<div class="content_frame">
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to_user(membership.user) if membership.respond_to?(:user) %></strong>
<span class="font_lighter"> <%= l(:label_project_take_in) %></span> <%= link_to_project(membership.project) %></td>
</tr>
<tr>
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
<p class="font_description">
<%= membership.project.short_description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"><%= l(:label_create_time) %> : <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
</tr>
</table></td>
</tr>
</table>
</li>
<% end %>
</ul>
<% else %>
<% if @user != User.current %>
<p class="font_description"><%= l(:label_project_un) %></p>
<% else %>
<p class="font_description"><%= l(:label_project_unadd) %></p>
<% end %>
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$("#content .tabs_new~").find("a").attr("target", "_blank");
$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
$('[mode=take]').click(function(event) {window.location.href='<%=user_projects_user_url%>'; });
$('[mode=watched]').click(function(event) {window.location.href='<%=watch_projects_user_url(type: 1)%>'; });
});
</script>
<% html_title(l(:label_user_project)) -%>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,14 @@
<% for item in @list %>
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>">
<div class="courses_list_pic fl ml10 mr10">
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a>
</div>
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>" class="home_list_title c_blue02 fl mb10" title="<%= item.name %>"><%= item.name %></a>
<div class="fl c_dgrey">
<!--<p>项目评分:<a href="<%#= url_for(:controller => 'projects', :action => 'show_projects_score', :id => item.id,:host=>Setting.host_name) %>" data-remote="true"><%#= format( "%.2f" , project_scores(item) ).to_i %></a></p>-->
<p>项目评分:<a href="<%= url_for(:controller => 'projects', :action => 'show_projects_score', :id => item.id) %>" data-remote="true"><%= format( "%.2f" , project_scores(item) ).to_i %></a></p>
<p>发布缺陷:<a href="<%= url_for(:controller => 'issues', :action=>"index", :project_id=>item.id, :host=>Setting.host_name) %>"><%= item.issues.count %></a> <span class="ml10"></span>成员:<a href="<%= url_for(:controller => 'projects', :action=>"member", :id=>item.id, :host=>Setting.host_name) %>"><%= item.members.count %></a></p>
</div>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1,11 +1,70 @@
<% if( params[:object_type] == 'user') %>
<% if( params[:target_id] == params[:object_id] ) %>
<% target = User.find_by_id(params[:target_id]) %>
//btn
var btn_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_btn', :locals => {:target => target} ) )%>";
$('#user_watch_id').replaceWith(btn_html);
//count
$("*[nh_name='fans_count']").html("<%= target.watcher_users.count.to_s %>");
//left list
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_fans_list', :locals => {:user => target} ) )%>";
$('#fans_nav_list').replaceWith(list_left_html);
//list
if( $("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0 ){
<% if( opt == 'add') %>
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>User.current,:target => target} ) )%>";
$("#nh_fans_list").after(list_html);
$("#nodata").hide();
<% else %>
$("#fans_item_<%= User.current.id %>",$("#nh_fans_list").parent('div')).remove();
if( $('>div',$("#nh_fans_list").parent('div')).length == 1 ){
$("#nodata").show();
}
<% end %>
}
<% elsif( params[:target_id] == User.current.id.to_s )%>
<% target = User.find_by_id(params[:target_id]) %>
<% item = User.find_by_id(params[:object_id]) %>
//count
$("*[nh_name='watcher_count']").html("<%= User.watched_by(target.id).count.to_s %>");
//left list
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_list', :locals => {:user => target} ) )%>";
$('#watcher_nav_list').replaceWith(list_left_html);
//list
if( $("#nh_wacth_list") != undefined && $("#nh_wacth_list").length != 0 ){
<% if( opt == 'delete') %>
$("#fans_item_<%= item.id %>",$("#nh_wacth_list").parent('div')).remove();
if( $('>div',$("#nh_wacth_list").parent('div')).length == 1 ){
$("#nodata").show();
}
<% end %>
}else if($("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0){
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
$('#fans_item_<%= item.id %>').replaceWith(list_html);
}
<% else %>
<% target = User.find_by_id(params[:target_id]) %>
<% item = User.find_by_id(params[:object_id]) %>
//list
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
$('#fans_item_<%= item.id %>').replaceWith(list_html);
<% end %>
<% else %>
<% selector = ".#{watcher_css(watched)}" %>
<% id_selector = "#{watcher_css(watched)}" %>
if($("<%= selector %>").get(0) == undefined)
{
$("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
$("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
}
else
{
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
}
<% end %>

View File

@ -1,6 +1,10 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
<% if @user && @jours_count%>
$("#nh_jours_<%= @journal_destroyed.id %>").remove();
<% else %>
<% if @bid && @jours_count %>
$('#jours_count').html("<%= @jours_count %>");
<% elsif @course && @jours_count%>
@ -12,6 +16,8 @@
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
});
<% end %>
<% else %>
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
$('#new_form_reference_user_id').val("");

View File

@ -297,6 +297,11 @@ RedmineApp::Application.routes.draw do
match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
match 'user_courses', :to => 'users#user_courses', :via => :get
match 'user_courses4show', :to => 'users#user_courses4show', :via => :get
match 'user_projects4show', :to => 'users#user_projects4show', :via => :get
match 'user_course_activities', :to => 'users#user_course_activities', :via => :get
match 'user_project_activities', :to => 'users#user_project_activities', :via => :get
match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
match 'watch_projects', :to => 'users#watch_projects', :via => :get
# added by bai
@ -340,6 +345,8 @@ RedmineApp::Application.routes.draw do
match 'my/remove_block', :via => :post
match 'my/order_blocks', :via => :post
match 'my/change_mail_notification', via: :get
match 'my/save_user_avatar', :to => 'my#save_user_avatar', :via => [:get, :post]
match 'my/clear_user_avatar_temp', :to => 'my#clear_user_avatar_temp', :via => [:get, :post]
get 'my/page2', :to => 'my#page2', :as => "my_page2"

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -0,0 +1,66 @@
.topbar_info02{ margin:5px 10px;width:480px; }
.topbar_info02 p{color: #7f7f7f;}
.search{ margin-top:8px; float:right; margin-right:5px;}
/*信息*/
.project_info{ background:#fff; padding:10px; padding-right:0px;width:222px; padding-right:8px; margin-bottom:10px;}
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px; margin-top:5px;}
.pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;}
.pr_info_logo:hover{ border:1px solid #64bdd9; }
.pr_info_join{}
a.pr_join_a{ color:#fff; display:block; padding:0 5px 0 3px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background-color:#64bdd9; float:left; }
a:hover.pr_join_a{ background:#41a8c8;}
.pr_join_span{color: #fff; display:block; padding:0 5px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background: #CCC;}
.pr_setting{ display:block; background:url(../images/leftside.png) -1px 0 no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_copy{ display:block; background:url(../images/leftside.png) -1px -23px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_close{ display:block; background:url(../images/leftside.png) -1px -49px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_add{display:block; background:url(../images/leftside.png) 0px -71px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_arrow{display:block; background:url(../images/leftside.png) 0px -90px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;}
.pr_info_name:hover{ color:#3ca5c6;}
.pr_info_score{ font-size:14px; color:#3e4040; }
.pr_info_score a{ color:#ff7143;}
.pr_info_score a:hover{ color:#64bdd9;}
.img_private{ background:url(../images/project/img_project.png) 0 0 no-repeat; width:33px; height:16px; color:#fff; font-size:12px; padding-left:7px; }
.info_foot_num{ color:#3ca5c6; }
.pr_info_foot{ color:#7f7f7f; margin-top:5px; }
.info_foot_num:hover{ color:#2390b2;}
.info_box{background:#fff; padding:10px;width:220px; }
.info_box ul li{ font-size:12px; color: #3e4040; line-height:1.7;}
/*左侧导航*/
.subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;}
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;}
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
.subNav_jiantou:hover{color:#0781b4; }
.currentDd{color:#0781b4;}
.currentDt{background-color:#fff;}
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
a.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:18px; padding:0px 5px; padding-top:2px; display:block; margin-top:2px; margin-bottom:5px; float:right; margin-right:5px;}
a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}
/****标签(和资源库的tag样式一致)***/
.project_Label{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px;}
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.re_tag{ width: auto; padding:0 5px; padding-top:2px; height:20px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
.re_tag a{ color:#0d90c3;}
.tag_h{ }
.tag_h span,.tag_h a{ margin-bottom:5px;}

View File

@ -0,0 +1,430 @@
/* CSS Document */
/* 2015-06-26 */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#7f7f7f;text-decoration:none;}
a:hover,a:active{color:#000;}
/*常用*/
select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; }
.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;}
.sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
table{ background:#fff;}
.more{ font-weight:normal; color:#999; font-size:12px;}
.no_line{ border-bottom:none;}
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
.no_border{ border:none;background:none;}
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;}
/* font & color */
h2{ font-size:18px; color:#15bccf;}
h3{ font-size:14px; color:#e8770d;}
h4{ font-size:14px; color:#3b3b3b;}
.f12{font-size:12px; font-weight:normal;}
.f14{font-size:14px;}
.f16{font-size:16px;}
.f18{font-size:18px;}
.fb{font-weight:bold;}
.lh20{line-height:20px;}
.lh22{line-height:22px;}
.lh24{line-height:24px;}
.lh26{line-height:26px;}
.fmYh{font-family:"MicroSoft Yahei";}
.font999{ color:#999;}
.fontRed{color:#770000;}
.text_c{ text-align:center;}
/* Float & Clear */
.cl{ clear:both; overflow:hidden; }
.fl{float:left;display:inline;}
.fr{float:right;display:inline;}
.f_l{ float:left;}
.f_r{ float:right;}
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
.clearfix{clear:both;zoom:1}
.break_word{ word-break:break-all; word-wrap: break-word;}
.white_space{white-space:nowrap;}
/* Spacing */
.ml2{ margin-left:2px;}
.ml3{ margin-left:3px;}
.ml4{ margin-left:4px;}
.ml5{ margin-left:5px;}
.ml8{ margin-left:8px;}
.ml10{ margin-left:10px;}
.ml15{ margin-left:15px;}
.ml20{ margin-left:20px;}
.ml40{ margin-left:40px;}
.ml45{ margin-left:45px;}
.ml55{ margin-left:55px;}
.ml30{ margin-left:30px;}
.ml60{ margin-left:60px;}
.ml80{ margin-left:80px;}
.ml90{ margin-left:90px;}
.ml100{ margin-left:100px;}
.ml110{ margin-left:110px;}
.mr5{ margin-right:5px;}
.mr10{ margin-right:10px;}
.mr20{ margin-right:20px;}
.mr30{ margin-right:30px;}
.mr40{ margin-right:40px;}
.mt3{ margin-top:3px;}
.mt5{ margin-top:5px;}
.mt8{ margin-top:8px;}
.mt10{ margin-top:10px;}
.mb5{ margin-bottom:5px;}
.mb10{ margin-bottom:10px;}
.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
.w20{ width:20px;}
.w60{ width:60px;}
.w70{ width:70px;}
.w90{ width:90px;}
.w210{ width:210px;}
.w150{ width:150px;}
.w280{ width:280px;}
.w430{ width:470px;}
.w520{ width:520px;}
.w543{ width:543px;}
.w557{ width:557px;}
.w583{ width:583px;}
.w350{ width:350px;}
.w610{ width:610px;}
.w600{ width:600px;}
.h22{ height:22px;}
.h26{ height:26px;}
.h50{ height:50px;}
.h70{ height:70px;}
.h150{ height:150px;}
/* Font & background Color */
a.b_grey{ background: #F5F5F5;}
a.b_dgrey{ background: #CCC;}
a.c_orange{color:#ff5722;}
a:hover.c_orange{color: #d33503;}
a.c_lorange{color:#ff9900;}
a:hover.c_lorange{color:#fff;}
a.c_blue{ color:#15bccf;}
a.c_dblue{ color:#09658c;}
a:hover.c_dblue{ color:#15bccf;}
a.c_white{ color:#fff;}
a.c_dorange{ color:#fd6e2a;}
a.c_dark{color: #3e4040;}
a:hover.c_dark{color: #3ca5c6;}
a.b_blue{background: #64bdd9;}
a:hover.b_blue{background: #41a8c8;}
a.b_green{background:#28be6c;}
a:hover.b_green{background:#14ad5a;}
a.c_blue02{color: #3ca5c6;}
a:hover.c_blue02{color: #0781b4;}
a.c_red{ color:#F00;}
a:hover.c_red{ color: #C00;}
a.c_purple{color: #426e9a;}
a:hover.c_purple{color: #d33503;}
a.c_green{ color:#28be6c;}
.b_grey{ background: #F5F5F5;}
.b_dgrey{ background: #CCC;}
.c_orange{color:#e8770d;}
.c_dark{ color:#2d2d2d;}
.c_lorange{ color:#ff9900;}
.c_purple{color: #6883b6;}
.c_blue{ color:#15bccf;}
.c_red{ color:#F00;}
.c_green{ color:#28be6c;}
.c_dblue{ color:#09658c;}
.b_blue{background:#64bdd9;}
.b_green{background:#28be6c;}
.b_w{ background:#fff;}
/* commonBtn */
.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center;padding:2px 10px;}
a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center;padding:2px 10px;}
a:hover.grey_btn{ background:#717171; color:#fff;}
.grey_n_btn{ background:#d9d9d9; color:#656565; font-weight:normal;padding:2px 10px; text-align:center;}
a.grey_n_btn{background:#d9d9d9; color:#656565;font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.grey_n_btn{ background:#717171; color:#fff;}
.green_btn{ background:#28be6c; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;}
a.green_btn{background:#28be6c;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.green_btn{ background:#14ad5a;}
.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_btn{ background:#329cbd;}
a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; }
a:hover.orange_btn{ background:#d63502;}
.green_u_btn{border:1px solid #3cb761; padding:2px 10px; color:#3cb761;}
a.green_u_btn{border:1px solid #3cb761; padding:2px 10px; color:#3cb761;}
a:hover.green_u_btn{ background:#3cb761; color:#fff;}
.orange_u_btn{border:1px solid #ff5d31; padding:2px 10px; color:#ff5d31;}
a.orange_u_btn{border:1px solid #ff5d31; padding:2px 10px; color:#ff5d31;}
a:hover.orange_u_btn{background:#ff5d31; color:#fff;}
.bgreen_u_btn{border:1px solid #1abc9c; padding:2px 10px; color:#1abc9c;}
a.bgreen_u_btn{border:1px solid #1abc9c1; padding:2px 10px; color:#1abc9c;}
a:hover.bgreen_u_btn{background:#1abc9c; color:#fff;}
.blue_u_btn{border:1px solid #64bdd9; padding:2px 10px; color:#64bdd9;}
a.blue_u_btn{border:1px solid #64bdd9; padding:2px 10px; color:#64bdd9;}
a:hover.blue_u_btn{background:#64bdd9; color:#fff;}
.blue_n_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_n_btn{background:#64bdd9;color:#fff;font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_n_btn{ background:#329cbd;}
.green_n_btn{background:#3cb761; padding:2px 10px; color:#fff;}
a.green_n_btn{background:#3cb761; padding:2px 10px; color:#fff;}
a:hover.green_n_btn{ background:#14ad5a;}
.orange_n_btn{background:#ff5d31; padding:2px 10px; color:#fff;}
a.orange_n_btn{background:#ff5d31; padding:2px 10px; color:#fff;}
a:hover.orange_n_btn{background:#d63502;}
.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;}
a.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;}
a:hover.bgreen_n_btn{background:#08a384;}
.nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;}
.more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;}
.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}
.red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
.bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
/* commonpic */
.pic_date{ display:block; background:url(../images/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;}
.pic_add{ display:block; background:url(../images/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;}
.pic_sch{ display:block; background:url(../images/public_icon.png) -31px -195px no-repeat; width:16px; height:15px; float:left;}
.pic_mes{ display:block; background:url(../images/public_icon.png) 0px -376px no-repeat; width:20px; height:15px; padding-left:18px;}
.pic_img{ display:block; background:url(../images/public_icon.png) -31px -419px no-repeat; width:20px; height:15px; }
.pic_del{ display:block; background:url(../images/public_icon.png) 0px -235px no-repeat; width:20px; height:15px; }
.pic_del:hover{ background:url(../images/public_icon.png) -32px -235px no-repeat; }
.pic_stats{display:block; background:url(../images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
.pic_files{display:block; background:url(../images/public_icon.png) 0px -578px no-repeat; width:20px; height:15px;}
.pic_text{display:block; background:url(../images/public_icon.png) 0px -609px no-repeat; width:20px; height:18px;}
.pic_text02{display:block; background:url(../images/public_icon.png) 0px -642px no-repeat; width:20px; height:19px;}
.pic_edit{display:block; background:url(../images/public_icon.png) 0px -32px no-repeat; width:20px; height:15px;}
.pic_edit:hover{display:block; background:url(../images/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;}
/*框架主类容*/
#Container{ width:1000px; margin:0 auto; }
/*头部导航*/
#Header{ margin:10px 0; background:#15bccf; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; }
.logo{ margin:5px 10px; }
#TopNav{}
#TopNav ul li{ margin-top:8px;}
.topnav_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;}
.topnav_a a:hover{color: #a1ebff;}
#TopUser{}
#TopUser ul li{ margin-top:8px;}
.topuser_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;}
.topuser_a a:hover{color: #a1ebff;}
#TopUser02{ }
#TopUser02 li{ float: left;}
#TopUser02 li a{ margin-right:10px;color: #FFF;text-align: center;}
#TopUser02 li a:hover{color: #a1ebff;}
#TopUser02 div{ position: absolute;visibility: hidden;background:#fff;border: 1px solid #15bccf;}
#TopUser02 div a{position: relative;display: block;white-space: nowrap;text-align: left; line-height:1.9; margin-left:5px;background: #fff;color:#15bccf; font-weight:normal;}
#TopUser02 div a:hover{ color:#e8770d; font-weight: bold;}
/*头部导航下拉*/
div#menu {height:41px; font-size:14px; font-weight:bold; }
div#menu ul {float: left;}
div#menu ul.menu { padding-left: 30px; }
div#menu li {position: relative; z-index: 9; margin: 0; display: block; float: left; }
div#menu li:hover>ul { left: -2px;}
div#menu a {position: relative;z-index: 10; height: 41px; display: block; float: left;line-height: 41px; text-decoration: none; font-size:14px; }
div#menu a:hover, div#menu a:hover span { color: #a1ebff; }
div#menu li.current a {}
div#menu {display: block; cursor: pointer; background-repeat: no-repeat;background-position: 95% 0;padding-right: 15px; _padding-right: 20px;}
div#menu ul a.parent {background: url(../images/item.png) -20px -30px no-repeat; width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
div#menu ul a.parent:hover {background: url(../images/item.png) -20px -60px no-repeat;}
div#menu ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;}
div#menu ul ul a.parent:hover {background: url(../images/item.png) -20px -11px no-repeat;}
/* menu::level1 */
div#menu a { padding: 5px 12px 0 10px;line-height: 30px; color: #fff;}
div#menu li { background: url(images/main-delimiter.png) 98% 4px no-repeat; }
div#menu li.last { background: none; }
/* menu::level2 */
div#menu ul ul li { background: none; }
div#menu ul ul { position: absolute;top: 38px; left: -999em; width: 90px; padding: 5px 0 0 0; background:#fff; border:1px solid #15bccf; margin-top:1px;}
div#menu ul ul a {padding: 0 0 0 15px; height: auto; float: none;display: block; line-height: 24px; font-size:12px; font-weight:normal;color:#15bccf;}
div#menu ul ul a:hover { color:#ff9900;}
div#menu ul ul li.last { margin-left:15px; }
div#menu ul ul li {width: 100%;}
/* menu::level3 */
div#menu ul ul ul {padding: 0;margin: -38px 0 0 92px !important; width:140px; }
div#menu ul ul ul li a{ width:125px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf;}
/*主类容*/
#Main{ background:#fff; margin-bottom:10px;}
#content{}
#content02{ background:#fff; padding:10px; margin-bottom:10px;}
/*主类容搜索*/
#TopBar{ height:60px; margin-bottom:10px; background:#fff;}
.topbar_info02{ margin:5px 10px;width:480px; }
.topbar_info02 p{color: #7f7f7f;}
.search{ margin-top:8px; margin-left:71px;}
.search_form{margin-top:8px;margin-left:72px;}
.topbar_info{ width:350px; color:#5c5c5c; font-size:16px; margin-right:50px; line-height:1.3; padding-left:100px;}
a.search_btn{ display:block; background:#15bccf; color:#fff; width:60px; height:24px; text-align:center; padding-top:3px;}
a:hover.search_btn{ background: #0fa9bb;}
.search_text{ border:1px solid #15bccf; background:#fff; width:220px; height:25px; padding-left:5px; }
/*主类容左右分栏*/
#LSide{ width:240px; }
#RSide{ width:730px; margin-left:10px; background:#fff; padding:10px; margin-bottom:10px;}
/*底部*/
#Footer{ padding-top:10px; background:#fff; margin-bottom:10px;}
.copyright{ width:780px; margin:0 auto;height:30px; }
.footlogo{ width:580px; margin:0 auto;height:50px; }
/*意见反馈*/
html{ overflow-x:hidden;}
.scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; }
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:190px;cursor:pointer;}
.show_btn span { display:none;}
.close_btn{width:24px;height:24px;cursor:pointer;}
.side_title,.side_bottom,.close_btn,.show_btn {background:url(../images/sidebar_bg.png) no-repeat; }
.side_title {height:35px;}
.side_bottom { height:8px;}
.side_center {font-family:Verdana, Geneva, sans-serif; padding:0px 12px; font-size:12px;}
.close_btn { float:right; display:block; width:21px; height:16px; margin:9px 10px 0 0; _margin:16px 5px 0 0;}
.close_btn span { display:none;}
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
.msgserver { margin-top:5px;}
/*.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -112px; padding-left:22px; height:21px; display:block; }*/
.msgserver a { height:21px; display:block; }
.opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;}
a.opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;}
a:hover.opnionButton{background: #0fa9bb; }
/* blue skin as the default skin */
.side_title {background-position:-195px 0;}
.side_center {background:url(../images/blue_line.png) repeat-y center; }
.side_bottom {background-position:-195px -50px;}
a.close_btn {background-position:-44px 0;}
a:hover.close_btn {background-position:-66px 0;}
.show_btn {background-position:-119px 0;}
.msgserver a {color:#15bccf; }
.msgserver a:hover { text-decoration:underline; }
/***** Ajax indicator ******/
#ajax-indicator {
position: absolute; /* fixed not supported by IE */
background-color:#eee;
border: 1px solid #bbb;
top:35%;
left:40%;
width:20%;
font-weight:bold;
text-align:center;
padding:0.6em;
z-index:100000;
opacity: 0.5;
}
html>body #ajax-indicator { position: fixed; }
#ajax-indicator span {
background-position: 0% 40%;
background-repeat: no-repeat;
background-image: url(../images/loading.gif);
padding-left: 26px;
vertical-align: bottom;
}
div.modal {
border-radius: 5px;
background: #fff;
z-index: 50;
padding: 4px;
}
.ui-widget-content {
border: 1px solid #ddd;
color: #333;
}
.ui-widget {
font-family: Verdana, sans-serif;
font-size: 1.1em;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
background: none;
overflow: auto;
zoom: 1;
}
.ui-widget-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-widget-overlay {
background: #666 url(http://forge.trustie.net/stylesheets/jquery/images/xui-bg_diagonals-thick_20_666666_40x40.png.pagespeed.ic.9mfuw_R0z1.png) 50% 50% repeat;
opacity: .5;
filter: Alpha(Opacity=50);
}
/***** end Ajax indicator ******/
/***** Flash & error messages ****/
#errorExplanation, div.flash, .nodata, .warning, .conflict {
padding: 4px 4px 4px 30px;
margin-bottom: 12px;
font-size: 1.1em;
border: 2px solid;
}
div.flash {margin-top: 8px;}
div.flash.error, #errorExplanation {
background: url(../images/exclamation.png) 8px 50% no-repeat;
background-color: #ffe3e3;
border-color: #dd0000;
color: #880000;
}
div.flash.notice {
background: url(../images/true.png) 8px 5px no-repeat;
background-color: #dfffdf;
border-color: #9fcf9f;
color: #005f00;
}
div.flash.warning, .conflict {
background: url(../images/warning.png) 8px 5px no-repeat;
background-color: #FFEBC1;
border-color: #FDBF3B;
color: #A6750C;
text-align: left;
}
.nodata, .warning {
text-align: center;
background-color: #FFEBC1;
border-color: #FDBF3B;
color: #A6750C;
}
#errorExplanation ul { font-size: 0.9em;}
#errorExplanation h2, #errorExplanation p { display: none; }
.conflict-details {font-size:80%;}
/***** end Flash & error messages ****/
/*弹出框*/
.black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);}
.white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.white_content02{display:none;position:fixed;top:15%;left:30%;width:200px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.newhwork_content{ display:none;position:fixed;top:15%;left:30%;width:600px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;}
a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
a:hover.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}

View File

@ -0,0 +1,127 @@
#RSide{ min-height:860px;}
/* 左侧信息*/
.users_info{background:#fff; padding:10px; width:230px; padding-right:0px; margin-bottom:10px; }
.pic_head{ width:214px; height:214px; border:1px solid #cbcbcb; padding:2px; position:relative;}
.pic_head:hover{border:1px solid #64bdd9;}
.usersphoto_edit{ position:absolute; left:198px; top:200px;}
.icon_male{ background:url(../images/pic_uersall.png) 0 0 no-repeat; width:15px; height:15px;}
.icon_female{ background:url(../images/pic_uersall.png) 0 -24px no-repeat; width:15px; height:15px;}
.pf_intro{ width:222px; margin-top:5px; color:#696969; }
.leftbox{ width:230px; padding:10px; padding-right:0px; padding-bottom:5px;background:#fff; margin-bottom:10px; margin-right:10px;}
.pic_members{ background:url(../images/pic_users.jpg) 0 0 no-repeat; display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;}
.pic_members:hover{border:1px solid #c9c9c9;}
/*新建*/
.top_new{ height:26px; border-bottom:10px solid #eaebed; padding:10px; background:#fff; float:left; margin-left:10px; width:730px; }
.top_new_bg{ background:url(../images/pic_uersall.png) -43px 3px no-repeat; height:26px; width:260px;}
.top_newcourses_bg{ background:url(../images/pic_uersall.png) -43px -29px no-repeat; height:28px; width:260px;}
.top_newproject_bg{ background:url(../images/pic_uersall.png) -43px -56px no-repeat; height:26px; width:260px;}
.newbtn{ height:24px; background:#18ca74; color:#fff; font-size:14px; padding:2px 12px 0 12px;}
.newbtn:hover{background: #14ad5a;}
a.newbtn_add{ display:block; background:url(../images/pic_uersall.png) -265px 3px no-repeat; height:20px; width:15px;}
a.newbtn_t{ font-size:14px; font-weight:bold; color:#fff;}
/*留言*/
a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; }
a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; }
.inputUsers_message{ border:1px solid #d2d2d2; width:718px; height:48px; color:#666; padding:5px; margin-bottom:5px;}
.inputUsers_message02{ border:1px solid #d2d2d2; width:618px; height:26px; color:#666; padding:5px; margin-bottom:5px; }
.message_list_box{ background:#f5f5f5; padding:10px;}
.users_pic{ width:27px; height:27px; border:1px solid #e3e3e3;}
.users_pic:hover{ border:1px solid #a5a5a5;}
.massage_txt{ max-width:360px; color: #666;}
.massage_time{ color:#8d8d8d; margin-top:5px;}
.message_list{ border-bottom:1px dashed #c9c9c9; padding-bottom:10px; margin-bottom:10px;}
.message_list_more{ text-align:center; width:720px;}
/*课程动态*/
.line_box{ width:728px; border:1px solid #d9d9d9; padding-bottom:10px;}
.users_courses_list{ height:24px; border-bottom:1px dashed #CCC; margin-bottom:10px;}
.users_coursename{width:180px; font-weight:bold; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; margin-right:5px; }
.course_name{max-width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.c_grey{ color:#8d8d8d;}
.users_courses_txt{width:330px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.users_top{ height:39px; border-bottom:1px solid #d9d9d9; margin-bottom:10px;}
.users_h4{border-bottom:1px solid #d9d9d9; height:29px; padding:10px 0 0 10px; margin-bottom:10px; }
/*弹框*/
.white_content_users{display:none;position:fixed;top:45%;left:45%;width:210px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
/*我的课程*/
.courses_top{ height:27px; border-bottom:3px solid #ebebeb;}
.courses_h2{ font-size:16px; font-weight:bold; color:#64bddb; border-bottom:3px solid #64bddb; padding-bottom:3px; padding-right:3px;}
.courses_select{}
a.select_btn{ border:1px solid #acacac; padding:0px 10px; color:#989898; display:block;}
a.select_btn:hover{ background:#64bddb; color:#fff;}
a.select_btn_select{ background:#64bddb; color:#fff;}
.courses_list_pic{ border:1px solid #ede7e9; width:64px; height:64px; padding:1px;}
.courses_list_pic:hover{border:1px solid #64bdd9;}
.courses_list_title{ max-width:500px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.pic_eye_blue{display:block; background:url(../images/pic_uersall.png) -372px 3px no-repeat; width:16px; height:15px; }
.pic_eye_grey{display:block; background:url(../images/pic_uersall.png) -372px -10px no-repeat; width:16px; height:15px; }
.td_w70{ width:70px;}
.td_w60{ width:60px;}
.td_w110{ width:110px;}
.mt20{ margin-top:20px;}
.courses_list{ padding-bottom:10px; }
.courses_list_table{ color:#6e6e6e;}
/****翻页***/
.wlist{float:right;}
.wlist li{float:left;}
.wlist a{ float:left; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;}
.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;}
.wlist_select a { background-color:#48aac9; color:#fff;}
/* 设置 */
#users_setting{clear:both;width:730px;/*滑动门的宽度*/}
/* TAB 切换效果 */
.users_tb_{ border-bottom:3px solid #CCC; height:26px; }
.users_tb_ ul{height:26px; }
.users_tb_ li{float:left;height:26px;width: 90px;cursor:pointer; font-size:14px; text-align:center; }
/* 控制显示与隐藏css类 */
.users_normaltab { color:#666; }
.users_hovertab { color:#64bdd9; border-bottom:3px solid #64bdd9; font-weight:bold;}
.users_normaltab a { color:#64bdd9 ; }
.users_hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;}
.users_dis{display:block; }
.users_undis{display:none;}
.users_ctt{ font-size:14px; color:#666; margin-top:10px;}
.setting_left{ width:85px; text-align:right; float:left;}
.setting_left li{ height:28px;line-height:28px;}
.setting_right{width:500px; text-align:left; float:left; margin-left:8px;}
.setting_right li{ height:28px;line-height:28px;}
.users_ctt ul li{ margin-bottom:10px;}
.users_ctt input,.users_ctt select,.users_ctt textarea{ border:1px solid #CCC;}
.users_ctt input,.users_ctt select,.users_ctt option{ height:26px;}
.users_ctt input,.users_ctt textarea{ margin-left:2px;}
.users_ctt textarea{ margin-bottom:none;}
.w450{ width:450px;}
.w210{ width:200px;}
.w70{ width:70px;}
.h200{ height:200px;}
/* 个人主页*/
a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
a:hover.gz_btn{ color:#ff5722;}
a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
a:hover.qx_btn{color:#64bdd9;}
a.c_lgrey{ color:#CCC;}
a:hover.c_lgrey{ color:#3ca5c6;}
.leftbox_ul_left{ width:60px; float:left; text-align:right; }
.leftbox_ul_right{ width:155px; float:left; margin-left:10px; }
.leftbox_ul_left li,.leftbox_ul_right li{ margin-bottom:5px;}
.c_dgrey{ color:#696969;}
.home_courses_list{ width:364px; margin-bottom:10px; }
.home_list_title{ width:260px; font-size:14px; font-weight:bold;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.users_list{ }
.users_course_intro{ width:530px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
/* 20150506上传头像*/
.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;}
.mr2{ margin-right:2px;}
.uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;}
/* 新建作品*/
.mr8{ margin-right:8px;}
.mt2{ margin-top:2px;}
.fans_sign{ width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.newhwork_div ul li{ margin-bottom:10px; font-size:14px; color:#666;}
.newhwork_div input,.newhwork_div select{ height:26px;border:1px solid #CCC; }
.newhwork_div textarea{border:1px solid #CCC;}
.w460{ width:460px;}
a.hidepic>img{display:none;}