diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index f487457b6..697f21e09 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -2,24 +2,34 @@ <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> <% end %> -<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %> -
- + +
+ <%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %> +
- - - - - + + + + + + + +
<%= l(:label_project_plural)%><%= 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) %> - <%= l(:label_project_deposit) %>当前位置 : + <% if User.current.logged? %> + <%= 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) %> + <% end %> + + +
<%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'index', :project_type => 0 %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_project_deposit), :controller => 'projects', :action => 'index', :project_type => 0 %>
-
-<% end %> + <% end %> + + <%= sort_project(@s_type, @project_type) %> diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb new file mode 100644 index 000000000..6fd22e422 --- /dev/null +++ b/app/views/users/_user_show.html.erb @@ -0,0 +1,49 @@ +
+ <% for user in @users -%> + <% unless user.id == 1%> +
+ + <%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %> + <%= image_tag "/images/time_member.png", :class => "img_member_time"%> + +
+ <%= image_tag(url_to_avatar(user), :class => 'avatar') %> + <%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %> +
+ <%= l(:label_user_grade) %>: <%= user.user_status.grade %> +
+ +
+ +
+ <%= l(:label_x_has_fans,:count=>user.watcher_users.count)%> + <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %> + +
+
+ <% unless user.memberships.empty? %> + <% 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 %> + <% end %> + +

+ <% unless user.memberships.empty? %> + <% cond = Project.visible_condition(User.current) + "AND projects.project_type = 1" %> + <% memberships = user.memberships.all(:conditions => cond) %> + <%= l(:label_x_course_contribute_to, :count => memberships.count) %> + <% for member in memberships %> + <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %> + <% end %> + <% end %> +

+ + <%= user.changesets.count == 0 ? '' : "#{l(:label_x_total_commit, :count => user.changesets.count)}" %> +
+
+ <% end -%> + <% end -%> +
\ No newline at end of file diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 4088fec27..832f1eea8 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -5,7 +5,7 @@

<%= l(:label_user_plural)%>

-<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %> + <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<%= l(:label_filter_plural) %> @@ -22,7 +22,7 @@ <%= text_field_tag 'name', params[:name], :size => 30 %> <%= submit_tag l(:label_search), :class => "small", :name => nil %>
-<% end %> + <% end %>  
@@ -33,7 +33,7 @@ <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %> <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %> <%= sort_header_tag('mail', :caption => l(:field_mail)) %> - + <%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %> <%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %> <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %> @@ -66,84 +66,56 @@ <% html_title(l(:label_user_plural)) -%> <% else %> - -
-<%= l(:label_user_plural)%> - -<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %> - - -
- + +
+ <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %> + + + + + + + + + + + +
<%= l(:label_software_user ) %>当前位置 : + +
<%= link_to "forge.trustie.net/users", :controller => 'users', :action => 'index' %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_software_user), :controller => 'users', :action => 'index' %>
+ <% end %> +
+ <%= sort_user(@s_type, @project_type)%> + +<%= render :partial => 'user_show' %> - - -
- <% for user in @users -%> - <% unless user.id == 1%> -
- - <%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %> - <%= image_tag "/images/time_member.png", :class => "img_member_time"%> - -
- <%= image_tag(url_to_avatar(user), :class => 'avatar') %> - <%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %> -
- <%= l(:label_user_grade) %>: <%= user.user_status.grade %> -
- - -
- -
- <%= l(:label_x_has_fans,:count=>user.watcher_users.count)%> - <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %> - -
- - -
- <% unless user.memberships.empty? %> - <% 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 %> - <% end %> - -

<% unless user.memberships.empty? %> - <% cond = Project.visible_condition(User.current) + "AND projects.project_type = 1" %> - <% memberships = user.memberships.all(:conditions => cond) %> - <%= l(:label_x_course_contribute_to, :count => memberships.count) %> - <% for member in memberships %> - <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %> - <% end %> - <% end %> -

- - <%= user.changesets.count == 0 ? '' : "#{l(:label_x_total_commit, :count => user.changesets.count)}" %> -
-
- <% end -%> - <% end -%> -
<% html_title(l(:label_user_plural)) -%> <% end -%>