Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ config :admin, :base_host, "localhost:3114"
# While testing, it was discovered that requests made from Elixir could not reach the vite proxy.
#
# In the future, if we change the setup and the entity that handles the "domain" in local dev is able to forward the requests to the backend correctly, this can be removed
config :admin, :backend_origin, "http://localhost:3001"
config :admin, :umami_origin, "http://localhost:8000"
config :admin, backend_origin: "http://localhost:3001"
config :admin, client_origin: "http://localhost:3114"
config :admin, umami_origin: "http://localhost:8000"
config :admin, library_origin: "http://localhost:3005"

# Publication index (development defaults)
config :admin, :publication_reindex_headers, [{"meilisearch-rebuild", "secret"}]
Expand Down
2 changes: 2 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ if config_env() == :prod do
# In production these configs have the same value.
config :admin, base_host: base_host
config :admin, backend_origin: "https://#{base_host}"
config :admin, client_origin: "https://#{base_host}"
config :admin, umami_origin: "https://umami.#{base_host}"
config :admin, library_origin: "https://library.#{base_host}"

# Get the value of the header secret to communicate with Meilisearch
config :admin, :publication_reindex_headers, [
Expand Down
2 changes: 2 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ config :admin, :umami,
username: "test",
password: "testest"

config :admin, :base_host, "graasp.org"
config :admin, :library_origin, "https://library.graasp.org"
config :admin, :umami_origin, "http://localhost:8000"
config :admin, :umami_req_options, plug: {Req.Test, Admin.UmamiApi}, retry: false
3 changes: 2 additions & 1 deletion lib/admin/platforms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ defmodule Admin.Platforms do
"""

defp base_host, do: Application.get_env(:admin, :base_host)
defp library_host, do: Application.get_env(:admin, :library_origin)

def get_url(:library, item_id) do
"https://library.#{base_host()}/collections/#{item_id}"
"#{library_host()}/collections/#{item_id}"
end

def get_url(:player, root_id), do: get_url(:player, root_id, root_id)
Expand Down
18 changes: 9 additions & 9 deletions lib/admin_web/components/layouts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ defmodule AdminWeb.Layouts do
def landing_menu(assigns) do
~H"""
<div class="navbar bg-base-100 shadow-xl shadow-xl/30">
<div class="w-full flex flex-row lg:max-w-screen-xl lg:mx-auto ">
<div class="w-full flex flex-row lg:max-w-screen-xl lg:mx-auto gap-4">
<div class="navbar-start w-fit">
<div class="dropdown">
<.burger_menu />
Expand All @@ -304,7 +304,7 @@ defmodule AdminWeb.Layouts do
class="menu menu-sm dropdown-content bg-base-100 rounded-box z-1 mt-3 w-52 p-2 shadow"
>
<li>
<.link navigate="/library">{gettext("Library")}</.link>
<.link navigate={~p"/library"}>{gettext("Library")}</.link>
</li>
<li>
<.link navigate={~p"/blog"}>{gettext("Blog")}</.link>
Expand All @@ -326,7 +326,7 @@ defmodule AdminWeb.Layouts do
{gettext("Get started")}
</.link>
<% else %>
<.link class="btn btn-soft" href="/auth/login">
<.link class="btn btn-soft" navigate={~p"/auth/login"}>
{gettext("Log in")}
</.link>
<% end %>
Expand All @@ -340,13 +340,13 @@ defmodule AdminWeb.Layouts do
</div>
<div class="navbar-center hidden lg:flex">
<ul class="menu menu-horizontal px-1">
<li><.link navigate="/library">{gettext("Library")}</.link></li>
<li><.link navigate={~p"/blog"}>{gettext("Blog")}</.link></li>
<li><.link navigate={~p"/about-us"}>{gettext("About")}</.link></li>
<li><.link navigate={~p"/contact"}>{gettext("Contact")}</.link></li>
<li><.link class="text-primary" navigate={~p"/library"}>{gettext("Library")}</.link></li>
<li><.link class="text-primary" navigate={~p"/blog"}>{gettext("Blog")}</.link></li>
<li><.link class="text-primary" navigate={~p"/about-us"}>{gettext("About")}</.link></li>
<li><.link class="text-primary" navigate={~p"/contact"}>{gettext("Contact")}</.link></li>
<%= if @current_scope do %>
<li>
<.link navigate={~p"/admin/dashboard"}>{gettext("Admin")}</.link>
<.link class="text-primary" navigate={~p"/admin/dashboard"}>{gettext("Admin")}</.link>
</li>
<% end %>
</ul>
Expand All @@ -358,7 +358,7 @@ defmodule AdminWeb.Layouts do
{gettext("Get started")}
</.link>
<% else %>
<.link class="btn btn-primary" href="/auth/login">
<.link class="btn btn-accent" navigate={~p"/auth/login"}>
{gettext("Log in")}
</.link>
<% end %>
Expand Down
5 changes: 4 additions & 1 deletion lib/admin_web/controllers/landing_html.ex
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,10 @@ defmodule AdminWeb.LandingHTML do

def social_card(assigns) do
~H"""
<a class="flex flex-col items-center bg-base-100 p-4 rounded-lg gap-2" href={@href}>
<a
class="flex flex-col items-center bg-base-100 p-4 rounded-lg gap-2 hover:shadow-md"
href={@href}
>
<.icon name={@icon} class="size-6 text-primary" /> {@name}
</a>
"""
Expand Down
11 changes: 11 additions & 0 deletions lib/admin_web/controllers/redirection_controller.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule AdminWeb.RedirectionController do
use AdminWeb, :controller

def library(conn, _params) do
redirect(conn, external: Application.get_env(:admin, :library_origin))
end

def login(conn, _params) do
redirect(conn, external: "#{Application.get_env(:admin, :client_origin)}/auth/login")
end
end
3 changes: 3 additions & 0 deletions lib/admin_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ defmodule AdminWeb.Router do
delete "/locale", LandingController, :remove_locale

generate_localized_routes()
# redirections for now
get "/library", RedirectionController, :library
get "/auth/login", RedirectionController, :login
end

scope "/admin", AdminWeb do
Expand Down
30 changes: 15 additions & 15 deletions priv/gettext/de/LC_MESSAGES/landing.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,67 +21,67 @@ msgstr ""
msgid "Your Learning Experience Platform"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:483
#: lib/admin_web/controllers/landing_html.ex:486
#, elixir-autogen, elixir-format
msgid "About Us"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:492
#: lib/admin_web/controllers/landing_html.ex:495
#, elixir-autogen, elixir-format
msgid "Blog"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:477
#: lib/admin_web/controllers/landing_html.ex:480
#, elixir-autogen, elixir-format
msgid "Content"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:473
#: lib/admin_web/controllers/landing_html.ex:476
#, elixir-autogen, elixir-format
msgid "Developed in Switzerland by the Graasp association"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:561
#: lib/admin_web/controllers/landing_html.ex:564
#, elixir-autogen, elixir-format
msgid "Disclaimer"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:479
#: lib/admin_web/controllers/landing_html.ex:482
#, elixir-autogen, elixir-format
msgid "Home"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:592
#: lib/admin_web/controllers/landing_html.ex:595
#, elixir-autogen, elixir-format
msgid "Idea illustrations by Storyset"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:553
#: lib/admin_web/controllers/landing_html.ex:556
#, elixir-autogen, elixir-format
msgid "Other"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:495
#: lib/admin_web/controllers/landing_html.ex:498
#, elixir-autogen, elixir-format
msgid "Partners"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:558
#: lib/admin_web/controllers/landing_html.ex:561
#, elixir-autogen, elixir-format
msgid "Privacy Policy"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:533
#: lib/admin_web/controllers/landing_html.ex:536
#, elixir-autogen, elixir-format
msgid "Social Media"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:486
#: lib/admin_web/controllers/landing_html.ex:489
#, elixir-autogen, elixir-format
msgid "Support"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:555
#: lib/admin_web/controllers/landing_html.ex:558
#, elixir-autogen, elixir-format
msgid "Terms of Use"
msgstr ""
Expand Down Expand Up @@ -432,12 +432,12 @@ msgstr ""
msgid "With Graasp, you can easily bring your teaching materials online, turning images, PDFs, and traditional resources into interactive digital lessons in minutes."
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:451
#: lib/admin_web/controllers/landing_html.ex:454
#, elixir-autogen, elixir-format
msgid "View the website of %{institution}, one of our supporting entities"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:489
#: lib/admin_web/controllers/landing_html.ex:492
#, elixir-autogen, elixir-format, fuzzy
msgctxt "footer link"
msgid "Contact Us"
Expand Down
30 changes: 15 additions & 15 deletions priv/gettext/en/LC_MESSAGES/landing.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,67 +21,67 @@ msgstr ""
msgid "Your Learning Experience Platform"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:483
#: lib/admin_web/controllers/landing_html.ex:486
#, elixir-autogen, elixir-format
msgid "About Us"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:492
#: lib/admin_web/controllers/landing_html.ex:495
#, elixir-autogen, elixir-format
msgid "Blog"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:477
#: lib/admin_web/controllers/landing_html.ex:480
#, elixir-autogen, elixir-format
msgid "Content"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:473
#: lib/admin_web/controllers/landing_html.ex:476
#, elixir-autogen, elixir-format
msgid "Developed in Switzerland by the Graasp association"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:561
#: lib/admin_web/controllers/landing_html.ex:564
#, elixir-autogen, elixir-format
msgid "Disclaimer"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:479
#: lib/admin_web/controllers/landing_html.ex:482
#, elixir-autogen, elixir-format
msgid "Home"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:592
#: lib/admin_web/controllers/landing_html.ex:595
#, elixir-autogen, elixir-format
msgid "Idea illustrations by Storyset"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:553
#: lib/admin_web/controllers/landing_html.ex:556
#, elixir-autogen, elixir-format
msgid "Other"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:495
#: lib/admin_web/controllers/landing_html.ex:498
#, elixir-autogen, elixir-format
msgid "Partners"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:558
#: lib/admin_web/controllers/landing_html.ex:561
#, elixir-autogen, elixir-format
msgid "Privacy Policy"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:533
#: lib/admin_web/controllers/landing_html.ex:536
#, elixir-autogen, elixir-format
msgid "Social Media"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:486
#: lib/admin_web/controllers/landing_html.ex:489
#, elixir-autogen, elixir-format
msgid "Support"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:555
#: lib/admin_web/controllers/landing_html.ex:558
#, elixir-autogen, elixir-format
msgid "Terms of Use"
msgstr ""
Expand Down Expand Up @@ -432,12 +432,12 @@ msgstr ""
msgid "With Graasp, you can easily bring your teaching materials online, turning images, PDFs, and traditional resources into interactive digital lessons in minutes."
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:451
#: lib/admin_web/controllers/landing_html.ex:454
#, elixir-autogen, elixir-format
msgid "View the website of %{institution}, one of our supporting entities"
msgstr ""

#: lib/admin_web/controllers/landing_html.ex:489
#: lib/admin_web/controllers/landing_html.ex:492
#, elixir-autogen, elixir-format, fuzzy
msgctxt "footer link"
msgid "Contact Us"
Expand Down
Loading
Loading