136 lines
6.7 KiB
Plaintext
136 lines
6.7 KiB
Plaintext
<% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %>
|
|
<% project_issue_count = @project.issues.count %>
|
|
<% project_acts = ForgeActivity.where("project_id = ?", @project.id).count %>
|
|
<% raodmaps = Version.where("project_id = ?", @project.id).count %>
|
|
|
|
<div class="pro_new_top clear mb10">
|
|
<div class="fl pro_new_name ml15">
|
|
<span class="icons_newpro_lock"></span>
|
|
<%=link_to "#{@project.owner.try(:show_name)}<span class='ml5 mr5'>/</span>".html_safe, user_path(@project.owner), :class => "pro_new_username" %>
|
|
<%=link_to @project.name, project_path(@project), :class => "pro_new_proname" %>
|
|
</div>
|
|
<div class="fr clear mr15">
|
|
<ul>
|
|
<!--加入、退出、关注项目-->
|
|
<span id="join_in_project_applied"><%= render :partial => "projects/applied_status" %></span>
|
|
</ul>
|
|
|
|
</div>
|
|
<div class="cl"></div>
|
|
<div class="pro_new_topnav mt15">
|
|
<ul>
|
|
<li id="project_menu_01">
|
|
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "pro_new_proname" %>
|
|
<% if project_acts > 0 %>
|
|
<span class="issues_nav_tag ml5"><%= project_acts %></span>
|
|
<% end %>
|
|
</li>
|
|
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
|
|
<li id="project_menu_02">
|
|
<%= link_to l(:label_issue_tracking), project_issues_path(@project, :remote => true), :class => "pro_new_proname" %>
|
|
<% if project_issue_count > 0 %>
|
|
<span class="issues_nav_tag ml5"><%= project_issue_count %></span>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
|
|
<li id="project_menu_03">
|
|
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "pro_new_proname" %>
|
|
<% unless @project.project_score.board_num == 0 %>
|
|
<span class="issues_nav_tag ml5"><%= @project.project_score.board_num %></span>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
|
|
<li id="project_menu_04">
|
|
<%= link_to l(:project_module_files), project_files_path(@project), :class => "pro_new_proname" %>
|
|
<% unless project_file_num == 0 %>
|
|
<span class="issues_nav_tag ml5"><%= project_file_num %></span>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<li id="project_menu_05"><a href="javascript:void(0);" class=" pro_new_proname"> 版本库</a><span class="issues_nav_tag ml5">25</span></li>
|
|
|
|
<% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) > 0 %>
|
|
<li id="project_menu_06">
|
|
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "pro_new_proname" %>
|
|
<span class="issues_nav_tag ml5"><%= pull_request_count(@project) %></span>
|
|
</li>
|
|
<% end %>
|
|
<li id="project_menu_07">
|
|
<%= link_to l(:label_roadmap) ,project_roadmap_path(@project), :class => "pro_new_proname" %>
|
|
<span class="issues_nav_tag ml5">25</span>
|
|
</li>
|
|
<li id="project_menu_08"><a href="javascript:void(0);" class=" pro_new_proname"> 更多</a></li>
|
|
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
|
|
<li id="project_menu_09">
|
|
<%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "pro_new_proname" %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!--新版项目头部结束-->
|
|
<script>
|
|
$(function(){
|
|
if($("#project_menu_0<%= @project_menu_type %>").length > 0){
|
|
$("#project_menu_0<%= @project_menu_type %>").addClass('pro_new_topnav_active');
|
|
} else {
|
|
$("#expand_tools_expand a").addClass('active');
|
|
$("#navContentCourse").toggle();
|
|
}
|
|
})
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="sy_class_infobox mb10 clear">
|
|
<div class="sy_class_logo fl">
|
|
<div class="pr" style="width: 110px; height:110px;">
|
|
<% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?) %>
|
|
<%=link_to image_tag(url_to_avatar(@project), width:"110", height: "110", :id => 'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @project.id), :remote => true%>
|
|
<div class="homepageEditProfile undis">
|
|
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
|
|
</div>
|
|
<% else %>
|
|
<%= image_tag(url_to_avatar(@project), :width => "110", :height => "110", :alt => "项目logo") %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<%# 更新访问数,刷新的时候更新访问次数 %>
|
|
<% update_visiti_count @project %>
|
|
<div class="sy_class_id fl"><p><%= l(:label_project_ivite_code)%><br /><span class="sy_corange"><%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %></span></p></div>
|
|
<div class="sy_class_info fl ml15">
|
|
<div class="sy_class_titbox clear">
|
|
<h3 class="fl sy_class_title">
|
|
<a href="javascript:void(0);"class="mr5 c_dark"><%= @project.creater %></a>/
|
|
<a href="javascript:void(0);"class=" ml5 c_dark"><%= @project.name %></a>
|
|
</h3>
|
|
<span class="sy_new_orange fl ml10 mt5"><%= @project.is_public? ? l(:label_public) : l(:label_private) %></span>
|
|
</div>
|
|
<p class="sy_cgrey">
|
|
<span class=" mr15">项目评分:
|
|
<% if @project.project_type == 0 %>
|
|
<%# unless static_project_score(@project.project_score) == 0 %>
|
|
<%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
|
|
{:controller => 'projects',
|
|
:action => 'show_projects_score',
|
|
:remote => true,
|
|
:id => @project.id}, :class => "sy_cblue" ) %>
|
|
<%# end %>
|
|
<% end %>
|
|
</span>
|
|
<span class=" mr15">浏览:<a class="sy_corange"><%= @project.visits.to_i %></a></span>
|
|
<span class=" mr15">关注:<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %></span>
|
|
<span class=" mr15">成员:<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %></span>
|
|
</p>
|
|
<div class="mt15 clear" id="join_exit_project_div">
|
|
<%= render 'layouts/join_exit_project' %>
|
|
</div>
|
|
</div>
|
|
<div class="cl"></div>
|
|
</div> |