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

36 lines
1.7 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 %>
<% %{type: "like", activity: %{actor: like_actor} = like_activity, referenced_activity: original_activity} -> %>
<%= render "_action_status.html", class: "notification", conn: @conn, action: :like, action_activity: like_activity, action_actor: like_actor, original_activity: original_activity, original_note: original_activity.object.data, original_actor: @current_user.actor %>
<% %{type: "announce", activity: %{actor: announce_actor} = announce_activity, referenced_activity: original_activity} -> %>
<%= render "_action_status.html", class: "notification", conn: @conn, action: :announce, action_activity: announce_activity, action_actor: announce_actor, original_activity: original_activity, original_note: original_activity.object.data, original_actor: @current_user.actor %>
<% %{type: "mention", activity: mention_activity} -> %>
<%= render "_status.html", class: "notification", conn: @conn, author: mention_activity.actor, status: mention_activity, note: mention_activity.object.data %>
<% %{type: "follow", activity: follow_activity} -> %>
<%= render "_follow_notification.html", activity: follow_activity, actor: follow_activity.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 %>