Sha256: 5cfaf319730ebefcab2c39456509a726975c22aca7fc5c318e8548aaa77aafcf

Contents?: true

Size: 1.73 KB

Versions: 37

Compression:

Stored size: 1.73 KB

Contents

<%= render Koi::Content::Editor::ItemFormComponent.new(model: table, url: path, data: { controller: "content--editor--table" }) do |form| %>
  <%= form.content_heading_fieldset %>

  <% content = sanitize_content_table(normalize_content_table(form.object, heading: false)) %>
  <%= form.govuk_text_area :content, value: content, data: { content__editor__table_target: "input" } %>

  <%# hidden button to receive <Enter> events (HTML-default is to click first button in form) %>
  <%= form.button "Save", hidden: "" %>

  <%# hidden button to submit the table for re-rendering %>
  <%= form.button "Update",
                  formaction: table.persisted? ? content_routes.table_path : content_routes.tables_path,
                  hidden:     "",
                  data:       { content__editor__table_target: "update" } %>

  <%= form.govuk_number_field :heading_rows,
                              label:       { text: "Heading rows" },
                              width:       2,
                              placeholder: 0,
                              min:         0,
                              data:        { content__editor__table_target: "headerRows",
                                             action:                        "input->content--editor--table#update" } %>

  <%= form.govuk_number_field :heading_columns,
                              label:       { text: "Heading columns" },
                              width:       2,
                              placeholder: 0,
                              min:         0,
                              data:        { content__editor__table_target: "headerColumns",
                                             action:                        "input->content--editor--table#update" } %>
<% end %>

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
katalyst-koi-4.15.1 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.15.0 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.14.3 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.14.2 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.14.1 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.14.0 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.13.2 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.13.0 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.12.6 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.12.5 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.12.4 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.12.3 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.12.2 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.12.1 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.12.0 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.11.2 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.11.1 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.11.0 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.10.3 app/views/katalyst/content/tables/_table.html+form.erb
katalyst-koi-4.10.2 app/views/katalyst/content/tables/_table.html+form.erb