engine/app/views/admin/theme_assets/_form.html.haml

40 lines
1.7 KiB
Plaintext
Raw Normal View History

2010-05-11 21:38:52 +00:00
- content_for :head do
= javascript_include_tag 'admin/plugins/json2', 'admin/plugins/scrollTo', 'admin/plugins/codemirror/codemirror', 'admin/plugins/fancybox', 'admin/plugins/plupload/plupload.full.js', 'admin/theme_assets.js'
2010-06-02 00:39:05 +00:00
= stylesheet_link_tag 'admin/plugins/fancybox', 'admin/box'
2010-05-11 21:38:52 +00:00
= f.hidden_field :performing_plain_text
#file-selector{ :class => "selector #{'hidden' if @theme_asset.performing_plain_text?}" }
2010-05-11 21:38:52 +00:00
= f.inputs :name => :information do
= f.input :source
- if @theme_asset.new_record? || !@theme_asset.image?
2010-05-11 21:38:52 +00:00
%span.alt
= t('admin.theme_assets.form.choose_plain_text')
- if allow_plain_text_editing?(@theme_asset)
#text-selector{ :class => "selector #{'hidden' if !@theme_asset.performing_plain_text?}", :style => "#{'display: none' if !@theme_asset.performing_plain_text?}" }
2010-05-11 21:38:52 +00:00
= f.inputs :name => :code, :class => 'inputs code' do
- if @theme_asset.new_record?
2010-05-11 21:38:52 +00:00
= 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 => (@theme_asset.size && @theme_asset.size > 40000 ? 'nude' : (@theme_asset.content_type || 'stylesheet')) }
2010-05-11 21:38:52 +00:00
= f.text_area :plain_text
.more
= link_to t('.picker_link'), admin_theme_assets_path, :id => 'asset-picker-link'
2010-05-11 21:38:52 +00:00
%span.alt
= t('admin.theme_assets.form.choose_file')
2010-06-02 00:39:05 +00:00
- if @theme_asset.image?
= f.foldable_inputs :name => "#{t('formtastic.titles.preview')} #{image_dimensions_and_size(@theme_asset)}", :class => 'preview' do
2010-05-11 21:38:52 +00:00
%li
.image
.inside
= image_tag(@theme_asset.source.url(:preview))