Added row tpl and moved flag to view tpls instead