Sha256: dba825d4afc492beb6b2a5cc908b6db037b26d6d5c01fbc4272517180c8fcdf2

Contents?: true

Size: 1.52 KB

Versions: 9

Compression:

Stored size: 1.52 KB

Contents

= form_for @template do |f|
  - if @template.errors.any?
    .row-fluid
      .alert.alert-error.fade.in.span12
        = link_to '×', '#', class: 'close', 'data-dismiss' => 'alert'
        - @template.errors.full_messages.each do |m|
          = m

  .form-horizontal
    .control-group
      = f.label :name, class: 'control-label'
      .controls= f.text_field :name, class: 'span4'

    .control-group
      = f.label :code_name, class: 'control-label'
      .controls= f.text_field :code_name, class: 'span4'

    .control-group
      = f.label :parent_id, class: 'control-label'
      .controls
        = f.select :parent_id, options_for_select(for_select(@roots), selected: @template.parent_id), disabled: @template.self_and_descendants.map(&:id), include_blank: t(:no)

    .control-group
      = f.label :child_id, class: 'control-label'
      .controls
        = f.select :child_id, options_for_select(for_select(@roots), selected: @template.child_id), include_blank: t(:no)

    - unless @template.new_record?
      .control-group
        .controls
          = link_to new_template_field_path(@template), class: 'btn btn-mini btn-link' do
            %i.icon-plus
            =t :new_field

    = render @template.fields

    .row-fluid
      .span12
        .form-actions
          = f.submit class: 'btn btn-primary'
          = link_to t(:cancel), templates_url, class: 'btn'
          = link_to t(:delete_template), @template, method: :delete, data: {confirm: t(:are_you_sure?)},  class: 'btn btn-danger pull-right' unless @template.new_record?

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
constructor-pages-0.8.5 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.8.4 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.8.3 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.8.2 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.8.1 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.8.0 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.7.10 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.7.9 app/views/constructor_pages/templates/_form.haml
constructor-pages-0.7.8 app/views/constructor_pages/templates/_form.haml