commit
4fd90464d9
@ -0,0 +1,7 @@
|
||||
class UserActivity < ActiveRecord::Base
|
||||
attr_accessible :act_type,:act_id,:container_type,:container_id
|
||||
# 虚拟关联---项目动态表/课程动态表
|
||||
belongs_to :act ,:polymorphic => true
|
||||
# 虚拟关联---项目/课程
|
||||
belongs_to :container ,:polymorphic => true
|
||||
end
|
@ -0,0 +1,47 @@
|
||||
<div class="navHomepage">
|
||||
<div class="navHomepageLogo fl">
|
||||
<%=link_to image_tag("../images/logo.png",width:"51px", height: "45px",class: "mt3"), user_activities_path(User.current.id)%>
|
||||
</div>
|
||||
<div class="fl">
|
||||
<ul>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href="javascript:void(0);" class="homepageWhite f16">首页</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href="javascript:void(0);" class="homepageWhite f16">资源库</a></li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href="javascript:void(0);" class="homepageWhite f16">作业</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href="javascript:void(0);" class="homepageWhite f16">联系人</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="fl">
|
||||
<form class="navHomepageSearchBox">
|
||||
<input type="text" name="navHomepageSearch" class="navHomepageSearchInput" />
|
||||
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="navHomepageProfile">
|
||||
<ul>
|
||||
<li class="homepageProfileMenuIcon">
|
||||
<%= link_to "<div class='mt5 mb8'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
|
||||
<ul class="topnav_login_list">
|
||||
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
|
||||
<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>
|
||||
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navHomepageNews">
|
||||
<%= link_to image_tag("/images/news_icon_small.png" , :width => "21", :height => "24"), {:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %>
|
||||
<% if User.current.count_new_message >0 %>
|
||||
<div class="newsActive"></div>
|
||||
<% end %>
|
||||
<div class="newsActive"></div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,40 @@
|
||||
<div class="navHomepage">
|
||||
<div class="navHomepageLogo fl">
|
||||
<%=link_to image_tag("../images/logo.png",weight:"51px", height: "45px",class: "mt3")%>
|
||||
</div>
|
||||
<div class="fl">
|
||||
<ul>
|
||||
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">首页</a></li>
|
||||
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">资源库</a></li>
|
||||
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">作业</a></li>
|
||||
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">联系人</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="fl">
|
||||
<form class="navHomepageSearchBox">
|
||||
<input type="text" name="navHomepageSearch" class="navHomepageSearchInput" />
|
||||
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="navHomepageProfile">
|
||||
<ul>
|
||||
<li class="homepageProfileMenuIcon">
|
||||
<a href="javascript:void(0);">
|
||||
<div class="mt5 mb8">
|
||||
<img src="images/homepageProfileImage.png" width="40" height="40" />
|
||||
</div>
|
||||
</a>
|
||||
<ul class="topnav_login_list">
|
||||
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
|
||||
<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>
|
||||
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navHomepageNews">
|
||||
<a href="javascript:void(0);" class="homepageNewsIcon">
|
||||
<div class="newsActive"></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,10 @@
|
||||
<% if user.user_extensions && user.user_extensions.brief_introduction && !user.user_extensions.brief_introduction.empty? %>
|
||||
<%= user.user_extensions.brief_introduction %>
|
||||
<% else%>
|
||||
这位童鞋很懒,什么也没有留下~
|
||||
<% end %>
|
||||
<% if User.current == user%>
|
||||
<a href="javascript:void(0);" onclick="show_edit_user_introduction();">
|
||||
<img src="../images/signature_edit.png" width="12" height="12" />
|
||||
</a>
|
||||
<% end%>
|
@ -1,11 +1,7 @@
|
||||
<% if User.current.logged?%>
|
||||
<% if User.current == target%>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'account') %>" class="fr gz_btn mr10 ">编辑资料</a>
|
||||
<%else%>
|
||||
<%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>
|
||||
<%= link_to "",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "homepageFollow", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<% 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>
|
||||
<%= link_to "",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "homepageFollowCancel", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<% end %>
|
||||
<% end%>
|
||||
<% end %>
|
@ -0,0 +1,212 @@
|
||||
<!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', 'new_public', 'user_leftside', :media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag "bootstrap","avatars","new_user"%>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="navContainer">
|
||||
<% is_current_user = User.current.logged? && User.current == @user%>
|
||||
<% if User.current.logged? %>
|
||||
<%= render :partial => 'layouts/logined_header' %>
|
||||
<% else%>
|
||||
<%= render :partial => 'layouts/unlogin_header' %>
|
||||
<% end%>
|
||||
</div>
|
||||
|
||||
<div class="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
<div class="homepageLeft" id="LSide">
|
||||
<div class="homepagePortraitContainer">
|
||||
<div class="homepagePortraitImage" id="homepage_portrait_image">
|
||||
<%= image_tag(url_to_avatar(@user),width:"206", height: "206", :id=>'nh_user_tx') %>
|
||||
<% if User.current.logged?%>
|
||||
<% if is_current_user%>
|
||||
<div id="edit_user_file_btn" class="none">
|
||||
<div class="homepageEditProfile">
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="watch_user_btn" class="none">
|
||||
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div>
|
||||
<div class="homepageImageName hidden">
|
||||
<%= @user.login %>
|
||||
</div>
|
||||
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
|
||||
<div class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></div>
|
||||
<% end %>
|
||||
<%= link_to("编辑资料", my_account_path, :class => "fr gz_btn mr10") if is_current_user%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="homepageSignature">
|
||||
<p id="user_brief_introduction_show">
|
||||
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
|
||||
</p>
|
||||
</div>
|
||||
<textarea class="homepageSignatureTextarea none" placeholder="请输入回复" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="homepageImageBlock">
|
||||
<div>
|
||||
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
|
||||
</div>
|
||||
<div class="homepageImageText">关注</div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div>
|
||||
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
|
||||
</div>
|
||||
<div class="homepageImageText">粉丝</div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div>
|
||||
<%= 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 => 'homepageImageNumber',:id => 'user_score') %>
|
||||
</div>
|
||||
<div class="homepageImageText">积分</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageLeftMenuContainer">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText">课程</a>
|
||||
<a href="javascript:void(0);" class="homepageMenuSetting">
|
||||
<img src="../images/menu_setting.png" width="14" height="14" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
|
||||
<% courses.each do |course|%>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>course.id, :host=>Setting.host_course) %>" class="coursesLineGrey">
|
||||
<%= course.name %>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if courses.size == 5%>
|
||||
<li class="homepageLeftMenuMore">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a>
|
||||
</li>
|
||||
<% end%>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText">项目</a>
|
||||
<a href="javascript:void(0);" class="homepageMenuSetting">
|
||||
<img src="../images/menu_setting.png" width="14" height="14" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<% projects.each do |project|%>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>project.id, :host=>Setting.host_name) %>" class="coursesLineGrey">
|
||||
<%= project.name %>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if projects.size == 5%>
|
||||
<li class="homepageLeftMenuMore">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a>
|
||||
</li>
|
||||
<% end%>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText">留言</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageLeftLabelContainer">
|
||||
<div class="project_Label_New">
|
||||
<span class="homepageLabelText">标签</span>
|
||||
<div class="tag_h ml10" >
|
||||
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial => 'layouts/new_feedback' %>
|
||||
</div>
|
||||
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
|
||||
<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 mr15"> 取 消</a>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确 定</a>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
</div><!--floatbox end-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,2 +1,3 @@
|
||||
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>');
|
||||
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>');
|
||||
hideModal();
|
@ -0,0 +1,3 @@
|
||||
$("#user_brief_introduction_show").html("<%= escape_javascript render(:partial => "layouts/user_brief_introduction", :locals => {:user => @user}) %>");
|
||||
$("#user_brief_introduction_show").show();
|
||||
$("#user_brief_introduction_edit").hide();
|
@ -1,2 +1,2 @@
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
||||
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
||||
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
||||
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
@ -1,2 +1,2 @@
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
||||
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue