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 # v0.1.18
- Update deps - Update deps
- Fix content not escaping HTML properly - 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.new()
|> Multi.one(:users_count, from(u in User, select: count(u.id), distinct: true)) |> Multi.one(:users_count, from(u in User, select: count(u.id), distinct: true))
|> Multi.run(:use_invite, fn _changes_so_far, _repo -> |> 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} {:ok, nil}
else else
Invites.use_invite(invite_token) 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()] @spec list_contexts(search :: String.t() | nil, User.t()) :: [Context.t()]
def list_contexts(search \\ nil, user) def list_contexts(search \\ nil, user)
def list_contexts(search, %{id: user_id}) when search |> is_nil() or search == "" do def list_contexts(search, %{id: user_id}) when user_id |> is_binary() and search in [nil, ""] do
Repo.all(from c in Context, where: c.user_id == ^user_id, order_by: c.slug) Repo.all(from c in Context, order_by: c.slug)
end 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) trimmed_search = String.trim(search)
Repo.all( Repo.all(
from c in Context, from c in Context,
where: c.user_id == ^user_id,
where: where:
fragment( fragment(
"search @@ websearch_to_tsquery('english', ?)", "search @@ websearch_to_tsquery('english', ?)",
@ -63,7 +63,7 @@ defmodule Memex.Contexts do
@spec list_public_contexts(search :: String.t() | nil) :: [Context.t()] @spec list_public_contexts(search :: String.t() | nil) :: [Context.t()]
def list_public_contexts(search \\ nil) 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) Repo.all(from c in Context, where: c.visibility == :public, order_by: c.slug)
end end
@ -88,6 +88,42 @@ defmodule Memex.Contexts do
) )
end 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 """ @doc """
Gets a single context. Gets a single context.
@ -103,12 +139,8 @@ defmodule Memex.Contexts do
""" """
@spec get_context!(Context.id(), User.t()) :: Context.t() @spec get_context!(Context.id(), User.t()) :: Context.t()
def get_context!(id, %{id: user_id}) do def get_context!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!( Repo.one!(from c in Context, where: c.id == ^id)
from c in Context,
where: c.id == ^id,
where: c.user_id == ^user_id or c.visibility in [:public, :unlisted]
)
end end
def get_context!(id, _invalid_user) do 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 @spec get_context_by_slug(Context.slug(), User.t()) :: Context.t() | nil
def get_context_by_slug(slug, %{id: user_id}) do def get_context_by_slug(slug, %{id: user_id}) when user_id |> is_binary() do
Repo.one( Repo.one(from c in Context, where: c.slug == ^slug)
from c in Context,
where: c.slug == ^slug,
where: c.user_id == ^user_id or c.visibility in [:public, :unlisted]
)
end end
def get_context_by_slug(slug, _invalid_user) do def get_context_by_slug(slug, _invalid_user) do
@ -194,23 +222,16 @@ defmodule Memex.Contexts do
## Examples ## 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}) iex> delete_context(%Context{}, %User{id: 123})
{:ok, %Context{}}
iex> delete_context(%Context{}, nil)
{:error, %Ecto.Changeset{}} {:error, %Ecto.Changeset{}}
""" """
@spec delete_context(Context.t(), User.t()) :: @spec delete_context(Context.t(), User.t()) ::
{:ok, Context.t()} | {:error, Context.changeset()} {:ok, Context.t()} | {:error, Context.changeset()}
def delete_context(%Context{user_id: user_id} = context, %{id: user_id}) do def delete_context(%Context{} = context, %{id: user_id}) when user_id |> is_binary() do
context |> Repo.delete()
end
def delete_context(%Context{} = context, %{role: :admin}) do
context |> Repo.delete() context |> Repo.delete()
end end
@ -228,13 +249,4 @@ defmodule Memex.Contexts do
def change_context(%Context{} = context, attrs \\ %{}, user) do def change_context(%Context{} = context, attrs \\ %{}, user) do
context |> Context.update_changeset(attrs, user) context |> Context.update_changeset(attrs, user)
end 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 end

View File

@ -63,8 +63,9 @@ defmodule Memex.Contexts.Context do
end end
@spec update_changeset(t(), attrs :: map(), User.t()) :: changeset() @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__{} = context, attrs, %User{id: user_id})
note when user_id |> is_binary() do
context
|> cast(attrs, [:slug, :content, :tags, :visibility]) |> cast(attrs, [:slug, :content, :tags, :visibility])
|> cast_tags_string(attrs) |> cast_tags_string(attrs)
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/, |> 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()] @spec list_notes(search :: String.t() | nil, User.t()) :: [Note.t()]
def list_notes(search \\ nil, user) def list_notes(search \\ nil, user)
def list_notes(search, %{id: user_id}) when search |> is_nil() or search == "" do def list_notes(search, %{id: user_id}) when user_id |> is_binary() and search in [nil, ""] do
Repo.all(from n in Note, where: n.user_id == ^user_id, order_by: n.slug) Repo.all(from n in Note, order_by: n.slug)
end 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) trimmed_search = String.trim(search)
Repo.all( Repo.all(
from n in Note, from n in Note,
where: n.user_id == ^user_id,
where: where:
fragment( fragment(
"search @@ websearch_to_tsquery('english', ?)", "search @@ websearch_to_tsquery('english', ?)",
@ -62,7 +61,7 @@ defmodule Memex.Notes do
@spec list_public_notes(search :: String.t() | nil) :: [Note.t()] @spec list_public_notes(search :: String.t() | nil) :: [Note.t()]
def list_public_notes(search \\ nil) 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) Repo.all(from n in Note, where: n.visibility == :public, order_by: n.slug)
end end
@ -87,6 +86,42 @@ defmodule Memex.Notes do
) )
end 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 """ @doc """
Gets a single note. Gets a single note.
@ -102,12 +137,8 @@ defmodule Memex.Notes do
""" """
@spec get_note!(Note.id(), User.t()) :: Note.t() @spec get_note!(Note.id(), User.t()) :: Note.t()
def get_note!(id, %{id: user_id}) do def get_note!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!( Repo.one!(from n in Note, where: n.id == ^id)
from n in Note,
where: n.id == ^id,
where: n.user_id == ^user_id or n.visibility in [:public, :unlisted]
)
end end
def get_note!(id, _invalid_user) do 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 @spec get_note_by_slug(Note.slug(), User.t()) :: Note.t() | nil
def get_note_by_slug(slug, %{id: user_id}) do def get_note_by_slug(slug, %{id: user_id}) when user_id |> is_binary() do
Repo.one( Repo.one(from n in Note, where: n.slug == ^slug)
from n in Note,
where: n.slug == ^slug,
where: n.user_id == ^user_id or n.visibility in [:public, :unlisted]
)
end end
def get_note_by_slug(slug, _invalid_user) do def get_note_by_slug(slug, _invalid_user) do
@ -192,22 +219,15 @@ defmodule Memex.Notes do
## Examples ## 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}) iex> delete_note(%Note{}, %User{id: 123})
{:ok, %Note{}}
iex> delete_note(%Note{}, nil)
{:error, %Ecto.Changeset{}} {:error, %Ecto.Changeset{}}
""" """
@spec delete_note(Note.t(), User.t()) :: {:ok, Note.t()} | {:error, Note.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 def delete_note(%Note{} = note, %{id: user_id}) when user_id |> is_binary() do
note |> Repo.delete()
end
def delete_note(%Note{} = note, %{role: :admin}) do
note |> Repo.delete() note |> Repo.delete()
end end
@ -228,13 +248,4 @@ defmodule Memex.Notes do
def change_note(%Note{} = note, attrs \\ %{}, user) do def change_note(%Note{} = note, attrs \\ %{}, user) do
note |> Note.update_changeset(attrs, user) note |> Note.update_changeset(attrs, user)
end 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 end

View File

@ -62,7 +62,8 @@ defmodule Memex.Notes.Note do
end end
@spec update_changeset(t(), attrs :: map(), User.t()) :: changeset() @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 note
|> cast(attrs, [:slug, :content, :tags, :visibility]) |> cast(attrs, [:slug, :content, :tags, :visibility])
|> cast_tags_string(attrs) |> 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()] @spec list_pipelines(search :: String.t() | nil, User.t()) :: [Pipeline.t()]
def list_pipelines(search \\ nil, user) def list_pipelines(search \\ nil, user)
def list_pipelines(search, %{id: user_id}) when search |> is_nil() or search == "" do def list_pipelines(search, %{id: user_id})
Repo.all(from p in Pipeline, where: p.user_id == ^user_id, order_by: p.slug) when user_id |> is_binary() and search in [nil, ""] do
Repo.all(from p in Pipeline, order_by: p.slug)
end 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) trimmed_search = String.trim(search)
Repo.all( Repo.all(
from p in Pipeline, from p in Pipeline,
where: p.user_id == ^user_id,
where: where:
fragment( fragment(
"search @@ websearch_to_tsquery('english', ?)", "search @@ websearch_to_tsquery('english', ?)",
@ -62,7 +63,7 @@ defmodule Memex.Pipelines do
@spec list_public_pipelines(search :: String.t() | nil) :: [Pipeline.t()] @spec list_public_pipelines(search :: String.t() | nil) :: [Pipeline.t()]
def list_public_pipelines(search \\ nil) 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) Repo.all(from p in Pipeline, where: p.visibility == :public, order_by: p.slug)
end end
@ -102,12 +103,8 @@ defmodule Memex.Pipelines do
""" """
@spec get_pipeline!(Pipeline.id(), User.t()) :: Pipeline.t() @spec get_pipeline!(Pipeline.id(), User.t()) :: Pipeline.t()
def get_pipeline!(id, %{id: user_id}) do def get_pipeline!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!( Repo.one!(from p in Pipeline, where: p.id == ^id)
from p in Pipeline,
where: p.id == ^id,
where: p.user_id == ^user_id or p.visibility in [:public, :unlisted]
)
end end
def get_pipeline!(id, _invalid_user) do 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 @spec get_pipeline_by_slug(Pipeline.slug(), User.t()) :: Pipeline.t() | nil
def get_pipeline_by_slug(slug, %{id: user_id}) do def get_pipeline_by_slug(slug, %{id: user_id}) when user_id |> is_binary() do
Repo.one( Repo.one(from p in Pipeline, where: p.slug == ^slug)
from p in Pipeline,
where: p.slug == ^slug,
where: p.user_id == ^user_id or p.visibility in [:public, :unlisted]
)
end end
def get_pipeline_by_slug(slug, _invalid_user) do def get_pipeline_by_slug(slug, _invalid_user) do
@ -149,6 +142,50 @@ defmodule Memex.Pipelines do
) )
end 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 """ @doc """
Creates a pipeline. Creates a pipeline.
@ -193,23 +230,16 @@ defmodule Memex.Pipelines do
## Examples ## 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}) iex> delete_pipeline(%Pipeline{}, %User{id: 123})
{:ok, %Pipeline{}}
iex> delete_pipeline(%Pipeline{}, nil)
{:error, %Ecto.Changeset{}} {:error, %Ecto.Changeset{}}
""" """
@spec delete_pipeline(Pipeline.t(), User.t()) :: @spec delete_pipeline(Pipeline.t(), User.t()) ::
{:ok, Pipeline.t()} | {:error, Pipeline.changeset()} {:ok, Pipeline.t()} | {:error, Pipeline.changeset()}
def delete_pipeline(%Pipeline{user_id: user_id} = pipeline, %{id: user_id}) do def delete_pipeline(%Pipeline{} = pipeline, %{id: user_id}) when user_id |> is_binary() do
pipeline |> Repo.delete()
end
def delete_pipeline(%Pipeline{} = pipeline, %{role: :admin}) do
pipeline |> Repo.delete() pipeline |> Repo.delete()
end end
@ -230,13 +260,4 @@ defmodule Memex.Pipelines do
def change_pipeline(%Pipeline{} = pipeline, attrs \\ %{}, user) do def change_pipeline(%Pipeline{} = pipeline, attrs \\ %{}, user) do
pipeline |> Pipeline.update_changeset(attrs, user) pipeline |> Pipeline.update_changeset(attrs, user)
end 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 end

View File

@ -65,7 +65,8 @@ defmodule Memex.Pipelines.Pipeline do
end end
@spec update_changeset(t(), attrs :: map(), User.t()) :: changeset() @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 pipeline
|> cast(attrs, [:slug, :description, :tags, :visibility]) |> cast(attrs, [:slug, :description, :tags, :visibility])
|> cast_tags_string(attrs) |> cast_tags_string(attrs)

View File

@ -44,9 +44,12 @@ defmodule Memex.Pipelines.Steps.Step do
@doc false @doc false
@spec create_changeset(attrs :: map(), position :: non_neg_integer(), Pipeline.t(), User.t()) :: @spec create_changeset(attrs :: map(), position :: non_neg_integer(), Pipeline.t(), User.t()) ::
changeset() changeset()
def create_changeset(attrs, position, %Pipeline{id: pipeline_id, user_id: user_id}, %User{ def create_changeset(
id: user_id attrs,
}) do position,
%Pipeline{id: pipeline_id, user_id: user_id},
%User{id: user_id}
) do
%__MODULE__{} %__MODULE__{}
|> cast(attrs, [:title, :content]) |> cast(attrs, [:title, :content])
|> change(pipeline_id: pipeline_id, user_id: user_id, position: position) |> 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()) :: @spec update_changeset(t(), attrs :: map(), User.t()) ::
changeset() changeset()
def update_changeset( def update_changeset(%__MODULE__{} = step, attrs, %User{id: user_id})
%{user_id: user_id} = step, when user_id |> is_binary() do
attrs,
%User{id: user_id}
) do
step step
|> cast(attrs, [:title, :content]) |> cast(attrs, [:title, :content])
|> validate_required([:title, :user_id, :position]) |> validate_required([:title, :user_id, :position])
end end
@spec position_changeset(t(), position :: non_neg_integer(), User.t()) :: changeset() @spec position_changeset(t(), position :: non_neg_integer(), User.t()) :: changeset()
def position_changeset( def position_changeset(%__MODULE__{} = step, position, %User{id: user_id})
%{user_id: user_id} = step, when user_id |> is_binary() do
position,
%User{id: user_id}
) do
step step
|> change(position: position) |> change(position: position)
|> validate_required([:title, :user_id, :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()] @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( Repo.all(
from s in Step, from s in Step,
where: s.pipeline_id == ^pipeline_id, where: s.pipeline_id == ^pipeline_id,
where: s.user_id == ^user_id,
order_by: s.position order_by: s.position
) )
end end
@ -62,8 +61,8 @@ defmodule Memex.Pipelines.Steps do
""" """
@spec get_step!(Step.id(), User.t()) :: Step.t() @spec get_step!(Step.id(), User.t()) :: Step.t()
def get_step!(id, %{id: user_id}) do def get_step!(id, %{id: user_id}) when user_id |> is_binary() do
Repo.one!(from n in Step, where: n.id == ^id, where: n.user_id == ^user_id) Repo.one!(from n in Step, where: n.id == ^id)
end end
def get_step!(id, _invalid_user) do def get_step!(id, _invalid_user) do
@ -119,22 +118,15 @@ defmodule Memex.Pipelines.Steps do
## Examples ## 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}) iex> delete_step(%Step{}, %User{id: 123})
{:ok, %Step{}}
iex> delete_step(%Step{}, nil)
{:error, %Ecto.Changeset{}} {:error, %Ecto.Changeset{}}
""" """
@spec delete_step(Step.t(), User.t()) :: {:ok, Step.t()} | {:error, Step.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 def delete_step(%Step{} = step, %{id: user_id}) when user_id |> is_binary() do
delete_step(step)
end
def delete_step(%Step{} = step, %{role: :admin}) do
delete_step(step) delete_step(step)
end 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: 0} = step, :up, _user), do: {:error, step}
def reorder_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, :up,
%{id: user_id} = user %{id: user_id} = user
) do )
when user_id |> is_binary() do
Multi.new() Multi.new()
|> Multi.update_all( |> Multi.update_all(
:reorder_steps, :reorder_steps,
@ -207,10 +200,11 @@ defmodule Memex.Pipelines.Steps do
end end
def reorder_step( def reorder_step(
%Step{pipeline_id: pipeline_id, position: position, user_id: user_id} = step, %Step{pipeline_id: pipeline_id, position: position} = step,
:down, :down,
%{id: user_id} = user %{id: user_id} = user
) do )
when user_id |> is_binary() do
Multi.new() Multi.new()
|> Multi.one( |> Multi.one(
:step_count, :step_count,

View File

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

View File

@ -37,7 +37,7 @@ defmodule MemexWeb.Components.ContextsTableComponent do
} = socket } = socket
) do ) do
columns = columns =
if actions == [] or current_user |> is_nil() do if actions == [] or !current_user do
[] []
else else
[%{label: gettext("actions"), key: :actions, sortable: false}] [%{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 <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">
bg-primary-900 <h1 class="text-xl title">
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
transition-all duration-300 ease-in-out">
<h1 class="title text-xl">
<%= @invite.name %> <%= @invite.name %>
</h1> </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"> <h2 class="title text-md">
<%= if @invite.uses_left do %> <%= if @invite.uses_left do %>
<%= gettext( <%= gettext(
@ -17,10 +18,6 @@
<%= gettext("uses left: unlimited") %> <%= gettext("uses left: unlimited") %>
<% end %> <% end %>
</h2> </h2>
<% else %>
<h2 class="title text-md">
<%= gettext("invite disabled") %>
</h2>
<% end %> <% end %>
<.qr_code <.qr_code
@ -35,14 +32,13 @@
<div class="flex flex-row flex-wrap justify-center items-center"> <div class="flex flex-row flex-wrap justify-center items-center">
<code <code
id={"code-#{@invite.id}"} id={"code-#{@invite.id}"}
class="mx-2 my-1 text-xs px-4 py-2 rounded-lg text-center break-all class="px-4 py-2 mx-2 my-1 text-xs text-center break-all rounded-lg text-primary-400 bg-primary-800"
text-primary-400 bg-primary-800"
phx-no-format phx-no-format
><%= url(MemexWeb.Endpoint, ~p"/users/register?invite=#{@invite.token}") %></code> ><%= url(MemexWeb.Endpoint, ~p"/users/register?invite=#{@invite.token}") %></code>
<%= if @code_actions, do: render_slot(@code_actions) %> <%= if @code_actions, do: render_slot(@code_actions) %>
</div> </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) %> <%= render_slot(@inner_block) %>
</div> </div>
</div> </div>

View File

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

View File

@ -37,7 +37,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
} = socket } = socket
) do ) do
columns = columns =
if actions == [] or current_user |> is_nil() do if actions == [] or !current_user do
[] []
else else
[%{label: gettext("actions"), key: :actions, sortable: false}] [%{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 defp get_value_for_key(:description, %{description: description} = assigns, _additional_data) do
description_block = ~H""" description_block = ~H"""
<div class="truncate max-w-sm"> <div class="max-w-sm truncate">
<%= @description %> <%= @description %>
</div> </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 # by some automation or by the user themselves, so we redirect without
# a warning message. # a warning message.
case conn.assigns do case conn.assigns do
%{current_user: %{confirmed_at: confirmed_at}} when not is_nil(confirmed_at) -> %{current_user: %{confirmed_at: %{}}} ->
redirect(conn, to: ~p"/") redirect(conn, to: ~p"/")
%{} -> %{} ->

View File

@ -54,7 +54,7 @@ defmodule MemexWeb.UserResetPasswordController do
%{"token" => token} = conn.params %{"token" => token} = conn.params
if user = Accounts.get_user_by_reset_password_token(token) do 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 else
conn conn
|> put_flash( |> 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 defp assign_email_and_password_changesets(%{assigns: %{current_user: user}} = conn, _opts) do
conn conn
|> assign(:email_changeset, Accounts.change_user_email(user)) |> assign(
|> assign(:password_changeset, Accounts.change_user_password(user)) email_changeset: Accounts.change_user_email(user),
|> assign(:locale_changeset, Accounts.change_user_locale(user)) locale_changeset: Accounts.change_user_locale(user),
password_changeset: Accounts.change_user_password(user)
)
end end
end end

View File

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

View File

@ -20,29 +20,37 @@ defmodule MemexWeb.ContextLive.Index do
%{slug: slug} = context = Contexts.get_context_by_slug(slug, current_user) %{slug: slug} = context = Contexts.get_context_by_slug(slug, current_user)
socket socket
|> assign(page_title: gettext("edit %{slug}", slug: slug)) |> assign(
|> assign(context: context) context: context,
page_title: gettext("edit %{slug}", slug: slug)
)
end end
defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do
socket socket
|> assign(page_title: gettext("new context")) |> assign(
|> assign(context: %Context{visibility: :private, user_id: current_user_id}) context: %Context{visibility: :private, user_id: current_user_id},
page_title: gettext("new context")
)
end end
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket socket
|> assign(page_title: gettext("contexts")) |> assign(
|> assign(search: nil) context: nil,
|> assign(context: nil) page_title: gettext("contexts"),
search: nil
)
|> display_contexts() |> display_contexts()
end end
defp apply_action(socket, :search, %{"search" => search}) do defp apply_action(socket, :search, %{"search" => search}) do
socket socket
|> assign(page_title: gettext("contexts")) |> assign(
|> assign(search: search) context: nil,
|> assign(context: nil) page_title: gettext("contexts"),
search: search
)
|> display_contexts() |> display_contexts()
end end
@ -68,8 +76,7 @@ defmodule MemexWeb.ContextLive.Index do
{:noreply, socket |> push_patch(to: redirect_to)} {:noreply, socket |> push_patch(to: redirect_to)}
end end
defp display_contexts(%{assigns: %{current_user: current_user, search: search}} = socket) defp display_contexts(%{assigns: %{current_user: %{} = current_user, search: search}} = socket) do
when not (current_user |> is_nil()) do
socket |> assign(contexts: Contexts.list_contexts(search, current_user)) socket |> assign(contexts: Contexts.list_contexts(search, current_user))
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"> <h1 class="text-xl">
<%= gettext("contexts") %> <%= gettext("contexts") %>
</h1> </h1>
@ -9,7 +9,7 @@
as={:search} as={:search}
phx-change="search" phx-change="search"
phx-submit="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, <%= text_input(f, :search_term,
class: "input input-primary", class: "input input-primary",
@ -33,14 +33,14 @@
> >
<:actions :let={context}> <:actions :let={context}>
<.link <.link
:if={Contexts.owner?(context, @current_user)} :if={@current_user}
patch={~p"/contexts/#{context}/edit"} patch={~p"/contexts/#{context}/edit"}
aria-label={dgettext("actions", "edit %{context_slug}", context_slug: context.slug)} aria-label={dgettext("actions", "edit %{context_slug}", context_slug: context.slug)}
> >
<%= dgettext("actions", "edit") %> <%= dgettext("actions", "edit") %>
</.link> </.link>
<.link <.link
:if={Contexts.owner_or_admin?(context, @current_user)} :if={@current_user}
href="#" href="#"
phx-click="delete" phx-click="delete"
phx-value-id={context.id} phx-value-id={context.id}

View File

@ -1,6 +1,6 @@
defmodule MemexWeb.ContextLive.Show do defmodule MemexWeb.ContextLive.Show do
use MemexWeb, :live_view use MemexWeb, :live_view
alias Memex.Contexts alias Memex.{Contexts, Pipelines}
@impl true @impl true
def mount(_params, _session, socket) do def mount(_params, _session, socket) do
@ -21,8 +21,12 @@ defmodule MemexWeb.ContextLive.Show do
socket = socket =
socket socket
|> assign(:page_title, page_title(live_action, context)) |> assign(
|> assign(:context, context) 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} {:noreply, socket}
end 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"> <h1 class="text-xl">
<%= @context.slug %> <%= @context.slug %>
</h1> </h1>
@ -11,20 +11,37 @@
<.context_content context={@context} /> <.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"> <p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @context.visibility) %> <%= gettext("Visibility: %{visibility}", visibility: @context.visibility) %>
</p> </p>
<div class="self-end flex space-x-4"> <div class="flex self-end space-x-4">
<.link <.link :if={@current_user} class="btn btn-primary" patch={~p"/context/#{@context}/edit"}>
:if={Contexts.owner?(@context, @current_user)}
class="btn btn-primary"
patch={~p"/context/#{@context}/edit"}
>
<%= dgettext("actions", "edit") %> <%= dgettext("actions", "edit") %>
</.link> </.link>
<button <button
:if={Contexts.owner_or_admin?(@context, @current_user)} :if={@current_user}
type="button" type="button"
class="btn btn-primary" class="btn btn-primary"
phx-click="delete" phx-click="delete"

View File

@ -11,6 +11,6 @@ defmodule MemexWeb.HomeLive do
@impl true @impl true
def mount(_params, _session, socket) do def mount(_params, _session, socket) do
admins = Accounts.list_users_by_role(:admin) 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
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"> <div class="flex flex-col justify-center items-stretch mx-auto space-y-4 max-w-lg">
<h1 class="title text-primary-400 text-xl"> <h1 class="text-xl title text-primary-400">
<%= gettext("memEx") %> <%= gettext("memEx") %>
</h1> </h1>
@ -31,7 +31,7 @@
</p> </p>
</li> </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"> <.link navigate={~p"/faq"} class="btn btn-primary">
<%= gettext("read more on how to use memEx") %> <%= gettext("read more on how to use memEx") %>
</.link> </.link>
@ -41,7 +41,7 @@
<hr class="hr" /> <hr class="hr" />
<ul class="flex flex-col space-y-4"> <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") %> <%= gettext("features") %>
</h2> </h2>
@ -71,12 +71,21 @@
<%= gettext("accessible from any internet-capable device") %> <%= gettext("accessible from any internet-capable device") %>
</p> </p>
</li> </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> </ul>
<hr class="hr" /> <hr class="hr" />
<ul class="flex flex-col justify-center space-y-4"> <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") %> <%= gettext("instance information") %>
</h2> </h2>
@ -124,7 +133,7 @@
<hr class="hr" /> <hr class="hr" />
<ul class="flex flex-col space-y-2"> <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") %> <%= gettext("get involved") %>
</h2> </h2>

View File

@ -82,7 +82,7 @@ defmodule MemexWeb.InviteLive.FormComponent do
socket |> put_flash(:info, prompt) |> push_navigate(to: return_to) socket |> put_flash(:info, prompt) |> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} -> {:error, %Changeset{} = changeset} ->
socket |> assign(changeset: changeset) socket |> assign(:changeset, changeset)
end end
{:noreply, socket} {: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 defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
socket 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 end
defp apply_action(socket, :new, _params) do 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 end
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket |> assign(page_title: gettext("invites"), invite: nil) socket |> assign(invite: nil, page_title: gettext("invites"))
end end
@impl true @impl true
@ -138,6 +138,6 @@ defmodule MemexWeb.InviteLive.Index do
use_counts = invites |> Invites.get_use_counts(current_user) use_counts = invites |> Invites.get_use_counts(current_user)
users = all_users |> Map.get(: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
end end

View File

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

View File

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

View File

@ -4,11 +4,11 @@ defmodule MemexWeb.NoteLive.Index do
@impl true @impl true
def mount(%{"search" => search}, _session, socket) do def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(search: search) |> display_notes()} {:ok, socket |> assign(:search, search) |> display_notes()}
end end
def mount(_params, _session, socket) do def mount(_params, _session, socket) do
{:ok, socket |> assign(search: nil) |> display_notes()} {:ok, socket |> assign(:search, nil) |> display_notes()}
end end
@impl true @impl true
@ -20,29 +20,37 @@ defmodule MemexWeb.NoteLive.Index do
%{slug: slug} = note = Notes.get_note_by_slug(slug, current_user) %{slug: slug} = note = Notes.get_note_by_slug(slug, current_user)
socket socket
|> assign(page_title: gettext("edit %{slug}", slug: slug)) |> assign(
|> assign(note: note) note: note,
page_title: gettext("edit %{slug}", slug: slug)
)
end end
defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do
socket socket
|> assign(page_title: gettext("new note")) |> assign(
|> assign(note: %Note{visibility: :private, user_id: current_user_id}) note: %Note{visibility: :private, user_id: current_user_id},
page_title: gettext("new note")
)
end end
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket socket
|> assign(page_title: gettext("notes")) |> assign(
|> assign(search: nil) note: nil,
|> assign(note: nil) page_title: gettext("notes"),
search: nil
)
|> display_notes() |> display_notes()
end end
defp apply_action(socket, :search, %{"search" => search}) do defp apply_action(socket, :search, %{"search" => search}) do
socket socket
|> assign(page_title: gettext("notes")) |> assign(
|> assign(search: search) note: nil,
|> assign(note: nil) page_title: gettext("notes"),
search: search
)
|> display_notes() |> display_notes()
end end
@ -53,7 +61,7 @@ defmodule MemexWeb.NoteLive.Index do
socket = socket =
socket socket
|> assign(notes: Notes.list_notes(current_user)) |> assign(:notes, Notes.list_notes(current_user))
|> put_flash(:info, gettext("%{slug} deleted", slug: slug)) |> put_flash(:info, gettext("%{slug} deleted", slug: slug))
{:noreply, socket} {:noreply, socket}
@ -67,12 +75,11 @@ defmodule MemexWeb.NoteLive.Index do
{:noreply, socket |> push_patch(to: ~p"/notes/#{search_term}")} {:noreply, socket |> push_patch(to: ~p"/notes/#{search_term}")}
end end
defp display_notes(%{assigns: %{current_user: current_user, search: search}} = socket) defp display_notes(%{assigns: %{current_user: %{} = current_user, search: search}} = socket) do
when not (current_user |> is_nil()) do socket |> assign(:notes, Notes.list_notes(search, current_user))
socket |> assign(notes: Notes.list_notes(search, current_user))
end end
defp display_notes(%{assigns: %{search: search}} = socket) do 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
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"> <h1 class="text-xl">
<%= gettext("notes") %> <%= gettext("notes") %>
</h1> </h1>
@ -9,7 +9,7 @@
as={:search} as={:search}
phx-change="search" phx-change="search"
phx-submit="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, <%= text_input(f, :search_term,
class: "input input-primary", class: "input input-primary",
@ -33,14 +33,14 @@
> >
<:actions :let={note}> <:actions :let={note}>
<.link <.link
:if={Notes.owner?(note, @current_user)} :if={@current_user}
patch={~p"/notes/#{note}/edit"} patch={~p"/notes/#{note}/edit"}
aria-label={dgettext("actions", "edit %{note_slug}", note_slug: note.slug)} aria-label={dgettext("actions", "edit %{note_slug}", note_slug: note.slug)}
> >
<%= dgettext("actions", "edit") %> <%= dgettext("actions", "edit") %>
</.link> </.link>
<.link <.link
:if={Notes.owner_or_admin?(note, @current_user)} :if={@current_user}
href="#" href="#"
phx-click="delete" phx-click="delete"
phx-value-id={note.id} phx-value-id={note.id}

View File

@ -1,6 +1,6 @@
defmodule MemexWeb.NoteLive.Show do defmodule MemexWeb.NoteLive.Show do
use MemexWeb, :live_view use MemexWeb, :live_view
alias Memex.Notes alias Memex.{Contexts, Notes, Pipelines}
@impl true @impl true
def mount(_params, _session, socket) do def mount(_params, _session, socket) do
@ -21,8 +21,13 @@ defmodule MemexWeb.NoteLive.Show do
socket = socket =
socket socket
|> assign(:page_title, page_title(live_action, note)) |> assign(
|> assign(:note, note) 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} {:noreply, socket}
end 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"> <h1 class="text-xl">
<%= @note.slug %> <%= @note.slug %>
</h1> </h1>
@ -11,20 +11,44 @@
<.note_content note={@note} /> <.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"> <p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @note.visibility) %> <%= gettext("Visibility: %{visibility}", visibility: @note.visibility) %>
</p> </p>
<div class="self-end flex space-x-4"> <div class="flex self-end space-x-4">
<.link <.link :if={@current_user} class="btn btn-primary" patch={~p"/note/#{@note}/edit"}>
:if={Notes.owner?(@note, @current_user)}
class="btn btn-primary"
patch={~p"/note/#{@note}/edit"}
>
<%= dgettext("actions", "edit") %> <%= dgettext("actions", "edit") %>
</.link> </.link>
<button <button
:if={Notes.owner_or_admin?(@note, @current_user)} :if={@current_user}
type="button" type="button"
class="btn btn-primary" class="btn btn-primary"
phx-click="delete" phx-click="delete"

View File

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

View File

@ -4,11 +4,11 @@ defmodule MemexWeb.PipelineLive.Index do
@impl true @impl true
def mount(%{"search" => search}, _session, socket) do def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(search: search) |> display_pipelines()} {:ok, socket |> assign(:search, search) |> display_pipelines()}
end end
def mount(_params, _session, socket) do def mount(_params, _session, socket) do
{:ok, socket |> assign(search: nil) |> display_pipelines()} {:ok, socket |> assign(:search, nil) |> display_pipelines()}
end end
@impl true @impl true
@ -20,29 +20,37 @@ defmodule MemexWeb.PipelineLive.Index do
%{slug: slug} = pipeline = Pipelines.get_pipeline_by_slug(slug, current_user) %{slug: slug} = pipeline = Pipelines.get_pipeline_by_slug(slug, current_user)
socket socket
|> assign(page_title: gettext("edit %{slug}", slug: slug)) |> assign(
|> assign(pipeline: pipeline) page_title: gettext("edit %{slug}", slug: slug),
pipeline: pipeline
)
end end
defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do defp apply_action(%{assigns: %{current_user: %{id: current_user_id}}} = socket, :new, _params) do
socket socket
|> assign(page_title: gettext("new pipeline")) |> assign(
|> assign(pipeline: %Pipeline{visibility: :private, user_id: current_user_id}) page_title: gettext("new pipeline"),
pipeline: %Pipeline{visibility: :private, user_id: current_user_id}
)
end end
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket socket
|> assign(page_title: gettext("pipelines")) |> assign(
|> assign(search: nil) page_title: gettext("pipelines"),
|> assign(pipeline: nil) pipeline: nil,
search: nil
)
|> display_pipelines() |> display_pipelines()
end end
defp apply_action(socket, :search, %{"search" => search}) do defp apply_action(socket, :search, %{"search" => search}) do
socket socket
|> assign(page_title: gettext("pipelines")) |> assign(
|> assign(search: search) page_title: gettext("pipelines"),
|> assign(pipeline: nil) pipeline: nil,
search: search
)
|> display_pipelines() |> display_pipelines()
end end
@ -53,7 +61,7 @@ defmodule MemexWeb.PipelineLive.Index do
socket = socket =
socket socket
|> assign(pipelines: Pipelines.list_pipelines(current_user)) |> assign(:pipelines, Pipelines.list_pipelines(current_user))
|> put_flash(:info, gettext("%{slug} deleted", slug: slug)) |> put_flash(:info, gettext("%{slug} deleted", slug: slug))
{:noreply, socket} {:noreply, socket}
@ -67,12 +75,11 @@ defmodule MemexWeb.PipelineLive.Index do
{:noreply, socket |> push_patch(to: ~p"/pipelines/#{search_term}")} {:noreply, socket |> push_patch(to: ~p"/pipelines/#{search_term}")}
end end
defp display_pipelines(%{assigns: %{current_user: current_user, search: search}} = socket) defp display_pipelines(%{assigns: %{current_user: %{} = current_user, search: search}} = socket) do
when not (current_user |> is_nil()) do socket |> assign(:pipelines, Pipelines.list_pipelines(search, current_user))
socket |> assign(pipelines: Pipelines.list_pipelines(search, current_user))
end end
defp display_pipelines(%{assigns: %{search: search}} = socket) do 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
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"> <h1 class="text-xl">
<%= gettext("pipelines") %> <%= gettext("pipelines") %>
</h1> </h1>
@ -9,7 +9,7 @@
as={:search} as={:search}
phx-change="search" phx-change="search"
phx-submit="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, <%= text_input(f, :search_term,
class: "input input-primary", class: "input input-primary",
@ -33,14 +33,14 @@
> >
<:actions :let={pipeline}> <:actions :let={pipeline}>
<.link <.link
:if={Pipelines.owner?(pipeline, @current_user)} :if={@current_user}
patch={~p"/pipelines/#{pipeline}/edit"} patch={~p"/pipelines/#{pipeline}/edit"}
aria-label={dgettext("actions", "edit %{pipeline_slug}", pipeline_slug: pipeline.slug)} aria-label={dgettext("actions", "edit %{pipeline_slug}", pipeline_slug: pipeline.slug)}
> >
<%= dgettext("actions", "edit") %> <%= dgettext("actions", "edit") %>
</.link> </.link>
<.link <.link
:if={Pipelines.owner_or_admin?(pipeline, @current_user)} :if={@current_user}
href="#" href="#"
phx-click="delete" phx-click="delete"
phx-value-id={pipeline.id} phx-value-id={pipeline.id}

View File

@ -21,9 +21,12 @@ defmodule MemexWeb.PipelineLive.Show do
socket = socket =
socket socket
|> assign(:page_title, page_title(live_action, pipeline)) |> assign(
|> assign(:pipeline, pipeline) page_title: page_title(live_action, pipeline),
|> assign(:steps, pipeline |> Steps.list_steps(current_user)) pipeline_backlinks: Pipelines.backlink("[#{pipeline.slug}]", current_user),
pipeline: pipeline,
steps: pipeline |> Steps.list_steps(current_user)
)
|> apply_action(live_action, params) |> apply_action(live_action, params)
{:noreply, socket} {:noreply, socket}
@ -47,8 +50,8 @@ defmodule MemexWeb.PipelineLive.Show do
socket socket
|> assign( |> assign(
step: %Step{ step: %Step{
position: steps |> Enum.count(),
pipeline_id: pipeline_id, pipeline_id: pipeline_id,
position: steps |> Enum.count(),
user_id: current_user_id user_id: current_user_id
} }
) )
@ -59,7 +62,7 @@ defmodule MemexWeb.PipelineLive.Show do
:edit_step, :edit_step,
%{"step_id" => step_id} %{"step_id" => step_id}
) do ) do
socket |> assign(step: step_id |> Steps.get_step!(current_user)) socket |> assign(:step, step_id |> Steps.get_step!(current_user))
end end
@impl true @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"> <h1 class="text-xl">
<%= @pipeline.slug %> <%= @pipeline.slug %>
</h1> </h1>
@ -11,20 +11,27 @@
<.pipeline_content pipeline={@pipeline} /> <.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"> <p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @pipeline.visibility) %> <%= gettext("Visibility: %{visibility}", visibility: @pipeline.visibility) %>
</p> </p>
<div class="pb-4 self-end flex space-x-4"> <div class="flex self-end pb-4 space-x-4">
<.link <.link :if={@current_user} class="btn btn-primary" patch={~p"/pipeline/#{@pipeline}/edit"}>
:if={Pipelines.owner?(@pipeline, @current_user)}
class="btn btn-primary"
patch={~p"/pipeline/#{@pipeline}/edit"}
>
<%= dgettext("actions", "edit") %> <%= dgettext("actions", "edit") %>
</.link> </.link>
<button <button
:if={Pipelines.owner_or_admin?(@pipeline, @current_user)} :if={@current_user}
type="button" type="button"
class="btn btn-primary" class="btn btn-primary"
phx-click="delete" phx-click="delete"
@ -37,7 +44,7 @@
<hr class="hr" /> <hr class="hr" />
<h2 class="pt-2 self-center text-lg"> <h2 class="self-center pt-2 text-lg">
<%= gettext("steps:") %> <%= gettext("steps:") %>
</h2> </h2>
@ -52,29 +59,29 @@
<%= gettext("%{position}. %{title}", position: position + 1, title: title) %> <%= gettext("%{position}. %{title}", position: position + 1, title: title) %>
</h3> </h3>
<%= if Pipelines.owner?(@pipeline, @current_user) do %> <%= if @current_user do %>
<div class="flex justify-between items-center space-x-4"> <div class="flex justify-between items-center space-x-4">
<%= if position <= 0 do %> <%= 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 %> <% else %>
<button <button
type="button" type="button"
class="cursor-pointer flex justify-center items-center" class="flex justify-center items-center cursor-pointer"
phx-click="reorder_step" phx-click="reorder_step"
phx-value-direction="up" phx-value-direction="up"
phx-value-step-id={step_id} phx-value-step-id={step_id}
aria-label={dgettext("actions", "move %{step_title} up", step_title: step.title)} 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> </button>
<% end %> <% end %>
<%= if position >= length(@steps) - 1 do %> <%= 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 %> <% else %>
<button <button
type="button" type="button"
class="cursor-pointer flex justify-center items-center" class="flex justify-center items-center cursor-pointer"
phx-click="reorder_step" phx-click="reorder_step"
phx-value-direction="down" phx-value-direction="down"
phx-value-step-id={step_id} phx-value-step-id={step_id}
@ -82,7 +89,7 @@
dgettext("actions", "move %{step_title} down", step_title: step.title) 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> </button>
<% end %> <% end %>
@ -113,7 +120,7 @@
<% end %> <% end %>
<.link <.link
:if={Pipelines.owner?(@pipeline, @current_user)} :if={@current_user}
class="self-end btn btn-primary" class="self-end btn btn-primary"
patch={~p"/pipeline/#{@pipeline}/add_step"} patch={~p"/pipeline/#{@pipeline}/add_step"}
> >

