% if project.present? && params[:controller] == 'files' && params[:action] == 'new' %>
<% download = DownloadButton.find_by_project_id(project.id) %>
<% unless download && download.disabled? %>
<% if project.versions.empty? %>
<%=l(:warning_no_file_for_download_button)%>: <%=l(:warning_no_project_version_found)%>
<% elsif project.versions.select{ |version| version.closed? }.empty? %>
<%=l(:warning_no_file_for_download_button)%>: <%=l(:warning_no_closed_version_found)%>
<% else %>
<%=l(:notice_file_should_be_added_to_closed_version)%>
<% end %>
<% end %>
<% end %>