Skip to content

Commit

Permalink
✅ Primitively display mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdawkins committed Feb 17, 2019
1 parent c6c2655 commit c8ac035
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/jobs/fetch_mention_content_job.rb
Expand Up @@ -10,7 +10,7 @@ def perform(mention)

mention.update(
title: collection.entry.try("name"),
content: collection.entry.try("content").try("value")
content: collection.entry.try("content").to_hash[:value]
)
end
end
18 changes: 18 additions & 0 deletions app/views/mentions/_mention.html.erb
@@ -0,0 +1,18 @@
<article class="h-entry post post--mention">
<%= link_to mention.source, class: "u-url quiet" do %>
<time class="block-time dt-published" datetime="<%= mention.created_at.strftime('%Y-%m-%dT%H:%M:%S.%L%z') %>">
<% if mention.created_at.today? %>
<%= time_ago_in_words(mention.created_at) %> ago
<span style="font-weight: normal; margin-left: 1em;"><%= mention.created_at.strftime("%R") %></span>
<% else %>
<%= mention.created_at.strftime("%a %-d %b %Y %R %Z") %>
<% end %>
</time>
<% end %>
<% unless mention.title.blank? %>
<h3><%= mention.title %></h3>
<% end %>
<p class="p-name e-content"><%= mention.content %></p>
<a class="u-author" href="/"></a>
</article>

4 changes: 4 additions & 0 deletions app/views/notes/show.html.erb
@@ -1 +1,5 @@
<%= render @post, as: :note %>
<% if @post.mentions.any? %>
<h3>Mentions</h3>
<%= render @post.mentions %>
<% end %>

0 comments on commit c8ac035

Please sign in to comment.