fix library user image

dev_bj
p31729568 6 years ago
parent 8195a7063c
commit 70eb506c57

@ -2,13 +2,17 @@
<% if @libraries.present? %> <% if @libraries.present? %>
<% @libraries.each do |library| %> <% @libraries.each do |library| %>
<li class="library_list_item"> <li class="library_list_item">
<img src="/<%= url_to_avatar(library.user) %>" width="50" height="50" class="radius mr15 mt3"> <%= link_to image_tag(url_to_avatar(library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(library.user) %>
<div class="flex1"> <div class="flex1">
<p class="task-hide font-16 mb15 lineh-20"><%= link_to library.title, library_path(library) %></p> <p class="task-hide font-16 mb15 lineh-20"><%= link_to library.title, library_path(library) %></p>
<p class="clearfix lineh-20"> <p class="clearfix lineh-20">
<span class="color-grey-3 mr20"><%= link_to library.user.show_real_name, user_path(library.user) %></span> <span class="color-grey-3 mr20"><%= link_to library.user.show_real_name, user_path(library.user) %></span>
<span class="color-grey-c mr20"><%= library.visited_count || 0 %> 浏览</span> <span class="color-grey-c mr20"><%= library.visited_count || 0 %> 浏览</span>
<% if params[:type] == 'mine' %>
<span class="color-grey-c mr20">上传时间:<%= library.created_at.strftime('%Y-%m-%d %H:%M') %></span>
<% else %>
<span class="color-grey-c mr20">发布时间:<%= library.published_at.try(:strftime, '%Y-%m-%d %H:%M') %></span> <span class="color-grey-c mr20">发布时间:<%= library.published_at.try(:strftime, '%Y-%m-%d %H:%M') %></span>
<% end %>
</p> </p>
</div> </div>
</li> </li>

@ -45,7 +45,7 @@
<% end %> <% end %>
</p> </p>
<div class="df mb20"> <div class="df mb20">
<img src="<%= url_to_avatar(@library.user) %>" width="50" height="50" class="radius mr15 mt3"/> <%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %>
<div class="flex1"> <div class="flex1">
<li class="font-16"><%= @library.user.show_real_name %></li> <li class="font-16"><%= @library.user.show_real_name %></li>
<li class="clearfix"> <li class="clearfix">
@ -53,7 +53,11 @@
<span class="fl color-grey-9"><%= @library.user.identity %></span> <span class="fl color-grey-9"><%= @library.user.identity %></span>
<span class="fr"> <span class="fr">
<span class="fl color-grey-9 mr30">编码:<span class="color-grey-6"><%= @library.uuid %></span></span> <span class="fl color-grey-9 mr30">编码:<span class="color-grey-6"><%= @library.uuid %></span></span>
<% if @library.published? %>
<span class="fl color-grey-9">发布时间:<span class="color-grey-6"><%= @library.published_at.strftime('%Y-%m-%d %H:%M') %></span></span>
<% else %>
<span class="fl color-grey-9">上传时间:<span class="color-grey-6"><%= @library.created_at.strftime('%Y-%m-%d %H:%M') %></span></span> <span class="fl color-grey-9">上传时间:<span class="color-grey-6"><%= @library.created_at.strftime('%Y-%m-%d %H:%M') %></span></span>
<% end %>
</span> </span>
</li> </li>
</div> </div>

Loading…
Cancel
Save