aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/templates/frontend/static
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/templates/frontend/static')
-rw-r--r--lib/pleroma/web/templates/frontend/static/_attachment.html.eex8
-rw-r--r--lib/pleroma/web/templates/frontend/static/_notice.html.eex41
-rw-r--r--lib/pleroma/web/templates/frontend/static/_user_card.html.eex11
-rw-r--r--lib/pleroma/web/templates/frontend/static/conversation.html.eex11
-rw-r--r--lib/pleroma/web/templates/frontend/static/error.html.eex7
-rw-r--r--lib/pleroma/web/templates/frontend/static/profile.html.eex31
6 files changed, 109 insertions, 0 deletions
diff --git a/lib/pleroma/web/templates/frontend/static/_attachment.html.eex b/lib/pleroma/web/templates/frontend/static/_attachment.html.eex
new file mode 100644
index 000000000..4853e7f4b
--- /dev/null
+++ b/lib/pleroma/web/templates/frontend/static/_attachment.html.eex
@@ -0,0 +1,8 @@
+<%= case @mediaType do %>
+<% "audio" -> %>
+<audio class="u-audio" src="<%= @url %>" controls="controls"></audio>
+<% "video" -> %>
+<video class="u-video" src="<%= @url %>" controls="controls"></video>
+<% _ -> %>
+<img class="u-photo" src="<%= @url %>" alt="<%= @name %>" title="<%= @name %>">
+<% end %>
diff --git a/lib/pleroma/web/templates/frontend/static/_notice.html.eex b/lib/pleroma/web/templates/frontend/static/_notice.html.eex
new file mode 100644
index 000000000..07c80d72b
--- /dev/null
+++ b/lib/pleroma/web/templates/frontend/static/_notice.html.eex
@@ -0,0 +1,41 @@
+<div class="activity h-entry" <%= if @selected do %> id="selected" <% end %>>
+ <p class="pull-right">
+ <a class="activity-link u-url u-uid" href="<%= @link %>">
+ <time class="dt-published" datetime="<%= @published %>">
+ <%= format_date(@published) %>
+ </time>
+ </a>
+ </p>
+ <%= render("_user_card.html", %{user: @user}) %>
+ <div class="activity-content">
+ <%= if @title != "" do %>
+ <details <%= if open_content?() do %>open<% end %>>
+ <summary class="p-name"><%= raw @title %></summary>
+ <div class="e-content"><%= raw @content %></div>
+ </details>
+ <% else %>
+ <div class="e-content"><%= raw @content %></div>
+ <% end %>
+ <%= for %{"name" => name, "url" => [url | _]} <- @attachment do %>
+ <%= if @sensitive do %>
+ <details class="nsfw">
+ <summary><%= gettext("sensitive media") %></summary>
+ <div>
+ <%= render("_attachment.html", %{name: name, url: url["href"],
+ mediaType: fetch_media_type(url)}) %>
+ </div>
+ </details>
+ <% else %>
+ <%= render("_attachment.html", %{name: name, url: url["href"],
+ mediaType: fetch_media_type(url)}) %>
+ <% end %>
+ <% end %>
+ </div>
+ <%= if @selected do %>
+ <dl class="counts">
+ <dt><%= gettext("replies") %></dt><dd><%= @counts.replies %></dd>
+ <dt><%= gettext("announces") %></dt><dd><%= @counts.announces %></dd>
+ <dt><%= gettext("likes") %></dt><dd><%= @counts.likes %></dd>
+ </dl>
+ <% end %>
+</div>
diff --git a/lib/pleroma/web/templates/frontend/static/_user_card.html.eex b/lib/pleroma/web/templates/frontend/static/_user_card.html.eex
new file mode 100644
index 000000000..977b894d3
--- /dev/null
+++ b/lib/pleroma/web/templates/frontend/static/_user_card.html.eex
@@ -0,0 +1,11 @@
+<div class="p-author h-card">
+ <a class="u-url" rel="author noopener" href="<%= (@user.uri || @user.ap_id) %>">
+ <div class="avatar">
+ <img class="u-photo" src="<%= User.avatar_url(@user) |> MediaProxy.url %>" width="48" height="48" alt="">
+ </div>
+ <span class="display-name">
+ <bdi class="p-name"><%= raw Formatter.emojify(@user.name, @user.emoji) %></bdi>
+ <span class="nickname"><%= @user.nickname %></span>
+ </span>
+ </a>
+</div>
diff --git a/lib/pleroma/web/templates/frontend/static/conversation.html.eex b/lib/pleroma/web/templates/frontend/static/conversation.html.eex
new file mode 100644
index 000000000..2acd84828
--- /dev/null
+++ b/lib/pleroma/web/templates/frontend/static/conversation.html.eex
@@ -0,0 +1,11 @@
+<header>
+ <h1><%= link instance_name(), to: "/" %></h1>
+</header>
+
+<main>
+ <div class="conversation">
+ <%= for activity <- @activities do %>
+ <%= render("_notice.html", activity) %>
+ <% end %>
+ </div>
+</main>
diff --git a/lib/pleroma/web/templates/frontend/static/error.html.eex b/lib/pleroma/web/templates/frontend/static/error.html.eex
new file mode 100644
index 000000000..d98a1eba7
--- /dev/null
+++ b/lib/pleroma/web/templates/frontend/static/error.html.eex
@@ -0,0 +1,7 @@
+<header>
+ <h1><%= gettext("Oops") %></h1>
+</header>
+
+<main>
+ <p><%= @message %></p>
+</main>
diff --git a/lib/pleroma/web/templates/frontend/static/profile.html.eex b/lib/pleroma/web/templates/frontend/static/profile.html.eex
new file mode 100644
index 000000000..1690c5edf
--- /dev/null
+++ b/lib/pleroma/web/templates/frontend/static/profile.html.eex
@@ -0,0 +1,31 @@
+<header>
+ <h1><%= link instance_name(), to: "/" %></h1>
+
+ <h3>
+ <form class="pull-right collapse" method="POST" action="<%= util_path(@conn, :remote_subscribe) %>">
+ <input type="hidden" name="nickname" value="<%= @user.nickname %>">
+ <input type="hidden" name="profile" value="">
+ <button type="submit" class="collapse">Remote follow</button>
+ </form>
+ <%= raw Pleroma.Emoji.Formatter.emojify(@user.name, @user.emoji) %> |
+ <%= link "@#{@user.nickname}@#{Endpoint.host()}", to: (@user.uri || @user.ap_id) %>
+ </h3>
+ <p><%= raw @user.bio %></p>
+</header>
+
+<main>
+ <div class="activity-stream">
+ <%= for activity <- @timeline do %>
+ <%= render("_notice.html", Map.put(activity, :selected, false)) %>
+ <% end %>
+ <p id="pagination">
+ <%= if @prev_page_id do %>
+ <%= link "«", to: "?min_id=" <> @prev_page_id %>
+ <% end %>
+ <%= if @prev_page_id && @next_page_id, do: " | " %>
+ <%= if @next_page_id do %>
+ <%= link "»", to: "?max_id=" <> @next_page_id %>
+ <% end %>
+ </p>
+ </div>
+</main>