Make analytics show on all posts and add other details (#1118)
This commit is contained in:
parent
61173bede1
commit
2022d45fb1
4 changed files with 46 additions and 9 deletions
|
|
@ -199,7 +199,7 @@
|
|||
margin-bottom:calc(-1px - 0.6vw);
|
||||
display: flex;
|
||||
.article-organization-headline-inner {
|
||||
background: darken($light-gray, 7%);
|
||||
background: darken($light-gray, 6%);
|
||||
color: $black;
|
||||
padding: 6px 12px;
|
||||
border-radius: 100px;
|
||||
|
|
|
|||
|
|
@ -132,6 +132,25 @@
|
|||
border-radius:3px;
|
||||
position:relative;
|
||||
background: white;
|
||||
&.single-article-unpublished {
|
||||
background: lighten($yellow, 20%);
|
||||
}
|
||||
.dashboard-collection-org-details {
|
||||
.dashboard-top-pill {
|
||||
background: darken($light-gray, 6%);
|
||||
margin-right: 5px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 100px;
|
||||
margin-top: 10px;
|
||||
display: inline-block;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
}
|
||||
.dashboard-meta-details{
|
||||
font-size: 0.85em;
|
||||
padding: 3px 0px 6px;
|
||||
color: $medium-gray;
|
||||
}
|
||||
a{
|
||||
color: $black;
|
||||
&.block-link{
|
||||
|
|
@ -165,18 +184,20 @@
|
|||
color:rgb(67, 78, 87);
|
||||
}
|
||||
.dashboard-actions{
|
||||
padding: 5px 0px;
|
||||
padding: 7px 0px 10px;
|
||||
}
|
||||
.pill{
|
||||
background:$bold-blue;
|
||||
padding:2px 14px;
|
||||
border-radius:3px;
|
||||
padding:4px 20px;
|
||||
border-radius:100px;
|
||||
color:white;
|
||||
margin-right:5px;
|
||||
font-size:13px;
|
||||
font-size:14px;
|
||||
border: 2px solid transparent;
|
||||
&.yellow{
|
||||
background:$yellow;
|
||||
color:$black;
|
||||
border: 2px solid $black;
|
||||
}
|
||||
&.green{
|
||||
background: $green;
|
||||
|
|
|
|||
|
|
@ -27,4 +27,4 @@ class DashboardsController < ApplicationController
|
|||
# Updates analytics in background if appropriate:
|
||||
ArticleAnalyticsFetcher.new.delay.update_analytics(current_user.id) if @articles
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,12 +1,28 @@
|
|||
<div class="single-article">
|
||||
<div class="single-article <%= "single-article-unpublished" unless article.published %>">
|
||||
<div class="dashboard-collection-org-details">
|
||||
<% if article.organization_id %>
|
||||
<span class="dashboard-top-pill"><%= article.organization&.name %></span>
|
||||
<% end %>
|
||||
<% if article.collection_id %>
|
||||
<span class="dashboard-top-pill"><strong>Series:</strong> <%= article.series %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<a href="<%= article.current_state_path %>"><h2><%= article.title %></h2></a>
|
||||
<div class="dashboard-meta-details">
|
||||
<% if article.published %>
|
||||
<%= article.readable_publish_date %>
|
||||
<% article.cached_tag_list_array.each do |tag| %>
|
||||
#<%= tag %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="dashboard-actions">
|
||||
<% if !article.published %>
|
||||
<span class="pill cta yellow">DRAFT</span>
|
||||
<a href="<%= article.current_state_path %>" class="pill cta yellow">DRAFT</a>
|
||||
<% end %>
|
||||
<a href="<%= article.path %>/edit" class="pill cta green">EDIT</a>
|
||||
<a href="<%= article.path %>/delete_confirm" data-no-instant class="cta pill black">DELETE</a>
|
||||
<% if article.published && current_user.can_view_analytics? %>
|
||||
<% if article.published %>
|
||||
<span id="pageviews-<%= article.id %>" class="cta pill dashboard-pageviews-indicator" data-analytics-pageviews data-article-id="<%= article.id %>">
|
||||
<%= article.page_views_count > 100 ? article.page_views_count : "under 100" %> views // <%= article.positive_reactions_count %> reactions // <%= article.comments_count %> comments
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue