%h1= model.new_record? ? t('new_javascript') : t('edit_javascript') - form_for [:admin, model], :url => (model.new_record? ? admin_scripts_url : admin_script_url(model)) do |f| %p.title = label :sheet_page, :slug, t('slug') = f.text_field :slug, :class => 'textbox', :maxlength => 255, :id => 'sheet_page_slug' %span.hint= %{#{t('path')}: #{@root.url}#{model.slug}} - f.fields_for :parts do |p| %p.content = p.label :content, t('content') = p.hidden_field :name, :value => 'body' if model.new_record? = p.text_area :content, :class => 'textarea large', :style => 'width: 100%' %p - if SheetsExtension.javascript_filters.blank? = p.hidden_field :filter_id, :value => '' - else = p.label :filter_id, t('filter'), :for => 'sheet_filter_id' = p.select :filter_id, javascript_filter_options_for_select(p.object.filter_id), {}, :id => 'sheet_filter_id' %span.reference_links = t('reference') - unless SheetsExtension.javascript_filters.blank? %span{:id => "filter_reference_link_body"} = link_to_function t('filter'), "loadFilterReference();" %span{:id => "tag_reference_link_body"} = link_to_function t('available_tags'), "loadTagReference('body');" %p.buttons{:style=>"clear: left"} = save_model_button(model) = save_model_and_continue_editing_button(model) = t('or') = link_to t('cancel'), admin_scripts_url = render 'admin/sheets/edit_scripts'