rename to memEx
This commit is contained in:
12
lib/memex_web/live/faq_live.ex
Normal file
12
lib/memex_web/live/faq_live.ex
Normal file
@ -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
|
18
lib/memex_web/live/faq_live.html.heex
Normal file
18
lib/memex_web/live/faq_live.html.heex
Normal file
@ -0,0 +1,18 @@
|
||||
<div class="mx-auto flex flex-col justify-center items-stretch space-y-8 max-w-3xl">
|
||||
<h1 class="title text-primary-400 text-2xl text-center">
|
||||
<%= gettext("faq") %>
|
||||
</h1>
|
||||
|
||||
<hr class="hr" />
|
||||
|
||||
<ul class="flex flex-col justify-start items-stretch space-y-4">
|
||||
<li class="flex flex-col justify-start items-stretch space-y-2">
|
||||
<b class="whitespace-nowrap">
|
||||
<%= gettext("what is this?") %>
|
||||
</b>
|
||||
<p>
|
||||
<%= gettext("this is a memex, used to document your notes") %>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
@ -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
|
||||
|
@ -1,13 +1,12 @@
|
||||
<div class="flex flex-col justify-center items-center text-center space-y-4">
|
||||
<h1 class="title text-primary-400 text-2xl">
|
||||
<%= gettext("memex") %>
|
||||
<div class="mx-auto flex flex-col justify-center items-stretch space-y-4 max-w-3xl">
|
||||
<h1 class="title text-primary-400 text-2xl text-center">
|
||||
<%= gettext("memEx") %>
|
||||
</h1>
|
||||
|
||||
<hr class="hr" />
|
||||
|
||||
<ul class="flex flex-col space-y-4 text-center">
|
||||
<li class="flex flex-col justify-center items-center
|
||||
space-y-2">
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<b class="whitespace-nowrap">
|
||||
<%= gettext("notes:") %>
|
||||
</b>
|
||||
@ -16,8 +15,7 @@
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li class="flex flex-col justify-center items-center
|
||||
space-y-2">
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<b class="whitespace-nowrap">
|
||||
<%= gettext("contexts:") %>
|
||||
</b>
|
||||
@ -26,8 +24,7 @@
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li class="flex flex-col justify-center items-center
|
||||
space-y-2">
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<b class="whitespace-nowrap">
|
||||
<%= gettext("pipelines:") %>
|
||||
</b>
|
||||
@ -35,6 +32,15 @@
|
||||
<%= gettext("document your processes, attaching contexts to each step") %>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<.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") %>
|
||||
</.link>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr class="hr" />
|
||||
@ -44,8 +50,7 @@
|
||||
<%= gettext("features") %>
|
||||
</h2>
|
||||
|
||||
<li class="flex flex-col justify-center items-center
|
||||
space-y-2">
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<b class="whitespace-nowrap">
|
||||
<%= gettext("multi-user:") %>
|
||||
</b>
|
||||
@ -54,8 +59,7 @@
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li class="flex flex-col justify-center items-center
|
||||
space-y-2">
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<b class="whitespace-nowrap">
|
||||
<%= gettext("privacy:") %>
|
||||
</b>
|
||||
@ -64,8 +68,7 @@
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li class="flex flex-col justify-center items-center
|
||||
space-y-2">
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<b class="whitespace-nowrap">
|
||||
<%= gettext("convenient:") %>
|
||||
</b>
|
||||
@ -88,16 +91,13 @@
|
||||
</b>
|
||||
<p>
|
||||
<%= 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") %>
|
||||
</.link>
|
||||
<% else %>
|
||||
<div class="flex flex-wrap justify-center space-x-2">
|
||||
<%= for admin <- @admins do %>
|
||||
<a class="hover:underline" href={"mailto:#{admin.email}"}>
|
||||
<a class="link" href={"mailto:#{admin.email}"}>
|
||||
<%= admin.email %>
|
||||
</a>
|
||||
<% end %>
|
||||
@ -109,7 +109,7 @@
|
||||
<li class="flex flex-row justify-center space-x-2">
|
||||
<b><%= gettext("registration:") %></b>
|
||||
<p>
|
||||
<%= 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 @@
|
||||
<b><%= gettext("version:") %></b>
|
||||
<.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 @@
|
||||
<li class="flex flex-col justify-center space-x-2">
|
||||
<.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 @@
|
||||
<li class="flex flex-col justify-center space-x-2">
|
||||
<.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 @@
|
||||
<li class="flex flex-col justify-center space-x-2">
|
||||
<.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"
|
||||
>
|
||||
|
Reference in New Issue
Block a user