logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

frontend_switcher_controller.ex (588B)


  1. defmodule Pleroma.Web.FrontendSwitcher.FrontendSwitcherController do
  2. use Pleroma.Web, :controller
  3. alias Pleroma.Config
  4. @doc "GET /frontend_switcher"
  5. def switch(conn, _params) do
  6. pickable = Config.get([:frontends, :pickable], [])
  7. conn
  8. |> put_view(Pleroma.Web.FrontendSwitcher.FrontendSwitcherView)
  9. |> render("switch.html", choices: pickable)
  10. end
  11. @doc "POST /frontend_switcher"
  12. def do_switch(conn, params) do
  13. conn
  14. |> put_resp_cookie("preferred_frontend", params["frontend"])
  15. |> html(~s(<meta http-equiv="refresh" content="0; url=/">))
  16. end
  17. end