|
...
|
...
|
@@ -71,5 +71,25 @@ module Kanjai |
|
71
|
71
|
content
|
|
72
|
72
|
end
|
|
73
|
73
|
|
|
|
74
|
+ def sort_markers(page_content, markers)
|
|
|
75
|
+ page_template = page_content.page.page_template
|
|
|
76
|
+ if page_template
|
|
|
77
|
+ subpart = page_template.template_parts.where(code: page_content.type_content).first
|
|
|
78
|
+ if subpart
|
|
|
79
|
+ p '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
|
|
|
80
|
+ markers_position = {}
|
|
|
81
|
+ subpart.field_options.each_with_index do |item, index|
|
|
|
82
|
+ markers_position[item[:name]] = index + 1
|
|
|
83
|
+ end
|
|
|
84
|
+
|
|
|
85
|
+ return markers.sort{|a,b| (markers_position[a.marker] <=> markers_position[b.marker] ) }
|
|
|
86
|
+
|
|
|
87
|
+ return markers
|
|
|
88
|
+ end
|
|
|
89
|
+ end
|
|
|
90
|
+
|
|
|
91
|
+ return markers
|
|
|
92
|
+ end
|
|
|
93
|
+
|
|
74
|
94
|
end
|
|
75
|
95
|
end |
...
|
...
|
|