post tooltips: fix long usernames causing header to overflow.
* Make tooltips wider. * Abbreviate ratings. * Truncate long usernames.
This commit is contained in:
@@ -1,38 +1,39 @@
|
||||
<div class="post-tooltip-header">
|
||||
<span class="post-tooltip-header-left">
|
||||
<%= link_to_user @post.uploader %>
|
||||
<%= link_to_user @post.uploader %>
|
||||
|
||||
<span class="post-tooltip-favorites post-tooltip-info">
|
||||
<span><%= @post.fav_count %></span>
|
||||
<i class="far fa-heart fa-xs"></i>
|
||||
</span>
|
||||
|
||||
<span class="post-tooltip-score post-tooltip-info">
|
||||
<span><%= @post.score %></span>
|
||||
<i class="far fa-thumbs-up fa-xs"></i>
|
||||
</span>
|
||||
|
||||
<% if @post.last_commented_at.present? %>
|
||||
<span class="post-tooltip-comments post-tooltip-info">
|
||||
<span><%= @post.comments.count %></span>
|
||||
<i class="far fa-comments fa-xs"></i>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<%= link_to posts_path(tags: "date:#{@post.created_at.strftime("%Y-%m-%d")}"), class: "post-tooltip-date post-tooltip-info" do %>
|
||||
<%= time_ago_in_words_tagged(@post.created_at, compact: true) %> ago
|
||||
<% end %>
|
||||
<span class="post-tooltip-favorites post-tooltip-info">
|
||||
<span><%= @post.fav_count %></span>
|
||||
<i class="far fa-heart fa-xs"></i>
|
||||
</span>
|
||||
|
||||
<span class="post-tooltip-header-right">
|
||||
<%= link_to @post.source_domain, @post.normalized_source, class: "post-tooltip-source post-tooltip-info" if @post.source_domain.present? %>
|
||||
<%= link_to "#{@post.pretty_rating.downcase}", posts_path(tags: "rating:#{@post.rating}"), class: "post-tooltip-rating post-tooltip-info" %>
|
||||
<%= link_to "#{@post.image_width}x#{@post.image_height}", @post.file_url, class: "post-tooltip-dimensions post-tooltip-info" %>
|
||||
|
||||
<%= link_to "#", class: "post-tooltip-disable", title: "Disable enhanced tooltips" do %>
|
||||
<i class="fas fa-times-circle"></i>
|
||||
<% end %>
|
||||
<span class="post-tooltip-score post-tooltip-info">
|
||||
<span><%= @post.score %></span>
|
||||
<i class="far fa-thumbs-up fa-xs"></i>
|
||||
</span>
|
||||
|
||||
<% if @post.last_commented_at.present? %>
|
||||
<span class="post-tooltip-comments post-tooltip-info">
|
||||
<span><%= @post.comments.count %></span>
|
||||
<i class="far fa-comments fa-xs"></i>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<%= link_to posts_path(tags: "date:#{@post.created_at.strftime("%Y-%m-%d")}"), class: "post-tooltip-date post-tooltip-info" do %>
|
||||
<%= time_ago_in_words_tagged(@post.created_at, compact: true) %> ago
|
||||
<% end %>
|
||||
|
||||
<% if @post.source_domain.present? %>
|
||||
<%= link_to @post.source_domain, @post.normalized_source, class: "post-tooltip-source post-tooltip-info" %>
|
||||
<% else %>
|
||||
<%= link_to "no source", posts_path(tags: "source:none"), class: "post-tooltip-source post-tooltip-info" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "#{@post.rating.upcase}", posts_path(tags: "rating:#{@post.pretty_rating}"), class: "post-tooltip-rating post-tooltip-info" %>
|
||||
<%= link_to "#{@post.image_width}x#{@post.image_height}", @post.file_url, class: "post-tooltip-dimensions post-tooltip-info" %>
|
||||
|
||||
<%= link_to "#", class: "post-tooltip-disable", title: "Disable enhanced tooltips" do %>
|
||||
<i class="fas fa-times-circle"></i>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="post-tooltip-body <%= "has-preview" if params[:preview].truthy? %>">
|
||||
|
||||
Reference in New Issue
Block a user