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

View File

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