<%= render 'menu' %> <%= form_for([:noodall, :admin, @asset], :html => { :multipart => true, :id => ( 'uploader' if @asset.new_record? ) } ) do |f| %>
<%= f.error_messages %> <%= hidden_field_tag :pending, true if params[:pending] || controller.action_name == "pending" %>

  <%= f.label :title %>
<%= f.text_field :title %>

  <%= f.label :description %>
<%= f.text_area :description %>

<% if @asset.video? -%>

  <%= f.label :video_thumbnail_offset, "Thumbnail Offset" %>
<%= f.select :video_thumbnail_offset, 1..100 %>%

<% end -%>

  <%= f.label :file %>
<%= f.file_field :file %>

  <%= f.label :tag_list, "Tags" %>
<%= f.text_field :tag_list %>

<%= f.submit @asset.new_record? ? 'Create' : 'Update', :disable_with => 'Submitting...', :class => 'update' %> <%= link_to 'Delete', noodall_admin_asset_path(@asset, :pending => true), :confirm => 'Are you sure?', :method => :delete, :class => 'delete', :title => 'Delete this asset' if params[:pending] || controller.action_name == "pending" %> <%= link_to 'Cancel', admin_assets_type_url(@asset), :class => 'cancel' %>

<% end %> <% unless @asset.new_record? %>
<% if @asset.image? or @asset.video? %> <%= image_tag( @asset.url('260x', :jpg), :alt => @asset.description, :id => "asset-#{@asset.id}" ) %> <% else -%> <%= link_to( @asset.file.name, @asset.url, :title => @asset.description, :id => "asset-#{@asset.id}" ) %> <% end -%>
<% end -%>