View File

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

View File

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

View File

@ -40,12 +40,12 @@ msgid "create invite"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:50 #: 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/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/index.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:34 #: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:105 #: lib/memex_web/live/pipeline_live/show.html.heex:112
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "delete" msgid "delete"
msgstr "" msgstr ""
@ -56,12 +56,12 @@ msgid "delete user"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:40 #: 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/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/index.html.heex:40
#: lib/memex_web/live/pipeline_live/show.html.heex:24 #: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:94 #: lib/memex_web/live/pipeline_live/show.html.heex:101
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "edit" msgid "edit"
msgstr "" msgstr ""
@ -112,7 +112,7 @@ msgstr ""
msgid "save" msgid "save"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "add step" msgid "add step"
msgstr "" msgstr ""
@ -145,24 +145,24 @@ msgid "copy invite link for %{invite_name}"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:48 #: 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 #, elixir-autogen, elixir-format
msgid "delete %{context_slug}" msgid "delete %{context_slug}"
msgstr "" msgstr ""
#: lib/memex_web/live/note_live/index.html.heex:48 #: 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 #, elixir-autogen, elixir-format
msgid "delete %{note_slug}" msgid "delete %{note_slug}"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/index.html.heex:49 #: 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 #, elixir-autogen, elixir-format
msgid "delete %{pipeline_slug}" msgid "delete %{pipeline_slug}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "delete %{step_title}" msgid "delete %{step_title}"
msgstr "" msgstr ""
@ -187,7 +187,7 @@ msgstr ""
msgid "edit %{pipeline_slug}" msgid "edit %{pipeline_slug}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "edit %{step_title}" msgid "edit %{step_title}"
msgstr "" msgstr ""
@ -197,12 +197,12 @@ msgstr ""
msgid "edit invite for %{invite_name}" msgid "edit invite for %{invite_name}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "move %{step_title} down" msgid "move %{step_title} down"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "move %{step_title} up" msgid "move %{step_title} up"
msgstr "" msgstr ""

