Fixed order of Teacher Show page

This commit is contained in:
saurabhbhatia 2013-09-27 12:01:41 +08:00
parent 471987f800
commit 250a03f074
3 changed files with 38 additions and 12 deletions

View File

@ -0,0 +1,30 @@
<% show_office_field.attribute_fields.where(:disabled=>false).asc(:_id).each do |rf| %>
<%
if !@member.get_attribute_value(rf).blank?
if !@member.get_attribute_value(rf)['val'].blank?
@rodata = @member.get_attribute_value(rf)['val']
elsif !@member.get_attribute_value(rf)[I18n.locale].blank?
@rodata = @member.get_attribute_value(rf)[I18n.locale]
else
@rodata = nil
end
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank?
%>
<tr>
<% if rf.title == "Office"%>
<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 -%>
<% end -%>
<% end -%>

View File

@ -38,7 +38,7 @@
%>
<tr>
<% if rf.title != "Research Field"%>
<% if (rf.title != "Research Field" && rf.title != "Office")%>
<td><%= rf.title %></td>
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
</tr>

View File

@ -20,11 +20,7 @@
<td><%= @member.office_tel%></td>
</tr>
<% end %>
<tr>
<td><%= t('users.sex')%></td>
<td><%= t("users.#{@member.sex}") %></td>
</tr>
<% @profile_data.each do |item| %>
<% if !item[:value].blank? %>
<tr>
@ -33,7 +29,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) %>
</tbody>
@ -57,14 +54,13 @@
<% 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 %>
<% if !@data.blank? %>
<li><a href="#<%= plugin.name.gsub(' ', '') %>"><%= plugin.name %></a></li>
<li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
<% end %>
<% end %>
@ -86,7 +82,7 @@
<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
<div class="module-pane" id="<%= plugin.name.gsub(' ', '') %>">
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div>
@ -95,7 +91,7 @@
<% else %>
<% if !@data.blank? %>
<div class="module-pane" id="<%= plugin.name.gsub(' ', '') %>">
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div>