Files
danbooru/app/views/uploads/show.html.erb
evazion ed79b623cc Fix #4544: Show limited view of other user's uploads on the upload index.
* Show completed uploads to other users.
* Don't show failed or incomplete uploads to other users.
* Don't show tags to other users.
* Delete completed uploads after 1 hour.
* Delete incomplete uploads after 1 day.
* Delete failed uploads after 3 days.
2020-07-13 19:25:30 -05:00

52 lines
1.9 KiB
Plaintext

<div id="c-uploads">
<div id="a-show">
<h1>Upload #<%= @upload.id %></h1>
<ul>
<li>Date: <%= @upload.created_at %></li>
<li>Source: <%= @upload.source %></li>
<% if policy(@upload).can_view_tags? %>
<li>Tags: <%= @upload.tag_string %></li>
<% end %>
<% if @upload.md5.present? %>
<li>MD5: <%= @upload.md5 %>
<% end %>
<% if @upload.file_size.present? %>
<li>
Size: <%= number_to_human_size(@upload.file_size) %></li>
<% if @upload.image_width.present? %>
(<%= @upload.image_width %>x<%= @upload.image_height %>)
<% end %>
</li>
<% end %>
</ul>
<% if @upload.is_completed? %>
<p>This upload has finished processing. <%= link_to "View the post", post_path(@upload.post_id) %>.</p>
<% elsif @upload.is_pending? %>
<p>This upload is waiting to be processed. Please wait a few seconds.</p>
<% elsif @upload.is_processing? || @upload.is_preprocessing? || @upload.is_preprocessed? %>
<p>This upload is being processed. Please wait a few seconds.</p>
<% elsif @upload.is_duplicate? %>
<p>This upload is a duplicate: <%= link_to "post ##{@upload.duplicate_post_id}", post_path(@upload.duplicate_post_id) %></p>
<% else %>
<p>An error occurred: <%= render_status(@upload) %></p>
<% if CurrentUser.user.is_builder? %>
<%= render "static/backtrace", backtrace: @upload.backtrace.to_s.split(/\n/) %>
<% end %>
<% end %>
<p>
You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path(:search => {:uploader_id => CurrentUser.id}) %>.
</p>
</div>
</div>
<%= render "uploads/secondary_links" %>
<% if @upload.is_pending? || @upload.is_processing? || @upload.is_preprocessing? || @upload.is_preprocessed? %>
<% content_for(:html_header) do %>
<meta http-equiv="refresh" content="2">
<% end %>
<% end %>