Commit 2005bd1101236e826661dfb89541c9d82fa4b3bd

Authored by Andrey Karpikov
1 parent 4b5f98c6

check repeat element

@@ -218,6 +218,7 @@ module Kanjai @@ -218,6 +218,7 @@ module Kanjai
218 when 'text' 218 when 'text'
219 subparts << self.replace_text_marker(item[:source], hash_value) 219 subparts << self.replace_text_marker(item[:source], hash_value)
220 when 'repeat' 220 when 'repeat'
  221 + repeat_item_index = value['REPEAT_ITEM_INDEX'] || 1
221 repeat_id = item[:attributes]['id'] 222 repeat_id = item[:attributes]['id']
222 scope = @page_content.page_content_markers.where(repeat_id: repeat_id) 223 scope = @page_content.page_content_markers.where(repeat_id: repeat_id)
223 if hash_value && hash_value['PARENT_ITEM_ID'].present? 224 if hash_value && hash_value['PARENT_ITEM_ID'].present?
@@ -238,9 +239,10 @@ module Kanjai @@ -238,9 +239,10 @@ module Kanjai
238 value['###FIRST_ITEM_FALSE###'] = 'true' 239 value['###FIRST_ITEM_FALSE###'] = 'true'
239 end 240 end
240 value['###REPEAT_NUMBER###'] = "#{repeat_id}_#{row_index.to_s}_#{hash_value['PARENT_ITEM_ID'] || 0}" 241 value['###REPEAT_NUMBER###'] = "#{repeat_id}_#{row_index.to_s}_#{hash_value['PARENT_ITEM_ID'] || 0}"
241 - value['###REPEAT_CYCLE_COUNT###'] = "#{row_index.to_s}" 242 + value['###REPEAT_CYCLE_COUNT###'] = repeat_item_index.to_s
242 value['PARENT_ITEM_ID'] = row_index.to_s 243 value['PARENT_ITEM_ID'] = row_index.to_s
243 - 244 + repeat_item_index += 1
  245 + value['REPEAT_ITEM_INDEX'] = repeat_item_index
244 self.content_generator(session, domain, item[:children], subparts, value) 246 self.content_generator(session, domain, item[:children], subparts, value)
245 247
246 end 248 end
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.281" 2 + VERSION = "0.0.282"
3 end 3 end