socialforge/app/views/projects/_applied_status.html.erb

51 lines
2.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<% if !User.current.member_of?(@project) %>
<% if User.current.login? && !User.current.admin %>
<!--关注项目-->
<li class="mr5 fl">
<%= watcher_link_for_project(@project, User.current) %>
<%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "project_watcherlist",
:id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
</li>
<!--加入项目-->
<li class="mr5 fl">
<% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %>
<%= join_in_project_link(@project, User.current) %>
<% else %>
<a style="cursor: default" class="pro_new_topbtn_left fl">等待审批</a>
<% end %>
<%= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员列表" %>
</li>
<% end %>
<% else %>
<!--项目创建者不能退出项目-->
<% if User.current.login? %>
<li class="mr5 fl">
<%= watcher_link_for_project(@project, User.current) %>
<%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "project_watcherlist",
:id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
</li>
<li class="mr5 fl">
<a class="pro_new_topbtn_left fl " style="cursor:default;"> 已加入</a>
<!-- <a href="<%#= project_member_path(@project) %>" class=" pro_new_topbtn fl"><%#= Member.where(:project_id => @project.id).count %></a>-->
<%= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员列表" %>
</li>
<%#= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
<% end %>
<% end %>
<!--项目fork-->
<li class="mr5 fl">
<!--实训项目条件1、modules中选中了实训任务 2、不是fork的项目-->
<% if User.current.logged? %>
<% if @project.is_training_project? && User.current.id != @project.user_id %>
<%= link_to "开始实训", training_chiled_project_exec_project_path(@project), :class => "sy_btn_green fr", :remote => true %>
<% else %>
<%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", forked_pop_project_path(@project),
:class=>"pro_new_topbtn_left fl", :remote => true %>
<a href="<%= member_forked_project_path(@project) %>" class=" pro_new_topbtn fl" title="fork成员列表"><%= project_fork_count %></a>
<% end %>
<% end %>
</li>