Sha256: d400af2b0fbf4fb23179c95dc3aa0cd0704a87fd89024a9cd27600ff3229a2d7

Contents?: true

Size: 1.2 KB

Versions: 5

Compression:

Stored size: 1.2 KB

Contents

- @field ||= CustomField.new
- field_group_id ||= @field.field_group_id
- new_field = @field.id.nil?
- url = new_field ? admin_fields_path : admin_field_path
- html_id = new_field ? nil : "edit_field_#{@field.id}"

%div{:class => new_field ? nil : 'remote edit_field'}
  = form_for([:admin, @field], :url => url, :as => :field, :html => one_submit_only(:field).merge(:class => nil, :id => html_id), :remote => true) do |f|
    = link_to( 'x', '#', :class => 'close', :title => t(:close_form) )
    = f.error_messages
    
    = hidden_field_tag 'field[field_group_id]', field_group_id, :id => nil

    .section
      %table
        %tr
          %td
            .label.top.req Field label:
            = f.text_field :label, :id => nil

          %td= spacer
          %td
            .label.top.req Field type:
            = select :field, :as, field_edit_as_options(@field), :include_blank => true, :id => nil

      .subform
        = render(:partial => 'admin/fields/subform') unless new_field

    .buttonbar
      - if new_field
        = f.submit t(:create_field), :id => :field_submit
      - else
        = f.submit t(:save_field), :id => :field_submit
      or
      = link_to( t(:cancel), '#', :class => 'cancel' )

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 app/views/admin/fields/_form.html.haml
fat_free_crm-0.12.2 app/views/admin/fields/_form.html.haml
fat_free_crm-0.12.1 app/views/admin/fields/_form.html.haml
fat_free_crm-0.12.0 app/views/admin/fields/_form.html.haml
fat_free_crm-0.11.4 app/views/admin/fields/_form.html.haml