diff --git a/.drone.yml b/.drone.yml index 1078fe8..a4ef025 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: docker -name: memex +name: memEx steps: - name: restore-cache diff --git a/lib/memex_web/components/topbar.ex b/lib/memex_web/components/topbar.ex index abaa8c7..b22db1f 100644 --- a/lib/memex_web/components/topbar.ex +++ b/lib/memex_web/components/topbar.ex @@ -20,7 +20,7 @@ defmodule MemexWeb.Components.Topbar do navigate={Routes.live_path(Endpoint, HomeLive)} class="mx-2 my-1 leading-5 text-xl text-primary-400 hover:underline" > - <%= gettext("memex") %> + <%= gettext("memEx") %> <%= if @title_content do %> diff --git a/lib/memex_web/live/faq_live.ex b/lib/memex_web/live/faq_live.ex new file mode 100644 index 0000000..4584a62 --- /dev/null +++ b/lib/memex_web/live/faq_live.ex @@ -0,0 +1,12 @@ +defmodule MemexWeb.FaqLive do + @moduledoc """ + Liveview for the faq page + """ + + use MemexWeb, :live_view + + @impl true + def mount(_params, _session, socket) do + {:ok, socket |> assign(page_title: gettext("faq"))} + end +end diff --git a/lib/memex_web/live/faq_live.html.heex b/lib/memex_web/live/faq_live.html.heex new file mode 100644 index 0000000..750e9b5 --- /dev/null +++ b/lib/memex_web/live/faq_live.html.heex @@ -0,0 +1,18 @@ +
+

+ <%= gettext("faq") %> +

+ +
+ + +
diff --git a/lib/memex_web/live/home_live.ex b/lib/memex_web/live/home_live.ex index 0cfbdd8..6c7ecfe 100644 --- a/lib/memex_web/live/home_live.ex +++ b/lib/memex_web/live/home_live.ex @@ -5,41 +5,11 @@ defmodule MemexWeb.HomeLive do use MemexWeb, :live_view alias Memex.Accounts + alias MemexWeb.{Endpoint, FaqLive} @impl true def mount(_params, _session, socket) do admins = Accounts.list_users_by_role(:admin) - {:ok, socket |> assign(page_title: gettext("home"), query: "", results: %{}, admins: admins)} - end - - @impl true - def handle_event("suggest", %{"q" => query}, socket) do - {:noreply, socket |> assign(results: search(query), query: query)} - end - - @impl true - def handle_event("search", %{"q" => query}, socket) do - case search(query) do - %{^query => vsn} -> - {:noreply, socket |> redirect(external: "https://hexdocs.pm/#{query}/#{vsn}")} - - _ -> - {:noreply, - socket - |> put_flash(:error, "No dependencies found matching \"#{query}\"") - |> assign(results: %{}, query: query)} - end - end - - defp search(query) do - if not MemexWeb.Endpoint.config(:code_reloader) do - raise "action disabled when not in development" - end - - for {app, desc, vsn} <- Application.started_applications(), - app = to_string(app), - String.starts_with?(app, query) and not List.starts_with?(desc, ~c"ERTS"), - into: %{}, - do: {app, vsn} + {:ok, socket |> assign(page_title: gettext("home"), admins: admins)} end end diff --git a/lib/memex_web/live/home_live.html.heex b/lib/memex_web/live/home_live.html.heex index 8628b60..9a8a4b2 100644 --- a/lib/memex_web/live/home_live.html.heex +++ b/lib/memex_web/live/home_live.html.heex @@ -1,13 +1,12 @@ -
-

- <%= gettext("memex") %> +
+

+ <%= gettext("memEx") %>


    -
  • +
  • <%= gettext("notes:") %> @@ -16,8 +15,7 @@

  • -
  • +
  • <%= gettext("contexts:") %> @@ -26,8 +24,7 @@

  • -
  • +
  • <%= gettext("pipelines:") %> @@ -35,6 +32,15 @@ <%= gettext("document your processes, attaching contexts to each step") %>

  • + +
  • + <.link + navigate={Routes.live_path(Endpoint, FaqLive)} + class="link title text-primary-400 text-lg" + > + <%= gettext("read more on how to use %{name}", name: "memEx") %> + +

@@ -44,8 +50,7 @@ <%= gettext("features") %>

-
  • +
  • <%= gettext("multi-user:") %> @@ -54,8 +59,7 @@

  • -
  • +
  • <%= gettext("privacy:") %> @@ -64,8 +68,7 @@

  • -
  • +
  • <%= gettext("convenient:") %> @@ -88,16 +91,13 @@

    <%= if @admins |> Enum.empty?() do %> - <.link - href={Routes.user_registration_path(MemexWeb.Endpoint, :new)} - class="hover:underline" - > - <%= dgettext("prompts", "register to setup %{name}", name: "memex") %> + <.link href={Routes.user_registration_path(Endpoint, :new)} class="link"> + <%= dgettext("prompts", "register to setup %{name}", name: "memEx") %> <% else %>

    <%= for admin <- @admins do %> - + <%= admin.email %> <% end %> @@ -109,7 +109,7 @@
  • <%= gettext("registration:") %>

    - <%= Application.get_env(:memex, MemexWeb.Endpoint)[:registration] + <%= Application.get_env(:memex, Endpoint)[:registration] |> case do "public" -> gettext("public signups") _ -> gettext("invite only") @@ -121,7 +121,7 @@ <%= gettext("version:") %> <.link href="https://gitea.bubbletea.dev/shibao/memex/src/branch/stable/CHANGELOG.md" - class="flex flex-row justify-center items-center space-x-2 hover:underline" + class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" > @@ -141,7 +141,7 @@

  • <.link href="https://gitea.bubbletea.dev/shibao/memex" - class="flex flex-row justify-center items-center space-x-2 hover:underline" + class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" > @@ -152,7 +152,7 @@
  • <.link href="https://weblate.bubbletea.dev/engage/memex" - class="flex flex-row justify-center items-center space-x-2 hover:underline" + class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" > @@ -163,7 +163,7 @@
  • <.link href="https://gitea.bubbletea.dev/shibao/memex/issues/new" - class="flex flex-row justify-center items-center space-x-2 hover:underline" + class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" > diff --git a/lib/memex_web/router.ex b/lib/memex_web/router.ex index 2c070fc..e8e795c 100644 --- a/lib/memex_web/router.ex +++ b/lib/memex_web/router.ex @@ -36,6 +36,7 @@ defmodule MemexWeb.Router do pipe_through :browser live "/", HomeLive + live "/faq", FaqLive end ## Authentication routes diff --git a/lib/memex_web/templates/layout/root.html.heex b/lib/memex_web/templates/layout/root.html.heex index 1862b7c..54e0da4 100644 --- a/lib/memex_web/templates/layout/root.html.heex +++ b/lib/memex_web/templates/layout/root.html.heex @@ -5,8 +5,8 @@ <%= csrf_meta_tag() %> - <.live_title suffix={" | #{gettext("memex")}"}> - <%= assigns[:page_title] || gettext("memex") %> + <.live_title suffix={" | #{gettext("memEx")}"}> + <%= assigns[:page_title] || gettext("memEx") %>