From 250a03f07404324cc5736eab39ccbcc25fdde8bb Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 27 Sep 2013 12:01:41 +0800 Subject: [PATCH] Fixed order of Teacher Show page --- .../member_lists/_show_office_field.html.erb | 30 +++++++++++++++++++ .../member_lists/_show_roles.html.erb | 2 +- .../front_end/member_lists/show.html.erb | 18 +++++------ 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb diff --git a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb new file mode 100644 index 000000000..ec26550a9 --- /dev/null +++ b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb @@ -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? + %> + + + <% if rf.title == "Office"%> + <%= rf.title %> + <%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %> + + <%end%> + + + + <% end -%> + + <% end -%> + + <% end -%> + diff --git a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb index 7d1d74ca5..710e22a86 100644 --- a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb +++ b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb @@ -38,7 +38,7 @@ %> - <% if rf.title != "Research Field"%> + <% if (rf.title != "Research Field" && rf.title != "Office")%> <%= rf.title %> <%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %> diff --git a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/show.html.erb b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/show.html.erb index 5df3ce4c9..624f88b21 100644 --- a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/show.html.erb +++ b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/show.html.erb @@ -20,11 +20,7 @@ <%= @member.office_tel%> <% end %> - - <%= t('users.sex')%> - <%= t("users.#{@member.sex}") %> - - + <% @profile_data.each do |item| %> <% if !item[:value].blank? %> @@ -33,7 +29,8 @@ <% end -%> <% end -%> - + <%= render :partial=> "show_office_field",:collection=>@member.roles.asc(:created_at) %> + <%= render :partial=> "show_research_field",:collection=>@member.roles.asc(:created_at) %> @@ -57,14 +54,13 @@ <% if !@intro_data.blank? %> <% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %> -
  • <%= plugin.name %>
  • - +
  • "><%= plugin["name"] %>
  • <% end %> <% else %> <% if !@data.blank? %> -
  • <%= plugin.name %>
  • +
  • "><%= plugin["name"] %>
  • <% end %> <% end %> @@ -86,7 +82,7 @@ <% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %> -
    +
    "> <%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
    @@ -95,7 +91,7 @@ <% else %> <% if !@data.blank? %> -
    +
    "> <%= render :partial => @plugin_partial if !@plugin_partial.blank? %>