Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
Tim 2016-05-17 11:24:42 +08:00
commit 70ff3e2c19
4 changed files with 15 additions and 11 deletions

View File

@ -27,8 +27,10 @@ class SsosController < ApplicationController
## 加入组织 ## 加入组织
@organization = Organization.find(82) @organization = Organization.find(82)
unless @organization.org_members.exists?(user_id: sso.user_id) unless @organization.org_members.exists?(user_id: sso.user_id)
member = OrgMember.new(:user_id => sso.user_id) member = OrgMember.create(:user_id => sso.user_id, :created_at => Time.now)
# member = OrgMember.new(:user_id => sso.user_id)
@organization.org_members << member @organization.org_members << member
OrgMemberRole.create(:org_member_id => member.id, :role_id => 12)
end end
## 选择性跳转 ## 选择性跳转

View File

@ -88,6 +88,7 @@ module ApplicationHelper
# 获取组织成员中文名字 # 获取组织成员中文名字
def get_org_member_role_name member def get_org_member_role_name member
unless member.roles[0].nil?
case member.roles[0].name case member.roles[0].name
when 'orgManager' when 'orgManager'
'管理人员' '管理人员'
@ -95,6 +96,7 @@ module ApplicationHelper
'组织成员' '组织成员'
end end
end end
end
# 判断组织左侧展开或者隐藏 # 判断组织左侧展开或者隐藏
def is_hide_org_left obj def is_hide_org_left obj

View File

@ -62,7 +62,7 @@
<div class="sn-header"> <div class="sn-header">
<div class="sn-row sn-bg-white"> <div class="sn-row sn-bg-white">
<div class="sn-logo"> <div class="sn-logo">
<% if @org_logo_attchment.blank? %> <% if @org_logo_attchment.blank? || !User.current.logged? %>
<img src="/images/org_new_style/logo.jpg" width="367" height="63" class="sn-mt13 sn-fl" alt=""/> <img src="/images/org_new_style/logo.jpg" width="367" height="63" class="sn-mt13 sn-fl" alt=""/>
<% else %> <% else %>
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" width="367" height="63" class="sn-mt13 sn-fl" alt=""> <img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" width="367" height="63" class="sn-mt13 sn-fl" alt="">

View File

@ -111,11 +111,11 @@
<p class="fontBlue fb mb5">添加成员</p> <p class="fontBlue fb mb5">添加成员</p>
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%> <%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%>
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" /> <input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
<% if @organization.secdomain_name.nil? %> <%# if @organization.secdomain_name.nil? %>
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
<% else %> <%# else %>
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> <%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
<% end %> <%# end %>
<div id="principals_for_new_member"> <div id="principals_for_new_member">
<%= find_user_not_in_current_org_by_name(@project) %> <%= find_user_not_in_current_org_by_name(@project) %>