added member names for frontend

This commit is contained in:
rulingcom 2025-11-12 20:50:16 +08:00
parent f08404cec0
commit 75acbf7d6d
2 changed files with 7 additions and 1 deletions

View File

@ -705,11 +705,13 @@ class EventNewsModsController < ApplicationController
"autobiography" => member.autobiography
}
end
{
"tags" => tags,
"event_news_files" => files,
"profiles" => profiles,
"event_news_links" => links,
"other_member_profiles" => event_news.get_other_member_profiles_names_for_frontend,
"data" => {
"title-head" => EventNewsCustomTitle.get_trans('title'),
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
@ -743,7 +745,7 @@ class EventNewsModsController < ApplicationController
"place_text" => (event_news.place.blank? ? "" : "#{EventNewsCustomTitle.get_trans("place")}: #{event_news.place}"),
"place-css" => (event_news.place.blank? ? "display: none;" : ""),
"carousel_html" => carousel_html,
"orbithashtags" => event_news.hashtags_for_frontend
"orbithashtags" => event_news.hashtags_for_frontend,
},
"impressionist" => (event_news.is_preview ? nil : event_news),
"url_to_edit"=>url_to_edit

View File

@ -337,6 +337,10 @@ class EventNews
MemberProfile.find(self.email_member_ids) rescue []
end
def get_other_member_profiles_names_for_frontend
MemberProfile.find(self.other_member_profiles).map{|m,n| {"name" => m.name}} rescue []
end
def email_addresses
addresses = self.email_members.collect{|member| member.email} rescue []
addresses = addresses +[self.other_mailaddress] if !self.other_mailaddress.blank?