Sha256: 9a9c6d80cf02d2a7da599836ede23172c59e49e4d852245daf585149e135a995

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

- for_context ||= context

- if for_context.child?
  - parent_name = for_context.parent.resource.name
  - parent_field = for_context.field(parent_name)
  - if parent_field
    input(
      name=parent_name
      value=parent_field.read(for_context.entity)
      type="hidden"
    )

/ hidden fields
- fields.each do |field|
  - next if field.visible?
  - locals = { field: field, for_context: for_context }
  = render partial: File.join(%w(admin_it editors hidden)), locals: locals

/ visible fields
- fields.each do |field|
  /- if field.type == :image
    - locals = { field: field, for_context: for_context, id: "#{for_context.resource.name}_#{field.name}" }
    = render partial: File.join(%w(admin_it editors hidden)), locals: locals
    - next
  - next unless field.visible?
  - next if field == parent_field
  - locals = { field: field, for_context: for_context }
  - if field.partial.nil?
    .form-group
      - control_width = 'col-sm-12'
      - if field.show_label?
        - id = "#{for_context.resource.name}_#{field.name}"
        label.col-sm-2.control-label for="#{id}"
          = field.display_name
          - control_width = 'col-sm-10'
      div class=control_width
        = render partial: File.join('admin_it', 'editors', field.editor.to_s), locals: locals
  - else
    = render partial: field.partial, locals: locals

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
admin_it-1.3.8 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.7 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.6 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.5 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.4 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.3 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.2 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.1 app/views/admin_it/shared/_fields.html.slim
admin_it-1.3.0 app/views/admin_it/shared/_fields.html.slim