View File

@ -40,12 +40,12 @@ msgid "create invite"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:50 #: 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/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/index.html.heex:52
#: lib/memex_web/live/pipeline_live/show.html.heex:34 #: lib/memex_web/live/pipeline_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/show.html.heex:105 #: lib/memex_web/live/pipeline_live/show.html.heex:112
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "delete" msgid "delete"
msgstr "" msgstr ""
@ -56,12 +56,12 @@ msgid "delete user"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:40 #: 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/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/index.html.heex:40
#: lib/memex_web/live/pipeline_live/show.html.heex:24 #: lib/memex_web/live/pipeline_live/show.html.heex:31
#: lib/memex_web/live/pipeline_live/show.html.heex:94 #: lib/memex_web/live/pipeline_live/show.html.heex:101
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "edit" msgid "edit"
msgstr "" msgstr ""
@ -112,7 +112,7 @@ msgstr ""
msgid "save" msgid "save"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "add step" msgid "add step"
msgstr "" msgstr ""
@ -145,24 +145,24 @@ msgid "copy invite link for %{invite_name}"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:48 #: 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 #, elixir-autogen, elixir-format
msgid "delete %{context_slug}" msgid "delete %{context_slug}"
msgstr "" msgstr ""
#: lib/memex_web/live/note_live/index.html.heex:48 #: 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 #, elixir-autogen, elixir-format
msgid "delete %{note_slug}" msgid "delete %{note_slug}"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/index.html.heex:49 #: 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 #, elixir-autogen, elixir-format
msgid "delete %{pipeline_slug}" msgid "delete %{pipeline_slug}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "delete %{step_title}" msgid "delete %{step_title}"
msgstr "" msgstr ""
@ -187,7 +187,7 @@ msgstr ""
msgid "edit %{pipeline_slug}" msgid "edit %{pipeline_slug}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "edit %{step_title}" msgid "edit %{step_title}"
msgstr "" msgstr ""
@ -197,12 +197,12 @@ msgstr ""
msgid "edit invite for %{invite_name}" msgid "edit invite for %{invite_name}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "move %{step_title} down" msgid "move %{step_title} down"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "move %{step_title} up" msgid "move %{step_title} up"
msgstr "" msgstr ""

