<% # encoding: utf-8 %>

		<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class='list_item'>
			<td>
				<div class="control-group">
					<div class="controls">
					<%= f.file_field :file %>
					<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %>
					</div>
				</div>
			</td>	
			<td>	
			
				<div class="tab-content">
				
					<% @site_in_use_locales.each_with_index do |locale, i| %>
					
					<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
						<%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %>
						<%= f.fields_for :file_title_translations do |f| %>
							<div class="control-group">
							<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.from_locale(locale) %></label>
							<div class="controls">
							<%= f.text_field locale, :class=>'post-file_title', :value => (form_file.file_title_translations[locale] rescue nil) %>
							</div>
							</div>
						<% end %>	
						
					</div>

					<% end %>
					
				</div>
				
			</td>
			
			<td>
			<span class="action">
			<% if form_file.new_record? %>
			  <a class="delete"><i class="icon-remove"></i></a>
			<% else %>	
			  <%= f.hidden_field :id %>
			  <a class="remove_existing_record"><i class="icon-remove"></i></a>
			  <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
			<% end %>
			</span>
			
			</td>
		</tr>
		
