fix natural

This commit is contained in:
xianbo 2013-10-24 10:13:00 +08:00
parent 39580a04a2
commit 2fa6276829
4 changed files with 59 additions and 50 deletions

View File

@ -567,7 +567,7 @@ class UsersController < ApplicationController
@watch_projects = []
unless @watch_type.nil?
@watch_type.each do |obj|
@watch_projects << Project.find(obj.watchable_id) if(Project.find(obj.watchable_id))
@watch_projects << Project.find(obj.watchable_id)
end
end
respond_to do |format|
@ -576,7 +576,7 @@ class UsersController < ApplicationController
}
format.api
end
end
end
def update
@user.admin = params[:user][:admin] if params[:user][:admin]

View File

@ -1,12 +1,12 @@
<!--add by huang-->
<div class="content_frame">
<p><%= link_to "关注的项目" , {:controller => 'users', :action => 'watch_projects', :id => @user.id}%>
<p>
<strong><%= l(:label_project_take)%>
<%= link_to l(:label_has_watched_project) , {:controller => 'users', :action => 'watch_projects', :id => @user.id}%></strong>
<% unless @memberships.empty? %>
<% if @user == User.current %>
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></p>
<span style="margin-left: 300px"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></sapn></p>
<% end %>
<div class="content_frame">
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
@ -17,7 +17,7 @@
<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_watch_project) %></span> <%= link_to_project(membership.project) %></td>
<span class="font_lighter"> <%= l(:label_peoject_take_in) %></span> <%= link_to_project(membership.project) %></td>
</tr>
<tr>
<td colspan="2" width="580" >

View File

@ -1,17 +1,22 @@
<p><%= link_to "关注的项目" , {:controller => 'users', :action => 'watch_projects', :id => @user.id}%>
<% if @user == User.current %>
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></p>
<% end %>
<table>
<p><strong>
<%= l(:label_has_watched_project)%>
<%= link_to l(:label_project_take) , {:controller => 'users', :action => 'user_projects', :course => 0, :project_type => @project_type}%></strong>
<% if @user == User.current %>
<span style="margin-left: 300px"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></span>
<% end %>
</td>
</p>
<table>
<% unless @watch_projects.nil?&&watch_projects.project.nil? %>
<% for watch_project in @watch_projects %>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<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" ><%= link_to image_tag(url_to_avatar(watch_project.project), :class => 'avatar'), project_path(watch_project.project) %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to_user(@user) if watch_project.respond_to?(:user) %></strong>
<span class="font_lighter"> <%= @user.name%><%= l(:label_watch_project) %></span> <%= link_to_project(watch_project.project) %></td>
<td colspan="2" valign="top"><strong> <%= link_to_user(@user) if watch_project.respond_to?(:user) %></strong><span class="font_lighter"> <%= @user.name%><%= l(:label_watch_project) %></span> <%= link_to_project(watch_project.project) %></td>
</tr>
<tr>
<td colspan="2" width="580" >
@ -25,10 +30,10 @@
</table></td>
</tr>
</table>
</table>
</li>
<% end %>
<% else %>
还米有关注任何项目
<% end %>
</li>
<% end %>
<% else %>
<%= l(:label_watch_no_projects)%>
<% end %>

View File

@ -1648,3 +1648,7 @@ zh:
label_homework_prompt_content: 亲,在这里我们的作业将以项目的形式提交,如果小伙伴们还没有创建项目,请先创建一个项目。项目创建成功后,就可以
label_create_homework: 布置了作业:
label_watch_project: 关注了
label_watch_no_projects: 没有关注任何项目
label_has_watched_project: 关注的项目
label_project_take: 参与的项目
label_peoject_take_in: 加入了项目: