<fieldset id="task_attachments">
    <legend>
        Files attached to this task
    </legend>
    <div id="task_attached_files">
        <% for file in @task.attachments %>
        <% if file.thumbnail? %>
        <div>
            <%= link_to image_tag("/project_files/thumbnail/#{file.id}"), {:controller => 'project_files', :action => 'download', :id => file.id.to_s + "." + file.file_extension}, :class=>'lightbox' %>
        </div>
        <% end %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id.to_s + "." + file.file_extension}, {:class=>'lightbox'} %><em>(<%=number_to_human_size(file.file_size) %>)</em>
        <%= link_to image_tag("/images/cross_small.png", :border=>0), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name), :class => 'close-cross' %>
        <span class="divider"></span>
        <% end %>
    </div>
</fieldset>
<% if @task.attachments.count > 0 %>
	<fieldset id="task_attachments">
		<legend>Files attached to this task</legend>
		<div id="task_attached_files">
			<% for file in @task.attachments %>
				<% if file.thumbnail? %>
					<div>
					<%= link_to image_tag("/project_files/thumbnail/#{file.id}"), {:controller => 'project_files', :action => 'download', :id => file.id.to_s + "." + file.file_extension}, :class=>'lightbox' %>
					</div>
				<% end %>
				<%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id.to_s + "." + file.file_extension}, {:class=>'lightbox'} %><em>(<%=number_to_human_size(file.file_size) %>)</em>
				<%= link_to image_tag("/images/cross_small.png", :border=>0), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name), :class => 'close-cross' %>
				<span class="divider"></span>
			<% end %>
		</div>
	</fieldset>
<% end %>
Hide attachments block when there aren't any.
Hide attachments block when there aren't any.
