2013-03-25 09:25:34 +01:00

38 lines
1.1 KiB
Plaintext

= semantic_form_for [:admin,@promotion], :remote => true do |form|
.content
= form.inputs do
= form.input :promotion_type_id, :collection => Promotion::PROMOTION_TYPES, :label => "Type :", :as => :select
= form.input :title, :label => "Titre :"
= form.input :month, :label => "Mois :", :order => [:month, :year]
= form.input :description, :label => "Description courte :", :as => :text, :input_html => {:class => "text_editor"}
%li.string.optional
%label
Image :
%fieldset
-r = rand(1000000000000000000000000000)
=link_to "Modifier cette image", "#", :onclick => "select_image_from_manager('"+r.to_s+"');return false;"
%br
-if form.object.image_file
=image_tag form.object.image_file.file.large.medium.small.thumb.url, :id => "img_"+r.to_s
-else
=image_tag "", :id => "img_"+r.to_s
=form.hidden_field :image_file_id, :class => "inputText", :id => "input_"+r.to_s
.actions
= form.submit "Sauvegarder"
:javascript
$(".text_editor").each(function() {
auto_tiny_mce($(this));
});