Compare commits

...

3 Commits
0.1.18 ... dev

Author SHA1 Message Date
0c5442f0cd add backlinks
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-02-15 06:01:03 +00:00
6c2aba84ef fix visibility issues with multiple users 2025-02-15 06:01:03 +00:00
3e686fa199 better code style 2025-02-15 06:01:03 +00:00
61 changed files with 805 additions and 637 deletions

View File

@ -1,3 +1,7 @@
# v0.1.19
- Add backlinks
- Fix visibility issues with multiple users
# v0.1.18
- Update deps
- Fix content not escaping HTML properly

BIN
home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 340 KiB

View File

@ -117,7 +117,7 @@ defmodule Memex.Accounts do
Multi.new()
|> Multi.one(:users_count, from(u in User, select: count(u.id), distinct: true))
|> Multi.run(:use_invite, fn _changes_so_far, _repo ->
if allow_registration?() and invite_token |> is_nil() do
if allow_registration?() and !invite_token do
{:ok, nil}
else
Invites.use_invite(invite_token)

View File

@ -22,16 +22,16 @@ defmodule Memex.Contexts do
@spec list_contexts(search :: String.t() | nil, User.t()) :: [Context.t()]
def list_contexts(search \\ nil, user)
def list_contexts(search, %{id: user_id}) when search |> is_nil() or search == "" do
Repo.all(from c in Context, where: c.user_id == ^user_id, order_by: c.slug)
def list_contexts(search, %{id: user_id}) when user_id |> is_binary() and search in [nil, ""] do
Repo.all(from c in Context, order_by: c.slug)
end
def list_contexts(search, %{id: user_id}) when search |> is_binary() do
def list_contexts(search, %{id: user_id})
when user_id |> is_binary() and search |> is_binary() do
trimmed_search = String.trim(search)
Repo.all(
from c in Context,
where: c.user_id == ^user_id,
where:
fragment(
"search @@ websearch_to_tsquery('english', ?)",
@ -63,7 +63,7 @@ defmodule Memex.Contexts do
@spec list_public_contexts(search :: String.t() | nil) :: [Context.t()]
def list_public_contexts(search \\ nil)
def list_public_contexts(search) when search |> is_nil() or search == "" do
def list_public_contexts(search) when search in [nil, ""] do
Repo.all(from c in Context, where: c.visibility == :public, order_by: c.slug)
end
@ -88,6 +88,42 @@ defmodule Memex.Contexts do
)
end
@doc """
Returns the list of contexts that link to a particular slug.
## Examples
iex> backlink(%User{id: 123})
[%Context{}, ...]
iex> backlink("[other-context]", %User{id: 123})
[%Context{content: "[other-context]"}, ...]
"""
@spec backlink(String.t(), User.t()) :: [Context.t()]
def backlink(link, %{id: user_id}) when user_id |> is_binary() do
link = link |> String.replace("[", "\\[") |> String.replace("]", "\\]")
link_regex = "(^|[^\[])#{link}($|[^\]])"
Repo.all(
from c in Context,
where: fragment("? ~ ?", c.content, ^link_regex),
order_by: c.slug
)
end
def backlink(link, _invalid_user) do
link = link |> String.replace("[", "\\[") |> String.replace("]", "\\]")
link_regex = "(^|[^\[])#{link}($|[^\]])"
Repo.all(
from c in Context,
where: fragment("? ~ ?", c.content, ^link_regex),
where: c.visibility == :public,
order_by: c.slug
)
end
@doc """
Gets a single context.
@ -103,12 +139,8 @@ defmodule Memex.Contexts do
"""
@spec get_context!(Context.id(), User.t()) :: Context.t()
def get_context!(id, %{id: user_id}) do
Repo.one!(
from c in Context,
where: c.id == ^id,
where: c.user_id == ^user_id or c.visibility in [:public, :unlisted]
)
def get_context!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!(from c in Context, where: c.id == ^id)
end
def get_context!(id, _invalid_user) do
@ -134,12 +166,8 @@ defmodule Memex.Contexts do
"""
@spec get_context_by_slug(Context.slug(), User.t()) :: Context.t() | nil
def get_context_by_slug(slug, %{id: user_id}) do
Repo.one(
from c in Context,
where: c.slug == ^slug,
where: c.user_id == ^user_id or c.visibility in [:public, :unlisted]
)
def get_context_by_slug(slug, %{id: user_id}) when user_id |> is_binary() do
Repo.one(from c in Context, where: c.slug == ^slug)
end
def get_context_by_slug(slug, _invalid_user) do
@ -194,23 +222,16 @@ defmodule Memex.Contexts do
## Examples
iex> delete_context(%Context{user_id: 123}, %User{id: 123})
{:ok, %Context{}}
iex> delete_context(%Context{user_id: 123}, %User{role: :admin})
{:ok, %Context{}}
iex> delete_context(%Context{}, %User{id: 123})
{:ok, %Context{}}
iex> delete_context(%Context{}, nil)
{:error, %Ecto.Changeset{}}
"""
@spec delete_context(Context.t(), User.t()) ::
{:ok, Context.t()} | {:error, Context.changeset()}
def delete_context(%Context{user_id: user_id} = context, %{id: user_id}) do
context |> Repo.delete()
end
def delete_context(%Context{} = context, %{role: :admin}) do
def delete_context(%Context{} = context, %{id: user_id}) when user_id |> is_binary() do
context |> Repo.delete()
end
@ -228,13 +249,4 @@ defmodule Memex.Contexts do
def change_context(%Context{} = context, attrs \\ %{}, user) do
context |> Context.update_changeset(attrs, user)
end
@spec owner_or_admin?(Context.t(), User.t()) :: boolean()
def owner_or_admin?(%{user_id: user_id}, %{id: user_id}), do: true
def owner_or_admin?(_context, %{role: :admin}), do: true
def owner_or_admin?(_context, _other_user), do: false
@spec owner?(Context.t(), User.t()) :: boolean()
def owner?(%{user_id: user_id}, %{id: user_id}), do: true
def owner?(_context, _other_user), do: false
end

View File

@ -63,8 +63,9 @@ defmodule Memex.Contexts.Context do
end
@spec update_changeset(t(), attrs :: map(), User.t()) :: changeset()
def update_changeset(%{user_id: user_id} = note, attrs, %User{id: user_id}) do
note
def update_changeset(%__MODULE__{} = context, attrs, %User{id: user_id})
when user_id |> is_binary() do
context
|> cast(attrs, [:slug, :content, :tags, :visibility])
|> cast_tags_string(attrs)
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,

View File

@ -22,16 +22,15 @@ defmodule Memex.Notes do
@spec list_notes(search :: String.t() | nil, User.t()) :: [Note.t()]
def list_notes(search \\ nil, user)
def list_notes(search, %{id: user_id}) when search |> is_nil() or search == "" do
Repo.all(from n in Note, where: n.user_id == ^user_id, order_by: n.slug)
def list_notes(search, %{id: user_id}) when user_id |> is_binary() and search in [nil, ""] do
Repo.all(from n in Note, order_by: n.slug)
end
def list_notes(search, %{id: user_id}) when search |> is_binary() do
def list_notes(search, %{id: user_id}) when user_id |> is_binary() and search |> is_binary() do
trimmed_search = String.trim(search)
Repo.all(
from n in Note,
where: n.user_id == ^user_id,
where:
fragment(
"search @@ websearch_to_tsquery('english', ?)",
@ -62,7 +61,7 @@ defmodule Memex.Notes do
@spec list_public_notes(search :: String.t() | nil) :: [Note.t()]
def list_public_notes(search \\ nil)
def list_public_notes(search) when search |> is_nil() or search == "" do
def list_public_notes(search) when search in [nil, ""] do
Repo.all(from n in Note, where: n.visibility == :public, order_by: n.slug)
end
@ -87,6 +86,42 @@ defmodule Memex.Notes do
)
end
@doc """
Returns the list of notes that link to a particular slug.
## Examples
iex> backlink(%User{id: 123})
[%Note{}, ...]
iex> backlink("[other-note]", %User{id: 123})
[%Note{content: "[other-note]"}, ...]
"""
@spec backlink(String.t(), User.t()) :: [Note.t()]
def backlink(link, %{id: user_id}) when user_id |> is_binary() do
link = link |> String.replace("[", "\\[") |> String.replace("]", "\\]")
link_regex = "(^|[^\[])#{link}($|[^\]])"
Repo.all(
from n in Note,
where: fragment("? ~ ?", n.content, ^link_regex),
order_by: n.slug
)
end
def backlink(link, _invalid_user) do
link = link |> String.replace("[", "\\[") |> String.replace("]", "\\]")
link_regex = "(^|[^\[])#{link}($|[^\]])"
Repo.all(
from n in Note,
where: fragment("? ~ ?", n.content, ^link_regex),
where: n.visibility == :public,
order_by: n.slug
)
end
@doc """
Gets a single note.
@ -102,12 +137,8 @@ defmodule Memex.Notes do
"""
@spec get_note!(Note.id(), User.t()) :: Note.t()
def get_note!(id, %{id: user_id}) do
Repo.one!(
from n in Note,
where: n.id == ^id,
where: n.user_id == ^user_id or n.visibility in [:public, :unlisted]
)
def get_note!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!(from n in Note, where: n.id == ^id)
end
def get_note!(id, _invalid_user) do
@ -133,12 +164,8 @@ defmodule Memex.Notes do
"""
@spec get_note_by_slug(Note.slug(), User.t()) :: Note.t() | nil
def get_note_by_slug(slug, %{id: user_id}) do
Repo.one(
from n in Note,
where: n.slug == ^slug,
where: n.user_id == ^user_id or n.visibility in [:public, :unlisted]
)
def get_note_by_slug(slug, %{id: user_id}) when user_id |> is_binary() do
Repo.one(from n in Note, where: n.slug == ^slug)
end
def get_note_by_slug(slug, _invalid_user) do
@ -192,22 +219,15 @@ defmodule Memex.Notes do
## Examples
iex> delete_note(%Note{user_id: 123}, %User{id: 123})
{:ok, %Note{}}
iex> delete_note(%Note{}, %User{role: :admin})
{:ok, %Note{}}
iex> delete_note(%Note{}, %User{id: 123})
{:ok, %Note{}}
iex> delete_note(%Note{}, nil)
{:error, %Ecto.Changeset{}}
"""
@spec delete_note(Note.t(), User.t()) :: {:ok, Note.t()} | {:error, Note.changeset()}
def delete_note(%Note{user_id: user_id} = note, %{id: user_id}) do
note |> Repo.delete()
end
def delete_note(%Note{} = note, %{role: :admin}) do
def delete_note(%Note{} = note, %{id: user_id}) when user_id |> is_binary() do
note |> Repo.delete()
end
@ -228,13 +248,4 @@ defmodule Memex.Notes do
def change_note(%Note{} = note, attrs \\ %{}, user) do
note |> Note.update_changeset(attrs, user)
end
@spec owner_or_admin?(Note.t(), User.t()) :: boolean()
def owner_or_admin?(%{user_id: user_id}, %{id: user_id}), do: true
def owner_or_admin?(_context, %{role: :admin}), do: true
def owner_or_admin?(_context, _other_user), do: false
@spec owner?(Note.t(), User.t()) :: boolean()
def owner?(%{user_id: user_id}, %{id: user_id}), do: true
def owner?(_context, _other_user), do: false
end

View File

@ -62,7 +62,8 @@ defmodule Memex.Notes.Note do
end
@spec update_changeset(t(), attrs :: map(), User.t()) :: changeset()
def update_changeset(%{user_id: user_id} = note, attrs, %User{id: user_id}) do
def update_changeset(%__MODULE__{} = note, attrs, %User{id: user_id})
when user_id |> is_binary() do
note
|> cast(attrs, [:slug, :content, :tags, :visibility])
|> cast_tags_string(attrs)

View File

@ -22,16 +22,17 @@ defmodule Memex.Pipelines do
@spec list_pipelines(search :: String.t() | nil, User.t()) :: [Pipeline.t()]
def list_pipelines(search \\ nil, user)
def list_pipelines(search, %{id: user_id}) when search |> is_nil() or search == "" do
Repo.all(from p in Pipeline, where: p.user_id == ^user_id, order_by: p.slug)
def list_pipelines(search, %{id: user_id})
when user_id |> is_binary() and search in [nil, ""] do
Repo.all(from p in Pipeline, order_by: p.slug)
end
def list_pipelines(search, %{id: user_id}) when search |> is_binary() do
def list_pipelines(search, %{id: user_id})
when user_id |> is_binary() and search |> is_binary() do
trimmed_search = String.trim(search)
Repo.all(
from p in Pipeline,
where: p.user_id == ^user_id,
where:
fragment(
"search @@ websearch_to_tsquery('english', ?)",
@ -62,7 +63,7 @@ defmodule Memex.Pipelines do
@spec list_public_pipelines(search :: String.t() | nil) :: [Pipeline.t()]
def list_public_pipelines(search \\ nil)
def list_public_pipelines(search) when search |> is_nil() or search == "" do
def list_public_pipelines(search) when search in [nil, ""] do
Repo.all(from p in Pipeline, where: p.visibility == :public, order_by: p.slug)
end
@ -102,12 +103,8 @@ defmodule Memex.Pipelines do
"""
@spec get_pipeline!(Pipeline.id(), User.t()) :: Pipeline.t()
def get_pipeline!(id, %{id: user_id}) do
Repo.one!(
from p in Pipeline,
where: p.id == ^id,
where: p.user_id == ^user_id or p.visibility in [:public, :unlisted]
)
def get_pipeline!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!(from p in Pipeline, where: p.id == ^id)
end
def get_pipeline!(id, _invalid_user) do
@ -133,12 +130,8 @@ defmodule Memex.Pipelines do
"""
@spec get_pipeline_by_slug(Pipeline.slug(), User.t()) :: Pipeline.t() | nil
def get_pipeline_by_slug(slug, %{id: user_id}) do
Repo.one(
from p in Pipeline,
where: p.slug == ^slug,
where: p.user_id == ^user_id or p.visibility in [:public, :unlisted]
)
def get_pipeline_by_slug(slug, %{id: user_id}) when user_id |> is_binary() do
Repo.one(from p in Pipeline, where: p.slug == ^slug)
end
def get_pipeline_by_slug(slug, _invalid_user) do
@ -149,6 +142,50 @@ defmodule Memex.Pipelines do
)
end
@doc """
Returns the list of pipelines that link to a particular slug.
## Examples
iex> backlink(%User{id: 123})
[%Pipeline{}, ...]
iex> backlink("[other-pipeline]", %User{id: 123})
[%Pipeline{description: "[other-pipeline]"}, ...]
"""
@spec backlink(String.t(), User.t()) :: [Pipeline.t()]
def backlink(link, %{id: user_id}) when user_id |> is_binary() do
link = link |> String.replace("[", "\\[") |> String.replace("]", "\\]")
link_regex = "(^|[^\[])#{link}($|[^\]])"
Repo.all(
from p in Pipeline,
left_join: s in assoc(p, :steps),
where:
fragment("? ~ ?", p.description, ^link_regex) or
fragment("? ~ ?", s.content, ^link_regex),
distinct: true,
order_by: p.slug
)
end
def backlink(link, _invalid_user) do
link = link |> String.replace("[", "\\[") |> String.replace("]", "\\]")
link_regex = "(^|[^\[])#{link}($|[^\]])"
Repo.all(
from p in Pipeline,
left_join: s in assoc(p, :steps),
where:
fragment("? ~ ?", p.description, ^link_regex) or
fragment("? ~ ?", s.content, ^link_regex),
where: p.visibility == :public,
distinct: true,
order_by: p.slug
)
end
@doc """
Creates a pipeline.
@ -193,23 +230,16 @@ defmodule Memex.Pipelines do
## Examples
iex> delete_pipeline(%Pipeline{user_id: 123}, %User{id: 123})
{:ok, %Pipeline{}}
iex> delete_pipeline(%Pipeline{}, %User{role: :admin})
{:ok, %Pipeline{}}
iex> delete_pipeline(%Pipeline{}, %User{id: 123})
{:ok, %Pipeline{}}
iex> delete_pipeline(%Pipeline{}, nil)
{:error, %Ecto.Changeset{}}
"""
@spec delete_pipeline(Pipeline.t(), User.t()) ::
{:ok, Pipeline.t()} | {:error, Pipeline.changeset()}
def delete_pipeline(%Pipeline{user_id: user_id} = pipeline, %{id: user_id}) do
pipeline |> Repo.delete()
end
def delete_pipeline(%Pipeline{} = pipeline, %{role: :admin}) do
def delete_pipeline(%Pipeline{} = pipeline, %{id: user_id}) when user_id |> is_binary() do
pipeline |> Repo.delete()
end
@ -230,13 +260,4 @@ defmodule Memex.Pipelines do
def change_pipeline(%Pipeline{} = pipeline, attrs \\ %{}, user) do
pipeline |> Pipeline.update_changeset(attrs, user)
end
@spec owner_or_admin?(Pipeline.t(), User.t()) :: boolean()
def owner_or_admin?(%{user_id: user_id}, %{id: user_id}), do: true
def owner_or_admin?(_context, %{role: :admin}), do: true
def owner_or_admin?(_context, _other_user), do: false
@spec owner?(Pipeline.t(), User.t()) :: boolean()
def owner?(%{user_id: user_id}, %{id: user_id}), do: true
def owner?(_context, _other_user), do: false
end

View File

@ -65,7 +65,8 @@ defmodule Memex.Pipelines.Pipeline do
end
@spec update_changeset(t(), attrs :: map(), User.t()) :: changeset()
def update_changeset(%{user_id: user_id} = pipeline, attrs, %User{id: user_id}) do
def update_changeset(%__MODULE__{} = pipeline, attrs, %User{id: user_id})
when user_id |> is_binary() do
pipeline
|> cast(attrs, [:slug, :description, :tags, :visibility])
|> cast_tags_string(attrs)

View File

@ -44,9 +44,12 @@ defmodule Memex.Pipelines.Steps.Step do
@doc false
@spec create_changeset(attrs :: map(), position :: non_neg_integer(), Pipeline.t(), User.t()) ::
changeset()
def create_changeset(attrs, position, %Pipeline{id: pipeline_id, user_id: user_id}, %User{
id: user_id
}) do
def create_changeset(
attrs,
position,
%Pipeline{id: pipeline_id, user_id: user_id},
%User{id: user_id}
) do
%__MODULE__{}
|> cast(attrs, [:title, :content])
|> change(pipeline_id: pipeline_id, user_id: user_id, position: position)
@ -55,22 +58,16 @@ defmodule Memex.Pipelines.Steps.Step do
@spec update_changeset(t(), attrs :: map(), User.t()) ::
changeset()
def update_changeset(
%{user_id: user_id} = step,
attrs,
%User{id: user_id}
) do
def update_changeset(%__MODULE__{} = step, attrs, %User{id: user_id})
when user_id |> is_binary() do
step
|> cast(attrs, [:title, :content])
|> validate_required([:title, :user_id, :position])
end
@spec position_changeset(t(), position :: non_neg_integer(), User.t()) :: changeset()
def position_changeset(
%{user_id: user_id} = step,
position,
%User{id: user_id}
) do
def position_changeset(%__MODULE__{} = step, position, %User{id: user_id})
when user_id |> is_binary() do
step
|> change(position: position)
|> validate_required([:title, :user_id, :position])

View File

@ -21,11 +21,10 @@ defmodule Memex.Pipelines.Steps do
"""
@spec list_steps(Pipeline.t(), User.t()) :: [Step.t()]
def list_steps(%{id: pipeline_id}, %{id: user_id}) do
def list_steps(%{id: pipeline_id}, %{id: user_id}) when user_id |> is_binary() do
Repo.all(
from s in Step,
where: s.pipeline_id == ^pipeline_id,
where: s.user_id == ^user_id,
order_by: s.position
)
end
@ -62,8 +61,8 @@ defmodule Memex.Pipelines.Steps do
"""
@spec get_step!(Step.id(), User.t()) :: Step.t()
def get_step!(id, %{id: user_id}) do
Repo.one!(from n in Step, where: n.id == ^id, where: n.user_id == ^user_id)
def get_step!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!(from n in Step, where: n.id == ^id)
end
def get_step!(id, _invalid_user) do
@ -119,22 +118,15 @@ defmodule Memex.Pipelines.Steps do
## Examples
iex> delete_step(%Step{user_id: 123}, %User{id: 123})
{:ok, %Step{}}
iex> delete_step(%Step{}, %User{role: :admin})
{:ok, %Step{}}
iex> delete_step(%Step{}, %User{id: 123})
{:ok, %Step{}}
iex> delete_step(%Step{}, nil)
{:error, %Ecto.Changeset{}}
"""
@spec delete_step(Step.t(), User.t()) :: {:ok, Step.t()} | {:error, Step.changeset()}
def delete_step(%Step{user_id: user_id} = step, %{id: user_id}) do
delete_step(step)
end
def delete_step(%Step{} = step, %{role: :admin}) do
def delete_step(%Step{} = step, %{id: user_id}) when user_id |> is_binary() do
delete_step(step)
end
@ -181,10 +173,11 @@ defmodule Memex.Pipelines.Steps do
def reorder_step(%Step{position: 0} = step, :up, _user), do: {:error, step}
def reorder_step(
%Step{position: position, pipeline_id: pipeline_id, user_id: user_id} = step,
%Step{position: position, pipeline_id: pipeline_id} = step,
:up,
%{id: user_id} = user
) do
)
when user_id |> is_binary() do
Multi.new()
|> Multi.update_all(
:reorder_steps,
@ -207,10 +200,11 @@ defmodule Memex.Pipelines.Steps do
end
def reorder_step(
%Step{pipeline_id: pipeline_id, position: position, user_id: user_id} = step,
%Step{pipeline_id: pipeline_id, position: position} = step,
:down,
%{id: user_id} = user
) do
)
when user_id |> is_binary() do
Multi.new()
|> Multi.one(
:step_count,

View File

@ -44,6 +44,7 @@ defmodule MemexWeb do
use Gettext, backend: MemexWeb.Gettext
import MemexWeb.ControllerHelpers
import Plug.Conn
unquote(verified_routes())

View File

@ -37,7 +37,7 @@ defmodule MemexWeb.Components.ContextsTableComponent do
} = socket
) do
columns =
if actions == [] or current_user |> is_nil() do
if actions == [] or !current_user do
[]
else
[%{label: gettext("actions"), key: :actions, sortable: false}]

View File

@ -1,12 +1,13 @@
<div class="px-8 py-4 flex flex-col justify-center items-center space-y-4
bg-primary-900
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
transition-all duration-300 ease-in-out">
<h1 class="title text-xl">
<div class="flex flex-col justify-center items-center px-8 py-4 space-y-4 rounded-lg border border-gray-400 shadow-lg transition-all duration-300 ease-in-out bg-primary-900 hover:shadow-md">
<h1 class="text-xl title">
<%= @invite.name %>
</h1>
<%= if @invite.disabled_at |> is_nil() do %>
<%= if @invite.disabled_at do %>
<h2 class="title text-md">
<%= gettext("invite disabled") %>
</h2>
<% else %>
<h2 class="title text-md">
<%= if @invite.uses_left do %>
<%= gettext(
@ -17,10 +18,6 @@
<%= gettext("uses left: unlimited") %>
<% end %>
</h2>
<% else %>
<h2 class="title text-md">
<%= gettext("invite disabled") %>
</h2>
<% end %>
<.qr_code
@ -35,14 +32,13 @@
<div class="flex flex-row flex-wrap justify-center items-center">
<code
id={"code-#{@invite.id}"}
class="mx-2 my-1 text-xs px-4 py-2 rounded-lg text-center break-all
text-primary-400 bg-primary-800"
class="px-4 py-2 mx-2 my-1 text-xs text-center break-all rounded-lg text-primary-400 bg-primary-800"
phx-no-format
><%= url(MemexWeb.Endpoint, ~p"/users/register?invite=#{@invite.token}") %></code>
<%= if @code_actions, do: render_slot(@code_actions) %>
</div>
<div :if={@inner_block} class="flex space-x-4 justify-center items-center">
<div :if={@inner_block} class="flex justify-center items-center space-x-4">
<%= render_slot(@inner_block) %>
</div>
</div>

View File

@ -37,7 +37,7 @@ defmodule MemexWeb.Components.NotesTableComponent do
} = socket
) do
columns =
if actions == [] or current_user |> is_nil() do
if actions == [] or !current_user do
[]
else
[%{label: gettext("actions"), key: :actions, sortable: false}]

View File

@ -37,7 +37,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
} = socket
) do
columns =
if actions == [] or current_user |> is_nil() do
if actions == [] or !current_user do
[]
else
[%{label: gettext("actions"), key: :actions, sortable: false}]
@ -101,7 +101,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
defp get_value_for_key(:description, %{description: description} = assigns, _additional_data) do
description_block = ~H"""
<div class="truncate max-w-sm">
<div class="max-w-sm truncate">
<%= @description %>
</div>
"""

View File

@ -0,0 +1,13 @@
defmodule MemexWeb.ControllerHelpers do
@moduledoc """
Implements controller helpers
"""
import Plug.Conn, only: [assign: 3]
def assign(conn, assigns) do
assigns
|> Map.new()
|> Enum.reduce(conn, fn {key, value}, conn -> conn |> assign(key, value) end)
end
end

View File

@ -42,7 +42,7 @@ defmodule MemexWeb.UserConfirmationController do
# by some automation or by the user themselves, so we redirect without
# a warning message.
case conn.assigns do
%{current_user: %{confirmed_at: confirmed_at}} when not is_nil(confirmed_at) ->
%{current_user: %{confirmed_at: %{}}} ->
redirect(conn, to: ~p"/")
%{} ->

View File

@ -54,7 +54,7 @@ defmodule MemexWeb.UserResetPasswordController do
%{"token" => token} = conn.params
if user = Accounts.get_user_by_reset_password_token(token) do
conn |> assign(:user, user) |> assign(:token, token)
conn |> assign(user: user, token: token)
else
conn
|> put_flash(

View File

@ -103,8 +103,10 @@ defmodule MemexWeb.UserSettingsController do
defp assign_email_and_password_changesets(%{assigns: %{current_user: user}} = conn, _opts) do
conn
|> assign(:email_changeset, Accounts.change_user_email(user))
|> assign(:password_changeset, Accounts.change_user_password(user))
|> assign(:locale_changeset, Accounts.change_user_locale(user))
|> assign(
email_changeset: Accounts.change_user_email(user),
locale_changeset: Accounts.change_user_locale(user),
password_changeset: Accounts.change_user_password(user)
)
end
end

View File

@ -69,7 +69,7 @@ defmodule MemexWeb.ContextLive.FormComponent do
|> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} ->
assign(socket, changeset: changeset)
assign(socket, :changeset, changeset)
end
{:noreply, socket}

View File

@ -20,29 +20,37 @@ defmodule MemexWeb.ContextLive.Index do
%{slug: slug} = context = Contexts.get_context_by_slug(slug, current_user)
socket
|> assign(page_title: gettext("edit %{slug}", slug: slug))
|> assign(context: context)
|> assign(
context: context,
page_title: gettext("edit %{slug}", slug: slug)
)
end
defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do
socket
|> assign(page_title: gettext("new context"))
|> assign(context: %Context{visibility: :private, user_id: current_user_id})
|> assign(
context: %Context{visibility: :private, user_id: current_user_id},
page_title: gettext("new context")
)
end
defp apply_action(socket, :index, _params) do
socket
|> assign(page_title: gettext("contexts"))
|> assign(search: nil)
|> assign(context: nil)
|> assign(
context: nil,
page_title: gettext("contexts"),
search: nil
)
|> display_contexts()
end
defp apply_action(socket, :search, %{"search" => search}) do
socket
|> assign(page_title: gettext("contexts"))
|> assign(search: search)
|> assign(context: nil)
|> assign(
context: nil,
page_title: gettext("contexts"),
search: search
)
|> display_contexts()
end
@ -68,8 +76,7 @@ defmodule MemexWeb.ContextLive.Index do
{:noreply, socket |> push_patch(to: redirect_to)}
end
defp display_contexts(%{assigns: %{current_user: current_user, search: search}} = socket)
when not (current_user |> is_nil()) do
defp display_contexts(%{assigns: %{current_user: %{} = current_user, search: search}} = socket) do
socket |> assign(contexts: Contexts.list_contexts(search, current_user))
end

View File

@ -1,4 +1,4 @@
<div class="mx-auto flex flex-col justify-center items-start space-y-4 max-w-3xl">
<div class="flex flex-col justify-center items-start mx-auto space-y-4 max-w-3xl">
<h1 class="text-xl">
<%= gettext("contexts") %>
</h1>
@ -9,7 +9,7 @@
as={:search}
phx-change="search"
phx-submit="search"
class="self-stretch flex flex-col items-stretch"
class="flex flex-col items-stretch self-stretch"
>
<%= text_input(f, :search_term,
class: "input input-primary",
@ -33,14 +33,14 @@
>
<:actions :let={context}>
<.link
:if={Contexts.owner?(context, @current_user)}
:if={@current_user}
patch={~p"/contexts/#{context}/edit"}
aria-label={dgettext("actions", "edit %{context_slug}", context_slug: context.slug)}
>
<%= dgettext("actions", "edit") %>
</.link>
<.link
:if={Contexts.owner_or_admin?(context, @current_user)}
:if={@current_user}
href="#"
phx-click="delete"
phx-value-id={context.id}

View File

@ -1,6 +1,6 @@
defmodule MemexWeb.ContextLive.Show do
use MemexWeb, :live_view
alias Memex.Contexts
alias Memex.{Contexts, Pipelines}
@impl true
def mount(_params, _session, socket) do
@ -21,8 +21,12 @@ defmodule MemexWeb.ContextLive.Show do
socket =
socket
|> assign(:page_title, page_title(live_action, context))
|> assign(:context, context)
|> assign(
context: context,
page_title: page_title(live_action, context),
context_backlinks: Contexts.backlink("[#{context.slug}]", current_user),
pipeline_backlinks: Pipelines.backlink("[[#{context.slug}]]", current_user)
)
{:noreply, socket}
end

View File

@ -1,4 +1,4 @@
<div class="mx-auto flex flex-col justify-center items-stretch space-y-4 max-w-3xl">
<div class="flex flex-col justify-center items-stretch mx-auto space-y-4 max-w-3xl">
<h1 class="text-xl">
<%= @context.slug %>
</h1>
@ -11,20 +11,37 @@
<.context_content context={@context} />
<div
:if={@context_backlinks ++ @pipeline_backlinks != []}
class="flex flex-wrap justify-end items-center self-end"
>
<p><%= gettext("Backlinked by:") %></p>
<.link
:for={backlink <- @context_backlinks}
class="m-1 hover:underline"
patch={~p"/context/#{backlink}"}
>
<%= gettext("[%{slug}]", slug: backlink.slug) %>
</.link>
<.link
:for={backlink <- @pipeline_backlinks}
class="m-1 hover:underline"
patch={~p"/pipeline/#{backlink}"}
>
<%= gettext("[[%{slug}]]", slug: backlink.slug) %>
</.link>
</div>
<p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @context.visibility) %>
</p>
<div class="self-end flex space-x-4">
<.link
:if={Contexts.owner?(@context, @current_user)}
class="btn btn-primary"
patch={~p"/context/#{@context}/edit"}
>
<div class="flex self-end space-x-4">
<.link :if={@current_user} class="btn btn-primary" patch={~p"/context/#{@context}/edit"}>
<%= dgettext("actions", "edit") %>
</.link>
<button
:if={Contexts.owner_or_admin?(@context, @current_user)}
:if={@current_user}
type="button"
class="btn btn-primary"
phx-click="delete"

View File

@ -11,6 +11,6 @@ defmodule MemexWeb.HomeLive do
@impl true
def mount(_params, _session, socket) do
admins = Accounts.list_users_by_role(:admin)
{:ok, socket |> assign(page_title: gettext("home"), admins: admins, version: @version)}
{:ok, socket |> assign(admins: admins, page_title: gettext("home"), version: @version)}
end
end

View File

@ -1,5 +1,5 @@
<div class="mx-auto flex flex-col justify-center items-stretch space-y-4 max-w-lg">
<h1 class="title text-primary-400 text-xl">
<div class="flex flex-col justify-center items-stretch mx-auto space-y-4 max-w-lg">
<h1 class="text-xl title text-primary-400">
<%= gettext("memEx") %>
</h1>
@ -31,7 +31,7 @@
</p>
</li>
<li class="flex flex-col justify-center items-center text-right space-y-2">
<li class="flex flex-col justify-center items-center space-y-2 text-right">
<.link navigate={~p"/faq"} class="btn btn-primary">
<%= gettext("read more on how to use memEx") %>
</.link>
@ -41,7 +41,7 @@
<hr class="hr" />
<ul class="flex flex-col space-y-4">
<h2 class="title text-primary-400 text-lg">
<h2 class="text-lg title text-primary-400">
<%= gettext("features") %>
</h2>
@ -71,12 +71,21 @@
<%= gettext("accessible from any internet-capable device") %>
</p>
</li>
<li class="flex flex-col justify-center items-center space-y-2">
<b class="whitespace-nowrap">
<%= gettext("backlinks:") %>
</b>
<p>
<%= gettext("view referencing items from the referenced item") %>
</p>
</li>
</ul>
<hr class="hr" />
<ul class="flex flex-col justify-center space-y-4">
<h2 class="title text-primary-400 text-lg">
<h2 class="text-lg title text-primary-400">
<%= gettext("instance information") %>
</h2>
@ -124,7 +133,7 @@
<hr class="hr" />
<ul class="flex flex-col space-y-2">
<h2 class="title text-primary-400 text-lg">
<h2 class="text-lg title text-primary-400">
<%= gettext("get involved") %>
</h2>

View File

@ -82,7 +82,7 @@ defmodule MemexWeb.InviteLive.FormComponent do
socket |> put_flash(:info, prompt) |> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} ->
socket |> assign(changeset: changeset)
socket |> assign(:changeset, changeset)
end
{:noreply, socket}

View File

@ -20,15 +20,15 @@ defmodule MemexWeb.InviteLive.Index do
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
socket
|> assign(page_title: gettext("edit invite"), invite: Invites.get_invite!(id, current_user))
|> assign(invite: Invites.get_invite!(id, current_user), page_title: gettext("edit invite"))
end
defp apply_action(socket, :new, _params) do
socket |> assign(page_title: gettext("new invite"), invite: %Invite{})
socket |> assign(invite: %Invite{}, page_title: gettext("new invite"))
end
defp apply_action(socket, :index, _params) do
socket |> assign(page_title: gettext("invites"), invite: nil)
socket |> assign(invite: nil, page_title: gettext("invites"))
end
@impl true
@ -138,6 +138,6 @@ defmodule MemexWeb.InviteLive.Index do
use_counts = invites |> Invites.get_use_counts(current_user)
users = all_users |> Map.get(:user, [])
socket |> assign(invites: invites, use_counts: use_counts, admins: admins, users: users)
socket |> assign(admins: admins, invites: invites, use_counts: use_counts, users: users)
end
end

View File

@ -71,7 +71,7 @@
</.link>
<.link
:if={invite.disabled_at |> is_nil() and not (invite.uses_left |> is_nil())}
:if={!invite.disabled_at and !!invite.uses_left}
href="#"
class="btn btn-secondary"
phx-click="set_unlimited"

View File

@ -68,7 +68,7 @@ defmodule MemexWeb.NoteLive.FormComponent do
|> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} ->
assign(socket, changeset: changeset)
assign(socket, :changeset, changeset)
end
{:noreply, socket}

View File

@ -4,11 +4,11 @@ defmodule MemexWeb.NoteLive.Index do
@impl true
def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(search: search) |> display_notes()}
{:ok, socket |> assign(:search, search) |> display_notes()}
end
def mount(_params, _session, socket) do
{:ok, socket |> assign(search: nil) |> display_notes()}
{:ok, socket |> assign(:search, nil) |> display_notes()}
end
@impl true
@ -20,29 +20,37 @@ defmodule MemexWeb.NoteLive.Index do
%{slug: slug} = note = Notes.get_note_by_slug(slug, current_user)
socket
|> assign(page_title: gettext("edit %{slug}", slug: slug))
|> assign(note: note)
|> assign(
note: note,
page_title: gettext("edit %{slug}", slug: slug)
)
end
defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do
socket
|> assign(page_title: gettext("new note"))
|> assign(note: %Note{visibility: :private, user_id: current_user_id})
|> assign(
note: %Note{visibility: :private, user_id: current_user_id},
page_title: gettext("new note")
)
end
defp apply_action(socket, :index, _params) do
socket
|> assign(page_title: gettext("notes"))
|> assign(search: nil)
|> assign(note: nil)
|> assign(
note: nil,
page_title: gettext("notes"),
search: nil
)
|> display_notes()
end
defp apply_action(socket, :search, %{"search" => search}) do
socket
|> assign(page_title: gettext("notes"))
|> assign(search: search)
|> assign(note: nil)
|> assign(
note: nil,
page_title: gettext("notes"),
search: search
)
|> display_notes()
end
@ -53,7 +61,7 @@ defmodule MemexWeb.NoteLive.Index do
socket =
socket
|> assign(notes: Notes.list_notes(current_user))
|> assign(:notes, Notes.list_notes(current_user))
|> put_flash(:info, gettext("%{slug} deleted", slug: slug))
{:noreply, socket}
@ -67,12 +75,11 @@ defmodule MemexWeb.NoteLive.Index do
{:noreply, socket |> push_patch(to: ~p"/notes/#{search_term}")}
end
defp display_notes(%{assigns: %{current_user: current_user, search: search}} = socket)
when not (current_user |> is_nil()) do
socket |> assign(notes: Notes.list_notes(search, current_user))
defp display_notes(%{assigns: %{current_user: %{} = current_user, search: search}} = socket) do
socket |> assign(:notes, Notes.list_notes(search, current_user))
end
defp display_notes(%{assigns: %{search: search}} = socket) do
socket |> assign(notes: Notes.list_public_notes(search))
socket |> assign(:notes, Notes.list_public_notes(search))
end
end

View File

@ -1,4 +1,4 @@
<div class="mx-auto flex flex-col justify-center items-start space-y-4 max-w-3xl">
<div class="flex flex-col justify-center items-start mx-auto space-y-4 max-w-3xl">
<h1 class="text-xl">
<%= gettext("notes") %>
</h1>
@ -9,7 +9,7 @@
as={:search}
phx-change="search"
phx-submit="search"
class="self-stretch flex flex-col items-stretch"
class="flex flex-col items-stretch self-stretch"
>
<%= text_input(f, :search_term,
class: "input input-primary",
@ -33,14 +33,14 @@
>
<:actions :let={note}>
<.link
:if={Notes.owner?(note, @current_user)}
:if={@current_user}
patch={~p"/notes/#{note}/edit"}
aria-label={dgettext("actions", "edit %{note_slug}", note_slug: note.slug)}
>
<%= dgettext("actions", "edit") %>
</.link>
<.link
:if={Notes.owner_or_admin?(note, @current_user)}
:if={@current_user}
href="#"
phx-click="delete"
phx-value-id={note.id}

View File

@ -1,6 +1,6 @@
defmodule MemexWeb.NoteLive.Show do
use MemexWeb, :live_view
alias Memex.Notes
alias Memex.{Contexts, Notes, Pipelines}
@impl true
def mount(_params, _session, socket) do
@ -21,8 +21,13 @@ defmodule MemexWeb.NoteLive.Show do
socket =
socket
|> assign(:page_title, page_title(live_action, note))
|> assign(:note, note)
|> assign(
context_backlinks: Contexts.backlink("[[#{note.slug}]]", current_user),
note_backlinks: Notes.backlink("[#{note.slug}]", current_user),
note: note,
page_title: page_title(live_action, note),
pipeline_backlinks: Pipelines.backlink("[[[#{note.slug}]]]", current_user)
)
{:noreply, socket}
end

View File

@ -1,4 +1,4 @@
<div class="mx-auto flex flex-col justify-center items-stretch space-y-4 max-w-3xl">
<div class="flex flex-col justify-center items-stretch mx-auto space-y-4 max-w-3xl">
<h1 class="text-xl">
<%= @note.slug %>
</h1>
@ -11,20 +11,44 @@
<.note_content note={@note} />
<div
:if={@note_backlinks ++ @context_backlinks ++ @pipeline_backlinks != []}
class="flex flex-wrap justify-end items-center self-end"
>
<p><%= gettext("Backlinked by:") %></p>
<.link
:for={backlink <- @note_backlinks}
class="m-1 hover:underline"
patch={~p"/note/#{backlink}"}
>
<%= gettext("[%{slug}]", slug: backlink.slug) %>
</.link>
<.link
:for={backlink <- @context_backlinks}
class="m-1 hover:underline"
patch={~p"/context/#{backlink}"}
>
<%= gettext("[[%{slug}]]", slug: backlink.slug) %>
</.link>
<.link
:for={backlink <- @pipeline_backlinks}
class="m-1 hover:underline"
patch={~p"/pipeline/#{backlink}"}
>
<%= gettext("[[[%{slug}]]]", slug: backlink.slug) %>
</.link>
</div>
<p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @note.visibility) %>
</p>
<div class="self-end flex space-x-4">
<.link
:if={Notes.owner?(@note, @current_user)}
class="btn btn-primary"
patch={~p"/note/#{@note}/edit"}
>
<div class="flex self-end space-x-4">
<.link :if={@current_user} class="btn btn-primary" patch={~p"/note/#{@note}/edit"}>
<%= dgettext("actions", "edit") %>
</.link>
<button
:if={Notes.owner_or_admin?(@note, @current_user)}
:if={@current_user}
type="button"
class="btn btn-primary"
phx-click="delete"

View File

@ -73,7 +73,7 @@ defmodule MemexWeb.PipelineLive.FormComponent do
|> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} ->
assign(socket, changeset: changeset)
assign(socket, :changeset, changeset)
end
{:noreply, socket}

View File

@ -4,11 +4,11 @@ defmodule MemexWeb.PipelineLive.Index do
@impl true
def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(search: search) |> display_pipelines()}
{:ok, socket |> assign(:search, search) |> display_pipelines()}
end
def mount(_params, _session, socket) do
{:ok, socket |> assign(search: nil) |> display_pipelines()}
{:ok, socket |> assign(:search, nil) |> display_pipelines()}
end
@impl true
@ -20,29 +20,37 @@ defmodule MemexWeb.PipelineLive.Index do
%{slug: slug} = pipeline = Pipelines.get_pipeline_by_slug(slug, current_user)
socket
|> assign(page_title: gettext("edit %{slug}", slug: slug))
|> assign(pipeline: pipeline)
|> assign(
page_title: gettext("edit %{slug}", slug: slug),
pipeline: pipeline
)
end
defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do
socket
|> assign(page_title: gettext("new pipeline"))
|> assign(pipeline: %Pipeline{visibility: :private, user_id: current_user_id})
|> assign(
page_title: gettext("new pipeline"),
pipeline: %Pipeline{visibility: :private, user_id: current_user_id}
)
end
defp apply_action(socket, :index, _params) do
socket
|> assign(page_title: gettext("pipelines"))
|> assign(search: nil)
|> assign(pipeline: nil)
|> assign(
page_title: gettext("pipelines"),
pipeline: nil,
search: nil
)
|> display_pipelines()
end
defp apply_action(socket, :search, %{"search" => search}) do
socket
|> assign(page_title: gettext("pipelines"))
|> assign(search: search)
|> assign(pipeline: nil)
|> assign(
page_title: gettext("pipelines"),
pipeline: nil,
search: search
)
|> display_pipelines()
end
@ -53,7 +61,7 @@ defmodule MemexWeb.PipelineLive.Index do
socket =
socket
|> assign(pipelines: Pipelines.list_pipelines(current_user))
|> assign(:pipelines, Pipelines.list_pipelines(current_user))
|> put_flash(:info, gettext("%{slug} deleted", slug: slug))
{:noreply, socket}
@ -67,12 +75,11 @@ defmodule MemexWeb.PipelineLive.Index do
{:noreply, socket |> push_patch(to: ~p"/pipelines/#{search_term}")}
end
defp display_pipelines(%{assigns: %{current_user: current_user, search: search}} = socket)
when not (current_user |> is_nil()) do
socket |> assign(pipelines: Pipelines.list_pipelines(search, current_user))
defp display_pipelines(%{assigns: %{current_user: %{} = current_user, search: search}} = socket) do
socket |> assign(:pipelines, Pipelines.list_pipelines(search, current_user))
end
defp display_pipelines(%{assigns: %{search: search}} = socket) do
socket |> assign(pipelines: Pipelines.list_public_pipelines(search))
socket |> assign(:pipelines, Pipelines.list_public_pipelines(search))
end
end

View File

@ -1,4 +1,4 @@
<div class="mx-auto flex flex-col justify-center items-start space-y-4 max-w-3xl">
<div class="flex flex-col justify-center items-start mx-auto space-y-4 max-w-3xl">
<h1 class="text-xl">
<%= gettext("pipelines") %>
</h1>
@ -9,7 +9,7 @@
as={:search}
phx-change="search"
phx-submit="search"
class="self-stretch flex flex-col items-stretch"
class="flex flex-col items-stretch self-stretch"
>
<%= text_input(f, :search_term,
class: "input input-primary",
@ -33,14 +33,14 @@
>
<:actions :let={pipeline}>
<.link
:if={Pipelines.owner?(pipeline, @current_user)}
:if={@current_user}
patch={~p"/pipelines/#{pipeline}/edit"}
aria-label={dgettext("actions", "edit %{pipeline_slug}", pipeline_slug: pipeline.slug)}
>
<%= dgettext("actions", "edit") %>
</.link>
<.link
:if={Pipelines.owner_or_admin?(pipeline, @current_user)}
:if={@current_user}
href="#"
phx-click="delete"
phx-value-id={pipeline.id}

View File

@ -21,9 +21,12 @@ defmodule MemexWeb.PipelineLive.Show do
socket =
socket
|> assign(:page_title, page_title(live_action, pipeline))
|> assign(:pipeline, pipeline)
|> assign(:steps, pipeline |> Steps.list_steps(current_user))
|> assign(
page_title: page_title(live_action, pipeline),
pipeline_backlinks: Pipelines.backlink("[#{pipeline.slug}]", current_user),
pipeline: pipeline,
steps: pipeline |> Steps.list_steps(current_user)
)
|> apply_action(live_action, params)
{:noreply, socket}
@ -47,8 +50,8 @@ defmodule MemexWeb.PipelineLive.Show do
socket
|> assign(
step: %Step{
position: steps |> Enum.count(),
pipeline_id: pipeline_id,
position: steps |> Enum.count(),
user_id: current_user_id
}
)
@ -59,7 +62,7 @@ defmodule MemexWeb.PipelineLive.Show do
:edit_step,
%{"step_id" => step_id}
) do
socket |> assign(step: step_id |> Steps.get_step!(current_user))
socket |> assign(:step, step_id |> Steps.get_step!(current_user))
end
@impl true

View File

@ -1,4 +1,4 @@
<div class="mx-auto flex flex-col justify-center items-stretch space-y-4 max-w-3xl">
<div class="flex flex-col justify-center items-stretch mx-auto space-y-4 max-w-3xl">
<h1 class="text-xl">
<%= @pipeline.slug %>
</h1>
@ -11,20 +11,27 @@
<.pipeline_content pipeline={@pipeline} />
<div :if={@pipeline_backlinks != []} class="flex flex-wrap justify-end items-center self-end">
<p><%= gettext("Backlinked by:") %></p>
<.link
:for={backlink <- @pipeline_backlinks}
class="m-1 hover:underline"
patch={~p"/pipeline/#{backlink}"}
>
<%= gettext("[%{slug}]", slug: backlink.slug) %>
</.link>
</div>
<p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @pipeline.visibility) %>
</p>
<div class="pb-4 self-end flex space-x-4">
<.link
:if={Pipelines.owner?(@pipeline, @current_user)}
class="btn btn-primary"
patch={~p"/pipeline/#{@pipeline}/edit"}
>
<div class="flex self-end pb-4 space-x-4">
<.link :if={@current_user} class="btn btn-primary" patch={~p"/pipeline/#{@pipeline}/edit"}>
<%= dgettext("actions", "edit") %>
</.link>
<button
:if={Pipelines.owner_or_admin?(@pipeline, @current_user)}
:if={@current_user}
type="button"
class="btn btn-primary"
phx-click="delete"
@ -37,7 +44,7 @@
<hr class="hr" />
<h2 class="pt-2 self-center text-lg">
<h2 class="self-center pt-2 text-lg">
<%= gettext("steps:") %>
</h2>
@ -52,29 +59,29 @@
<%= gettext("%{position}. %{title}", position: position + 1, title: title) %>
</h3>
<%= if Pipelines.owner?(@pipeline, @current_user) do %>
<%= if @current_user do %>
<div class="flex justify-between items-center space-x-4">
<%= if position <= 0 do %>
<i class="fas text-xl fa-chevron-up cursor-not-allowed opacity-25"></i>
<i class="text-xl opacity-25 cursor-not-allowed fas fa-chevron-up"></i>
<% else %>
<button
type="button"
class="cursor-pointer flex justify-center items-center"
class="flex justify-center items-center cursor-pointer"
phx-click="reorder_step"
phx-value-direction="up"
phx-value-step-id={step_id}
aria-label={dgettext("actions", "move %{step_title} up", step_title: step.title)}
>
<i class="fas text-xl fa-chevron-up"></i>
<i class="text-xl fas fa-chevron-up"></i>
</button>
<% end %>
<%= if position >= length(@steps) - 1 do %>
<i class="fas text-xl fa-chevron-down cursor-not-allowed opacity-25"></i>
<i class="text-xl opacity-25 cursor-not-allowed fas fa-chevron-down"></i>
<% else %>
<button
type="button"
class="cursor-pointer flex justify-center items-center"
class="flex justify-center items-center cursor-pointer"
phx-click="reorder_step"
phx-value-direction="down"
phx-value-step-id={step_id}
@ -82,7 +89,7 @@
dgettext("actions", "move %{step_title} down", step_title: step.title)
}
>
<i class="fas text-xl fa-chevron-down"></i>
<i class="text-xl fas fa-chevron-down"></i>
</button>
<% end %>
@ -113,7 +120,7 @@
<% end %>
<.link
:if={Pipelines.owner?(@pipeline, @current_user)}
:if={@current_user}
class="self-end btn btn-primary"
patch={~p"/pipeline/#{@pipeline}/add_step"}
>

View File

@ -75,7 +75,7 @@ defmodule MemexWeb.StepLive.FormComponent do
|> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} ->
assign(socket, changeset: changeset)
assign(socket, :changeset, changeset)
end
{:noreply, socket}

View File

@ -4,7 +4,7 @@ defmodule Memex.MixProject do
def project do
[
app: :memex,
version: "0.1.18",
version: "0.1.19",
elixir: "1.18.1",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,

View File

@ -40,12 +40,12 @@ msgid "create invite"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:50
#: lib/memex_web/live/context_live/show.html.heex:34
#: lib/memex_web/live/context_live/show.html.heex:51
#: lib/memex_web/live/note_live/index.html.heex:50
#: lib/memex_web/live/note_live/show.html.heex:34
#: lib/memex_web/live/note_live/show.html.heex:58
#: lib/memex_web/live/pipeline_live/index.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:34
#: lib/memex_web/live/pipeline_live/show.html.heex:105
#: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:112
#, elixir-autogen, elixir-format
msgid "delete"
msgstr ""
@ -56,12 +56,12 @@ msgid "delete user"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:40
#: lib/memex_web/live/context_live/show.html.heex:24
#: lib/memex_web/live/context_live/show.html.heex:41
#: lib/memex_web/live/note_live/index.html.heex:40
#: lib/memex_web/live/note_live/show.html.heex:24
#: lib/memex_web/live/note_live/show.html.heex:48
#: lib/memex_web/live/pipeline_live/index.html.heex:40
#: lib/memex_web/live/pipeline_live/show.html.heex:24
#: lib/memex_web/live/pipeline_live/show.html.heex:94
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:101
#, elixir-autogen, elixir-format
msgid "edit"
msgstr ""
@ -112,7 +112,7 @@ msgstr ""
msgid "save"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:120
#: lib/memex_web/live/pipeline_live/show.html.heex:127
#, elixir-autogen, elixir-format
msgid "add step"
msgstr ""
@ -145,24 +145,24 @@ msgid "copy invite link for %{invite_name}"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:48
#: lib/memex_web/live/context_live/show.html.heex:32
#: lib/memex_web/live/context_live/show.html.heex:49
#, elixir-autogen, elixir-format
msgid "delete %{context_slug}"
msgstr ""
#: lib/memex_web/live/note_live/index.html.heex:48
#: lib/memex_web/live/note_live/show.html.heex:32
#: lib/memex_web/live/note_live/show.html.heex:56
#, elixir-autogen, elixir-format
msgid "delete %{note_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.html.heex:49
#: lib/memex_web/live/pipeline_live/show.html.heex:32
#: lib/memex_web/live/pipeline_live/show.html.heex:39
#, elixir-autogen, elixir-format
msgid "delete %{pipeline_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:103
#: lib/memex_web/live/pipeline_live/show.html.heex:110
#, elixir-autogen, elixir-format
msgid "delete %{step_title}"
msgstr ""
@ -187,7 +187,7 @@ msgstr ""
msgid "edit %{pipeline_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:92
#: lib/memex_web/live/pipeline_live/show.html.heex:99
#, elixir-autogen, elixir-format
msgid "edit %{step_title}"
msgstr ""
@ -197,12 +197,12 @@ msgstr ""
msgid "edit invite for %{invite_name}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:82
#: lib/memex_web/live/pipeline_live/show.html.heex:89
#, elixir-autogen, elixir-format
msgid "move %{step_title} down"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:66
#: lib/memex_web/live/pipeline_live/show.html.heex:73
#, elixir-autogen, elixir-format
msgid "move %{step_title} up"
msgstr ""

View File

@ -40,12 +40,12 @@ msgid "create invite"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:50
#: lib/memex_web/live/context_live/show.html.heex:34
#: lib/memex_web/live/context_live/show.html.heex:51
#: lib/memex_web/live/note_live/index.html.heex:50
#: lib/memex_web/live/note_live/show.html.heex:34
#: lib/memex_web/live/note_live/show.html.heex:58
#: lib/memex_web/live/pipeline_live/index.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:34
#: lib/memex_web/live/pipeline_live/show.html.heex:105
#: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:112
#, elixir-autogen, elixir-format
msgid "delete"
msgstr ""
@ -56,12 +56,12 @@ msgid "delete user"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:40
#: lib/memex_web/live/context_live/show.html.heex:24
#: lib/memex_web/live/context_live/show.html.heex:41
#: lib/memex_web/live/note_live/index.html.heex:40
#: lib/memex_web/live/note_live/show.html.heex:24
#: lib/memex_web/live/note_live/show.html.heex:48
#: lib/memex_web/live/pipeline_live/index.html.heex:40
#: lib/memex_web/live/pipeline_live/show.html.heex:24
#: lib/memex_web/live/pipeline_live/show.html.heex:94
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:101
#, elixir-autogen, elixir-format
msgid "edit"
msgstr ""
@ -112,7 +112,7 @@ msgstr ""
msgid "save"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:120
#: lib/memex_web/live/pipeline_live/show.html.heex:127
#, elixir-autogen, elixir-format
msgid "add step"
msgstr ""
@ -145,24 +145,24 @@ msgid "copy invite link for %{invite_name}"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:48
#: lib/memex_web/live/context_live/show.html.heex:32
#: lib/memex_web/live/context_live/show.html.heex:49
#, elixir-autogen, elixir-format
msgid "delete %{context_slug}"
msgstr ""
#: lib/memex_web/live/note_live/index.html.heex:48
#: lib/memex_web/live/note_live/show.html.heex:32
#: lib/memex_web/live/note_live/show.html.heex:56
#, elixir-autogen, elixir-format
msgid "delete %{note_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.html.heex:49
#: lib/memex_web/live/pipeline_live/show.html.heex:32
#: lib/memex_web/live/pipeline_live/show.html.heex:39
#, elixir-autogen, elixir-format
msgid "delete %{pipeline_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:103
#: lib/memex_web/live/pipeline_live/show.html.heex:110
#, elixir-autogen, elixir-format
msgid "delete %{step_title}"
msgstr ""
@ -187,7 +187,7 @@ msgstr ""
msgid "edit %{pipeline_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:92
#: lib/memex_web/live/pipeline_live/show.html.heex:99
#, elixir-autogen, elixir-format
msgid "edit %{step_title}"
msgstr ""
@ -197,12 +197,12 @@ msgstr ""
msgid "edit invite for %{invite_name}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:82
#: lib/memex_web/live/pipeline_live/show.html.heex:89
#, elixir-autogen, elixir-format
msgid "move %{step_title} down"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:66
#: lib/memex_web/live/pipeline_live/show.html.heex:73
#, elixir-autogen, elixir-format
msgid "move %{step_title} up"
msgstr ""

View File

@ -17,9 +17,9 @@ msgstr ""
msgid "Reconnecting..."
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:15
#: lib/memex_web/live/note_live/show.html.heex:15
#: lib/memex_web/live/pipeline_live/show.html.heex:15
#: lib/memex_web/live/context_live/show.html.heex:36
#: lib/memex_web/live/note_live/show.html.heex:43
#: lib/memex_web/live/pipeline_live/show.html.heex:26
#, elixir-autogen, elixir-format
msgid "Visibility: %{visibility}"
msgstr ""
@ -29,7 +29,7 @@ msgstr ""
msgid "accessible from any internet-capable device"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:85
#: lib/memex_web/live/home_live.html.heex:94
#, elixir-autogen, elixir-format
msgid "admins:"
msgstr ""
@ -46,8 +46,8 @@ msgid "confirm new password"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:28
#: lib/memex_web/live/context_live/index.ex:35
#: lib/memex_web/live/context_live/index.ex:43
#: lib/memex_web/live/context_live/index.ex:41
#: lib/memex_web/live/context_live/index.ex:51
#: lib/memex_web/live/context_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "contexts"
@ -118,22 +118,22 @@ msgstr ""
msgid "features"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:149
#: lib/memex_web/live/home_live.html.heex:158
#, elixir-autogen, elixir-format
msgid "help translate"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:80
#: lib/memex_web/live/home_live.html.heex:89
#, elixir-autogen, elixir-format
msgid "instance information"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:22
#: lib/memex_web/components/core_components/invite_card.html.heex:8
#, elixir-autogen, elixir-format
msgid "invite disabled"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:105
#: lib/memex_web/live/home_live.html.heex:114
#, elixir-autogen, elixir-format
msgid "invite only"
msgstr ""
@ -177,8 +177,8 @@ msgid "no notes found"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:22
#: lib/memex_web/live/note_live/index.ex:35
#: lib/memex_web/live/note_live/index.ex:43
#: lib/memex_web/live/note_live/index.ex:41
#: lib/memex_web/live/note_live/index.ex:51
#: lib/memex_web/live/note_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "notes"
@ -190,8 +190,8 @@ msgid "notes:"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:34
#: lib/memex_web/live/pipeline_live/index.ex:35
#: lib/memex_web/live/pipeline_live/index.ex:43
#: lib/memex_web/live/pipeline_live/index.ex:40
#: lib/memex_web/live/pipeline_live/index.ex:50
#: lib/memex_web/live/pipeline_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "pipelines"
@ -217,7 +217,7 @@ msgstr ""
msgid "provide context around a single topic and hotlink to your notes"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:104
#: lib/memex_web/live/home_live.html.heex:113
#, elixir-autogen, elixir-format
msgid "public signups"
msgstr ""
@ -227,12 +227,12 @@ msgstr ""
msgid "register"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:101
#: lib/memex_web/live/home_live.html.heex:110
#, elixir-autogen, elixir-format
msgid "registration:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:160
#: lib/memex_web/live/home_live.html.heex:169
#, elixir-autogen, elixir-format
msgid "report bugs or request features"
msgstr ""
@ -288,12 +288,12 @@ msgstr ""
msgid "users"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:111
#: lib/memex_web/live/home_live.html.heex:120
#, elixir-autogen, elixir-format
msgid "version:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:138
#: lib/memex_web/live/home_live.html.heex:147
#, elixir-autogen, elixir-format
msgid "view the source code"
msgstr ""
@ -305,7 +305,7 @@ msgstr ""
msgid "visibility"
msgstr ""
#: lib/memex_web/live/note_live/index.ex:29
#: lib/memex_web/live/note_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "new note"
msgstr ""
@ -317,7 +317,7 @@ msgstr ""
msgid "search"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:29
#: lib/memex_web/live/context_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "new context"
msgstr ""
@ -332,7 +332,7 @@ msgstr ""
msgid "description"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.ex:29
#: lib/memex_web/live/pipeline_live/index.ex:32
#, elixir-autogen, elixir-format
msgid "new pipeline"
msgstr ""
@ -349,12 +349,12 @@ msgstr ""
msgid "%{slug} created"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:57
#: lib/memex_web/live/context_live/show.ex:40
#: lib/memex_web/live/note_live/index.ex:57
#: lib/memex_web/live/note_live/show.ex:40
#: lib/memex_web/live/pipeline_live/index.ex:57
#: lib/memex_web/live/pipeline_live/show.ex:75
#: lib/memex_web/live/context_live/index.ex:65
#: lib/memex_web/live/context_live/show.ex:44
#: lib/memex_web/live/note_live/index.ex:65
#: lib/memex_web/live/note_live/show.ex:45
#: lib/memex_web/live/pipeline_live/index.ex:65
#: lib/memex_web/live/pipeline_live/show.ex:78
#, elixir-autogen, elixir-format
msgid "%{slug} deleted"
msgstr ""
@ -366,12 +366,12 @@ msgstr ""
msgid "%{slug} saved"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:23
#: lib/memex_web/live/context_live/show.ex:47
#: lib/memex_web/live/note_live/index.ex:23
#: lib/memex_web/live/note_live/show.ex:47
#: lib/memex_web/live/pipeline_live/index.ex:23
#: lib/memex_web/live/pipeline_live/show.ex:121
#: lib/memex_web/live/context_live/index.ex:25
#: lib/memex_web/live/context_live/show.ex:51
#: lib/memex_web/live/note_live/index.ex:25
#: lib/memex_web/live/note_live/show.ex:52
#: lib/memex_web/live/pipeline_live/index.ex:24
#: lib/memex_web/live/pipeline_live/show.ex:124
#, elixir-autogen, elixir-format
msgid "edit %{slug}"
msgstr ""
@ -422,7 +422,7 @@ msgstr ""
msgid "what is this?"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:59
#, elixir-autogen, elixir-format
msgid "%{position}. %{title}"
msgstr ""
@ -432,7 +432,7 @@ msgstr ""
msgid "%{title} created"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:93
#: lib/memex_web/live/pipeline_live/show.ex:96
#, elixir-autogen, elixir-format
msgid "%{title} deleted"
msgstr ""
@ -442,17 +442,17 @@ msgstr ""
msgid "%{title} saved"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:123
#: lib/memex_web/live/pipeline_live/show.ex:126
#, elixir-autogen, elixir-format
msgid "add step to %{slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:46
#: lib/memex_web/live/pipeline_live/show.html.heex:53
#, elixir-autogen, elixir-format
msgid "no steps"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:48
#, elixir-autogen, elixir-format
msgid "steps:"
msgstr ""
@ -578,7 +578,7 @@ msgstr ""
msgid "user registered on%{registered_datetime}"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:17
#: lib/memex_web/components/core_components/invite_card.html.heex:18
#, elixir-autogen, elixir-format
msgid "uses left: unlimited"
msgstr ""
@ -588,17 +588,17 @@ msgstr ""
msgid "read more on how to use memEx"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:12
#: lib/memex_web/components/core_components/invite_card.html.heex:13
#, elixir-autogen, elixir-format, fuzzy
msgid "uses left: %{uses_left_count}"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:32
#: lib/memex_web/components/core_components/invite_card.html.heex:29
#, elixir-autogen, elixir-format
msgid "uses: %{uses_count}"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:128
#: lib/memex_web/live/home_live.html.heex:137
#, elixir-autogen, elixir-format, fuzzy
msgid "get involved"
msgstr ""
@ -721,3 +721,38 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "(This note is empty)"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:18
#: lib/memex_web/live/note_live/show.html.heex:18
#: lib/memex_web/live/pipeline_live/show.html.heex:15
#, elixir-autogen, elixir-format
msgid "Backlinked by:"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:24
#: lib/memex_web/live/note_live/show.html.heex:24
#: lib/memex_web/live/pipeline_live/show.html.heex:21
#, elixir-autogen, elixir-format, fuzzy
msgid "[%{slug}]"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:31
#, elixir-autogen, elixir-format
msgid "[[%{slug}]]"
msgstr ""
#: lib/memex_web/live/note_live/show.html.heex:38
#, elixir-autogen, elixir-format
msgid "[[[%{slug}]]]"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:77
#, elixir-autogen, elixir-format
msgid "backlinks:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:80
#, elixir-autogen, elixir-format
msgid "view referencing items from the referenced item"
msgstr ""

View File

@ -47,11 +47,11 @@ msgid "must have the @ sign and no spaces"
msgstr ""
#: lib/memex/contexts/context.ex:58
#: lib/memex/contexts/context.ex:71
#: lib/memex/contexts/context.ex:72
#: lib/memex/notes/note.ex:57
#: lib/memex/notes/note.ex:70
#: lib/memex/notes/note.ex:71
#: lib/memex/pipelines/pipeline.ex:60
#: lib/memex/pipelines/pipeline.ex:73
#: lib/memex/pipelines/pipeline.ex:74
#, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted"
msgstr ""
@ -140,9 +140,9 @@ msgstr ""
msgid "user confirmation link is invalid or it has expired."
msgstr ""
#: lib/memex/contexts/context.ex:84
#: lib/memex/notes/note.ex:83
#: lib/memex/pipelines/pipeline.ex:86
#: lib/memex/contexts/context.ex:85
#: lib/memex/notes/note.ex:84
#: lib/memex/pipelines/pipeline.ex:87
#, elixir-autogen, elixir-format, fuzzy
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma or space delimited"
msgstr ""

View File

@ -66,12 +66,12 @@ msgid "are you sure you want to make %{invite_name} unlimited?"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:47
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/context_live/show.html.heex:48
#: lib/memex_web/live/note_live/index.html.heex:47
#: lib/memex_web/live/note_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:55
#: lib/memex_web/live/pipeline_live/index.html.heex:47
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:102
#: lib/memex_web/live/pipeline_live/show.html.heex:38
#: lib/memex_web/live/pipeline_live/show.html.heex:109
#, elixir-autogen, elixir-format
msgid "are you sure?"
msgstr ""
@ -86,7 +86,7 @@ msgstr ""
msgid "language updated successfully."
msgstr ""
#: lib/memex_web/live/home_live.html.heex:90
#: lib/memex_web/live/home_live.html.heex:99
#, elixir-autogen, elixir-format, fuzzy
msgid "register to setup memEx"
msgstr ""

View File

@ -15,9 +15,9 @@ msgstr ""
msgid "Reconnecting..."
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:15
#: lib/memex_web/live/note_live/show.html.heex:15
#: lib/memex_web/live/pipeline_live/show.html.heex:15
#: lib/memex_web/live/context_live/show.html.heex:36
#: lib/memex_web/live/note_live/show.html.heex:43
#: lib/memex_web/live/pipeline_live/show.html.heex:26
#, elixir-autogen, elixir-format
msgid "Visibility: %{visibility}"
msgstr ""
@ -27,7 +27,7 @@ msgstr ""
msgid "accessible from any internet-capable device"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:85
#: lib/memex_web/live/home_live.html.heex:94
#, elixir-autogen, elixir-format
msgid "admins:"
msgstr ""
@ -44,8 +44,8 @@ msgid "confirm new password"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:28
#: lib/memex_web/live/context_live/index.ex:35
#: lib/memex_web/live/context_live/index.ex:43
#: lib/memex_web/live/context_live/index.ex:41
#: lib/memex_web/live/context_live/index.ex:51
#: lib/memex_web/live/context_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "contexts"
@ -116,22 +116,22 @@ msgstr ""
msgid "features"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:149
#: lib/memex_web/live/home_live.html.heex:158
#, elixir-autogen, elixir-format
msgid "help translate"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:80
#: lib/memex_web/live/home_live.html.heex:89
#, elixir-autogen, elixir-format
msgid "instance information"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:22
#: lib/memex_web/components/core_components/invite_card.html.heex:8
#, elixir-autogen, elixir-format
msgid "invite disabled"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:105
#: lib/memex_web/live/home_live.html.heex:114
#, elixir-autogen, elixir-format
msgid "invite only"
msgstr ""
@ -175,8 +175,8 @@ msgid "no notes found"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:22
#: lib/memex_web/live/note_live/index.ex:35
#: lib/memex_web/live/note_live/index.ex:43
#: lib/memex_web/live/note_live/index.ex:41
#: lib/memex_web/live/note_live/index.ex:51
#: lib/memex_web/live/note_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "notes"
@ -188,8 +188,8 @@ msgid "notes:"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:34
#: lib/memex_web/live/pipeline_live/index.ex:35
#: lib/memex_web/live/pipeline_live/index.ex:43
#: lib/memex_web/live/pipeline_live/index.ex:40
#: lib/memex_web/live/pipeline_live/index.ex:50
#: lib/memex_web/live/pipeline_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "pipelines"
@ -215,7 +215,7 @@ msgstr ""
msgid "provide context around a single topic and hotlink to your notes"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:104
#: lib/memex_web/live/home_live.html.heex:113
#, elixir-autogen, elixir-format
msgid "public signups"
msgstr ""
@ -225,12 +225,12 @@ msgstr ""
msgid "register"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:101
#: lib/memex_web/live/home_live.html.heex:110
#, elixir-autogen, elixir-format
msgid "registration:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:160
#: lib/memex_web/live/home_live.html.heex:169
#, elixir-autogen, elixir-format
msgid "report bugs or request features"
msgstr ""
@ -286,12 +286,12 @@ msgstr ""
msgid "users"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:111
#: lib/memex_web/live/home_live.html.heex:120
#, elixir-autogen, elixir-format
msgid "version:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:138
#: lib/memex_web/live/home_live.html.heex:147
#, elixir-autogen, elixir-format
msgid "view the source code"
msgstr ""
@ -303,7 +303,7 @@ msgstr ""
msgid "visibility"
msgstr ""
#: lib/memex_web/live/note_live/index.ex:29
#: lib/memex_web/live/note_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "new note"
msgstr ""
@ -315,7 +315,7 @@ msgstr ""
msgid "search"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:29
#: lib/memex_web/live/context_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "new context"
msgstr ""
@ -330,7 +330,7 @@ msgstr ""
msgid "description"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.ex:29
#: lib/memex_web/live/pipeline_live/index.ex:32
#, elixir-autogen, elixir-format
msgid "new pipeline"
msgstr ""
@ -347,12 +347,12 @@ msgstr ""
msgid "%{slug} created"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:57
#: lib/memex_web/live/context_live/show.ex:40
#: lib/memex_web/live/note_live/index.ex:57
#: lib/memex_web/live/note_live/show.ex:40
#: lib/memex_web/live/pipeline_live/index.ex:57
#: lib/memex_web/live/pipeline_live/show.ex:75
#: lib/memex_web/live/context_live/index.ex:65
#: lib/memex_web/live/context_live/show.ex:44
#: lib/memex_web/live/note_live/index.ex:65
#: lib/memex_web/live/note_live/show.ex:45
#: lib/memex_web/live/pipeline_live/index.ex:65
#: lib/memex_web/live/pipeline_live/show.ex:78
#, elixir-autogen, elixir-format
msgid "%{slug} deleted"
msgstr ""
@ -364,12 +364,12 @@ msgstr ""
msgid "%{slug} saved"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:23
#: lib/memex_web/live/context_live/show.ex:47
#: lib/memex_web/live/note_live/index.ex:23
#: lib/memex_web/live/note_live/show.ex:47
#: lib/memex_web/live/pipeline_live/index.ex:23
#: lib/memex_web/live/pipeline_live/show.ex:121
#: lib/memex_web/live/context_live/index.ex:25
#: lib/memex_web/live/context_live/show.ex:51
#: lib/memex_web/live/note_live/index.ex:25
#: lib/memex_web/live/note_live/show.ex:52
#: lib/memex_web/live/pipeline_live/index.ex:24
#: lib/memex_web/live/pipeline_live/show.ex:124
#, elixir-autogen, elixir-format
msgid "edit %{slug}"
msgstr ""
@ -420,7 +420,7 @@ msgstr ""
msgid "what is this?"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:59
#, elixir-autogen, elixir-format
msgid "%{position}. %{title}"
msgstr ""
@ -430,7 +430,7 @@ msgstr ""
msgid "%{title} created"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:93
#: lib/memex_web/live/pipeline_live/show.ex:96
#, elixir-autogen, elixir-format
msgid "%{title} deleted"
msgstr ""
@ -440,17 +440,17 @@ msgstr ""
msgid "%{title} saved"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:123
#: lib/memex_web/live/pipeline_live/show.ex:126
#, elixir-autogen, elixir-format
msgid "add step to %{slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:46
#: lib/memex_web/live/pipeline_live/show.html.heex:53
#, elixir-autogen, elixir-format
msgid "no steps"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:48
#, elixir-autogen, elixir-format
msgid "steps:"
msgstr ""
@ -576,7 +576,7 @@ msgstr ""
msgid "user registered on%{registered_datetime}"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:17
#: lib/memex_web/components/core_components/invite_card.html.heex:18
#, elixir-autogen, elixir-format
msgid "uses left: unlimited"
msgstr ""
@ -586,17 +586,17 @@ msgstr ""
msgid "read more on how to use memEx"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:12
#: lib/memex_web/components/core_components/invite_card.html.heex:13
#, elixir-autogen, elixir-format
msgid "uses left: %{uses_left_count}"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:32
#: lib/memex_web/components/core_components/invite_card.html.heex:29
#, elixir-autogen, elixir-format
msgid "uses: %{uses_count}"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:128
#: lib/memex_web/live/home_live.html.heex:137
#, elixir-autogen, elixir-format
msgid "get involved"
msgstr ""
@ -719,3 +719,38 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "(This note is empty)"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:18
#: lib/memex_web/live/note_live/show.html.heex:18
#: lib/memex_web/live/pipeline_live/show.html.heex:15
#, elixir-autogen, elixir-format
msgid "Backlinked by:"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:24
#: lib/memex_web/live/note_live/show.html.heex:24
#: lib/memex_web/live/pipeline_live/show.html.heex:21
#, elixir-autogen, elixir-format
msgid "[%{slug}]"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:31
#, elixir-autogen, elixir-format
msgid "[[%{slug}]]"
msgstr ""
#: lib/memex_web/live/note_live/show.html.heex:38
#, elixir-autogen, elixir-format
msgid "[[[%{slug}]]]"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:77
#, elixir-autogen, elixir-format
msgid "backlinks:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:80
#, elixir-autogen, elixir-format
msgid "view referencing items from the referenced item"
msgstr ""

View File

@ -41,12 +41,12 @@ msgid "create invite"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:50
#: lib/memex_web/live/context_live/show.html.heex:34
#: lib/memex_web/live/context_live/show.html.heex:51
#: lib/memex_web/live/note_live/index.html.heex:50
#: lib/memex_web/live/note_live/show.html.heex:34
#: lib/memex_web/live/note_live/show.html.heex:58
#: lib/memex_web/live/pipeline_live/index.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:34
#: lib/memex_web/live/pipeline_live/show.html.heex:105
#: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:112
#, elixir-autogen, elixir-format
msgid "delete"
msgstr ""
@ -57,12 +57,12 @@ msgid "delete user"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:40
#: lib/memex_web/live/context_live/show.html.heex:24
#: lib/memex_web/live/context_live/show.html.heex:41
#: lib/memex_web/live/note_live/index.html.heex:40
#: lib/memex_web/live/note_live/show.html.heex:24
#: lib/memex_web/live/note_live/show.html.heex:48
#: lib/memex_web/live/pipeline_live/index.html.heex:40
#: lib/memex_web/live/pipeline_live/show.html.heex:24
#: lib/memex_web/live/pipeline_live/show.html.heex:94
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:101
#, elixir-autogen, elixir-format
msgid "edit"
msgstr ""
@ -113,7 +113,7 @@ msgstr ""
msgid "save"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:120
#: lib/memex_web/live/pipeline_live/show.html.heex:127
#, elixir-autogen, elixir-format
msgid "add step"
msgstr ""
@ -146,24 +146,24 @@ msgid "copy invite link for %{invite_name}"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:48
#: lib/memex_web/live/context_live/show.html.heex:32
#: lib/memex_web/live/context_live/show.html.heex:49
#, elixir-autogen, elixir-format
msgid "delete %{context_slug}"
msgstr ""
#: lib/memex_web/live/note_live/index.html.heex:48
#: lib/memex_web/live/note_live/show.html.heex:32
#: lib/memex_web/live/note_live/show.html.heex:56
#, elixir-autogen, elixir-format
msgid "delete %{note_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.html.heex:49
#: lib/memex_web/live/pipeline_live/show.html.heex:32
#: lib/memex_web/live/pipeline_live/show.html.heex:39
#, elixir-autogen, elixir-format
msgid "delete %{pipeline_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:103
#: lib/memex_web/live/pipeline_live/show.html.heex:110
#, elixir-autogen, elixir-format
msgid "delete %{step_title}"
msgstr ""
@ -188,7 +188,7 @@ msgstr ""
msgid "edit %{pipeline_slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:92
#: lib/memex_web/live/pipeline_live/show.html.heex:99
#, elixir-autogen, elixir-format
msgid "edit %{step_title}"
msgstr ""
@ -198,12 +198,12 @@ msgstr ""
msgid "edit invite for %{invite_name}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:82
#: lib/memex_web/live/pipeline_live/show.html.heex:89
#, elixir-autogen, elixir-format
msgid "move %{step_title} down"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:66
#: lib/memex_web/live/pipeline_live/show.html.heex:73
#, elixir-autogen, elixir-format
msgid "move %{step_title} up"
msgstr ""

View File

@ -16,9 +16,9 @@ msgstr ""
msgid "Reconnecting..."
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:15
#: lib/memex_web/live/note_live/show.html.heex:15
#: lib/memex_web/live/pipeline_live/show.html.heex:15
#: lib/memex_web/live/context_live/show.html.heex:36
#: lib/memex_web/live/note_live/show.html.heex:43
#: lib/memex_web/live/pipeline_live/show.html.heex:26
#, elixir-autogen, elixir-format
msgid "Visibility: %{visibility}"
msgstr ""
@ -28,7 +28,7 @@ msgstr ""
msgid "accessible from any internet-capable device"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:85
#: lib/memex_web/live/home_live.html.heex:94
#, elixir-autogen, elixir-format
msgid "admins:"
msgstr ""
@ -45,8 +45,8 @@ msgid "confirm new password"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:28
#: lib/memex_web/live/context_live/index.ex:35
#: lib/memex_web/live/context_live/index.ex:43
#: lib/memex_web/live/context_live/index.ex:41
#: lib/memex_web/live/context_live/index.ex:51
#: lib/memex_web/live/context_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "contexts"
@ -117,22 +117,22 @@ msgstr ""
msgid "features"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:149
#: lib/memex_web/live/home_live.html.heex:158
#, elixir-autogen, elixir-format
msgid "help translate"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:80
#: lib/memex_web/live/home_live.html.heex:89
#, elixir-autogen, elixir-format
msgid "instance information"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:22
#: lib/memex_web/components/core_components/invite_card.html.heex:8
#, elixir-autogen, elixir-format
msgid "invite disabled"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:105
#: lib/memex_web/live/home_live.html.heex:114
#, elixir-autogen, elixir-format
msgid "invite only"
msgstr ""
@ -176,8 +176,8 @@ msgid "no notes found"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:22
#: lib/memex_web/live/note_live/index.ex:35
#: lib/memex_web/live/note_live/index.ex:43
#: lib/memex_web/live/note_live/index.ex:41
#: lib/memex_web/live/note_live/index.ex:51
#: lib/memex_web/live/note_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "notes"
@ -189,8 +189,8 @@ msgid "notes:"
msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:34
#: lib/memex_web/live/pipeline_live/index.ex:35
#: lib/memex_web/live/pipeline_live/index.ex:43
#: lib/memex_web/live/pipeline_live/index.ex:40
#: lib/memex_web/live/pipeline_live/index.ex:50
#: lib/memex_web/live/pipeline_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "pipelines"
@ -216,7 +216,7 @@ msgstr ""
msgid "provide context around a single topic and hotlink to your notes"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:104
#: lib/memex_web/live/home_live.html.heex:113
#, elixir-autogen, elixir-format
msgid "public signups"
msgstr ""
@ -226,12 +226,12 @@ msgstr ""
msgid "register"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:101
#: lib/memex_web/live/home_live.html.heex:110
#, elixir-autogen, elixir-format
msgid "registration:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:160
#: lib/memex_web/live/home_live.html.heex:169
#, elixir-autogen, elixir-format
msgid "report bugs or request features"
msgstr ""
@ -287,12 +287,12 @@ msgstr ""
msgid "users"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:111
#: lib/memex_web/live/home_live.html.heex:120
#, elixir-autogen, elixir-format
msgid "version:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:138
#: lib/memex_web/live/home_live.html.heex:147
#, elixir-autogen, elixir-format
msgid "view the source code"
msgstr ""
@ -304,7 +304,7 @@ msgstr ""
msgid "visibility"
msgstr ""
#: lib/memex_web/live/note_live/index.ex:29
#: lib/memex_web/live/note_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "new note"
msgstr ""
@ -316,7 +316,7 @@ msgstr ""
msgid "search"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:29
#: lib/memex_web/live/context_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "new context"
msgstr ""
@ -331,7 +331,7 @@ msgstr ""
msgid "description"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.ex:29
#: lib/memex_web/live/pipeline_live/index.ex:32
#, elixir-autogen, elixir-format
msgid "new pipeline"
msgstr ""
@ -348,12 +348,12 @@ msgstr ""
msgid "%{slug} created"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:57
#: lib/memex_web/live/context_live/show.ex:40
#: lib/memex_web/live/note_live/index.ex:57
#: lib/memex_web/live/note_live/show.ex:40
#: lib/memex_web/live/pipeline_live/index.ex:57
#: lib/memex_web/live/pipeline_live/show.ex:75
#: lib/memex_web/live/context_live/index.ex:65
#: lib/memex_web/live/context_live/show.ex:44
#: lib/memex_web/live/note_live/index.ex:65
#: lib/memex_web/live/note_live/show.ex:45
#: lib/memex_web/live/pipeline_live/index.ex:65
#: lib/memex_web/live/pipeline_live/show.ex:78
#, elixir-autogen, elixir-format
msgid "%{slug} deleted"
msgstr ""
@ -365,12 +365,12 @@ msgstr ""
msgid "%{slug} saved"
msgstr ""
#: lib/memex_web/live/context_live/index.ex:23
#: lib/memex_web/live/context_live/show.ex:47
#: lib/memex_web/live/note_live/index.ex:23
#: lib/memex_web/live/note_live/show.ex:47
#: lib/memex_web/live/pipeline_live/index.ex:23
#: lib/memex_web/live/pipeline_live/show.ex:121
#: lib/memex_web/live/context_live/index.ex:25
#: lib/memex_web/live/context_live/show.ex:51
#: lib/memex_web/live/note_live/index.ex:25
#: lib/memex_web/live/note_live/show.ex:52
#: lib/memex_web/live/pipeline_live/index.ex:24
#: lib/memex_web/live/pipeline_live/show.ex:124
#, elixir-autogen, elixir-format
msgid "edit %{slug}"
msgstr ""
@ -421,7 +421,7 @@ msgstr ""
msgid "what is this?"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:59
#, elixir-autogen, elixir-format
msgid "%{position}. %{title}"
msgstr ""
@ -431,7 +431,7 @@ msgstr ""
msgid "%{title} created"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:93
#: lib/memex_web/live/pipeline_live/show.ex:96
#, elixir-autogen, elixir-format
msgid "%{title} deleted"
msgstr ""
@ -441,17 +441,17 @@ msgstr ""
msgid "%{title} saved"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:123
#: lib/memex_web/live/pipeline_live/show.ex:126
#, elixir-autogen, elixir-format
msgid "add step to %{slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:46
#: lib/memex_web/live/pipeline_live/show.html.heex:53
#, elixir-autogen, elixir-format
msgid "no steps"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:48
#, elixir-autogen, elixir-format
msgid "steps:"
msgstr ""
@ -577,7 +577,7 @@ msgstr ""
msgid "user registered on%{registered_datetime}"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:17
#: lib/memex_web/components/core_components/invite_card.html.heex:18
#, elixir-autogen, elixir-format
msgid "uses left: unlimited"
msgstr ""
@ -587,17 +587,17 @@ msgstr ""
msgid "read more on how to use memEx"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:12
#: lib/memex_web/components/core_components/invite_card.html.heex:13
#, elixir-autogen, elixir-format
msgid "uses left: %{uses_left_count}"
msgstr ""
#: lib/memex_web/components/core_components/invite_card.html.heex:32
#: lib/memex_web/components/core_components/invite_card.html.heex:29
#, elixir-autogen, elixir-format
msgid "uses: %{uses_count}"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:128
#: lib/memex_web/live/home_live.html.heex:137
#, elixir-autogen, elixir-format
msgid "get involved"
msgstr ""
@ -720,3 +720,38 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "(This note is empty)"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:18
#: lib/memex_web/live/note_live/show.html.heex:18
#: lib/memex_web/live/pipeline_live/show.html.heex:15
#, elixir-autogen, elixir-format
msgid "Backlinked by:"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:24
#: lib/memex_web/live/note_live/show.html.heex:24
#: lib/memex_web/live/pipeline_live/show.html.heex:21
#, elixir-autogen, elixir-format, fuzzy
msgid "[%{slug}]"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:31
#, elixir-autogen, elixir-format
msgid "[[%{slug}]]"
msgstr ""
#: lib/memex_web/live/note_live/show.html.heex:38
#, elixir-autogen, elixir-format
msgid "[[[%{slug}]]]"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:77
#, elixir-autogen, elixir-format
msgid "backlinks:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:80
#, elixir-autogen, elixir-format
msgid "view referencing items from the referenced item"
msgstr ""

View File

@ -48,11 +48,11 @@ msgid "must have the @ sign and no spaces"
msgstr ""
#: lib/memex/contexts/context.ex:58
#: lib/memex/contexts/context.ex:71
#: lib/memex/contexts/context.ex:72
#: lib/memex/notes/note.ex:57
#: lib/memex/notes/note.ex:70
#: lib/memex/notes/note.ex:71
#: lib/memex/pipelines/pipeline.ex:60
#: lib/memex/pipelines/pipeline.ex:73
#: lib/memex/pipelines/pipeline.ex:74
#, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted"
msgstr ""
@ -141,9 +141,9 @@ msgstr ""
msgid "user confirmation link is invalid or it has expired."
msgstr ""
#: lib/memex/contexts/context.ex:84
#: lib/memex/notes/note.ex:83
#: lib/memex/pipelines/pipeline.ex:86
#: lib/memex/contexts/context.ex:85
#: lib/memex/notes/note.ex:84
#: lib/memex/pipelines/pipeline.ex:87
#, elixir-autogen, elixir-format, fuzzy
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma or space delimited"
msgstr ""

View File

@ -67,12 +67,12 @@ msgid "are you sure you want to make %{invite_name} unlimited?"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:47
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/context_live/show.html.heex:48
#: lib/memex_web/live/note_live/index.html.heex:47
#: lib/memex_web/live/note_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:55
#: lib/memex_web/live/pipeline_live/index.html.heex:47
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:102
#: lib/memex_web/live/pipeline_live/show.html.heex:38
#: lib/memex_web/live/pipeline_live/show.html.heex:109
#, elixir-autogen, elixir-format
msgid "are you sure?"
msgstr ""
@ -87,7 +87,7 @@ msgstr ""
msgid "language updated successfully."
msgstr ""
#: lib/memex_web/live/home_live.html.heex:90
#: lib/memex_web/live/home_live.html.heex:99
#, elixir-autogen, elixir-format
msgid "register to setup memEx"
msgstr ""

View File

@ -47,11 +47,11 @@ msgid "must have the @ sign and no spaces"
msgstr ""
#: lib/memex/contexts/context.ex:58
#: lib/memex/contexts/context.ex:71
#: lib/memex/contexts/context.ex:72
#: lib/memex/notes/note.ex:57
#: lib/memex/notes/note.ex:70
#: lib/memex/notes/note.ex:71
#: lib/memex/pipelines/pipeline.ex:60
#: lib/memex/pipelines/pipeline.ex:73
#: lib/memex/pipelines/pipeline.ex:74
#, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted"
msgstr ""
@ -140,9 +140,9 @@ msgstr ""
msgid "user confirmation link is invalid or it has expired."
msgstr ""
#: lib/memex/contexts/context.ex:84
#: lib/memex/notes/note.ex:83
#: lib/memex/pipelines/pipeline.ex:86
#: lib/memex/contexts/context.ex:85
#: lib/memex/notes/note.ex:84
#: lib/memex/pipelines/pipeline.ex:87
#, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma or space delimited"
msgstr ""

View File

@ -66,12 +66,12 @@ msgid "are you sure you want to make %{invite_name} unlimited?"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:47
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/context_live/show.html.heex:48
#: lib/memex_web/live/note_live/index.html.heex:47
#: lib/memex_web/live/note_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:55
#: lib/memex_web/live/pipeline_live/index.html.heex:47
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:102
#: lib/memex_web/live/pipeline_live/show.html.heex:38
#: lib/memex_web/live/pipeline_live/show.html.heex:109
#, elixir-autogen, elixir-format
msgid "are you sure?"
msgstr ""
@ -86,7 +86,7 @@ msgstr ""
msgid "language updated successfully."
msgstr ""
#: lib/memex_web/live/home_live.html.heex:90
#: lib/memex_web/live/home_live.html.heex:99
#, elixir-autogen, elixir-format
msgid "register to setup memEx"
msgstr ""

View File

@ -1,8 +1,8 @@
# memEx
![old screenshot](https://gitea.bubbletea.dev/shibao/memEx/raw/branch/stable/home.png)
![home page screenshot](https://gitea.bubbletea.dev/shibao/memEx/raw/branch/stable/home.png)
memEx is an easy way to digitize the structured processes of your life.
A structured personal knowledge base, inspired by zettlekasten and org-mode.
- Notes: Document notes about individual items or concepts
- Contexts: Provide context around a single topic and hotlink to individual
@ -14,6 +14,7 @@ memEx is an easy way to digitize the structured processes of your life.
- Multi-user: Built with sharing and collaboration in mind
- Privacy: Privacy controls on a per-note, context or pipeline basis
- Convenient: Accessible from any internet-capable device
- Backlinks: View referencing items from the referenced item
# Installation

View File

@ -126,7 +126,7 @@ defmodule Memex.InvitesTest do
%{invite: %{token: token} = invite, current_user: current_user} do
{:ok, _invite} = Invites.update_invite(invite, %{uses_left: 1}, current_user)
assert {:ok, %{uses_left: 0, disabled_at: disabled_at}} = Invites.use_invite(token)
assert not is_nil(disabled_at)
assert not (disabled_at |> is_nil())
end
test "use_invite/1 does not work on disactivated invite",

View File

@ -96,9 +96,9 @@ defmodule Memex.AccountsTest do
Accounts.register_user(%{"email" => email, "password" => valid_user_password()})
assert user.email == email
assert is_binary(user.hashed_password)
assert is_nil(user.confirmed_at)
assert is_nil(user.password)
assert user.hashed_password |> is_binary()
assert user.confirmed_at |> is_nil()
assert user.password |> is_nil()
end
test "records used invite during registration" do
@ -128,7 +128,7 @@ defmodule Memex.AccountsTest do
assert changeset.valid?
assert get_change(changeset, :email) == email
assert get_change(changeset, :password) == password
assert is_nil(get_change(changeset, :hashed_password))
assert get_change(changeset, :hashed_password) |> is_nil()
end
end
@ -265,7 +265,7 @@ defmodule Memex.AccountsTest do
assert changeset.valid?
assert get_change(changeset, :password) == "new valid password"
assert is_nil(get_change(changeset, :hashed_password))
assert get_change(changeset, :hashed_password) |> is_nil()
end
end
@ -309,7 +309,7 @@ defmodule Memex.AccountsTest do
"password" => "new valid password"
})
assert is_nil(user.password)
assert user.password |> is_nil()
assert Accounts.get_user_by_email_and_password(user.email, "new valid password")
end
@ -506,7 +506,7 @@ defmodule Memex.AccountsTest do
{:ok, updated_user} =
Accounts.reset_user_password(user, %{"password" => "new valid password"})
assert is_nil(updated_user.password)
assert updated_user.password |> is_nil()
assert Accounts.get_user_by_email_and_password(user.email, "new valid password")
end

View File

@ -25,10 +25,6 @@ defmodule Memex.ContextsTest do
%{slug: "chickens", content: "bananas stuff", tags: ["life", "decisions"]}
|> context_fixture(user)
_shouldnt_return =
%{slug: "dog", content: "banana treat stuff", visibility: :private}
|> context_fixture(user_fixture())
# slug
assert Contexts.list_contexts("dog", user) == [context_a]
assert Contexts.list_contexts("dogs", user) == [context_a]
@ -72,15 +68,6 @@ defmodule Memex.ContextsTest do
}
|> context_fixture(user)
_shouldnt_return =
%{
slug: "dog",
content: "treats bananas stuff",
tags: ["home", "life", "decisions"],
visibility: :private
}
|> context_fixture(user)
# slug
assert Contexts.list_public_contexts("dog") == [context_a]
assert Contexts.list_public_contexts("dogs") == [context_a]
@ -110,21 +97,6 @@ defmodule Memex.ContextsTest do
assert Contexts.get_context!(context.id, user) == context
end
test "get_context!/1 only returns unlisted or public contexts for other users", %{user: user} do
another_user = user_fixture()
context = context_fixture(%{visibility: :public}, another_user)
assert Contexts.get_context!(context.id, user) == context
context = context_fixture(%{visibility: :unlisted}, another_user)
assert Contexts.get_context!(context.id, user) == context
context = context_fixture(%{visibility: :private}, another_user)
assert_raise Ecto.NoResultsError, fn ->
Contexts.get_context!(context.id, user)
end
end
test "get_context_by_slug/1 returns the context with given id", %{user: user} do
context = context_fixture(%{slug: "a", visibility: :public}, user)
assert Contexts.get_context_by_slug("a", user) == context
@ -136,18 +108,23 @@ defmodule Memex.ContextsTest do
assert Contexts.get_context_by_slug("c", user) == context
end
test "get_context_by_slug/1 only returns unlisted or public contexts for other users", %{
user: user
} do
another_user = user_fixture()
context = context_fixture(%{slug: "a", visibility: :public}, another_user)
assert Contexts.get_context_by_slug("a", user) == context
test "backlink/2 returns contexts with backlinks", %{user: user} do
context_fixture(%{slug: "a", visibility: :public}, user)
assert Contexts.backlink("[a]", user) == []
context = context_fixture(%{slug: "b", visibility: :unlisted}, another_user)
assert Contexts.get_context_by_slug("b", user) == context
context = context_fixture(%{slug: "b", content: "[a]", visibility: :unlisted}, user)
assert Contexts.backlink("[a]", user) == [context]
assert Contexts.backlink("[b]", user) == []
end
context_fixture(%{slug: "c", visibility: :private}, another_user)
assert Contexts.get_context_by_slug("c", user) |> is_nil()
test "backlink/2 only returns public contexts for empty user", %{user: user} do
context_fixture(%{slug: "a", visibility: :public}, user)
context_fixture(%{slug: "b", content: "[a]", visibility: :unlisted}, user)
context_fixture(%{slug: "c", content: "[a]", visibility: :private}, user)
assert Contexts.backlink("[a]", nil) == []
context = context_fixture(%{slug: "d", content: "[a]", visibility: :public}, user)
assert Contexts.backlink("[a]", nil) == [context]
end
test "create_context/1 with valid data creates a context", %{user: user} do

View File

@ -14,7 +14,6 @@ defmodule Memex.NotesTest do
note_a = note_fixture(%{slug: "a", visibility: :public}, user)
note_b = note_fixture(%{slug: "b", visibility: :unlisted}, user)
note_c = note_fixture(%{slug: "c", visibility: :private}, user)
_shouldnt_return = note_fixture(%{visibility: :private}, user_fixture())
assert Notes.list_notes(user) == [note_a, note_b, note_c]
end
@ -27,10 +26,6 @@ defmodule Memex.NotesTest do
%{slug: "chickens", content: "bananas stuff", tags: ["life", "decisions"]}
|> note_fixture(user)
_shouldnt_return =
%{slug: "dog", content: "banana treat stuff", visibility: :private}
|> note_fixture(user_fixture())
# slug
assert Notes.list_notes("dog", user) == [note_a]
assert Notes.list_notes("dogs", user) == [note_a]
@ -74,15 +69,6 @@ defmodule Memex.NotesTest do
}
|> note_fixture(user)
_shouldnt_return =
%{
slug: "dog",
content: "treats bananas stuff",
tags: ["home", "life", "decisions"],
visibility: :private
}
|> note_fixture(user)
# slug
assert Notes.list_public_notes("dog") == [note_a]
assert Notes.list_public_notes("dogs") == [note_a]
@ -112,21 +98,6 @@ defmodule Memex.NotesTest do
assert Notes.get_note!(note.id, user) == note
end
test "get_note!/1 only returns unlisted or public notes for other users", %{user: user} do
another_user = user_fixture()
note = note_fixture(%{visibility: :public}, another_user)
assert Notes.get_note!(note.id, user) == note
note = note_fixture(%{visibility: :unlisted}, another_user)
assert Notes.get_note!(note.id, user) == note
note = note_fixture(%{visibility: :private}, another_user)
assert_raise Ecto.NoResultsError, fn ->
Notes.get_note!(note.id, user)
end
end
test "get_note_by_slug/1 returns the note with given id", %{user: user} do
note = note_fixture(%{slug: "a", visibility: :public}, user)
assert Notes.get_note_by_slug("a", user) == note
@ -138,18 +109,23 @@ defmodule Memex.NotesTest do
assert Notes.get_note_by_slug("c", user) == note
end
test "get_note_by_slug/1 only returns unlisted or public notes for other users", %{
user: user
} do
another_user = user_fixture()
note = note_fixture(%{slug: "a", visibility: :public}, another_user)
assert Notes.get_note_by_slug("a", user) == note
test "backlink/2 returns notes with backlinks", %{user: user} do
note_fixture(%{slug: "a", visibility: :public}, user)
assert Notes.backlink("[a]", user) == []
note = note_fixture(%{slug: "b", visibility: :unlisted}, another_user)
assert Notes.get_note_by_slug("b", user) == note
note = note_fixture(%{slug: "b", content: "[a]", visibility: :unlisted}, user)
assert Notes.backlink("[a]", user) == [note]
assert Notes.backlink("[b]", user) == []
end
note_fixture(%{slug: "c", visibility: :private}, another_user)
assert Notes.get_note_by_slug("c", user) |> is_nil()
test "backlink/2 only returns public notes for empty user", %{user: user} do
note_fixture(%{slug: "a", visibility: :public}, user)
note_fixture(%{slug: "b", content: "[a]", visibility: :unlisted}, user)
note_fixture(%{slug: "c", content: "[a]", visibility: :private}, user)
assert Notes.backlink("[a]", nil) == []
note = note_fixture(%{slug: "d", content: "[a]", visibility: :public}, user)
assert Notes.backlink("[a]", nil) == [note]
end
test "create_note/1 with valid data creates a note", %{user: user} do

View File

@ -25,10 +25,6 @@ defmodule Memex.PipelinesTest do
%{slug: "chickens", description: "bananas stuff", tags: ["life", "decisions"]}
|> pipeline_fixture(user)
_shouldnt_return =
%{slug: "dog", description: "banana treat stuff", visibility: :private}
|> pipeline_fixture(user_fixture())
# slug
assert Pipelines.list_pipelines("dog", user) == [pipeline_a]
assert Pipelines.list_pipelines("dogs", user) == [pipeline_a]
@ -72,15 +68,6 @@ defmodule Memex.PipelinesTest do
}
|> pipeline_fixture(user)
_shouldnt_return =
%{
slug: "dog",
description: "treats bananas stuff",
tags: ["home", "life", "decisions"],
visibility: :private
}
|> pipeline_fixture(user)
# slug
assert Pipelines.list_public_pipelines("dog") == [pipeline_a]
assert Pipelines.list_public_pipelines("dogs") == [pipeline_a]
@ -110,23 +97,6 @@ defmodule Memex.PipelinesTest do
assert Pipelines.get_pipeline!(pipeline.id, user) == pipeline
end
test "get_pipeline!/1 only returns unlisted or public pipelines for other users", %{
user: user
} do
another_user = user_fixture()
pipeline = pipeline_fixture(%{visibility: :public}, another_user)
assert Pipelines.get_pipeline!(pipeline.id, user) == pipeline
pipeline = pipeline_fixture(%{visibility: :unlisted}, another_user)
assert Pipelines.get_pipeline!(pipeline.id, user) == pipeline
pipeline = pipeline_fixture(%{visibility: :private}, another_user)
assert_raise Ecto.NoResultsError, fn ->
Pipelines.get_pipeline!(pipeline.id, user)
end
end
test "get_pipeline_by_slug/1 returns the pipeline with given id", %{user: user} do
pipeline = pipeline_fixture(%{slug: "a", visibility: :public}, user)
assert Pipelines.get_pipeline_by_slug("a", user) == pipeline
@ -138,18 +108,23 @@ defmodule Memex.PipelinesTest do
assert Pipelines.get_pipeline_by_slug("c", user) == pipeline
end
test "get_pipeline_by_slug/1 only returns unlisted or public pipelines for other users", %{
user: user
} do
another_user = user_fixture()
pipeline = pipeline_fixture(%{slug: "a", visibility: :public}, another_user)
assert Pipelines.get_pipeline_by_slug("a", user) == pipeline
test "backlink/2 returns pipelines with backlinks", %{user: user} do
pipeline_fixture(%{slug: "a", visibility: :public}, user)
assert Pipelines.backlink("[a]", user) == []
pipeline = pipeline_fixture(%{slug: "b", visibility: :unlisted}, another_user)
assert Pipelines.get_pipeline_by_slug("b", user) == pipeline
pipeline = pipeline_fixture(%{slug: "b", description: "[a]", visibility: :unlisted}, user)
assert Pipelines.backlink("[a]", user) == [pipeline]
assert Pipelines.backlink("[b]", user) == []
end
pipeline_fixture(%{slug: "c", visibility: :private}, another_user)
assert Pipelines.get_pipeline_by_slug("c", user) |> is_nil()
test "backlink/2 only returns public pipelines for empty user", %{user: user} do
pipeline_fixture(%{slug: "a", visibility: :public}, user)
pipeline_fixture(%{slug: "b", description: "[a]", visibility: :unlisted}, user)
pipeline_fixture(%{slug: "c", description: "[a]", visibility: :private}, user)
assert Pipelines.backlink("[a]", nil) == []
pipeline = pipeline_fixture(%{slug: "d", description: "[a]", visibility: :public}, user)
assert Pipelines.backlink("[a]", nil) == [pipeline]
end
test "create_pipeline/1 with valid data creates a pipeline", %{user: user} do

View File

@ -25,16 +25,6 @@ defmodule Memex.StepsTest do
assert Steps.get_step!(step.id, user) == step
end
test "get_step!/2 only returns unlisted or public steps for other users", %{user: user} do
another_user = user_fixture()
another_pipeline = pipeline_fixture(another_user)
step = step_fixture(0, another_pipeline, another_user)
assert_raise Ecto.NoResultsError, fn ->
Steps.get_step!(step.id, user)
end
end
test "create_step/4 with valid data creates a step", %{pipeline: pipeline, user: user} do
valid_attrs = %{
content: "some content",