<%~if not widget_end%><%set widget_end = $widgets_loop.length%><%endif%>
<%~loop widgets_loop%>
  <%~if row_num >= $widget_start%>
    <%~if Type%>
    <%include _widget_automated.html%>
    <%~else%>
    <%include _widget_manual.html%>
    <%~endif%>
    <%~if row_num < $widget_end or $widgets_loop.length == 1%>
    <div class="widget-divider"></div>
    <%~endif%>
  <%~endif%>
  <%~if row_num == $widget_end%><%lastloop%><%endif%>
<%~endloop%>
