AlchemyCMS/alchemy_cms

View on GitHub
app/views/alchemy/admin/pages/new.html.erb

Summary

Maintainability
Test Coverage
<%- if @clipboard_items.blank? -%>
  <%= render 'new_page_form' %>
<%- else -%>
<sl-tab-group id="overlay_tabs">
  <sl-tab slot="nav" panel="create_page_tab"><%= Alchemy.t('New page') %></sl-tab>
  <sl-tab slot="nav" panel="paste_page_tab"><%= Alchemy.t('Paste from clipboard') %></sl-tab>
  <sl-tab-panel name="create_page_tab">
    <%= render 'new_page_form' %>
  </sl-tab-panel>
  <sl-tab-panel name="paste_page_tab">
    <%= alchemy_form_for [:admin, @page] do |f| %>
      <%= f.hidden_field(:parent_id) %>
      <div class="input select">
        <label for="paste_from_clipboard" class="control-label"><%= Alchemy.t("Page") %></label>
        <%= select_tag 'paste_from_clipboard',
          clipboard_select_tag_options(@clipboard_items),
          is: 'alchemy-select' %>
      </div>
      <%= f.input :name %>
      <%= f.submit Alchemy.t(:paste) %>
    <% end %>
  </sl-tab-panel>
</sl-tab-group>
<%- end -%>