Sha256: 903ec99f46a4facdc0cf8cb0e2e2989f608b6b46e63a388212f2e3a628d39001

Contents?: true

Size: 1.35 KB

Versions: 7

Compression:

Stored size: 1.35 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) %>

    <% 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

7 entries across 7 versions & 1 rubygems

Version Path
brainsome_typus-4.0.0.beta7 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta6 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta5 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta4 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta3 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta2 app/views/admin/resources/_form.html.erb
brainsome_typus-4.0.0.beta1 app/views/admin/resources/_form.html.erb