Merge branch 'master' into 'master'

fix showing author error for admin's index



See merge request !5
This commit is contained in:
wmcheng 2019-11-13 13:36:49 +08:00
commit eb68726fa7
2 changed files with 5 additions and 2 deletions

View File

@ -3,11 +3,14 @@ module Admin::PersonalConferencesHelper
(writing_conference.authors.to_s.blank? ? get_member(writing_conference).collect(&:name).join('/') : Nokogiri::HTML(writing_conference.authors.to_s).text rescue '') (writing_conference.authors.to_s.blank? ? get_member(writing_conference).collect(&:name).join('/') : Nokogiri::HTML(writing_conference.authors.to_s).text rescue '')
end end
def get_authors_show(writing_conference) def get_authors_show(writing_conference)
(writing_conference.authors.to_s.blank? ? get_member(writing_conference).collect{|member| "<a href='#{OrbitHelper.url_to_plugin_show(member.to_param,'member')}' title='#{member.name}'>#{member.name}</a>"}.join('/') : writing_conference.authors.to_s rescue '') (writing_conference.authors.to_s.blank? ? get_member_show(writing_conference) : writing_conference.authors.to_s rescue '')
end end
def get_member(writing_conference) def get_member(writing_conference)
Array(MemberProfile.find(Array(writing_conference).collect(&:member_profile_id))) Array(MemberProfile.find(Array(writing_conference).collect(&:member_profile_id)))
end end
def get_member_show(writing_conference)
get_member(writing_conference).collect{|member| "<a href='#{OrbitHelper.url_to_plugin_show(member.to_param,'member')}' title='#{member.name}'>#{member.name}</a>"}.join('/')
end
def get_sponsor(writing_conference) def get_sponsor(writing_conference)
writing_conference.sponsor writing_conference.sponsor
end end

View File

@ -10,6 +10,6 @@
</ul> </ul>
</div> </div>
</td> </td>
<td><%= writing_conference.member_profile.name rescue "" %></td> <td><%= get_member_show(writing_conference).html_safe %></td>
</tr> </tr>
<% end %> <% end %>