aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/templates/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/templates/frontend')
-rw-r--r--lib/pleroma/web/templates/frontend/mastodon/index.html.eex35
-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
7 files changed, 144 insertions, 0 deletions
diff --git a/lib/pleroma/web/templates/frontend/mastodon/index.html.eex b/lib/pleroma/web/templates/frontend/mastodon/index.html.eex
new file mode 100644
index 000000000..22f3f3b5a
--- /dev/null
+++ b/lib/pleroma/web/templates/frontend/mastodon/index.html.eex
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang='en'>
+<head>
+<meta charset='utf-8'>
+<meta content='width=device-width, initial-scale=1' name='viewport'>
+<title>
+<%= Config.get([:instance, :name]) %>
+</title>
+<link rel="icon" type="image/png" href="favicon.png"/>
+<link rel="manifest" type="applicaton/manifest+json" href="<%= frontend_mastodon_path(Pleroma.Web.Endpoint, :manifest) %>" />
+
+<meta name="theme-color" content="<%= Config.get([:manifest, :theme_color]) %>" />
+
+<script crossorigin='anonymous' src="/packs/locales.js"></script>
+<script crossorigin='anonymous' src="/packs/locales/glitch/en.js"></script>
+
+<link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/getting_started.js'>
+<link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/compose.js'>
+<link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/home_timeline.js'>
+<link rel='preload' as='script' crossorigin='anonymous' href='/packs/features/notifications.js'>
+<script id='initial-state' type='application/json'><%= initial_state(@token, @user, @custom_emojis) %></script>
+
+<script src="/packs/core/common.js"></script>
+<link rel="stylesheet" media="all" href="/packs/core/common.css" />
+
+<script src="/packs/flavours/glitch/common.js"></script>
+<link rel="stylesheet" media="all" href="/packs/flavours/glitch/common.css" />
+
+<script src="/packs/flavours/glitch/home.js"></script>
+</head>
+<body class='app-body no-reduce-motion system-font'>
+ <div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'>
+ </div>
+</body>
+</html>
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>