View File

@ -17,9 +17,9 @@ msgstr ""
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:15 #: lib/memex_web/live/context_live/show.html.heex:36
#: lib/memex_web/live/note_live/show.html.heex:15 #: lib/memex_web/live/note_live/show.html.heex:43
#: lib/memex_web/live/pipeline_live/show.html.heex:15 #: lib/memex_web/live/pipeline_live/show.html.heex:26
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Visibility: %{visibility}" msgid "Visibility: %{visibility}"
msgstr "" msgstr ""
@ -29,7 +29,7 @@ msgstr ""
msgid "accessible from any internet-capable device" msgid "accessible from any internet-capable device"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:85 #: lib/memex_web/live/home_live.html.heex:94
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "admins:" msgid "admins:"
msgstr "" msgstr ""
@ -46,8 +46,8 @@ msgid "confirm new password"
msgstr "" msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:28 #: 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:41
#: lib/memex_web/live/context_live/index.ex:43 #: lib/memex_web/live/context_live/index.ex:51
#: lib/memex_web/live/context_live/index.html.heex:3 #: lib/memex_web/live/context_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "contexts" msgid "contexts"
@ -118,22 +118,22 @@ msgstr ""
msgid "features" msgid "features"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:149 #: lib/memex_web/live/home_live.html.heex:158
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "help translate" msgid "help translate"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:80 #: lib/memex_web/live/home_live.html.heex:89
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "instance information" msgid "instance information"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "invite disabled" msgid "invite disabled"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:105 #: lib/memex_web/live/home_live.html.heex:114
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "invite only" msgid "invite only"
msgstr "" msgstr ""
@ -177,8 +177,8 @@ msgid "no notes found"
msgstr "" msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:22 #: 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:41
#: lib/memex_web/live/note_live/index.ex:43 #: lib/memex_web/live/note_live/index.ex:51
#: lib/memex_web/live/note_live/index.html.heex:3 #: lib/memex_web/live/note_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "notes" msgid "notes"
@ -190,8 +190,8 @@ msgid "notes:"
msgstr "" msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:34 #: 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:40
#: lib/memex_web/live/pipeline_live/index.ex:43 #: lib/memex_web/live/pipeline_live/index.ex:50
#: lib/memex_web/live/pipeline_live/index.html.heex:3 #: lib/memex_web/live/pipeline_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "pipelines" msgid "pipelines"
@ -217,7 +217,7 @@ msgstr ""
msgid "provide context around a single topic and hotlink to your notes" msgid "provide context around a single topic and hotlink to your notes"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:104 #: lib/memex_web/live/home_live.html.heex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "public signups" msgid "public signups"
msgstr "" msgstr ""
@ -227,12 +227,12 @@ msgstr ""
msgid "register" msgid "register"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:101 #: lib/memex_web/live/home_live.html.heex:110
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "registration:" msgid "registration:"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:160 #: lib/memex_web/live/home_live.html.heex:169
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "report bugs or request features" msgid "report bugs or request features"
msgstr "" msgstr ""
@ -288,12 +288,12 @@ msgstr ""
msgid "users" msgid "users"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:111 #: lib/memex_web/live/home_live.html.heex:120
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "version:" msgid "version:"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:138 #: lib/memex_web/live/home_live.html.heex:147
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "view the source code" msgid "view the source code"
msgstr "" msgstr ""
@ -305,7 +305,7 @@ msgstr ""
msgid "visibility" msgid "visibility"
msgstr "" msgstr ""
#: lib/memex_web/live/note_live/index.ex:29 #: lib/memex_web/live/note_live/index.ex:33
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "new note" msgid "new note"
msgstr "" msgstr ""
@ -317,7 +317,7 @@ msgstr ""
msgid "search" msgid "search"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.ex:29 #: lib/memex_web/live/context_live/index.ex:33
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "new context" msgid "new context"
msgstr "" msgstr ""
@ -332,7 +332,7 @@ msgstr ""
msgid "description" msgid "description"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/index.ex:29 #: lib/memex_web/live/pipeline_live/index.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "new pipeline" msgid "new pipeline"
msgstr "" msgstr ""
@ -349,12 +349,12 @@ msgstr ""
msgid "%{slug} created" msgid "%{slug} created"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.ex:57 #: lib/memex_web/live/context_live/index.ex:65
#: lib/memex_web/live/context_live/show.ex:40 #: lib/memex_web/live/context_live/show.ex:44
#: lib/memex_web/live/note_live/index.ex:57 #: lib/memex_web/live/note_live/index.ex:65
#: lib/memex_web/live/note_live/show.ex:40 #: lib/memex_web/live/note_live/show.ex:45
#: lib/memex_web/live/pipeline_live/index.ex:57 #: lib/memex_web/live/pipeline_live/index.ex:65
#: lib/memex_web/live/pipeline_live/show.ex:75 #: lib/memex_web/live/pipeline_live/show.ex:78
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "%{slug} deleted" msgid "%{slug} deleted"
msgstr "" msgstr ""
@ -366,12 +366,12 @@ msgstr ""
msgid "%{slug} saved" msgid "%{slug} saved"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.ex:23 #: lib/memex_web/live/context_live/index.ex:25
#: lib/memex_web/live/context_live/show.ex:47 #: lib/memex_web/live/context_live/show.ex:51
#: lib/memex_web/live/note_live/index.ex:23 #: lib/memex_web/live/note_live/index.ex:25
#: lib/memex_web/live/note_live/show.ex:47 #: lib/memex_web/live/note_live/show.ex:52
#: lib/memex_web/live/pipeline_live/index.ex:23 #: lib/memex_web/live/pipeline_live/index.ex:24
#: lib/memex_web/live/pipeline_live/show.ex:121 #: lib/memex_web/live/pipeline_live/show.ex:124
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "edit %{slug}" msgid "edit %{slug}"
msgstr "" msgstr ""
@ -422,7 +422,7 @@ msgstr ""
msgid "what is this?" msgid "what is this?"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "%{position}. %{title}" msgid "%{position}. %{title}"
msgstr "" msgstr ""
@ -432,7 +432,7 @@ msgstr ""
msgid "%{title} created" msgid "%{title} created"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:93 #: lib/memex_web/live/pipeline_live/show.ex:96
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "%{title} deleted" msgid "%{title} deleted"
msgstr "" msgstr ""
@ -442,17 +442,17 @@ msgstr ""
msgid "%{title} saved" msgid "%{title} saved"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:123 #: lib/memex_web/live/pipeline_live/show.ex:126
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "add step to %{slug}" msgid "add step to %{slug}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "no steps" msgid "no steps"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "steps:" msgid "steps:"
msgstr "" msgstr ""
@ -578,7 +578,7 @@ msgstr ""
msgid "user registered on%{registered_datetime}" msgid "user registered on%{registered_datetime}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "uses left: unlimited" msgid "uses left: unlimited"
msgstr "" msgstr ""
@ -588,17 +588,17 @@ msgstr ""
msgid "read more on how to use memEx" msgid "read more on how to use memEx"
msgstr "" 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 #, elixir-autogen, elixir-format, fuzzy
msgid "uses left: %{uses_left_count}" msgid "uses left: %{uses_left_count}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "uses: %{uses_count}" msgid "uses: %{uses_count}"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:128 #: lib/memex_web/live/home_live.html.heex:137
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "get involved" msgid "get involved"
msgstr "" msgstr ""
@ -721,3 +721,38 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "(This note is empty)" msgid "(This note is empty)"
msgstr "" 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 "" msgstr ""
#: lib/memex/contexts/context.ex:58 #: 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:57
#: lib/memex/notes/note.ex:70 #: lib/memex/notes/note.ex:71
#: lib/memex/pipelines/pipeline.ex:60 #: lib/memex/pipelines/pipeline.ex:60
#: lib/memex/pipelines/pipeline.ex:73 #: lib/memex/pipelines/pipeline.ex:74
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted" msgid "invalid format: only numbers, letters and hyphen are accepted"
msgstr "" msgstr ""
@ -140,9 +140,9 @@ msgstr ""
msgid "user confirmation link is invalid or it has expired." msgid "user confirmation link is invalid or it has expired."
msgstr "" msgstr ""
#: lib/memex/contexts/context.ex:84 #: lib/memex/contexts/context.ex:85
#: lib/memex/notes/note.ex:83 #: lib/memex/notes/note.ex:84
#: lib/memex/pipelines/pipeline.ex:86 #: lib/memex/pipelines/pipeline.ex:87
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma or space delimited" msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma or space delimited"
msgstr "" msgstr ""

