#small_index
	-@portfolio.images.each do |img|
		=link_to image_tag(img.photo.thumb.url, :style => "height:100px;float:left;padding:5px;"), portfolio_path(:slug => @portfolio.slug, :format => "js", :page => (@portfolio.images.after(img.shoot_at).count+1)), :onclick => '$("#small_index").toggleClass("active");' ,:remote => true
		
		
.portfolio
	-if 1==2
		.intro
			%h1=@portfolio.title
			=markdown @portfolio.markdown_content

	.portfolio_images

		-if current_admin
		
	
			%form.fileupload{:action => admin_portfolio_images_path(:portfolio_id => @portfolio.id), :enctype => "multipart/form-data", :method => "POST"}
	
				.upload
					.progress
						.bar{:style => "height:1em;"}
					
					%button.add_files ajouter des photos
	
					%input{:multiple => "", :name => "portfolio_image[photo]", :type => "file", :style => "float:right;"}
			
			
					%br
			
					%br
					= hidden_field_tag "portfolio_image[portfolio_ids][]", @portfolio.id
			
				

			:javascript
				init_portfolio_images();

	%br
	.images=render :collection => @images, :partial => "portfolio_images/portfolio_image", :as => :image
	