parent
d53e9a48c7
commit
0d6ab9100c
|
@ -1,13 +1,16 @@
|
||||||
module Admin::PersonalBooksHelper
|
module Admin::PersonalBooksHelper
|
||||||
def get_authors_text(book)
|
def get_authors_text(book)
|
||||||
(book.authors.to_s.blank? ? get_member(book).collect(&:name).join('/') : Nokogiri::HTML(book.authors.to_s).text rescue '')
|
(book.authors.to_s.blank? ? get_member(book).collect(&:name).join('/') : Nokogiri::HTML(book.authors.to_s).text rescue '')
|
||||||
end
|
end
|
||||||
def get_authors_show(book)
|
def get_authors_show(book)
|
||||||
(book.authors.to_s.blank? ? get_member(book).collect{|member| "<a href='#{OrbitHelper.url_to_plugin_show(member.to_param,'member')}' title='#{member.name}'>#{member.name}</a>"}.join('/') : book.authors.to_s rescue '')
|
(book.authors.to_s.blank? ? get_member_show(book) : book.authors.to_s) rescue ''
|
||||||
end
|
end
|
||||||
def get_member(book)
|
def get_member(book)
|
||||||
Array(MemberProfile.find(Array(book).collect(&:member_profile_id)))
|
Array(MemberProfile.find(Array(book).collect(&:member_profile_id)))
|
||||||
end
|
end
|
||||||
|
def get_member_show(book)
|
||||||
|
get_member(book).collect{|member| "<a href='#{OrbitHelper.url_to_plugin_show(member.to_param,'member')}' title='#{member.name}'>#{member.name}</a>"}.join('/')
|
||||||
|
end
|
||||||
def get_publisher(book)
|
def get_publisher(book)
|
||||||
book.publisher
|
book.publisher
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue