engine/app/views/admin/theme_assets/_form.html.haml
2010-05-11 23:38:52 +02:00

37 lines
1.4 KiB
Plaintext

- content_for :head do
= javascript_include_tag 'admin/plugins/codemirror/codemirror', 'admin/theme_assets.js'
= f.hidden_field :performing_plain_text
#file-selector{ :class => "selector #{'hidden' if @asset.performing_plain_text?}" }
= f.inputs :name => :information do
= f.input :source
- if @asset.new_record? || !@asset.image?
%span.alt
= t('admin.theme_assets.form.choose_plain_text')
- if allow_plain_text_editing?(@asset)
#text-selector{ :class => "selector #{'hidden' if !@asset.performing_plain_text?}", :style => "#{'display: none' if !@asset.performing_plain_text?}" }
= f.inputs :name => :code, :class => 'inputs code' do
- if @asset.new_record?
= f.input :slug
= f.custom_input :content_type do
= f.select :content_type, ["stylesheet", "javascript"]
= f.custom_input :plain_text, :css => 'full', :with_label => false do
%code{ :class => (@asset.new_record? || (@asset.size && @asset.size > 40000) ? 'nude' : @asset.content_type) }
= f.text_area :plain_text
%span.alt
= t('admin.theme_assets.form.choose_file')
- if @asset.image?
= f.foldable_inputs :name => "#{t('formtastic.titles.preview')} #{image_dimensions_and_size(@asset)}", :class => 'preview' do
%li
.image
.inside
= image_tag(@asset.source.url(:preview))