View File

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

View File

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

View File

@ -16,9 +16,9 @@ msgstr ""
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:15 #: lib/memex_web/live/context_live/show.html.heex:36
#: lib/memex_web/live/note_live/show.html.heex:15 #: lib/memex_web/live/note_live/show.html.heex:43
#: lib/memex_web/live/pipeline_live/show.html.heex:15 #: lib/memex_web/live/pipeline_live/show.html.heex:26
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Visibility: %{visibility}" msgid "Visibility: %{visibility}"
msgstr "" msgstr ""
@ -28,7 +28,7 @@ msgstr ""
msgid "accessible from any internet-capable device" msgid "accessible from any internet-capable device"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:85 #: lib/memex_web/live/home_live.html.heex:94
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "admins:" msgid "admins:"
msgstr "" msgstr ""
@ -45,8 +45,8 @@ msgid "confirm new password"
msgstr "" msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:28 #: 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:41
#: lib/memex_web/live/context_live/index.ex:43 #: lib/memex_web/live/context_live/index.ex:51
#: lib/memex_web/live/context_live/index.html.heex:3 #: lib/memex_web/live/context_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "contexts" msgid "contexts"
@ -117,22 +117,22 @@ msgstr ""
msgid "features" msgid "features"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:149 #: lib/memex_web/live/home_live.html.heex:158
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "help translate" msgid "help translate"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:80 #: lib/memex_web/live/home_live.html.heex:89
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "instance information" msgid "instance information"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "invite disabled" msgid "invite disabled"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:105 #: lib/memex_web/live/home_live.html.heex:114
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "invite only" msgid "invite only"
msgstr "" msgstr ""
@ -176,8 +176,8 @@ msgid "no notes found"
msgstr "" msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:22 #: 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:41
#: lib/memex_web/live/note_live/index.ex:43 #: lib/memex_web/live/note_live/index.ex:51
#: lib/memex_web/live/note_live/index.html.heex:3 #: lib/memex_web/live/note_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "notes" msgid "notes"
@ -189,8 +189,8 @@ msgid "notes:"
msgstr "" msgstr ""
#: lib/memex_web/components/core_components/topbar.html.heex:34 #: 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:40
#: lib/memex_web/live/pipeline_live/index.ex:43 #: lib/memex_web/live/pipeline_live/index.ex:50
#: lib/memex_web/live/pipeline_live/index.html.heex:3 #: lib/memex_web/live/pipeline_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "pipelines" msgid "pipelines"
@ -216,7 +216,7 @@ msgstr ""
msgid "provide context around a single topic and hotlink to your notes" msgid "provide context around a single topic and hotlink to your notes"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:104 #: lib/memex_web/live/home_live.html.heex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "public signups" msgid "public signups"
msgstr "" msgstr ""
@ -226,12 +226,12 @@ msgstr ""
msgid "register" msgid "register"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:101 #: lib/memex_web/live/home_live.html.heex:110
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "registration:" msgid "registration:"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:160 #: lib/memex_web/live/home_live.html.heex:169
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "report bugs or request features" msgid "report bugs or request features"
msgstr "" msgstr ""
@ -287,12 +287,12 @@ msgstr ""
msgid "users" msgid "users"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:111 #: lib/memex_web/live/home_live.html.heex:120
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "version:" msgid "version:"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:138 #: lib/memex_web/live/home_live.html.heex:147
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "view the source code" msgid "view the source code"
msgstr "" msgstr ""
@ -304,7 +304,7 @@ msgstr ""
msgid "visibility" msgid "visibility"
msgstr "" msgstr ""
#: lib/memex_web/live/note_live/index.ex:29 #: lib/memex_web/live/note_live/index.ex:33
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "new note" msgid "new note"
msgstr "" msgstr ""
@ -316,7 +316,7 @@ msgstr ""
msgid "search" msgid "search"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.ex:29 #: lib/memex_web/live/context_live/index.ex:33
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "new context" msgid "new context"
msgstr "" msgstr ""
@ -331,7 +331,7 @@ msgstr ""
msgid "description" msgid "description"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/index.ex:29 #: lib/memex_web/live/pipeline_live/index.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "new pipeline" msgid "new pipeline"
msgstr "" msgstr ""
@ -348,12 +348,12 @@ msgstr ""
msgid "%{slug} created" msgid "%{slug} created"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.ex:57 #: lib/memex_web/live/context_live/index.ex:65
#: lib/memex_web/live/context_live/show.ex:40 #: lib/memex_web/live/context_live/show.ex:44
#: lib/memex_web/live/note_live/index.ex:57 #: lib/memex_web/live/note_live/index.ex:65
#: lib/memex_web/live/note_live/show.ex:40 #: lib/memex_web/live/note_live/show.ex:45
#: lib/memex_web/live/pipeline_live/index.ex:57 #: lib/memex_web/live/pipeline_live/index.ex:65
#: lib/memex_web/live/pipeline_live/show.ex:75 #: lib/memex_web/live/pipeline_live/show.ex:78
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "%{slug} deleted" msgid "%{slug} deleted"
msgstr "" msgstr ""
@ -365,12 +365,12 @@ msgstr ""
msgid "%{slug} saved" msgid "%{slug} saved"
msgstr "" msgstr ""
#: lib/memex_web/live/context_live/index.ex:23 #: lib/memex_web/live/context_live/index.ex:25
#: lib/memex_web/live/context_live/show.ex:47 #: lib/memex_web/live/context_live/show.ex:51
#: lib/memex_web/live/note_live/index.ex:23 #: lib/memex_web/live/note_live/index.ex:25
#: lib/memex_web/live/note_live/show.ex:47 #: lib/memex_web/live/note_live/show.ex:52
#: lib/memex_web/live/pipeline_live/index.ex:23 #: lib/memex_web/live/pipeline_live/index.ex:24
#: lib/memex_web/live/pipeline_live/show.ex:121 #: lib/memex_web/live/pipeline_live/show.ex:124
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "edit %{slug}" msgid "edit %{slug}"
msgstr "" msgstr ""
@ -421,7 +421,7 @@ msgstr ""
msgid "what is this?" msgid "what is this?"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "%{position}. %{title}" msgid "%{position}. %{title}"
msgstr "" msgstr ""
@ -431,7 +431,7 @@ msgstr ""
msgid "%{title} created" msgid "%{title} created"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:93 #: lib/memex_web/live/pipeline_live/show.ex:96
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "%{title} deleted" msgid "%{title} deleted"
msgstr "" msgstr ""
@ -441,17 +441,17 @@ msgstr ""
msgid "%{title} saved" msgid "%{title} saved"
msgstr "" msgstr ""
#: lib/memex_web/live/pipeline_live/show.ex:123 #: lib/memex_web/live/pipeline_live/show.ex:126
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "add step to %{slug}" msgid "add step to %{slug}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "no steps" msgid "no steps"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "steps:" msgid "steps:"
msgstr "" msgstr ""
@ -577,7 +577,7 @@ msgstr ""
msgid "user registered on%{registered_datetime}" msgid "user registered on%{registered_datetime}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "uses left: unlimited" msgid "uses left: unlimited"
msgstr "" msgstr ""
@ -587,17 +587,17 @@ msgstr ""
msgid "read more on how to use memEx" msgid "read more on how to use memEx"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "uses left: %{uses_left_count}" msgid "uses left: %{uses_left_count}"
msgstr "" 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 #, elixir-autogen, elixir-format
msgid "uses: %{uses_count}" msgid "uses: %{uses_count}"
msgstr "" msgstr ""
#: lib/memex_web/live/home_live.html.heex:128 #: lib/memex_web/live/home_live.html.heex:137
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "get involved" msgid "get involved"
msgstr "" msgstr ""
@ -720,3 +720,38 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "(This note is empty)" msgid "(This note is empty)"
msgstr "" 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 "" msgstr ""
#: lib/memex/contexts/context.ex:58 #: 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:57
#: lib/memex/notes/note.ex:70 #: lib/memex/notes/note.ex:71
#: lib/memex/pipelines/pipeline.ex:60 #: lib/memex/pipelines/pipeline.ex:60
#: lib/memex/pipelines/pipeline.ex:73 #: lib/memex/pipelines/pipeline.ex:74
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted" msgid "invalid format: only numbers, letters and hyphen are accepted"
msgstr "" msgstr ""
@ -141,9 +141,9 @@ msgstr ""
msgid "user confirmation link is invalid or it has expired." msgid "user confirmation link is invalid or it has expired."
msgstr "" msgstr ""
#: lib/memex/contexts/context.ex:84 #: lib/memex/contexts/context.ex:85
#: lib/memex/notes/note.ex:83 #: lib/memex/notes/note.ex:84
#: lib/memex/pipelines/pipeline.ex:86 #: lib/memex/pipelines/pipeline.ex:87
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma or space delimited" msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma or space delimited"
msgstr "" msgstr ""

