From 8609263ec6b57debbff360030b65c27b81341b1b Mon Sep 17 00:00:00 2001 From: Spen Date: Tue, 5 Nov 2013 17:35:18 +0800 Subject: [PATCH] fix member show fields --- .../member_lists/_show_roles.html.erb | 29 +------------- .../front_end/member_lists/show.html.erb | 39 ++++++++++++------- 2 files changed, 27 insertions(+), 41 deletions(-) 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 7fee0d91d..443c38356 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 @@ -1,26 +1,3 @@ - - - <% - @category = @member.role_categorys.where(:role_id=>show_roles.id) - - if !@category.blank? - %> - - <%= t('category')%> - <%= show_attribute_value(@member.role_categorys.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %> - - - <% 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' %> - <% if (rf.title == "Academic Position" || rf.title == "職稱")%> <%= rf.title %> <%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %> - - <%end%> - <% end -%> 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 1c765a65d..4b74a4eef 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 @@ -3,25 +3,42 @@ - <%= 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? + %> + + + + + + <% 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? + %> + + + + + <% end -%> - <% if !@member.email_hidden? %> - <% end %> <% if !@member.office_tel.blank? %> <% end %> - + <% @profile_data.each do |item| %> <% if !item[:value].blank? %> @@ -30,9 +47,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) %> + <%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
<%= t('category')%><%= show_attribute_value(@member.role_categorys.where(:role_id=>@member_role.id).map{|t|t.title.to_s}.join(',')) rescue '' %>
<%= User.get_member_list_attribute_field_name("teacher","job_title") %><%= @job_title %>
<%= t('users.name')%> <%= @member.name%>
<%= t('users.email')%> <%= @member.email %>
<%= t('users.office_tel')%> <%= @member.office_tel%>
@@ -55,13 +71,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 %> @@ -82,9 +98,7 @@ <% if !@intro_data.blank? %> <% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %> - -
    "> - +
    "> <%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
    <% end %> @@ -92,8 +106,7 @@ <% else %> <% if !@data.blank? %> -
    "> - +
    "> <%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
    <% end %>