Add header to profile/notice pages linking to pleroma-fe.
authorPhil Hagelberg <phil@hagelb.org>
Wed, 30 Oct 2019 03:55:43 +0000 (20:55 -0700)
committerPhil Hagelberg <phil@hagelb.org>
Sun, 10 Nov 2019 02:07:50 +0000 (18:07 -0800)
lib/pleroma/web/static_fe/static_fe_controller.ex
lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex
lib/pleroma/web/templates/static_fe/static_fe/_user_card.html.eex [moved from lib/pleroma/web/templates/static_fe/static_fe/user_card.html.eex with 100% similarity]
lib/pleroma/web/templates/static_fe/static_fe/conversation.html.eex
lib/pleroma/web/templates/static_fe/static_fe/profile.html.eex

index a5cb761674c5f7db4fee703874b3dc546d5cfa88..fe2fb09c4d878405f14ef43c844c09699854e41d 100644 (file)
@@ -43,6 +43,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
   end
 
   def show_notice(%{assigns: %{notice_id: notice_id}} = conn, _params) do
+    instance_name = Pleroma.Config.get([:instance, :name], "Pleroma")
     activity = Activity.get_by_id_with_object(notice_id)
     context = activity.object.data["context"]
     activities = ActivityPub.fetch_activities_for_context(context, %{})
@@ -52,10 +53,11 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
         represent(activity, a.object.id == activity.object.id)
       end
 
-    render(conn, "conversation.html", activities: represented)
+    render(conn, "conversation.html", %{activities: represented, instance_name: instance_name})
   end
 
   def show_user(%{assigns: %{username_or_id: username_or_id}} = conn, _params) do
+    instance_name = Pleroma.Config.get([:instance, :name], "Pleroma")
     %User{} = user = User.get_cached_by_nickname_or_id(username_or_id)
 
     timeline =
@@ -63,7 +65,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
         represent(activity, user, false)
       end
 
-    render(conn, "profile.html", %{user: user, timeline: timeline})
+    render(conn, "profile.html", %{user: user, timeline: timeline, instance_name: instance_name})
   end
 
   def assign_id(%{path_info: ["notice", notice_id]} = conn, _opts),
index b16d19a2c183d824de5f36a91c4321bcf94ddfbf..d1daa281c5c8eb92818331aa31fdfedc4007e072 100644 (file)
@@ -2,7 +2,7 @@
   <p class="pull-right">
     <%= link @published, to: @link, class: "activity-link" %>
   </p>
-  <%= render("user_card.html", %{user: @user}) %>
+  <%= render("_user_card.html", %{user: @user}) %>
   <div class="activity-content">
     <%= if @title != "" do %>
       <details>
index f0d3b5972171e2fa6cb93c65a1c2b9750d25c269..3a1249df2e01ddf717ff31f20bd9a208aea8c9c9 100644 (file)
@@ -1,3 +1,5 @@
+<h1><%= link @instance_name, to: "/" %></h1>
+
 <div class="conversation">
   <%= for activity <- @activities do %>
     <%= render("_notice.html", activity) %>
index da23be1e5a8e285b305f54731cdd8e33b2970210..8f2c7462712f6a65ad98f7d68368363865eb9288 100644 (file)
@@ -1,11 +1,13 @@
-<h1>
+<h1><%= link @instance_name, to: "/" %></h1>
+
+<h3>
   <form class="pull-right collapse" method="POST" action="<%= Helpers.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 (@user.name |> Formatter.emojify(emoji_for_user(@user))) %>
-</h1>
+</h3>
 <p><%= raw @user.bio %></p>
 <div class="activity-stream">
   <%= for activity <- @timeline do %>