From 70eb506c570bff69453bb30101fb9e7faeec6cd8 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 28 Jun 2019 10:26:25 +0800 Subject: [PATCH] fix library user image --- app/views/libraries/_library_list.html.erb | 8 ++++++-- app/views/libraries/show.html.erb | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/views/libraries/_library_list.html.erb b/app/views/libraries/_library_list.html.erb index e147e237..63314d65 100644 --- a/app/views/libraries/_library_list.html.erb +++ b/app/views/libraries/_library_list.html.erb @@ -2,13 +2,17 @@ <% if @libraries.present? %> <% @libraries.each do |library| %>
  • - + <%= link_to image_tag(url_to_avatar(library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(library.user) %>

    <%= link_to library.title, library_path(library) %>

    <%= link_to library.user.show_real_name, user_path(library.user) %> <%= library.visited_count || 0 %> 浏览 - 发布时间:<%= library.published_at.try(:strftime, '%Y-%m-%d %H:%M') %> + <% if params[:type] == 'mine' %> + 上传时间:<%= library.created_at.strftime('%Y-%m-%d %H:%M') %> + <% else %> + 发布时间:<%= library.published_at.try(:strftime, '%Y-%m-%d %H:%M') %> + <% end %>

  • diff --git a/app/views/libraries/show.html.erb b/app/views/libraries/show.html.erb index 1c23d979..c098b069 100644 --- a/app/views/libraries/show.html.erb +++ b/app/views/libraries/show.html.erb @@ -45,15 +45,19 @@ <% 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 %> + 编码:<%= @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 %>