#{form_for(
@section,
:method => :post,
:action => Sections::Controller::Sections.r(:save),
:id => :section_form,
:'data-autosave-url' => Sections::Controller::Sections.r(:autosave)
) do |f|
f.input_hidden(:id , @section.id)
f.input_hidden(:csrf_token, get_csrf_token)
f.g.div(:id => 'general', :class => :tab_field) do
f.input_text(
lang('sections.labels.name'),
:name,
:required => :required,
:maxlength => 255
)
f.input_text(
lang('sections.labels.slug'),
:slug,
:maxlength => 255
)
f.textarea(
lang('sections.labels.description'),
:description,
:rows => 10
)
end # f.g.div(:id => 'general')
f.g.div(:id => 'comments', :class => :tab_field) do
f.input_radio(
lang('sections.labels.comment_allow'),
:comment_allow,
@section.comment_allow,
:values => @boolean_hash.invert,
:required => :required
)
f.input_radio(
lang('sections.labels.comment_require_account'),
:comment_require_account,
@section.comment_require_account,
:values => @boolean_hash.invert,
:required => :required
)
f.input_radio(
lang('sections.labels.comment_moderate'),
:comment_moderate,
@section.comment_moderate,
:values => @boolean_hash.invert,
:required => :required
)
f.select(
lang('sections.labels.comment_format'),
:comment_format,
:values => Zen::Markup.to_hash,
:selected => @section.comment_format,
:size => 1,
:required => :required
)
end # f.g.div(:id => 'comments')
f.g.div(:id => 'groups', :class => :tab_field) do
f.input_checkbox(
lang('sections.labels.custom_field_groups'),
:custom_field_group_pks,
@section.custom_field_group_pks,
:values => @custom_field_group_pk_hash,
)
f.input_checkbox(
lang('sections.labels.category_groups'),
:category_group_pks,
@section.category_group_pks,
:values => @category_group_pk_hash,
)
end # f.g.div(:id => 'groups')
f.g.input(
:type => 'submit',
:value => lang('sections.buttons.save'),
:class => 'button'
)
end}