clacks/lib/clacks_web/templates/frontend/notifications.html.eex

36 lines
1.5 KiB
Elixir

<h1>Notifications</h1>
<% newer = prev_page_path(@conn, @notifications) %>
<%= if newer do %>
<p class="pagination-link">
<a href="<%= newer %>">Newer</a>
</p>
<% end %>
<ul class="notifications-list">
<%= for notification <- @notifications do %>
<li>
<%= case notification do %>
<% {:like, like_activity, actor, original_activity} -> %>
<%= render "_action_status.html", class: "notification", conn: @conn, action: :like, action_activity: like_activity, action_actor: actor, original_activity: original_activity, original_note: original_activity.data["object"], original_actor: @current_user.actor %>
<% {:announce, announce_activity, actor, original_activity} -> %>
<%= render "_action_status.html", class: "notification", conn: @conn, action: :announce, action_activity: announce_activity, action_actor: actor, original_activity: original_activity, original_note: original_activity.data["object"], original_actor: @current_user.actor %>
<% {:mention, mention_activity, actor, _} -> %>
<%= render "_status.html", class: "notification", conn: @conn, author: actor, status: mention_activity, note: mention_activity.data["object"] %>
<% {:follow, follow_activity, actor, _} -> %>
<%= render "_follow_notification.html", activity: follow_activity, actor: actor %>
<% end %>
</li>
<% end %>
</ul>
<% older = next_page_path(@conn, @notifications) %>
<%= if older do %>
<p class="pagination-link">
<a href="<%= older %>">Older</a>
</p>
<% end %>