socialforge/app/views/users/user_projects.html.erb

56 lines
3.4 KiB
Plaintext

<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" target="_blank">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
<% end %>
<div class="cl"></div>
</div>
<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 class="cl"></div>
</div>