View File

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

View File

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

View File

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

View File

@ -1,8 +1,8 @@
# memEx # 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 - Notes: Document notes about individual items or concepts
- Contexts: Provide context around a single topic and hotlink to individual - 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 - Multi-user: Built with sharing and collaboration in mind
- Privacy: Privacy controls on a per-note, context or pipeline basis - Privacy: Privacy controls on a per-note, context or pipeline basis
- Convenient: Accessible from any internet-capable device - Convenient: Accessible from any internet-capable device
- Backlinks: View referencing items from the referenced item
# Installation # Installation

View File

@ -126,7 +126,7 @@ defmodule Memex.InvitesTest do
%{invite: %{token: token} = invite, current_user: current_user} do %{invite: %{token: token} = invite, current_user: current_user} do
{:ok, _invite} = Invites.update_invite(invite, %{uses_left: 1}, current_user) {: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 {: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 end
test "use_invite/1 does not work on disactivated invite", 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()}) Accounts.register_user(%{"email" => email, "password" => valid_user_password()})
assert user.email == email assert user.email == email
assert is_binary(user.hashed_password) assert user.hashed_password |> is_binary()
assert is_nil(user.confirmed_at) assert user.confirmed_at |> is_nil()
assert is_nil(user.password) assert user.password |> is_nil()
end end
test "records used invite during registration" do test "records used invite during registration" do
@ -128,7 +128,7 @@ defmodule Memex.AccountsTest do
assert changeset.valid? assert changeset.valid?
assert get_change(changeset, :email) == email assert get_change(changeset, :email) == email
assert get_change(changeset, :password) == password assert get_change(changeset, :password) == password
assert is_nil(get_change(changeset, :hashed_password)) assert get_change(changeset, :hashed_password) |> is_nil()
end end
end end
@ -265,7 +265,7 @@ defmodule Memex.AccountsTest do
assert changeset.valid? assert changeset.valid?
assert get_change(changeset, :password) == "new valid password" 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
end end
@ -309,7 +309,7 @@ defmodule Memex.AccountsTest do
"password" => "new valid password" "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") assert Accounts.get_user_by_email_and_password(user.email, "new valid password")
end end
@ -506,7 +506,7 @@ defmodule Memex.AccountsTest do
{:ok, updated_user} = {:ok, updated_user} =
Accounts.reset_user_password(user, %{"password" => "new valid password"}) 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") assert Accounts.get_user_by_email_and_password(user.email, "new valid password")
end end

