fix member show fields

This commit is contained in:
Spen 2013-11-05 17:35:18 +08:00
parent 20a9f60c09
commit 8609263ec6
2 changed files with 27 additions and 41 deletions

View File

@ -1,26 +1,3 @@
<!-- <%
@status = @member.role_statuses.where(:role_id=>show_roles.id)
if !@status.blank?
%>
<tr>
<td><%= t('status')%></td>
<td><%= show_attribute_value(@member.role_statuses.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
</tr>
<% end -%> -->
<%
@category = @member.role_categorys.where(:role_id=>show_roles.id)
if !@category.blank?
%>
<tr>
<td><%= t('category')%></td>
<td><%= show_attribute_value(@member.role_categorys.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
</tr>
<% end -%>
<% show_roles.attribute_fields.where(:disabled=>false).asc(:_id).each do |rf| %>
@ -34,16 +11,12 @@
@rodata = nil
end
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank?
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank? and rf.key != 'job_title'
%>
<tr>
<% if (rf.title == "Academic Position" || rf.title == "職稱")%>
<td><%= rf.title %></td>
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
</tr>
<%end%>
</tr>
<% end -%>

View File

@ -3,18 +3,35 @@
<table>
<tbody>
<%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
<%
@member_role = @member.roles.asc(:created_at).first
@category = @member.role_categorys.where(:role_id=>@member_role.id)
if !@category.blank?
%>
<tr>
<td><%= t('category')%></td>
<td><%= show_attribute_value(@member.role_categorys.where(:role_id=>@member_role.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
</tr>
<% end -%>
<% @job_title = show_attribute_value(User.get_member_list_attribute_value(@member.id,"teacher","job_title").get_value_by_locale(I18n.locale))
if @job_title != 'NoData' and !@job_title.blank?
%>
<tr>
<td><%= User.get_member_list_attribute_field_name("teacher","job_title") %></td>
<td><%= @job_title %></td>
</tr>
<% end -%>
<tr>
<td><%= t('users.name')%></td>
<td><%= @member.name%></td>
</tr>
<% if !@member.email_hidden? %>
<tr>
<td><%= t('users.email')%></td>
<td><a href="mailto:<%= @member.email %>"><%= @member.email %></a></td>
</tr>
<% end %>
<% if !@member.office_tel.blank? %>
<tr>
<td><%= t('users.office_tel')%></td>
@ -30,9 +47,8 @@
</tr>
<% end -%>
<% end -%>
<%= render :partial=> "show_office_field",:collection=>@member.roles.asc(:created_at) %>
<%= render :partial=> "show_research_field",:collection=>@member.roles.asc(:created_at) %>
<%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
</tbody>
</table>
@ -55,7 +71,7 @@
<% if !@intro_data.blank? %>
<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
<li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
<li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
<% end %>
<% else %>
@ -82,9 +98,7 @@
<% if !@intro_data.blank? %>
<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div>
<% end %>
@ -93,7 +107,6 @@
<% if !@data.blank? %>
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div>
<% end %>