This commit is contained in:
rulingcom 2025-06-17 18:52:21 +08:00
parent 3d65aaffbc
commit 2a60bfe730
1 changed files with 9 additions and 12 deletions

View File

@ -47,13 +47,14 @@ class CurationPostSection
end end
def get_frontend_object def get_frontend_object
case self.section_type uid = self.id.to_s[0,5] + self.id.to_s[-5,5]
case self.section_type
when "universal_table" when "universal_table"
{ {
"section" => self.title, "section" => self.title,
"section_uid" => self.id.to_s[0..5], "section_uid" => uid,
"entries" => self.get_table_entries_for_frontend, "entries" => self.get_table_entries_for_frontend,
"url_to_show" => "", "type" => self.section_type,
"text" => "", "text" => "",
"mind_map_title" => "", "mind_map_title" => "",
"mind_map_data" => "" "mind_map_data" => ""
@ -61,11 +62,9 @@ class CurationPostSection
when "text" when "text"
{ {
"section" => self.title, "section" => self.title,
"section_uid" => self.id.to_s[0..5], "section_uid" => uid,
"entries" => [], "entries" => [],
"uid" => "",
"type" => self.section_type, "type" => self.section_type,
"url_to_show" => "",
"text" => self.text.html_safe, "text" => self.text.html_safe,
"mind_map_title" => "", "mind_map_title" => "",
"mind_map_data" => "" "mind_map_data" => ""
@ -74,14 +73,12 @@ class CurationPostSection
mm = MindMap.find(self.mind_map_id) mm = MindMap.find(self.mind_map_id)
{ {
"section" => self.title, "section" => self.title,
"section_uid" => self.id.to_s[0..5], "section_uid" => uid,
"entries" => [], "entries" => [],
"mind_map_title" => mm.title,
"mind_map_data" => mm.mind_map_data.to_json,
"uid" => "",
"type" => self.section_type, "type" => self.section_type,
"url_to_show" => "", "text" => "",
"text" => "" "mind_map_title" => mm.title,
"mind_map_data" => mm.mind_map_data.to_json
} }
end end
end end