View File

@ -25,10 +25,6 @@ defmodule Memex.ContextsTest do
%{slug: "chickens", content: "bananas stuff", tags: ["life", "decisions"]} %{slug: "chickens", content: "bananas stuff", tags: ["life", "decisions"]}
|> context_fixture(user) |> context_fixture(user)
_shouldnt_return =
%{slug: "dog", content: "banana treat stuff", visibility: :private}
|> context_fixture(user_fixture())
# slug # slug
assert Contexts.list_contexts("dog", user) == [context_a] assert Contexts.list_contexts("dog", user) == [context_a]
assert Contexts.list_contexts("dogs", user) == [context_a] assert Contexts.list_contexts("dogs", user) == [context_a]
@ -72,15 +68,6 @@ defmodule Memex.ContextsTest do
} }
|> context_fixture(user) |> context_fixture(user)
_shouldnt_return =
%{
slug: "dog",
content: "treats bananas stuff",
tags: ["home", "life", "decisions"],
visibility: :private
}
|> context_fixture(user)
# slug # slug
assert Contexts.list_public_contexts("dog") == [context_a] assert Contexts.list_public_contexts("dog") == [context_a]
assert Contexts.list_public_contexts("dogs") == [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 assert Contexts.get_context!(context.id, user) == context
end 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 test "get_context_by_slug/1 returns the context with given id", %{user: user} do
context = context_fixture(%{slug: "a", visibility: :public}, user) context = context_fixture(%{slug: "a", visibility: :public}, user)
assert Contexts.get_context_by_slug("a", user) == context 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 assert Contexts.get_context_by_slug("c", user) == context
end end
test "get_context_by_slug/1 only returns unlisted or public contexts for other users", %{ test "backlink/2 returns contexts with backlinks", %{user: user} do
user: user context_fixture(%{slug: "a", visibility: :public}, user)
} do assert Contexts.backlink("[a]", user) == []
another_user = user_fixture()
context = context_fixture(%{slug: "a", visibility: :public}, another_user)
assert Contexts.get_context_by_slug("a", user) == context
context = context_fixture(%{slug: "b", visibility: :unlisted}, another_user) context = context_fixture(%{slug: "b", content: "[a]", visibility: :unlisted}, user)
assert Contexts.get_context_by_slug("b", user) == context assert Contexts.backlink("[a]", user) == [context]
assert Contexts.backlink("[b]", user) == []
end
context_fixture(%{slug: "c", visibility: :private}, another_user) test "backlink/2 only returns public contexts for empty user", %{user: user} do
assert Contexts.get_context_by_slug("c", user) |> is_nil() 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 end
test "create_context/1 with valid data creates a context", %{user: user} do 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_a = note_fixture(%{slug: "a", visibility: :public}, user)
note_b = note_fixture(%{slug: "b", visibility: :unlisted}, user) note_b = note_fixture(%{slug: "b", visibility: :unlisted}, user)
note_c = note_fixture(%{slug: "c", visibility: :private}, 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] assert Notes.list_notes(user) == [note_a, note_b, note_c]
end end
@ -27,10 +26,6 @@ defmodule Memex.NotesTest do
%{slug: "chickens", content: "bananas stuff", tags: ["life", "decisions"]} %{slug: "chickens", content: "bananas stuff", tags: ["life", "decisions"]}
|> note_fixture(user) |> note_fixture(user)
_shouldnt_return =
%{slug: "dog", content: "banana treat stuff", visibility: :private}
|> note_fixture(user_fixture())
# slug # slug
assert Notes.list_notes("dog", user) == [note_a] assert Notes.list_notes("dog", user) == [note_a]
assert Notes.list_notes("dogs", user) == [note_a] assert Notes.list_notes("dogs", user) == [note_a]
@ -74,15 +69,6 @@ defmodule Memex.NotesTest do
} }
|> note_fixture(user) |> note_fixture(user)
_shouldnt_return =
%{
slug: "dog",
content: "treats bananas stuff",
tags: ["home", "life", "decisions"],
visibility: :private
}
|> note_fixture(user)
# slug # slug
assert Notes.list_public_notes("dog") == [note_a] assert Notes.list_public_notes("dog") == [note_a]
assert Notes.list_public_notes("dogs") == [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 assert Notes.get_note!(note.id, user) == note
end 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 test "get_note_by_slug/1 returns the note with given id", %{user: user} do
note = note_fixture(%{slug: "a", visibility: :public}, user) note = note_fixture(%{slug: "a", visibility: :public}, user)
assert Notes.get_note_by_slug("a", user) == note 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 assert Notes.get_note_by_slug("c", user) == note
end end
test "get_note_by_slug/1 only returns unlisted or public notes for other users", %{ test "backlink/2 returns notes with backlinks", %{user: user} do
user: user note_fixture(%{slug: "a", visibility: :public}, user)
} do assert Notes.backlink("[a]", user) == []
another_user = user_fixture()
note = note_fixture(%{slug: "a", visibility: :public}, another_user)
assert Notes.get_note_by_slug("a", user) == note
note = note_fixture(%{slug: "b", visibility: :unlisted}, another_user) note = note_fixture(%{slug: "b", content: "[a]", visibility: :unlisted}, user)
assert Notes.get_note_by_slug("b", user) == note assert Notes.backlink("[a]", user) == [note]
assert Notes.backlink("[b]", user) == []
end
note_fixture(%{slug: "c", visibility: :private}, another_user) test "backlink/2 only returns public notes for empty user", %{user: user} do
assert Notes.get_note_by_slug("c", user) |> is_nil() 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 end
test "create_note/1 with valid data creates a note", %{user: user} do 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"]} %{slug: "chickens", description: "bananas stuff", tags: ["life", "decisions"]}
|> pipeline_fixture(user) |> pipeline_fixture(user)
_shouldnt_return =
%{slug: "dog", description: "banana treat stuff", visibility: :private}
|> pipeline_fixture(user_fixture())
# slug # slug
assert Pipelines.list_pipelines("dog", user) == [pipeline_a] assert Pipelines.list_pipelines("dog", user) == [pipeline_a]
assert Pipelines.list_pipelines("dogs", user) == [pipeline_a] assert Pipelines.list_pipelines("dogs", user) == [pipeline_a]
@ -72,15 +68,6 @@ defmodule Memex.PipelinesTest do
} }
|> pipeline_fixture(user) |> pipeline_fixture(user)
_shouldnt_return =
%{
slug: "dog",
description: "treats bananas stuff",
tags: ["home", "life", "decisions"],
visibility: :private
}
|> pipeline_fixture(user)
# slug # slug
assert Pipelines.list_public_pipelines("dog") == [pipeline_a] assert Pipelines.list_public_pipelines("dog") == [pipeline_a]
assert Pipelines.list_public_pipelines("dogs") == [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 assert Pipelines.get_pipeline!(pipeline.id, user) == pipeline
end 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 test "get_pipeline_by_slug/1 returns the pipeline with given id", %{user: user} do
pipeline = pipeline_fixture(%{slug: "a", visibility: :public}, user) pipeline = pipeline_fixture(%{slug: "a", visibility: :public}, user)
assert Pipelines.get_pipeline_by_slug("a", user) == pipeline 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 assert Pipelines.get_pipeline_by_slug("c", user) == pipeline
end end
test "get_pipeline_by_slug/1 only returns unlisted or public pipelines for other users", %{ test "backlink/2 returns pipelines with backlinks", %{user: user} do
user: user pipeline_fixture(%{slug: "a", visibility: :public}, user)
} do assert Pipelines.backlink("[a]", user) == []
another_user = user_fixture()
pipeline = pipeline_fixture(%{slug: "a", visibility: :public}, another_user)
assert Pipelines.get_pipeline_by_slug("a", user) == pipeline
pipeline = pipeline_fixture(%{slug: "b", visibility: :unlisted}, another_user) pipeline = pipeline_fixture(%{slug: "b", description: "[a]", visibility: :unlisted}, user)
assert Pipelines.get_pipeline_by_slug("b", user) == pipeline assert Pipelines.backlink("[a]", user) == [pipeline]
assert Pipelines.backlink("[b]", user) == []
end
pipeline_fixture(%{slug: "c", visibility: :private}, another_user) test "backlink/2 only returns public pipelines for empty user", %{user: user} do
assert Pipelines.get_pipeline_by_slug("c", user) |> is_nil() 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 end
test "create_pipeline/1 with valid data creates a pipeline", %{user: user} do 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 assert Steps.get_step!(step.id, user) == step
end 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 test "create_step/4 with valid data creates a step", %{pipeline: pipeline, user: user} do
valid_attrs = %{ valid_attrs = %{
content: "some content", content: "some content",