Files
danbooru/app/views/posts/partials/show/_information.html.erb
evazion c99d0523bb /media_assets: add basic index and show pages.
* Add a basic index page at https://danbooru.donmai.us/media_assets.
* Add a basic show page at https://danbooru.donmai.us/media_assets/1.
* Add ability to search /media_assets.json by metadata. Example:
** https://danbooru.donmai.us/media_assets.json?search[metadata][File:ColorComponents]=3
* Add a "»" link next to the filesize on posts linking to the metadata page.

Known issues:

* Sometimes the MD5 links on the /media_assets page return "That record
  was not found" errors. These are unfinished uploads that haven't been
  made into posts yet.
* No good way to search for custom metadata fields in the search form.
* Design is ugly.
2021-09-29 07:46:11 -05:00

53 lines
1.9 KiB
Plaintext

<ul>
<li id="post-info-id">ID: <%= post.id %></li>
<li id="post-info-uploader">
Uploader: <%= link_to_user(post.uploader) %>
<%= link_to "»", posts_path(tags: "user:#{post.uploader.name}") %>
</li>
<li id="post-info-date">
Date: <%= link_to time_ago_in_words_tagged(post.created_at), posts_path(tags: "date:#{post.created_at.to_date}") %>
</li>
<% if post.approver %>
<li id="post-info-approver">
Approver: <%= link_to_user(post.approver) %>
<%= link_to "»", posts_path(tags: "approver:#{post.approver.name}") %>
</li>
<% end %>
<li id="post-info-size">
Size: <%= link_to_if policy(post).visible?, "#{number_to_human_size(post.file_size)} .#{post.file_ext}", post.tagged_file_url %>
(<%= post.image_width %>x<%= post.image_height %>)
<%= link_to "»", @post.media_asset %>
</li>
<li id="post-info-source">Source: <%= post_source_tag(post.source, post.normalized_source) %></li>
<li id="post-info-rating">Rating: <%= post.pretty_rating %></li>
<li id="post-info-score">
Score: <%= render_post_votes post, current_user: CurrentUser.user %>
</li>
<li id="post-info-favorites">Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
<% if policy(post).can_view_favlist? %>
<%= link_to "Show »", "#", id: "show-favlist-link", style: ("display: none;" if post.fav_count == 0) %>
<%= link_to "« Hide", "#", id: "hide-favlist-link", style: "display: none;" %>
<div id="favlist" style="display: none;" class="ml-4">
<%= render "posts/partials/show/favorite_list", post: post %>
</div>
<% end %></li>
<li id="post-info-status">
Status:
<% if post.is_pending? %>
Pending
<% elsif post.is_flagged? %>
Flagged
<% elsif post.is_appealed? %>
Appealed
<% elsif post.is_deleted? %>
Deleted
<% else %>
Active
<% end %>
<% if post.is_banned? %>
Banned
<% end %>
</li>
</ul>