user apply add laboratory flag

dev_home
p31729568 5 years ago
parent 292ce8cd6c
commit adb96983db

@ -695,6 +695,10 @@ class User < ApplicationRecord
LimitForbidControl::UserLogin.new(self).clear
end
def from_sub_site?
laboratory_id.present? && laboratory_id != 1
end
protected
def validate_password_length
# 管理员的初始密码是5位

@ -43,6 +43,9 @@
<%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
<% end %>
<% if user.from_sub_site? %>
<span class="badge badge-pill badge-info">合作</span>
<% end %>
</td>
<td><%= user.real_name %></td>
<td><%= user.ID_number %></td>

@ -41,6 +41,9 @@
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
<% end %>
<% if user.from_sub_site? %>
<span class="badge badge-pill badge-info">合作</span>
<% end %>
</td>
<td><%= user.real_name %></td>
<td><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>

Loading…
Cancel
Save