2010-05-11 21:38:52 +00:00
|
|
|
- content_for :head do
|
2010-07-17 22:01:00 +00:00
|
|
|
= javascript_include_tag 'admin/plugins/codemirror/codemirror', 'admin/theme_assets.js'
|
|
|
|
= image_picker_include_tags
|
2010-05-11 21:38:52 +00:00
|
|
|
|
|
|
|
= f.hidden_field :performing_plain_text
|
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
#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
|
2010-07-22 22:10:40 +00:00
|
|
|
= f.input :slug
|
2010-05-11 21:38:52 +00:00
|
|
|
|
2010-07-17 22:01:00 +00:00
|
|
|
- if @theme_asset.new_record? || @theme_asset.stylesheet_or_javascript?
|
2010-05-11 21:38:52 +00:00
|
|
|
%span.alt
|
2010-07-21 23:56:42 +00:00
|
|
|
!= t('admin.theme_assets.form.choose_plain_text')
|
2010-05-11 21:38:52 +00:00
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
- 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
|
2010-07-21 23:56:42 +00:00
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
- if @theme_asset.new_record?
|
2010-05-11 21:38:52 +00:00
|
|
|
= f.input :slug
|
2010-07-21 23:56:42 +00:00
|
|
|
|
2010-05-11 21:38:52 +00:00
|
|
|
= f.custom_input :content_type do
|
|
|
|
= f.select :content_type, ["stylesheet", "javascript"]
|
2010-07-21 23:56:42 +00:00
|
|
|
|
2010-05-11 21:38:52 +00:00
|
|
|
= f.custom_input :plain_text, :css => 'full', :with_label => false do
|
2010-07-13 00:46:17 +00:00
|
|
|
%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
|
2010-06-30 15:41:54 +00:00
|
|
|
.more
|
2010-07-17 22:01:00 +00:00
|
|
|
= link_to t('admin.image_picker.link'), admin_theme_assets_path, :id => 'image-picker-link'
|
2010-07-21 23:56:42 +00:00
|
|
|
|
2010-05-11 21:38:52 +00:00
|
|
|
%span.alt
|
2010-07-21 23:56:42 +00:00
|
|
|
!= t('admin.theme_assets.form.choose_file')
|
|
|
|
|
2010-07-13 00:46:17 +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
|
2010-07-13 00:46:17 +00:00
|
|
|
= image_tag(@theme_asset.source.url(:preview))
|