css: factor out recent posts component.
This commit is contained in:
9
app/javascript/src/styles/common/recent_posts.scss
Normal file
9
app/javascript/src/styles/common/recent_posts.scss
Normal file
@@ -0,0 +1,9 @@
|
||||
/* A small set of recent posts. Used for recent uploads and favorites on user
|
||||
* profile pages, and recent posts on artist and wiki pages. */
|
||||
div.recent-posts {
|
||||
margin-bottom: 1rem;
|
||||
|
||||
h2.recent-posts-header {
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
div#c-users {
|
||||
div#a-show {
|
||||
div.box {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
table.user-statistics {
|
||||
th {
|
||||
width: 15%;
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
|
||||
<% if @artist.tag.present? && @artist.tag.post_count > 0 %>
|
||||
<div class="recent-posts">
|
||||
<h2>Recent Posts <%= link_to "»", posts_path(tags: @artist.name) %></h2>
|
||||
<h2 class="recent-posts-header">
|
||||
<%= link_to "Posts", posts_path(tags: @artist.name) %>
|
||||
</h2>
|
||||
|
||||
<%= render "posts/partials/common/inline_blacklist" %>
|
||||
|
||||
<div>
|
||||
<div class="recent-posts-previews">
|
||||
<%= post_previews_html(@artist.tag.posts.limit(8), tags: @artist.name) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,36 +1,21 @@
|
||||
<% if presenter.has_uploads? %>
|
||||
<div class="box user-uploads">
|
||||
<h2>
|
||||
<%= link_to "Uploads", posts_path(:tags => "user:#{user.name}") %>
|
||||
<div class="user-uploads recent-posts">
|
||||
<h2 class="recent-posts-header">
|
||||
<%= link_to "Uploads", posts_path(tags: "user:#{user.name}") %>
|
||||
</h2>
|
||||
<div>
|
||||
<div class="recent-posts-previews">
|
||||
<%= post_previews_html(presenter.uploads, tags: "user:#{user.name}") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if presenter.has_favorites? && policy(user).can_see_favorites? %>
|
||||
<div class="box user-favorites">
|
||||
<h2>
|
||||
<div class="user-favorites recent-posts">
|
||||
<h2 class="recent-posts-header">
|
||||
<%= link_to "Favorites", posts_path(tags: "ordfav:#{user.name}") %>
|
||||
</h2>
|
||||
<div>
|
||||
<div class="recent-posts-previews">
|
||||
<%= post_previews_html(presenter.favorites, tags: "ordfav:#{user.name}") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if false %>
|
||||
<% presenter.saved_search_labels.each do |label| %>
|
||||
<div class="box user-saved-search" data-label="<%= label %>">
|
||||
<h2>
|
||||
Saved Search: <%= link_to label, posts_path(:tags => "search:#{label}") %>
|
||||
(<%= link_to "manage", saved_searches_path(label: label) %>)
|
||||
</h2>
|
||||
|
||||
<div class="box">
|
||||
<%= post_previews_html(presenter.posts_for_saved_search_category, tags: "search:#{label}") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<% if wiki_page.tag.present? && !wiki_page.tag.empty? %>
|
||||
<div id="wiki-page-posts">
|
||||
<h2>Recent Posts <%= link_to "»", posts_path(tags: wiki_page.title) %></h2>
|
||||
<div class="recent-posts">
|
||||
<h2 class="recent-posts-header">
|
||||
<%= link_to "Posts", posts_path(tags: wiki_page.title) %>
|
||||
</h2>
|
||||
|
||||
<%= post_previews_html(wiki_page.tag.posts.limit(8), tags: wiki_page.title) %>
|
||||
<div class="recent-posts-previews">
|
||||
<%= post_previews_html(wiki_page.tag.posts.limit(8), tags: wiki_page.title) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user