退出项目成员以及项目邀请码显示权限
This commit is contained in:
parent
52ae2ef5a3
commit
7e2834f680
|
@ -838,7 +838,7 @@ class ProjectsController < ApplicationController
|
||||||
@project = Project.find params[:id]
|
@project = Project.find params[:id]
|
||||||
if User.current.login?
|
if User.current.login?
|
||||||
members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first
|
members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first
|
||||||
if members != nil && members.roles.first.to_s != "Manager"
|
if User.current != @project.owner
|
||||||
members.destroy
|
members.destroy
|
||||||
# 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除
|
# 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除
|
||||||
applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => members.user_id).first
|
applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => members.user_id).first
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<h2>项目简介
|
||||||
|
<% if User.current.member_of?(@project) %>
|
||||||
|
<span class="fr mr15" id="project_invite_code">邀请码:<span class="c_orange"><%= @project.invite_code %></span></span>
|
||||||
|
<% end %>
|
||||||
|
</h2>
|
|
@ -1 +1,2 @@
|
||||||
$('#join_exit_project_div').html("<%= escape_javascript(render(:partial => 'layouts/join_exit_project')) %>");
|
$('#join_in_project_applied').html("<%= escape_javascript(render(:partial => 'projects/applied_status')) %>");
|
||||||
|
$('#project_invite_code').html("<%= escape_javascript(render(:partial => 'projects/invite_code')) %>");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!--新版项目头部结束-->
|
<!--新版项目头部结束-->
|
||||||
<div class="pro_new_info mb10">
|
<div class="pro_new_info mb10">
|
||||||
<h2>项目简介<span class="fr mr15">邀请码:<span class="c_orange"><%= @project.invite_code %></span></span></h2>
|
<div id="project_invite_code"><%= render :partial => 'projects/invite_code' %></div>
|
||||||
<% if @project.description.blank? %>
|
<% if @project.description.blank? %>
|
||||||
<p class="break_word"><%= @project.name %><p>
|
<p class="break_word"><%= @project.name %><p>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
Loading…
Reference in New Issue