用户列表添加单位

This commit is contained in:
linchun 2016-03-14 17:40:49 +08:00
parent 3e70db4e82
commit 96f65f338c
2 changed files with 18 additions and 2 deletions

View File

@ -45,6 +45,9 @@
<th style="width: 50px;">
用户身份
</th>
<th style="width: 50px;">
用户单位
</th>
</tr>
</thead>
<tbody>
@ -59,7 +62,7 @@
<%=format_time(teacher.last_login_on) %>
</td>
<td align="center">
<%=teacher.user_id %>
<%= teacher.user_id %>
</td>
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if teacher.try(:realname) == ' '%><%= teacher.login%><% else %><%=teacher.try(:realname) %><% end %>'>
<% if teacher.try(:realname) == ' '%>
@ -69,11 +72,14 @@
<% end %>
</td>
<td align="center">
<%=link_to(teacher.login, user_path(teacher.user_id)) %>
<%= link_to(teacher.login, user_path(teacher.user_id)) %>
</td>
<td align="center">
老师
</td>
<td align="center">
<%= teacher.school_id.nil? ? "" : (School.find teacher.school_id).try(:name) %>
</td>
</tr>
<% end %>
</tbody>

View File

@ -46,6 +46,9 @@
<th style="width: 50px;">
用户身份
</th>
<th style="width: 50px;">
用户单位
</th>
</tr>
</thead>
<tbody>
@ -88,6 +91,13 @@
<% end %>
<% end%>
</td>
<td align="center">
<% if User.current.user_extensions.identity == "0" %>
<%= user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %>
<% else %>
<%= user.user_extensions.occupation %>
<% end %>
</td>
</tr>
<% end %>
</tbody>