moved collection loop from tpl to view

Signed-off-by: alkaest2002 <p.calanna@gmail.com>