mirror of
https://github.com/discourse/discourse-table-builder.git
synced 2026-09-30 04:23:56 -04:00
- Adds a button to the composer tools which triggers a modal window for a table builder - Table builder contains fields to add table contents, as well as buttons to align contents, and add additional tables/rows
40 lines
1.2 KiB
Handlebars
40 lines
1.2 KiB
Handlebars
<DModalBody
|
|
@title={{theme-prefix "discourse_table_builder.modal.title"}}
|
|
@class="table-builder-modal"
|
|
>
|
|
<form id="insert-markdown-table-form" {{action "createTable" on="submit"}}>
|
|
<section class="header-section">
|
|
<div class="table-header-fields">
|
|
{{#each this.tableItems as |item|}}
|
|
<HeaderColumn
|
|
@column={{item}}
|
|
@columnId={{item.column}}
|
|
@tableItems={{this.tableItems}}
|
|
@addColumn={{this.addColumn}}
|
|
@removeColumn={{this.removeColumn}}
|
|
@setColumnHeader={{this.setColumnHeader}}
|
|
@addRow={{this.addRow}}
|
|
@removeRow={{this.removeRow}}
|
|
@setRowValue={{this.setRowValue}}
|
|
@alignColumn={{this.alignColumn}}
|
|
/>
|
|
{{/each}}
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</DModalBody>
|
|
|
|
<div class="modal-footer">
|
|
<DButton
|
|
@class="btn-primary"
|
|
@label={{theme-prefix "discourse_table_builder.modal.create"}}
|
|
@icon="plus"
|
|
@action={{action "createTable"}}
|
|
/>
|
|
|
|
<DButton
|
|
@class="btn-flat"
|
|
@label={{theme-prefix "discourse_table_builder.modal.cancel"}}
|
|
@action={{action "cancelTableCreation"}}
|
|
/>
|
|
</div> |