增加了粉丝和关注 单个页面,增加了默认用户图像,默认项目图像
|
@ -17,8 +17,8 @@
|
|||
class UsersController < ApplicationController
|
||||
layout 'base_users'
|
||||
|
||||
before_filter :require_admin, :except => [:show, :index,:tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info]
|
||||
before_filter :find_user, :only => [:show, :edit, :update, :destroy, :edit_membership, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info]
|
||||
before_filter :require_admin, :except => [:show, :index,:tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist]
|
||||
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info]
|
||||
accept_api_auth :index, :show, :create, :update, :destroy
|
||||
|
||||
helper :sort
|
||||
|
@ -27,7 +27,7 @@ class UsersController < ApplicationController
|
|||
include CustomFieldsHelper
|
||||
include AvatarHelper
|
||||
|
||||
# added by liuping 关注
|
||||
# added by liuping 关注
|
||||
|
||||
helper :watchers
|
||||
helper :activities
|
||||
|
@ -379,7 +379,16 @@ class UsersController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
###add by huang
|
||||
def user_watchlist
|
||||
|
||||
end
|
||||
###add by huang
|
||||
def user_fanslist
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -1305,4 +1305,14 @@ module ApplicationHelper
|
|||
html.html_safe
|
||||
end
|
||||
#end
|
||||
# add by huang
|
||||
def show_watcher_list(user)
|
||||
html = ''
|
||||
for user in User.watched_by(user.id)
|
||||
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
|
||||
end
|
||||
html.html_safe
|
||||
end
|
||||
# end
|
||||
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<div class="inf_user_image">
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= link_to image_tag(avatar_image(@project), :class => 'avatar') %></td>
|
||||
<td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar') %></td>
|
||||
<td align="center">
|
||||
<div class="info_font">
|
||||
<%= textilizable @project.name %>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<div>
|
||||
<%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%= User.watched_by(@user.id).count %></strong>)
|
||||
<%= l(:label_user_fans) %> (<strong class="font_small_watch"><%= @user.watcher_users.count %></strong>)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user_underline"></div>
|
||||
<!--info-->
|
||||
|
@ -76,7 +76,7 @@
|
|||
|
||||
<div class="user_fans">
|
||||
<div class="font_title_left">
|
||||
<strong><%= l(:label_user_watcher) %>(<%= link_to User.watched_by(@user.id).count %>)</strong>
|
||||
<strong><%= l(:label_user_watcher) %>(<%= link_to User.watched_by(@user.id).count, :controller=>"users",:action=>"user_watchlist" %>)</strong>
|
||||
</div>
|
||||
|
||||
<div class="left_wf">
|
||||
|
@ -93,7 +93,7 @@
|
|||
<!--fans-->
|
||||
<div class="user_fans">
|
||||
<div class="font_title_left">
|
||||
<strong><%= l(:label_user_fans) %>(<%= link_to @user.watcher_users.count %>)</strong>
|
||||
<strong><%= l(:label_user_fans) %>(<%= link_to @user.watcher_users.count,:controller=>"users",:action=>"user_fanslist" %>)</strong>
|
||||
</div>
|
||||
<div class="left_wf">
|
||||
<table>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<!--add by huang-->
|
||||
<h3><%= l(:label_user_fans)%></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>
|
||||
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "nomargin avatar_name" %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><p class="font_description">
|
||||
<% unless user.memberships.empty? %>
|
||||
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
|
||||
<% for member in user.memberships %>
|
||||
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<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>
|
|
@ -10,7 +10,8 @@
|
|||
<td>
|
||||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong> <%= link_to_user(membership.user) if membership.respond_to?(:user) %></strong><a class="font_lighter"> 创建了</a> <%= link_to_project(membership.project) %></td>
|
||||
<td colspan="2" valign="top"><strong> <%= link_to_user(membership.user) if membership.respond_to?(:user) %></strong>
|
||||
<a class="font_lighter"> 创建了</a> <%= link_to_project(membership.project) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<!--add by huang-->
|
||||
<h3><%= l(:label_user_watcher)%></h3>
|
||||
<div class="inf_user_image">
|
||||
<% for user in User.watched_by(@user.id) %>
|
||||
<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>
|
||||
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "nomargin avatar_name" %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><p class="font_description">
|
||||
<% unless user.memberships.empty? %>
|
||||
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
|
||||
<% for member in user.memberships %>
|
||||
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<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>
|
|
@ -137,7 +137,7 @@
|
|||
<p class="font_welcome2">项目需求</p>
|
||||
<p class="font_lighter">添加描述添加描述添加描述添加描述...</p>
|
||||
</td><td align="center">
|
||||
<p class="font_welcome2">发现开源</p>
|
||||
<p class="font_welcome2">项目需求</p>
|
||||
<p class="font_lighter">添加描述添加描述添加描述添加描述...</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
|
|
@ -78,6 +78,8 @@ RedmineApp::Application.routes.draw do
|
|||
match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
|
||||
match 'watch_bids', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
|
||||
match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
|
||||
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
|
||||
end
|
||||
end
|
||||
#end
|
||||
|
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
|
@ -11,6 +11,11 @@ h4 {border-bottom: 1px dotted #bbb;}
|
|||
|
||||
/*new by huang*/
|
||||
/**/
|
||||
ul.list_watch{list-style-type:none;
|
||||
height:auto;
|
||||
border-bottom: 1px dashed rgb(204, 204, 204);
|
||||
}
|
||||
|
||||
.new_creat{
|
||||
padding-top: 0px;
|
||||
float: right;
|
||||
|
|