Sha256: c1a0301e5e5e212b128c8cc9078d088a0bb735d567b18161a27064958a6ee938

Contents?: true

Size: 1.42 KB

Versions: 6

Compression:

Stored size: 1.42 KB

Contents

<%= render "form_javascripts" %>
<% form_class = headless_mode? ? 'form-vertical' : 'form-horizontal' %>

<% resource_options = options.delete(@resource.model_name.param_key) %>

<%= form_for @item,
            :url => options,
            :html => { :multipart => true, :class => form_class } do |form| %>

  <%= render "helpers/admin/resources/errors" %>

  <fieldset>
    <% if resource_options %>
      <%= hidden_field_tag("#{@resource.model_name.param_key}[#{resource_options.keys.first}]", resource_options.values.first) %>
    <% end %>
    <%= build_form(fields, form) %>
    <%= hidden_field_tag :resource_class, @item.class.model_name.name %>

    <% if headless_mode? %>
      <% unless @item.new_record? %>
        <%= hidden_field_tag "_id", @item.id %>
        <%= hidden_field_tag "_label", @item.to_label %>
      <% end %>
      <%= hidden_field_tag "_continue" %>
    <% else %>
      <div class="form-actions">
        <% build_save_options.each do |key, value, special| %>
          <% klass = key.eql?("_save") ? 'btn-primary' : 'btn' %>
          <%
            message = Typus::I18n.t(value)
            options = { :name => key,
                        :onclick => "Typus.setConfirmUnload(false);",
                        'data-disable-with' => message,
                        :class => "btn #{klass}" }
          %>
          <%= submit_tag message, options %>
        <% end %>
      </div>
    <% end %>
  </fieldset>

<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
brainsome_typus-4.0.0.beta13 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta12 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta11 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta10 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta9 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta8 app/views/admin/resources/_form.html.erb