Skip to content

Commit

Permalink
chore: template simplification (#104)
Browse files Browse the repository at this point in the history
we obviously only need the condition around the table cell head element
  • Loading branch information
mfranzke authored Oct 20, 2022
1 parent f6a7ec6 commit 3401787
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions source/_patterns/02-components/table/table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,12 @@
</tr>
</thead>
<tbody{{#if align}} data-align="{{ align }}"{{/if }}{{#if vertical-align}} data-vertical-align="{{ vertical-align }}"{{/if }}>
{{! TODO: Not elegant, but working for the moment… }}
{{#if rowtitle }}
{{#each cells }}
<tr>
<th scope="row">table header</th>
<td{{#if @first }}{{#if ../icon}} data-icon="{{ ../icon }}"{{/if }}{{/if }}>{{{ text01 }}}</td>
<td>{{{ text02 }}}</td>
</tr>
{{/each }}
{{else}}
{{#each cells }}
<tr>
<td{{#if @first }}{{#if ../icon}} data-icon="{{ ../icon }}"{{/if }}{{/if }}>{{{ text01 }}}</td>
<td>{{{ text02 }}}</td>
</tr>
{{/each }}
{{/if }}
{{#each cells }}
<tr>
{{#if ../rowtitle }}<th scope="row">table header</th>{{/if }}
<td{{#if @first }}{{#if ../icon}} data-icon="{{ ../icon }}"{{/if }}{{/if }}>{{{ text01 }}}</td>
<td>{{{ text02 }}}</td>
</tr>
{{/each }}
</tbody>
</table>

0 comments on commit 3401787

Please sign in to comment.