From 3a4773c3c2bd0bbef244eb519b07208da9108e49 Mon Sep 17 00:00:00 2001 From: dcc Date: Sat, 2 Sep 2023 00:52:52 -0700 Subject: First --- lib/pleroma/web/twitter_api/views/util_view.ex | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/pleroma/web/twitter_api/views/util_view.ex (limited to 'lib/pleroma/web/twitter_api/views/util_view.ex') diff --git a/lib/pleroma/web/twitter_api/views/util_view.ex b/lib/pleroma/web/twitter_api/views/util_view.ex new file mode 100644 index 0000000..31b7c0c --- /dev/null +++ b/lib/pleroma/web/twitter_api/views/util_view.ex @@ -0,0 +1,31 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.TwitterAPI.UtilView do + use Pleroma.Web, :view + import Phoenix.HTML + import Phoenix.HTML.Form + import Phoenix.HTML.Link + alias Pleroma.Config + alias Pleroma.Web.Endpoint + alias Pleroma.Web.Gettext + + def status_net_config(instance) do + """ + + + #{Keyword.get(instance, :name)} + #{Endpoint.url()} + #{Keyword.get(instance, :limit)} + #{!Keyword.get(instance, :registrations_open)} + + + """ + end + + def render("frontend_configurations.json", _) do + Config.get(:frontend_configurations, %{}) + |> Enum.into(%{}) + end +end -- cgit v1.2.3