Sha256: 1157016e3d3c6eaea6c58797fcadb4461b6a5d6b4b6d1f2a52452edfa7d37001

Contents?: true

Size: 1.79 KB

Versions: 14

Compression:

Stored size: 1.79 KB

Contents

- highlighted_field_name = parent.highlighted_field_name rescue ''

= form.inputs :name => title || :attributes do
  - form.object.custom_fields.each do |field|
    - required = highlighted_field_name == field._name

    - if field.string?
      = form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :required => required
    - elsif field.text?
      = form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :as => :text, :required => required, :input_html => { :class => field.text_formatting }
    - elsif field.category?
      = form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
        = form.select field._name.to_sym, field.ordered_category_items.collect { |item| [item.name, item.id] }
        %button.button.light.edit-categories-link{ :type => 'button', :'data-url' => edit_admin_custom_field_path(parent.model_name.underscore, parent.slug, field) }
          %span!= t('.edit_categories')
    - elsif field.boolean?
      = form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
        = form.check_box field._alias.to_sym
    - elsif field.date?
      = form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :input_html => { :class => 'date' }
    - elsif field.file?
      = form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'file' do
        = form.file_field field._name.to_sym
        - if form.object.send(:"#{field._name}?")
          %p.remove
            %strong
              = link_to File.basename(form.object.send(field._name).url), form.object.send(field._name).url
            %span
               / 
              != t('.delete_file')
              = form.check_box :"remove_#{field._name}"

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-1.0.0.beta app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta12 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta11 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta10 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta9 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta8 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta7 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta5 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta4 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta3 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta2 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4.beta1 app/views/admin/custom_fields/_custom_form.html.haml
locomotive_cms-0.0.4 app/views/admin/custom_fields/_custom_form.html.haml