% @props.helper = @form.helper() @props.formWidth = @props.helper.width() if @fullWidthForm() @props.fullWidthForm = true else @props.visualCells = @form.visualCellWidths() %> {BEGIN <%- @location %>_block} <% @props.openTable = () => %>
| _<%- context.gridCell.cell %>}
class="<%- context.form.cellClasses( context.gridCell.cell ) %>"
<% if context.cell.columnName == 'field' : %>
data-field="<%- @goodFieldName( context.cell.field ) %>"
<% end %>
<% if context.cell.items.length <= 1 : %>
data-single
<% end %>
<% if context.props.fullWidthCell : %>
data-fullwidth
<% end %>
<%- if context.gridCell.colspan>1 then 'ocolspan="'+context.gridCell.colspan+'"' else '' %>
<%- if context.gridCell.rowspan>1 then 'orowspan="'+context.gridCell.rowspan+'"' else '' %>
<%- context.cellAttr( context.gridCell.cell ) %>
<% if context.props.visualCells : %>
data-v-cell="<%- context.props.visualCells.cellWidths[ context.gridCell.cell ] %>"
<% end %>
>
<% end %>
<%
@props.tableOpened = false;
@props.rowOpened = false;
@props.cellOpened = false;
@props.breakTable = ( rowIdx, itemIdx = 0 ) =>
row = @form.grid[ rowIdx ]
if row.cells.length != 1 or (row.cells[0].colspan || 1) != @props.formWidth
return false
cell = @form.cells[ row.cells[0].cell ]
if cell.items.length <= itemIdx
return false;
return @page.items[ cell.items[itemIdx] ].breaksTable()
%>
<% for rowIdx in Object.keys( @form.grid ) : %>
<% for gridCell, cellIdx in @form.grid[rowIdx].cells : %>
<% include 'forms/edit-grid-cell.htm', @addCell( rowIdx, cellIdx, false ) %>
<% if @props.cellOpened : %>
<% @props.cellOpened = false %>
|
{END cellblock_<%- @location %>_<%- @gridCell.cell %>}
<% end %>
<% end %>
<% if @props.rowOpened : %>
<% @props.rowOpened = false %>
<% end %>
<% end %>
<% if @props.tableOpened : %>
<% @props.tableOpened = false %>