版本库权限,及项目收藏用户列表

This commit is contained in:
huang 2016-10-11 10:03:00 +08:00
parent 188db13c33
commit 3c15c4f315
5 changed files with 21 additions and 10 deletions

View File

@ -369,7 +369,7 @@ module WatchersHelper
text = collected == 1 ? l(:label_project_collect) : l(:label_project_collect_cancel)
url = store_mine_project_path(project_id)
method = 'post'
link = link_to(text, url, :remote => true, :method => method, :id => "#{project_id}", :class => "pro_new_topbtn_left fl")
link = link_to(text, url, :remote => true, :method => method, :id => "#{project_id}", :class => "pro_new_topbtn_left fl", :title => "点击将其从个人主页的项目列表中移除")
# link.html_safe
end

View File

@ -25,6 +25,7 @@
<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" %>
@ -33,7 +34,7 @@
<% 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" %>
@ -42,7 +43,7 @@
<% 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" %>
@ -51,19 +52,27 @@
<% 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 visible_repository?(@project) %>
<li id="project_menu_05"><%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "pro_new_proname" %>
<% unless @project.project_score.changeset_num == 0 %>
<span class="issues_nav_tag ml5"><%= @project.project_score.changeset_num %></span>
<% end %>
</li>
<% end %>
<!--Pull Request-->
<% 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">

View File

@ -12,15 +12,17 @@
<% else %>
<a style="cursor: default" class="pro_new_topbtn_left fl">等待审批</a>
<% end %>
<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'pro_new_topbtn fl' %>
<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
</li>
<% end %>
<% else %>
<li class="mr5 fl"><%= store_project_link(@project.id, User.current.id) %><a href="javascript:void(0);" class="pro_new_topbtn fl"> 10</a></li>
<!--项目收藏-->
<% my_stores = Member.where(:project_id => @project.id, :is_collect => 0).count %>
<li class="mr5 fl"><%= store_project_link(@project.id, User.current.id) %><%= link_to my_stores, store_mine_project_path(@project), :class => "pro_new_topbtn fl" %></li>
<!--项目创建者不能退出项目-->
<% if User.current.id != @project.user_id %>
<%= exit_project_link(@project) %>
<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'pro_new_topbtn fl' %>
<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
<% end %>
<% end %>

View File

View File

@ -745,7 +745,7 @@ RedmineApp::Application.routes.draw do
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
#by young
get 'member', :to => 'projects#member', :as => 'member'
post 'store', :to => 'projects#store_mine', :as => 'store_mine'
match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine'
get 'file', :action => 'file', :as => 'file'
get 'statistics', :action => 'statistics', :as => 'statistics'