Commit 2005bd1101236e826661dfb89541c9d82fa4b3bd

Authored by Andrey Karpikov
1 parent 4b5f98c6

check repeat element

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