<% admin_or_self = User.current.admin? || @library.user_id == User.current.id %>

<%= link_to '文库', libraries_path, class: 'color-grey-9' %> > 详情

<%= @library.title %> <% if admin_or_self %> <% if @library.pending? %> 草稿 <% elsif @library.processing? %> 审核中 <% elsif @library.refused? %> 未通过 <% end %> <% end %> <%= link_to('返回', libraries_path, class: 'fr color-grey-9 mt5') %>

<% if admin_or_self && !@library.published? && @library_applies.size > 0 %>

私有化原因 (请按照提示修改,并在完成编辑后重新提交)

    <% @library_applies.each do |apply| %>
  • <%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %>

    <%= apply.reason %>

  • <% end %>
<% end %>

详情 <% if admin_or_self && @library.editable? %> <%= link_to '编辑', edit_library_path(id: @library.id), class: 'white-btn edu-blueline-btn fr' %> <% end %>

<%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %>
  • <%= @library.user.show_real_name %>
  • <%= @library.user.school_name %> <%= @library.user.identity %> 编码:<%= @library.uuid %> <% if @library.published? %> 发布时间:<%= @library.published_at.strftime('%Y-%m-%d %H:%M') %> <% else %> 上传时间:<%= @library.created_at.strftime('%Y-%m-%d %H:%M') %> <% end %>
  • <%= render partial: 'attachments/links', locals: { attachments: @library.attachments, options: {} } %>