Compare commits

..

No commits in common. "fa44a094c7aec10d240d9cb0deff2c8df136d3c1" and "634891ee73a45c85040c3a8e39b24fff607d8e4d" have entirely different histories.

99 changed files with 2439 additions and 3216 deletions

View File

@ -157,17 +157,17 @@
#
# Controversial and experimental checks (opt-in, just replace `false` with `[]`)
#
{Credo.Check.Consistency.MultiAliasImportRequireUse, []},
{Credo.Check.Consistency.UnusedVariableNames, [force: :meaningful]},
{Credo.Check.Consistency.MultiAliasImportRequireUse, false},
{Credo.Check.Consistency.UnusedVariableNames, false},
{Credo.Check.Design.DuplicatedCode, false},
{Credo.Check.Readability.AliasAs, false},
{Credo.Check.Readability.BlockPipe, false},
{Credo.Check.Readability.ImplTrue, false},
{Credo.Check.Readability.MultiAlias, false},
{Credo.Check.Readability.SeparateAliasRequire, []},
{Credo.Check.Readability.SeparateAliasRequire, false},
{Credo.Check.Readability.SinglePipe, false},
{Credo.Check.Readability.Specs, false},
{Credo.Check.Readability.StrictModuleLayout, []},
{Credo.Check.Readability.StrictModuleLayout, false},
{Credo.Check.Readability.WithCustomTaggedTuple, false},
{Credo.Check.Refactor.ABCSize, false},
{Credo.Check.Refactor.AppendSingleItem, false},
@ -176,9 +176,9 @@
{Credo.Check.Refactor.NegatedIsNil, false},
{Credo.Check.Refactor.PipeChainStart, false},
{Credo.Check.Refactor.VariableRebinding, false},
{Credo.Check.Warning.LeakyEnvironment, []},
{Credo.Check.Warning.MapGetUnsafePass, []},
{Credo.Check.Warning.UnsafeToAtom, []}
{Credo.Check.Warning.LeakyEnvironment, false},
{Credo.Check.Warning.MapGetUnsafePass, false},
{Credo.Check.Warning.UnsafeToAtom, false}
#
# Custom checks can be created using `mix credo.gen.check`.

View File

@ -25,13 +25,12 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts";
100% { scale: 1.0; opacity: 1; }
}
// disconnect toast
.phx-connected > #disconnect {
.phx-connected > #disconnect, #loading {
opacity: 0 !important;
pointer-events: none;
}
.phx-error > #disconnect {
.phx-loading:not(.phx-error) > #loading, .phx-error > #disconnect {
opacity: 0.95 !important;
}

View File

@ -25,7 +25,7 @@ import 'phoenix_html'
// Establish Phoenix Socket and LiveView configuration.
import { Socket } from 'phoenix'
import { LiveSocket } from 'phoenix_live_view'
import topbar from 'topbar'
import topbar from '../vendor/topbar'
import MaintainAttrs from './maintain_attrs'
import Alpine from 'alpinejs'
@ -50,8 +50,6 @@ Alpine.start()
topbar.config({ barThickness: 1, barColors: { 0: '#fff' }, shadowColor: 'rgba(0, 0, 0, .3)' })
window.addEventListener('phx:page-loading-start', info => topbar.show())
window.addEventListener('phx:page-loading-stop', info => topbar.hide())
window.addEventListener('submit', info => topbar.show())
window.addEventListener('beforeunload', info => topbar.show())
// connect if there are any LiveViews on the page
liveSocket.connect()

1482
assets/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,10 +2,6 @@
"repository": {},
"description": " ",
"license": "MIT",
"engines": {
"node": "18.12.1",
"npm": "8.19.2"
},
"scripts": {
"deploy": "NODE_ENV=production webpack --mode production",
"watch": "webpack --mode development --watch --watch-options-stdin",
@ -30,14 +26,16 @@
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^3.4.1",
"file-loader": "^6.2.0",
"hard-source-webpack-plugin": "^0.13.1",
"mini-css-extract-plugin": "^2.6.0",
"node-sass": "^7.0.1",
"postcss": "^8.4.13",
"postcss-import": "^14.1.0",
"postcss-loader": "^6.2.1",
"postcss-preset-env": "^7.5.0",
"sass": "^1.56.0",
"sass-loader": "^12.6.0",
"standard": "^17.0.0",
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.24",
"terser-webpack-plugin": "^5.3.1",
"webpack": "^5.72.0",

157
assets/vendor/topbar.js vendored Normal file
View File

@ -0,0 +1,157 @@
/**
* @license MIT
* topbar 1.0.0, 2021-01-06
* https://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/
(function (window, document) {
"use strict";
// https://gist.github.com/paulirish/1579671
(function () {
var lastTime = 0;
var vendors = ["ms", "moz", "webkit", "o"];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame =
window[vendors[x] + "RequestAnimationFrame"];
window.cancelAnimationFrame =
window[vendors[x] + "CancelAnimationFrame"] ||
window[vendors[x] + "CancelRequestAnimationFrame"];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function (callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function () {
callback(currTime + timeToCall);
}, timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function (id) {
clearTimeout(id);
};
})();
var canvas,
progressTimerId,
fadeTimerId,
currentProgress,
showing,
addEvent = function (elem, type, handler) {
if (elem.addEventListener) elem.addEventListener(type, handler, false);
else if (elem.attachEvent) elem.attachEvent("on" + type, handler);
else elem["on" + type] = handler;
},
options = {
autoRun: true,
barThickness: 3,
barColors: {
0: "rgba(26, 188, 156, .9)",
".25": "rgba(52, 152, 219, .9)",
".50": "rgba(241, 196, 15, .9)",
".75": "rgba(230, 126, 34, .9)",
"1.0": "rgba(211, 84, 0, .9)",
},
shadowBlur: 10,
shadowColor: "rgba(0, 0, 0, .6)",
className: null,
},
repaint = function () {
canvas.width = window.innerWidth;
canvas.height = options.barThickness * 5; // need space for shadow
var ctx = canvas.getContext("2d");
ctx.shadowBlur = options.shadowBlur;
ctx.shadowColor = options.shadowColor;
var lineGradient = ctx.createLinearGradient(0, 0, canvas.width, 0);
for (var stop in options.barColors)
lineGradient.addColorStop(stop, options.barColors[stop]);
ctx.lineWidth = options.barThickness;
ctx.beginPath();
ctx.moveTo(0, options.barThickness / 2);
ctx.lineTo(
Math.ceil(currentProgress * canvas.width),
options.barThickness / 2
);
ctx.strokeStyle = lineGradient;
ctx.stroke();
},
createCanvas = function () {
canvas = document.createElement("canvas");
var style = canvas.style;
style.position = "fixed";
style.top = style.left = style.right = style.margin = style.padding = 0;
style.zIndex = 100001;
style.display = "none";
if (options.className) canvas.classList.add(options.className);
document.body.appendChild(canvas);
addEvent(window, "resize", repaint);
},
topbar = {
config: function (opts) {
for (var key in opts)
if (options.hasOwnProperty(key)) options[key] = opts[key];
},
show: function () {
if (showing) return;
showing = true;
if (fadeTimerId !== null) window.cancelAnimationFrame(fadeTimerId);
if (!canvas) createCanvas();
canvas.style.opacity = 1;
canvas.style.display = "block";
topbar.progress(0);
if (options.autoRun) {
(function loop() {
progressTimerId = window.requestAnimationFrame(loop);
topbar.progress(
"+" + 0.05 * Math.pow(1 - Math.sqrt(currentProgress), 2)
);
})();
}
},
progress: function (to) {
if (typeof to === "undefined") return currentProgress;
if (typeof to === "string") {
to =
(to.indexOf("+") >= 0 || to.indexOf("-") >= 0
? currentProgress
: 0) + parseFloat(to);
}
currentProgress = to > 1 ? 1 : to;
repaint();
return currentProgress;
},
hide: function () {
if (!showing) return;
showing = false;
if (progressTimerId != null) {
window.cancelAnimationFrame(progressTimerId);
progressTimerId = null;
}
(function loop() {
if (topbar.progress("+.1") >= 1) {
canvas.style.opacity -= 0.05;
if (canvas.style.opacity <= 0.05) {
canvas.style.display = "none";
fadeTimerId = null;
return;
}
}
fadeTimerId = window.requestAnimationFrame(loop);
})();
},
};
if (typeof module === "object" && typeof module.exports === "object") {
module.exports = topbar;
} else if (typeof define === "function" && define.amd) {
define(function () {
return topbar;
});
} else {
this.topbar = topbar;
}
}.call(this, window, document));

View File

@ -1,26 +1,6 @@
# v0.1.8
- Fix bug with public registration
- Improve templates
- Improve invites, record usage
- Fix padding on more pages when using chrome
- Add oban metrics to server log and live dashboard
# v0.1.7
- Update dependencies
- Show topbar on form submit/page refresh
- Make loading/reconnection less intrusive
- Add QR code for invite link
# v0.1.6
- fix formatting in note/context/step contents
- add json export for data
# v0.1.5
- fix overflow on note/contexts/step contents
# v0.1.4
- fix docker-compose
- fix newlines in note/context/step contents
- fix newlines in notes/context/step contents
- fix user invite page
- improve tagging logic

View File

@ -11,8 +11,6 @@ config :memex,
ecto_repos: [Memex.Repo],
generators: [binary_id: true]
config :memex, Memex.Accounts, registration: System.get_env("REGISTRATION", "invite")
# Configures the endpoint
config :memex, MemexWeb.Endpoint,
url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"],
@ -20,7 +18,8 @@ config :memex, MemexWeb.Endpoint,
secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I",
render_errors: [view: MemexWeb.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: Memex.PubSub,
live_view: [signing_salt: "zOLgd3lr"]
live_view: [signing_salt: "zOLgd3lr"],
registration: System.get_env("REGISTRATION") || "invite"
config :memex, Memex.Application, automigrate: false

View File

@ -64,9 +64,8 @@ config :memex, MemexWeb.Endpoint,
]
]
config :logger, :console,
format: "[$level] $message $metadata\n\n",
metadata: [:data]
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.

View File

@ -13,18 +13,17 @@ if System.get_env("PHX_SERVER") && System.get_env("RELEASE_NAME") do
end
# Set default locale
config :gettext, :default_locale, System.get_env("LOCALE", "en_US")
config :gettext, :default_locale, System.get_env("LOCALE") || "en_US"
maybe_ipv6 = if System.get_env("ECTO_IPV6") == "true", do: [:inet6], else: []
database_url =
if config_env() == :test do
System.get_env(
"TEST_DATABASE_URL",
System.get_env("TEST_DATABASE_URL") ||
"ecto://postgres:postgres@localhost/memex_test#{System.get_env("MIX_TEST_PARTITION")}"
)
else
System.get_env("DATABASE_URL", "ecto://postgres:postgres@memex-db/memex")
System.get_env("DATABASE_URL") ||
"ecto://postgres:postgres@memex-db/memex"
end
host =
@ -39,7 +38,7 @@ interface =
config :memex, Memex.Repo,
# ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
socket_options: maybe_ipv6
config :memex, MemexWeb.Endpoint,
@ -48,13 +47,10 @@ config :memex, MemexWeb.Endpoint,
# See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
# for details about using IPv6 vs IPv4 and loopback vs public addresses.
ip: interface,
port: String.to_integer(System.get_env("PORT", "4000"))
port: String.to_integer(System.get_env("PORT") || "4000")
],
server: true
if config_env() in [:dev, :prod] do
config :memex, Memex.Accounts, registration: System.get_env("REGISTRATION", "invite")
end
server: true,
registration: System.get_env("REGISTRATION") || "invite"
if config_env() == :prod do
# The secret key base is used to sign/encrypt cookies and other secrets.
@ -78,12 +74,12 @@ if config_env() == :prod do
config :memex, Memex.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("SMTP_HOST") || raise("No SMTP_HOST set!"),
port: System.get_env("SMTP_PORT", "587"),
port: System.get_env("SMTP_PORT") || 587,
username: System.get_env("SMTP_USERNAME") || raise("No SMTP_USERNAME set!"),
password: System.get_env("SMTP_PASSWORD") || raise("No SMTP_PASSWORD set!"),
ssl: System.get_env("SMTP_SSL") == "true",
email_from: System.get_env("EMAIL_FROM", "no-reply@#{System.get_env("HOST")}"),
email_name: System.get_env("EMAIL_NAME", "memEx")
email_from: System.get_env("EMAIL_FROM") || "no-reply@#{System.get_env("HOST")}",
email_name: System.get_env("EMAIL_NAME") || "memEx"
# ## Using releases
#

View File

@ -22,9 +22,6 @@ config :memex, MemexWeb.Endpoint,
# In test we don't send emails.
config :memex, Memex.Mailer, adapter: Swoosh.Adapters.Test
# Don't require invites for signups
config :memex, Memex.Accounts, registration: "public"
# Print only warnings and errors during test
config :logger, level: :warn

View File

@ -5,7 +5,7 @@ defmodule Memex.Accounts do
import Ecto.Query, warn: false
alias Memex.{Mailer, Repo}
alias Memex.Accounts.{Invite, Invites, User, UserToken}
alias Memex.Accounts.{User, UserToken}
alias Ecto.{Changeset, Multi}
alias Oban.Job
@ -16,27 +16,23 @@ defmodule Memex.Accounts do
## Examples
iex> register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with %User{} <- get_user_by_email("foo@example.com"), do: :passed
:passed
iex> get_user_by_email("foo@example.com")
%User{}
iex> get_user_by_email("unknown@example.com")
nil
"""
@spec get_user_by_email(email :: String.t()) :: User.t() | nil
def get_user_by_email(email) when is_binary(email) do
Repo.get_by(User, email: email)
end
def get_user_by_email(email) when is_binary(email), do: Repo.get_by(User, email: email)
@doc """
Gets a user by email and password.
## Examples
iex> register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with %User{} <- get_user_by_email_and_password("foo@example.com", "valid_password"), do: :passed
:passed
iex> get_user_by_email_and_password("foo@example.com", "correct_password")
%User{}
iex> get_user_by_email_and_password("foo@example.com", "invalid_password")
nil
@ -57,33 +53,28 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> get_user!(user.id)
user
iex> get_user!(123)
%User{}
> get_user!()
iex> get_user!(456)
** (Ecto.NoResultsError)
"""
@spec get_user!(User.t()) :: User.t()
def get_user!(id) do
Repo.get!(User, id)
end
def get_user!(id), do: Repo.get!(User, id)
@doc """
Returns all users grouped by role.
## Examples
iex> {:ok, user1} = register_user(%{email: "foo1@example.com", password: "valid_password"})
iex> {:ok, user2} = register_user(%{email: "foo2@example.com", password: "valid_password"})
iex> with %{admin: [^user1], user: [^user2]} <- list_all_users_by_role(user1), do: :passed
:passed
iex> list_users_by_role(%User{id: 123, role: :admin})
[admin: [%User{}], user: [%User{}, %User{}]]
"""
@spec list_all_users_by_role(User.t()) :: %{User.role() => [User.t()]}
@spec list_all_users_by_role(User.t()) :: %{String.t() => [User.t()]}
def list_all_users_by_role(%User{role: :admin}) do
Repo.all(from u in User, order_by: u.email) |> Enum.group_by(fn %{role: role} -> role end)
Repo.all(from u in User, order_by: u.email) |> Enum.group_by(fn user -> user.role end)
end
@doc """
@ -91,13 +82,13 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with [^user] <- list_users_by_role(:admin), do: :passed
:passed
iex> list_users_by_role(%User{id: 123, role: :admin})
[%User{}]
"""
@spec list_users_by_role(:admin) :: [User.t()]
def list_users_by_role(:admin = role) do
@spec list_users_by_role(User.role()) :: [User.t()]
def list_users_by_role(role) do
role = role |> to_string()
Repo.all(from u in User, where: u.role == ^role, order_by: u.email)
end
@ -108,38 +99,26 @@ defmodule Memex.Accounts do
## Examples
iex> with {:ok, %User{email: "foo@example.com"}} <-
...> register_user(%{email: "foo@example.com", password: "valid_password"}),
...> do: :passed
:passed
iex> register_user(%{field: value})
{:ok, %User{}}
iex> with {:error, %Changeset{}} <- register_user(%{email: "foo@example"}), do: :passed
:passed
iex> register_user(%{field: bad_value})
{:error, %Changeset{}}
"""
@spec register_user(attrs :: map()) ::
{:ok, User.t()} | {:error, :invalid_token | User.changeset()}
@spec register_user(attrs :: map(), Invite.token() | nil) ::
{:ok, User.t()} | {:error, :invalid_token | User.changeset()}
def register_user(attrs, invite_token \\ nil) do
@spec register_user(attrs :: map()) :: {:ok, User.t()} | {:error, User.changeset()}
def register_user(attrs) do
Multi.new()
|> Multi.one(:users_count, from(u in User, select: count(u.id), distinct: true))
|> Multi.run(:use_invite, fn _changes_so_far, _repo ->
if allow_registration?() and invite_token |> is_nil() do
{:ok, nil}
else
Invites.use_invite(invite_token)
end
end)
|> Multi.insert(:add_user, fn %{users_count: count, use_invite: invite} ->
|> Multi.insert(:add_user, fn %{users_count: count} ->
# if no registered users, make first user an admin
role = if count == 0, do: :admin, else: :user
User.registration_changeset(attrs, invite) |> User.role_changeset(role)
role = if count == 0, do: "admin", else: "user"
User.registration_changeset(attrs) |> User.role_changeset(role)
end)
|> Repo.transaction()
|> case do
{:ok, %{add_user: user}} -> {:ok, user}
{:error, :use_invite, :invalid_token, _changes_so_far} -> {:error, :invalid_token}
{:error, :add_user, changeset, _changes_so_far} -> {:error, changeset}
end
end
@ -149,18 +128,14 @@ defmodule Memex.Accounts do
## Examples
iex> with %Changeset{} <- change_user_registration(), do: :passed
:passed
iex> with %Changeset{} <- change_user_registration(%{password: "hi"}), do: :passed
:passed
iex> change_user_registration(user)
%Changeset{data: %User{}}
"""
@spec change_user_registration() :: User.changeset()
@spec change_user_registration(attrs :: map()) :: User.changeset()
def change_user_registration(attrs \\ %{}) do
User.registration_changeset(attrs, nil, hash_password: false)
end
def change_user_registration(attrs \\ %{}),
do: User.registration_changeset(attrs, hash_password: false)
## Settings
@ -169,29 +144,24 @@ defmodule Memex.Accounts do
## Examples
iex> with %Changeset{} <- change_user_email(%User{email: "foo@example.com"}), do: :passed
:passed
iex> change_user_email(user)
%Changeset{data: %User{}}
"""
@spec change_user_email(User.t()) :: User.changeset()
@spec change_user_email(User.t(), attrs :: map()) :: User.changeset()
def change_user_email(user, attrs \\ %{}) do
User.email_changeset(user, attrs)
end
def change_user_email(user, attrs \\ %{}), do: User.email_changeset(user, attrs)
@doc """
Returns an `%Changeset{}` for changing the user role.
## Examples
iex> with %Changeset{} <- change_user_role(%User{}, :user), do: :passed
:passed
iex> change_user_role(user)
%Changeset{data: %User{}}
"""
@spec change_user_role(User.t(), User.role()) :: User.changeset()
def change_user_role(user, role) do
User.role_changeset(user, role)
end
def change_user_role(user, role), do: User.role_changeset(user, role)
@doc """
Emulates that the email will change without actually changing
@ -199,20 +169,14 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with {:ok, %User{}} <-
...> apply_user_email(user, "valid_password", %{email: "new_email@account.com"}),
...> do: :passed
:passed
iex> apply_user_email(user, "valid password", %{email: ...})
{:ok, %User{}}
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with {:error, %Changeset{}} <-
...> apply_user_email(user, "invalid password", %{email: "new_email@account"}),
...> do: :passed
:passed
iex> apply_user_email(user, "invalid password", %{email: ...})
{:error, %Changeset{}}
"""
@spec apply_user_email(User.t(), email :: String.t(), attrs :: map()) ::
@spec apply_user_email(User.t(), password :: String.t(), attrs :: map()) ::
{:ok, User.t()} | {:error, User.changeset()}
def apply_user_email(user, password, attrs) do
user
@ -236,7 +200,7 @@ defmodule Memex.Accounts do
{:ok, _} <- Repo.transaction(user_email_multi(user, email, context)) do
:ok
else
_error_tuple -> :error
_ -> :error
end
end
@ -254,12 +218,8 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, %{id: user_id} = user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with %Oban.Job{
...> args: %{email: :update_email, user_id: ^user_id, attrs: %{url: "example url"}}
...> } <- deliver_update_email_instructions(user, "new_foo@example.com", fn _token -> "example url" end),
...> do: :passed
:passed
iex> deliver_update_email_instructions(user, current_email, &Routes.user_update_email_url(conn, :edit, &1))
{:ok, %{to: ..., body: ...}}
"""
@spec deliver_update_email_instructions(User.t(), current_email :: String.t(), function) ::
@ -276,37 +236,27 @@ defmodule Memex.Accounts do
## Examples
iex> with %Changeset{} <- change_user_password(%User{}), do: :passed
:passed
iex> change_user_password(user)
%Changeset{data: %User{}}
"""
@spec change_user_password(User.t(), attrs :: map()) :: User.changeset()
def change_user_password(user, attrs \\ %{}) do
User.password_changeset(user, attrs, hash_password: false)
end
def change_user_password(user, attrs \\ %{}),
do: User.password_changeset(user, attrs, hash_password: false)
@doc """
Updates the user password.
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with {:ok, %User{}} <-
...> reset_user_password(user, %{
...> password: "new password",
...> password_confirmation: "new password"
...> }),
...> do: :passed
:passed
iex> update_user_password(user, "valid password", %{password: ...})
{:ok, %User{}}
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with {:error, %Changeset{}} <-
...> update_user_password(user, "invalid password", %{password: "123"}),
...> do: :passed
:passed
iex> update_user_password(user, "invalid password", %{password: ...})
{:error, %Changeset{}}
"""
@spec update_user_password(User.t(), String.t(), attrs :: map()) ::
@spec update_user_password(User.t(), password :: String.t(), attrs :: map()) ::
{:ok, User.t()} | {:error, User.changeset()}
def update_user_password(user, password, attrs) do
changeset =
@ -320,62 +270,54 @@ defmodule Memex.Accounts do
|> Repo.transaction()
|> case do
{:ok, %{user: user}} -> {:ok, user}
{:error, :user, changeset, _changes_so_far} -> {:error, changeset}
{:error, :user, changeset, _} -> {:error, changeset}
end
end
@doc """
Returns an `Ecto.Changeset.t()` for changing the user locale.
Returns an `%Changeset{}` for changing the user locale.
## Examples
iex> with %Changeset{} <- change_user_locale(%User{}), do: :passed
:passed
iex> change_user_locale(user)
%Changeset{data: %User{}}
"""
@spec change_user_locale(User.t()) :: User.changeset()
def change_user_locale(%{locale: locale} = user) do
User.locale_changeset(user, locale)
end
def change_user_locale(%{locale: locale} = user), do: User.locale_changeset(user, locale)
@doc """
Updates the user locale.
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with {:ok, %User{}} <- update_user_locale(user, "en_US"), do: :passed
:passed
iex> update_user_locale(user, "valid locale")
{:ok, %User{}}
iex> update_user_password(user, "invalid locale")
{:error, %Changeset{}}
"""
@spec update_user_locale(User.t(), locale :: String.t()) ::
{:ok, User.t()} | {:error, User.changeset()}
def update_user_locale(user, locale) do
user |> User.locale_changeset(locale) |> Repo.update()
end
def update_user_locale(user, locale),
do: user |> User.locale_changeset(locale) |> Repo.update()
@doc """
Deletes a user. must be performed by an admin or the same user!
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with %User{} <- delete_user!(user, %User{id: 123, role: :admin}), do: :passed
:passed
iex> delete_user!(user_to_delete, %User{id: 123, role: :admin})
%User{}
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with %User{} <- delete_user!(user, user), do: :passed
:passed
iex> delete_user!(%User{id: 123}, %User{id: 123})
%User{}
"""
@spec delete_user!(user_to_delete :: User.t(), User.t()) :: User.t()
def delete_user!(user, %User{role: :admin}) do
user |> Repo.delete!()
end
def delete_user!(%User{id: user_id} = user, %User{id: user_id}) do
user |> Repo.delete!()
end
def delete_user!(user, %User{role: :admin}), do: user |> Repo.delete!()
def delete_user!(%User{id: user_id} = user, %User{id: user_id}), do: user |> Repo.delete!()
## Session
@ -403,7 +345,7 @@ defmodule Memex.Accounts do
"""
@spec delete_session_token(token :: String.t()) :: :ok
def delete_session_token(token) do
UserToken.token_and_context_query(token, "session") |> Repo.delete_all()
Repo.delete_all(UserToken.token_and_context_query(token, "session"))
:ok
end
@ -412,40 +354,20 @@ defmodule Memex.Accounts do
"""
@spec allow_registration?() :: boolean()
def allow_registration? do
Application.get_env(:memex, Memex.Accounts)[:registration] == "public" or
Application.get_env(:memex, MemexWeb.Endpoint)[:registration] == "public" or
list_users_by_role(:admin) |> Enum.empty?()
end
@doc """
Checks if user is an admin
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> is_admin?(user)
true
iex> is_admin?(%User{id: Ecto.UUID.generate()})
false
"""
@spec is_admin?(User.t()) :: boolean()
def is_admin?(%User{id: user_id}) do
Repo.exists?(from u in User, where: u.id == ^user_id, where: u.role == :admin)
Repo.exists?(from u in User, where: u.id == ^user_id and u.role == :admin)
end
@doc """
Checks to see if user has the admin role
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> is_already_admin?(user)
true
iex> is_already_admin?(%User{})
false
"""
@spec is_already_admin?(User.t() | nil) :: boolean()
def is_already_admin?(%User{role: :admin}), do: true
@ -458,16 +380,10 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, %{id: user_id} = user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with %Oban.Job{
...> args: %{email: :welcome, user_id: ^user_id, attrs: %{url: "example url"}}
...> } <- deliver_user_confirmation_instructions(user, fn _token -> "example url" end),
...> do: :passed
:passed
iex> deliver_user_confirmation_instructions(user, &Routes.user_confirmation_url(conn, :confirm, &1))
{:ok, %{to: ..., body: ...}}
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> user = user |> User.confirm_changeset() |> Repo.update!()
iex> deliver_user_confirmation_instructions(user, fn _token -> "example url" end)
iex> deliver_user_confirmation_instructions(confirmed_user, &Routes.user_confirmation_url(conn, :confirm, &1))
{:error, :already_confirmed}
"""
@ -489,14 +405,14 @@ defmodule Memex.Accounts do
If the token matches, the user account is marked as confirmed
and the token is deleted.
"""
@spec confirm_user(token :: String.t()) :: {:ok, User.t()} | :error
@spec confirm_user(token :: String.t()) :: {:ok, User.t()} | atom()
def confirm_user(token) do
with {:ok, query} <- UserToken.verify_email_token_query(token, "confirm"),
%User{} = user <- Repo.one(query),
{:ok, %{user: user}} <- Repo.transaction(confirm_user_multi(user)) do
{:ok, user}
else
_error_tuple -> :error
_ -> :error
end
end
@ -514,12 +430,8 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, %{id: user_id} = user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with %Oban.Job{args: %{
...> email: :reset_password, user_id: ^user_id, attrs: %{url: "example url"}}
...> } <- deliver_user_reset_password_instructions(user, fn _token -> "example url" end),
...> do: :passed
:passed
iex> deliver_user_reset_password_instructions(user, &Routes.user_reset_password_url(conn, :edit, &1))
{:ok, %{to: ..., body: ...}}
"""
@spec deliver_user_reset_password_instructions(User.t(), function()) :: Job.t()
@ -535,11 +447,8 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> {encoded_token, user_token} = UserToken.build_email_token(user, "reset_password")
iex> Repo.insert!(user_token)
iex> with %User{} <- get_user_by_reset_password_token(encoded_token), do: :passed
:passed
iex> get_user_by_reset_password_token("validtoken")
%User{}
iex> get_user_by_reset_password_token("invalidtoken")
nil
@ -551,7 +460,7 @@ defmodule Memex.Accounts do
%User{} = user <- Repo.one(query) do
user
else
_error_tuple -> nil
_ -> nil
end
end
@ -560,20 +469,11 @@ defmodule Memex.Accounts do
## Examples
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with {:ok, %User{}} <-
...> reset_user_password(user, %{
...> password: "new password",
...> password_confirmation: "new password"
...> }),
...> do: :passed
:passed
iex> reset_user_password(user, %{password: "new long password", password_confirmation: "new long password"})
{:ok, %User{}}
iex> {:ok, user} = register_user(%{email: "foo@example.com", password: "valid_password"})
iex> with {:error, %Changeset{}} <-
...> reset_user_password(user, %{password: "valid", password_confirmation: "not the same"}),
...> do: :passed
:passed
iex> reset_user_password(user, %{password: "valid", password_confirmation: "not the same"})
{:error, %Changeset{}}
"""
@spec reset_user_password(User.t(), attrs :: map()) ::
@ -585,7 +485,7 @@ defmodule Memex.Accounts do
|> Repo.transaction()
|> case do
{:ok, %{user: user}} -> {:ok, user}
{:error, :user, changeset, _changes_so_far} -> {:error, changeset}
{:error, :user, changeset, _} -> {:error, changeset}
end
end
end

View File

@ -1,198 +0,0 @@
defmodule Memex.Accounts.Invites do
@moduledoc """
The Invites context.
"""
import Ecto.Query, warn: false
alias Ecto.Multi
alias Memex.Accounts.{Invite, User}
alias Memex.Repo
@invite_token_length 20
@doc """
Returns the list of invites.
## Examples
iex> list_invites(%User{id: 123, role: :admin})
[%Invite{}, ...]
"""
@spec list_invites(User.t()) :: [Invite.t()]
def list_invites(%User{role: :admin}) do
Repo.all(from i in Invite, order_by: i.name)
end
@doc """
Gets a single invite for a user
Raises `Ecto.NoResultsError` if the Invite does not exist.
## Examples
iex> get_invite!(123, %User{id: 123, role: :admin})
%Invite{}
> get_invite!(456, %User{id: 123, role: :admin})
** (Ecto.NoResultsError)
"""
@spec get_invite!(Invite.id(), User.t()) :: Invite.t()
def get_invite!(id, %User{role: :admin}) do
Repo.get!(Invite, id)
end
@doc """
Returns if an invite token is still valid
## Examples
iex> valid_invite_token?("valid_token")
%Invite{}
iex> valid_invite_token?("invalid_token")
nil
"""
@spec valid_invite_token?(Invite.token() | nil) :: boolean()
def valid_invite_token?(token) when token in [nil, ""], do: false
def valid_invite_token?(token) do
Repo.exists?(
from i in Invite,
where: i.token == ^token,
where: i.disabled_at |> is_nil()
)
end
@doc """
Uses invite by decrementing uses_left, or marks invite invalid if it's been
completely used.
"""
@spec use_invite(Invite.token()) :: {:ok, Invite.t()} | {:error, :invalid_token}
def use_invite(invite_token) do
Multi.new()
|> Multi.run(:invite, fn _changes_so_far, _repo ->
invite_token |> get_invite_by_token()
end)
|> Multi.update(:decrement_invite, fn %{invite: invite} ->
decrement_invite_changeset(invite)
end)
|> Repo.transaction()
|> case do
{:ok, %{decrement_invite: invite}} -> {:ok, invite}
{:error, :invite, :invalid_token, _changes_so_far} -> {:error, :invalid_token}
end
end
@spec get_invite_by_token(Invite.token() | nil) :: {:ok, Invite.t()} | {:error, :invalid_token}
defp get_invite_by_token(token) when token in [nil, ""], do: {:error, :invalid_token}
defp get_invite_by_token(token) do
Repo.one(
from i in Invite,
where: i.token == ^token,
where: i.disabled_at |> is_nil()
)
|> case do
nil -> {:error, :invalid_token}
invite -> {:ok, invite}
end
end
@spec get_use_count(Invite.t(), User.t()) :: non_neg_integer()
def get_use_count(%Invite{id: invite_id}, %User{role: :admin}) do
Repo.one(
from u in User,
where: u.invite_id == ^invite_id,
select: count(u.id)
)
end
@spec decrement_invite_changeset(Invite.t()) :: Invite.changeset()
defp decrement_invite_changeset(%Invite{uses_left: nil} = invite) do
invite |> Invite.update_changeset(%{})
end
defp decrement_invite_changeset(%Invite{uses_left: 1} = invite) do
now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)
invite |> Invite.update_changeset(%{uses_left: 0, disabled_at: now})
end
defp decrement_invite_changeset(%Invite{uses_left: uses_left} = invite) do
invite |> Invite.update_changeset(%{uses_left: uses_left - 1})
end
@doc """
Creates a invite.
## Examples
iex> create_invite(%User{id: 123, role: :admin}, %{field: value})
{:ok, %Invite{}}
iex> create_invite(%User{id: 123, role: :admin}, %{field: bad_value})
{:error, %Changeset{}}
"""
@spec create_invite(User.t(), attrs :: map()) ::
{:ok, Invite.t()} | {:error, Invite.changeset()}
def create_invite(%User{role: :admin} = user, attrs) do
token =
:crypto.strong_rand_bytes(@invite_token_length)
|> Base.url_encode64()
|> binary_part(0, @invite_token_length)
Invite.create_changeset(user, token, attrs) |> Repo.insert()
end
@doc """
Updates a invite.
## Examples
iex> update_invite(invite, %{field: new_value}, %User{id: 123, role: :admin})
{:ok, %Invite{}}
iex> update_invite(invite, %{field: bad_value}, %User{id: 123, role: :admin})
{:error, %Changeset{}}
"""
@spec update_invite(Invite.t(), attrs :: map(), User.t()) ::
{:ok, Invite.t()} | {:error, Invite.changeset()}
def update_invite(invite, attrs, %User{role: :admin}) do
invite |> Invite.update_changeset(attrs) |> Repo.update()
end
@doc """
Deletes a invite.
## Examples
iex> delete_invite(invite, %User{id: 123, role: :admin})
{:ok, %Invite{}}
iex> delete_invite(invite, %User{id: 123, role: :admin})
{:error, %Changeset{}}
"""
@spec delete_invite(Invite.t(), User.t()) ::
{:ok, Invite.t()} | {:error, Invite.changeset()}
def delete_invite(invite, %User{role: :admin}) do
invite |> Repo.delete()
end
@doc """
Deletes a invite.
## Examples
iex> delete_invite(invite, %User{id: 123, role: :admin})
%Invite{}
"""
@spec delete_invite!(Invite.t(), User.t()) :: Invite.t()
def delete_invite!(invite, %User{role: :admin}) do
invite |> Repo.delete!()
end
end

View File

@ -6,19 +6,9 @@ defmodule Memex.Accounts.User do
use Ecto.Schema
import Ecto.Changeset
import MemexWeb.Gettext
alias Ecto.{Association, Changeset, UUID}
alias Memex.Accounts.{Invite, User}
alias Ecto.{Changeset, UUID}
alias Memex.Invites.Invite
@derive {Jason.Encoder,
only: [
:id,
:email,
:confirmed_at,
:role,
:locale,
:inserted_at,
:updated_at
]}
@derive {Inspect, except: [:password]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
@ -30,31 +20,27 @@ defmodule Memex.Accounts.User do
field :role, Ecto.Enum, values: [:admin, :user], default: :user
field :locale, :string
has_many :created_invites, Invite, foreign_key: :created_by_id
belongs_to :invite, Invite
has_many :invites, Invite, on_delete: :delete_all
timestamps()
end
@type t :: %User{
@type t :: %__MODULE__{
id: id(),
email: String.t(),
password: String.t(),
hashed_password: String.t(),
confirmed_at: NaiveDateTime.t(),
role: role(),
invites: [Invite.t()],
locale: String.t() | nil,
created_invites: [Invite.t()] | Association.NotLoaded.t(),
invite: Invite.t() | nil | Association.NotLoaded.t(),
invite_id: Invite.id() | nil,
inserted_at: NaiveDateTime.t(),
updated_at: NaiveDateTime.t()
}
@type new_user :: %User{}
@type new_user :: %__MODULE__{}
@type id :: UUID.t()
@type changeset :: Changeset.t(t() | new_user())
@type role :: :admin | :user
@type role :: :user | :admin | String.t()
@doc """
A user changeset for registration.
@ -73,22 +59,22 @@ defmodule Memex.Accounts.User do
validations on a LiveView form), this option can be set to `false`.
Defaults to `true`.
"""
@spec registration_changeset(attrs :: map(), Invite.t() | nil) :: changeset()
@spec registration_changeset(attrs :: map(), Invite.t() | nil, opts :: keyword()) :: changeset()
def registration_changeset(attrs, invite, opts \\ []) do
%User{}
@spec registration_changeset(attrs :: map()) :: changeset()
@spec registration_changeset(attrs :: map(), opts :: keyword()) :: changeset()
def registration_changeset(attrs, opts \\ []) do
%__MODULE__{}
|> cast(attrs, [:email, :password, :locale])
|> put_change(:invite_id, if(invite, do: invite.id))
|> validate_email()
|> validate_password(opts)
end
@doc """
A user changeset for role.
"""
@spec role_changeset(t() | new_user() | changeset(), role()) :: changeset()
def role_changeset(user, role) do
user |> change(role: role)
user |> cast(%{"role" => role}, [:role])
end
@spec validate_email(changeset()) :: changeset()
@ -103,8 +89,7 @@ defmodule Memex.Accounts.User do
|> unique_constraint(:email)
end
@spec validate_password(changeset(), opts :: keyword()) ::
changeset()
@spec validate_password(changeset(), opts :: keyword()) :: changeset()
defp validate_password(changeset, opts) do
changeset
|> validate_required([:password])
@ -182,12 +167,12 @@ defmodule Memex.Accounts.User do
`Bcrypt.no_user_verify/0` to avoid timing attacks.
"""
@spec valid_password?(t(), String.t()) :: boolean()
def valid_password?(%User{hashed_password: hashed_password}, password)
def valid_password?(%__MODULE__{hashed_password: hashed_password}, password)
when is_binary(hashed_password) and byte_size(password) > 0 do
Bcrypt.verify_pass(password, hashed_password)
end
def valid_password?(_invalid_user, _invalid_password) do
def valid_password?(_, _) do
Bcrypt.no_user_verify()
false
end

View File

@ -5,8 +5,6 @@ defmodule Memex.Accounts.UserToken do
use Ecto.Schema
import Ecto.Query
alias Ecto.{Association, UUID}
alias Memex.Accounts.User
@hash_algorithm :sha256
@rand_size 32
@ -24,25 +22,11 @@ defmodule Memex.Accounts.UserToken do
field :token, :binary
field :context, :string
field :sent_to, :string
belongs_to :user, User
belongs_to :user, Memex.Accounts.User
timestamps(updated_at: false)
end
@type t :: %__MODULE__{
id: id(),
token: token(),
context: String.t(),
sent_to: String.t(),
user: User.t() | Association.NotLoaded.t(),
user_id: User.id() | nil,
inserted_at: NaiveDateTime.t()
}
@type new_user_token :: %__MODULE__{}
@type id :: UUID.t()
@type token :: binary()
@doc """
Generates a token that will be stored in a signed place,
such as session or cookie. As they are signed, those
@ -50,7 +34,7 @@ defmodule Memex.Accounts.UserToken do
"""
def build_session_token(user) do
token = :crypto.strong_rand_bytes(@rand_size)
{token, %__MODULE__{token: token, context: "session", user_id: user.id}}
{token, %Memex.Accounts.UserToken{token: token, context: "session", user_id: user.id}}
end
@doc """
@ -85,7 +69,7 @@ defmodule Memex.Accounts.UserToken do
hashed_token = :crypto.hash(@hash_algorithm, token)
{Base.url_encode64(token, padding: false),
%__MODULE__{
%Memex.Accounts.UserToken{
token: hashed_token,
context: context,
sent_to: sent_to,
@ -145,17 +129,17 @@ defmodule Memex.Accounts.UserToken do
Returns the given token with the given context.
"""
def token_and_context_query(token, context) do
from __MODULE__, where: [token: ^token, context: ^context]
from Memex.Accounts.UserToken, where: [token: ^token, context: ^context]
end
@doc """
Gets all tokens for the given user for the given contexts.
"""
def user_and_contexts_query(user, :all) do
from t in __MODULE__, where: t.user_id == ^user.id
from t in Memex.Accounts.UserToken, where: t.user_id == ^user.id
end
def user_and_contexts_query(user, [_ | _] = contexts) do
from t in __MODULE__, where: t.user_id == ^user.id and t.context in ^contexts
from t in Memex.Accounts.UserToken, where: t.user_id == ^user.id and t.context in ^contexts
end
end

View File

@ -4,7 +4,6 @@ defmodule Memex.Application do
@moduledoc false
use Application
alias Memex.ErrorReporter
@impl true
def start(_type, _args) do
@ -18,24 +17,16 @@ defmodule Memex.Application do
# Start the Endpoint (http/https)
MemexWeb.Endpoint,
# Add Oban
{Oban, oban_config()},
Memex.Repo.Migrator
{Oban, oban_config()}
# Start a worker by calling: Memex.Worker.start_link(arg)
# {Memex.Worker, arg}
]
# Oban events logging https://hexdocs.pm/oban/Oban.html#module-reporting-errors
:ok =
:telemetry.attach_many(
"oban-logger",
[
[:oban, :job, :exception],
[:oban, :job, :start],
[:oban, :job, :stop]
],
&ErrorReporter.handle_event/4,
[]
)
# Automatically migrate on start in prod
children =
if Application.get_env(:memex, Memex.Application, automigrate: false)[:automigrate],
do: children ++ [Memex.Repo.Migrator],
else: children
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options

View File

@ -9,15 +9,6 @@ defmodule Memex.Contexts.Context do
alias Ecto.{Changeset, UUID}
alias Memex.{Accounts.User, Repo}
@derive {Jason.Encoder,
only: [
:slug,
:content,
:tags,
:visibility,
:inserted_at,
:updated_at
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "contexts" do

View File

@ -1,57 +0,0 @@
defmodule Memex.ErrorReporter do
@moduledoc """
Custom logger for telemetry events
Oban implementation taken from
https://hexdocs.pm/oban/Oban.html#module-reporting-errors
"""
require Logger
def handle_event([:oban, :job, :exception], measure, %{stacktrace: stacktrace} = meta, _config) do
data =
get_oban_job_data(meta, measure)
|> Map.put(:stacktrace, Exception.format_stacktrace(stacktrace))
Logger.error(meta.reason, data: pretty_encode(data))
end
def handle_event([:oban, :job, :start], measure, meta, _config) do
Logger.info("Started oban job", data: get_oban_job_data(meta, measure) |> pretty_encode())
end
def handle_event([:oban, :job, :stop], measure, meta, _config) do
Logger.info("Finished oban job", data: get_oban_job_data(meta, measure) |> pretty_encode())
end
def handle_event([:oban, :job, unhandled_event], measure, meta, _config) do
data =
get_oban_job_data(meta, measure)
|> Map.put(:event, unhandled_event)
Logger.warning("Unhandled oban job event", data: pretty_encode(data))
end
def handle_event(unhandled_event, measure, meta, config) do
data = %{
event: unhandled_event,
meta: meta,
measurements: measure,
config: config
}
Logger.warning("Unhandled telemetry event", data: pretty_encode(data))
end
defp get_oban_job_data(%{job: job}, measure) do
job
|> Map.take([:id, :args, :meta, :queue, :worker])
|> Map.merge(measure)
end
defp pretty_encode(data) do
data
|> Jason.encode!()
|> Jason.Formatter.pretty_print()
end
end

173
lib/memex/invites.ex Normal file
View File

@ -0,0 +1,173 @@
defmodule Memex.Invites do
@moduledoc """
The Invites context.
"""
import Ecto.Query, warn: false
alias Ecto.Changeset
alias Memex.{Accounts.User, Invites.Invite, Repo}
@invite_token_length 20
@doc """
Returns the list of invites.
## Examples
iex> list_invites(%User{id: 123, role: :admin})
[%Invite{}, ...]
"""
@spec list_invites(User.t()) :: [Invite.t()]
def list_invites(%User{role: :admin}) do
Repo.all(from i in Invite, order_by: i.name)
end
@doc """
Gets a single invite.
Raises `Ecto.NoResultsError` if the Invite does not exist.
## Examples
iex> get_invite!(123, %User{id: 123, role: :admin})
%Invite{}
iex> get_invite!(456, %User{id: 123, role: :admin})
** (Ecto.NoResultsError)
"""
@spec get_invite!(Invite.id(), User.t()) :: Invite.t()
def get_invite!(id, %User{role: :admin}) do
Repo.get!(Invite, id)
end
@doc """
Returns a valid invite or nil based on the attempted token
## Examples
iex> get_invite_by_token("valid_token")
%Invite{}
iex> get_invite_by_token("invalid_token")
nil
"""
@spec get_invite_by_token(token :: String.t() | nil) :: Invite.t() | nil
def get_invite_by_token(nil), do: nil
def get_invite_by_token(""), do: nil
def get_invite_by_token(token) do
Repo.one(
from(i in Invite,
where: i.token == ^token and i.disabled_at |> is_nil()
)
)
end
@doc """
Uses invite by decrementing uses_left, or marks invite invalid if it's been
completely used.
"""
@spec use_invite!(Invite.t()) :: Invite.t()
def use_invite!(%Invite{uses_left: nil} = invite), do: invite
def use_invite!(%Invite{uses_left: uses_left} = invite) do
new_uses_left = uses_left - 1
attrs =
if new_uses_left <= 0 do
now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)
%{"uses_left" => 0, "disabled_at" => now}
else
%{"uses_left" => new_uses_left}
end
invite |> Invite.update_changeset(attrs) |> Repo.update!()
end
@doc """
Creates a invite.
## Examples
iex> create_invite(%User{id: 123, role: :admin}, %{field: value})
{:ok, %Invite{}}
iex> create_invite(%User{id: 123, role: :admin}, %{field: bad_value})
{:error, %Changeset{}}
"""
@spec create_invite(User.t(), attrs :: map()) ::
{:ok, Invite.t()} | {:error, Changeset.t(Invite.new_invite())}
def create_invite(%User{id: user_id, role: :admin}, attrs) do
token =
:crypto.strong_rand_bytes(@invite_token_length)
|> Base.url_encode64()
|> binary_part(0, @invite_token_length)
attrs = attrs |> Map.merge(%{"user_id" => user_id, "token" => token})
%Invite{} |> Invite.create_changeset(attrs) |> Repo.insert()
end
@doc """
Updates a invite.
## Examples
iex> update_invite(invite, %{field: new_value}, %User{id: 123, role: :admin})
{:ok, %Invite{}}
iex> update_invite(invite, %{field: bad_value}, %User{id: 123, role: :admin})
{:error, %Changeset{}}
"""
@spec update_invite(Invite.t(), attrs :: map(), User.t()) ::
{:ok, Invite.t()} | {:error, Changeset.t(Invite.t())}
def update_invite(invite, attrs, %User{role: :admin}),
do: invite |> Invite.update_changeset(attrs) |> Repo.update()
@doc """
Deletes a invite.
## Examples
iex> delete_invite(invite, %User{id: 123, role: :admin})
{:ok, %Invite{}}
iex> delete_invite(invite, %User{id: 123, role: :admin})
{:error, %Changeset{}}
"""
@spec delete_invite(Invite.t(), User.t()) ::
{:ok, Invite.t()} | {:error, Changeset.t(Invite.t())}
def delete_invite(invite, %User{role: :admin}), do: invite |> Repo.delete()
@doc """
Deletes a invite.
## Examples
iex> delete_invite(invite, %User{id: 123, role: :admin})
%Invite{}
"""
@spec delete_invite!(Invite.t(), User.t()) :: Invite.t()
def delete_invite!(invite, %User{role: :admin}), do: invite |> Repo.delete!()
@doc """
Returns an `%Changeset{}` for tracking invite changes.
## Examples
iex> change_invite(invite)
%Changeset{data: %Invite{}}
"""
@spec change_invite(Invite.t() | Invite.new_invite()) ::
Changeset.t(Invite.t() | Invite.new_invite())
@spec change_invite(Invite.t() | Invite.new_invite(), attrs :: map()) ::
Changeset.t(Invite.t() | Invite.new_invite())
def change_invite(invite, attrs \\ %{}), do: invite |> Invite.update_changeset(attrs)
end

View File

@ -1,4 +1,4 @@
defmodule Memex.Accounts.Invite do
defmodule Memex.Invites.Invite do
@moduledoc """
An invite, created by an admin to allow someone to join their instance. An
invite can be enabled or disabled, and can have an optional number of uses if
@ -7,8 +7,8 @@ defmodule Memex.Accounts.Invite do
use Ecto.Schema
import Ecto.Changeset
alias Ecto.{Association, Changeset, UUID}
alias Memex.Accounts.User
alias Ecto.{Changeset, UUID}
alias Memex.{Accounts.User, Invites.Invite}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
@ -18,46 +18,40 @@ defmodule Memex.Accounts.Invite do
field :uses_left, :integer, default: nil
field :disabled_at, :naive_datetime
belongs_to :created_by, User
has_many :users, User
belongs_to :user, User
timestamps()
end
@type t :: %__MODULE__{
@type t :: %Invite{
id: id(),
name: String.t(),
token: token(),
token: String.t(),
uses_left: integer() | nil,
disabled_at: NaiveDateTime.t(),
created_by: User.t() | nil | Association.NotLoaded.t(),
created_by_id: User.id() | nil,
users: [User.t()] | Association.NotLoaded.t(),
user: User.t(),
user_id: User.id(),
inserted_at: NaiveDateTime.t(),
updated_at: NaiveDateTime.t()
}
@type new_invite :: %__MODULE__{}
@type new_invite :: %Invite{}
@type id :: UUID.t()
@type changeset :: Changeset.t(t() | new_invite())
@type token :: String.t()
@doc false
@spec create_changeset(User.t(), token(), attrs :: map()) :: changeset()
def create_changeset(%User{id: user_id}, token, attrs) do
%__MODULE__{}
|> change(token: token, created_by_id: user_id)
|> cast(attrs, [:name, :uses_left, :disabled_at])
|> validate_required([:name, :token, :created_by_id])
@spec create_changeset(new_invite(), attrs :: map()) :: Changeset.t(new_invite())
def create_changeset(invite, attrs) do
invite
|> cast(attrs, [:name, :token, :uses_left, :disabled_at, :user_id])
|> validate_required([:name, :token, :user_id])
|> validate_number(:uses_left, greater_than_or_equal_to: 0)
end
@doc false
@spec update_changeset(t() | new_invite(), attrs :: map()) :: changeset()
@spec update_changeset(t() | new_invite(), attrs :: map()) :: Changeset.t(t() | new_invite())
def update_changeset(invite, attrs) do
invite
|> cast(attrs, [:name, :uses_left, :disabled_at])
|> validate_required([:name])
|> validate_required([:name, :token, :user_id])
|> validate_number(:uses_left, greater_than_or_equal_to: 0)
end
end

View File

@ -8,15 +8,6 @@ defmodule Memex.Notes.Note do
alias Ecto.{Changeset, UUID}
alias Memex.{Accounts.User, Repo}
@derive {Jason.Encoder,
only: [
:slug,
:content,
:tags,
:visibility,
:inserted_at,
:updated_at
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "notes" do

View File

@ -8,16 +8,6 @@ defmodule Memex.Pipelines.Pipeline do
alias Ecto.{Changeset, UUID}
alias Memex.{Accounts.User, Pipelines.Steps.Step, Repo}
@derive {Jason.Encoder,
only: [
:slug,
:description,
:tags,
:visibility,
:inserted_at,
:steps,
:updated_at
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "pipelines" do

View File

@ -7,14 +7,6 @@ defmodule Memex.Pipelines.Steps.Step do
alias Ecto.{Changeset, UUID}
alias Memex.{Accounts.User, Pipelines.Pipeline}
@derive {Jason.Encoder,
only: [
:title,
:content,
:position,
:inserted_at,
:updated_at
]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "steps" do

View File

@ -7,9 +7,7 @@ defmodule Memex.Release do
def rollback(repo, version) do
load_app()
{:ok, _fun_return, _apps} =
Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
end
defp load_app do
@ -20,8 +18,7 @@ defmodule Memex.Release do
load_app()
for repo <- Application.fetch_env!(@app, :ecto_repos) do
{:ok, _fun_return, _apps} =
Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
end
end
end

View File

@ -6,24 +6,17 @@ defmodule Memex.Repo.Migrator do
use GenServer
require Logger
def start_link(_opts) do
def start_link(_) do
GenServer.start_link(__MODULE__, [], [])
end
def init(_opts) do
{:ok, if(automigrate_enabled?(), do: migrate!())}
def init(_) do
migrate!()
{:ok, nil}
end
def migrate! do
path = Application.app_dir(:lokal, "priv/repo/migrations")
Ecto.Migrator.run(Lokal.Repo, path, :up, all: true)
end
defp automigrate_enabled? do
Application.get_env(:lokal, Lokal.Application, automigrate: false)[:automigrate]
end
defp automigrate_enabled? do
Application.get_env(:memex, Memex.Application, automigrate: false)[:automigrate]
path = Application.app_dir(:memex, "priv/repo/migrations")
Ecto.Migrator.run(Memex.Repo, path, :up, all: true)
end
end

View File

@ -46,7 +46,7 @@ defmodule MemexWeb do
def live_view do
quote do
use Phoenix.LiveView,
layout: {MemexWeb.LayoutView, "live.html"}
layout: {MemexWeb.LayoutView, :live}
on_mount MemexWeb.InitAssigns
unquote(view_helpers())
@ -73,16 +73,15 @@ defmodule MemexWeb do
quote do
use Phoenix.Router
import Phoenix.{Controller, LiveView.Router}
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import Plug.Conn
import Phoenix.Controller
import Phoenix.LiveView.Router
end
end
def channel do
quote do
use Phoenix.Channel
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import MemexWeb.Gettext
end
end
@ -90,15 +89,16 @@ defmodule MemexWeb do
defp view_helpers do
quote do
# Use all HTML functionality (forms, tags, etc)
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
use Phoenix.HTML
# Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc)
# Import basic rendering functionality (render, render_layout, etc)
import Phoenix.{Component, View}
import MemexWeb.{ErrorHelpers, Gettext, LiveHelpers, ViewHelpers}
import Phoenix.Component
import MemexWeb.LiveHelpers
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
# Import basic rendering functionality (render, render_layout, etc)
import Phoenix.View
import MemexWeb.{ErrorHelpers, Gettext, LiveHelpers, ViewHelpers}
alias MemexWeb.Endpoint
alias MemexWeb.Router.Helpers, as: Routes
end

View File

@ -12,7 +12,7 @@ defmodule MemexWeb.Components.ContextContent do
~H"""
<div
id={"show-context-content-#{@context.id}"}
class="input input-primary h-128 min-h-128 inline-block whitespace-pre-wrap overflow-x-hidden overflow-y-auto"
class="input input-primary h-128 min-h-128 inline-block"
phx-hook="MaintainAttrs"
phx-update="ignore"
readonly
@ -39,6 +39,7 @@ defmodule MemexWeb.Components.ContextContent do
"</p>#{link}<p class=\"inline\">"
end
)
|> String.replace("\n", "<br>")
|> HTML.raw()
end
end

View File

@ -109,13 +109,11 @@ defmodule MemexWeb.Components.ContextsTableComponent do
~H"""
<div class="flex flex-wrap justify-center space-x-1">
<.link
:for={tag <- @tags}
patch={Routes.context_index_path(Endpoint, :search, tag)}
class="link"
>
<%= for tag <- @tags do %>
<.link patch={Routes.context_index_path(Endpoint, :search, tag)} class="link">
<%= tag %>
</.link>
<% end %>
</div>
"""
end

View File

@ -4,20 +4,8 @@ defmodule MemexWeb.Components.InviteCard do
"""
use MemexWeb, :component
alias Memex.Accounts.{Invite, Invites, User}
alias MemexWeb.Endpoint
attr :invite, Invite, required: true
attr :current_user, User, required: true
slot(:inner_block)
slot(:code_actions)
def invite_card(%{invite: invite, current_user: current_user} = assigns) do
assigns =
assigns
|> assign(:use_count, Invites.get_use_count(invite, current_user))
|> assign_new(:code_actions, fn -> [] end)
def invite_card(assigns) do
~H"""
<div class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center space-y-4
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
@ -28,14 +16,8 @@ defmodule MemexWeb.Components.InviteCard do
<%= if @invite.disabled_at |> is_nil() do %>
<h2 class="title text-md">
<%= if @invite.uses_left do %>
<%= gettext(
"uses left: %{uses_left_count}",
uses_left_count: @invite.uses_left
) %>
<% else %>
<%= gettext("uses left: unlimited") %>
<% end %>
<%= gettext("Uses Left:") %>
<%= @invite.uses_left || gettext("unlimited") %>
</h2>
<% else %>
<h2 class="title text-md">
@ -43,27 +25,24 @@ defmodule MemexWeb.Components.InviteCard do
</h2>
<% end %>
<.qr_code
content={Routes.user_registration_url(Endpoint, :new, invite: @invite.token)}
filename={@invite.name}
/>
<h2 :if={@use_count != 0} class="title text-md">
<%= gettext("uses: %{uses_count}", uses_count: @use_count) %>
</h2>
<div class="flex flex-row flex-wrap justify-center items-center">
<code
id={"code-#{@invite.id}"}
class="mx-2 my-1 text-xs px-4 py-2 rounded-lg text-center break-all text-gray-100 bg-primary-800"
phx-no-format
><%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %></code>
>
<%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %>
</code>
<%= if @code_actions do %>
<%= render_slot(@code_actions) %>
<% end %>
</div>
<div :if={@inner_block} class="flex space-x-4 justify-center items-center">
<%= if @inner_block do %>
<div class="flex space-x-4 justify-center items-center">
<%= render_slot(@inner_block) %>
</div>
<% end %>
</div>
"""
end

View File

@ -12,7 +12,7 @@ defmodule MemexWeb.Components.NoteContent do
~H"""
<div
id={"show-note-content-#{@note.id}"}
class="input input-primary h-128 min-h-128 inline-block whitespace-pre-wrap overflow-x-hidden overflow-y-auto"
class="input input-primary h-128 min-h-128 inline-block"
phx-hook="MaintainAttrs"
phx-update="ignore"
readonly
@ -39,6 +39,7 @@ defmodule MemexWeb.Components.NoteContent do
"</p>#{link}<p class=\"inline\">"
end
)
|> String.replace("\n", "<br>")
|> HTML.raw()
end
end

View File

@ -109,9 +109,11 @@ defmodule MemexWeb.Components.NotesTableComponent do
~H"""
<div class="flex flex-wrap justify-center space-x-1">
<.link :for={tag <- @tags} patch={Routes.note_index_path(Endpoint, :search, tag)} class="link">
<%= for tag <- @tags do %>
<.link patch={Routes.note_index_path(Endpoint, :search, tag)} class="link">
<%= tag %>
</.link>
<% end %>
</div>
"""
end

View File

@ -122,13 +122,11 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
~H"""
<div class="flex flex-wrap justify-center space-x-1">
<.link
:for={tag <- @tags}
patch={Routes.pipeline_index_path(Endpoint, :search, tag)}
class="link"
>
<%= for tag <- @tags do %>
<.link patch={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link">
<%= tag %>
</.link>
<% end %>
</div>
"""
end

View File

@ -12,7 +12,7 @@ defmodule MemexWeb.Components.StepContent do
~H"""
<div
id={"show-step-content-#{@step.id}"}
class="input input-primary h-32 min-h-32 inline-block whitespace-pre-wrap overflow-x-hidden overflow-y-auto"
class="input input-primary h-32 min-h-32 inline-block"
phx-hook="MaintainAttrs"
phx-update="ignore"
readonly
@ -39,6 +39,7 @@ defmodule MemexWeb.Components.StepContent do
"</p>#{link}<p class=\"inline\">"
end
)
|> String.replace("\n", "<br>")
|> HTML.raw()
end
end

View File

@ -4,7 +4,7 @@
<tr>
<%= for %{key: key, label: label} = column <- @columns do %>
<%= if column |> Map.get(:sortable, true) do %>
<th class={["p-2", column[:class]]}>
<th class={"p-2 #{column[:class]}"}>
<span
class="cursor-pointer flex justify-center items-center space-x-2"
phx-click="sort_by"
@ -25,7 +25,7 @@
</span>
</th>
<% else %>
<th class={["p-2", column[:class]]}>
<th class={"p-2 #{column[:class]}"}>
<%= label %>
</th>
<% end %>
@ -33,11 +33,10 @@
</tr>
</thead>
<tbody>
<tr
:for={{values, i} <- @rows |> Enum.with_index()}
class={if i |> Integer.is_even(), do: @row_class, else: @alternate_row_class}
>
<td :for={%{key: key} = value <- @columns} class={["p-2", value[:class]]}>
<%= for {values, i} <- @rows |> Enum.with_index() do %>
<tr class={if i |> Integer.is_even(), do: @row_class, else: @alternate_row_class}>
<%= for %{key: key} = value <- @columns do %>
<td class={"p-2 #{value[:class]}"}>
<%= case values |> Map.get(key) do %>
<% {_custom_sort_value, value} -> %>
<%= value %>
@ -45,7 +44,9 @@
<%= value %>
<% end %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@ -65,7 +65,8 @@ defmodule MemexWeb.Components.Topbar do
<li class="mx-2 my-1 border-left border border-primary-700"></li>
<%= if @current_user do %>
<li :if={@current_user |> Accounts.is_already_admin?()} class="mx-2 my-1">
<%= if @current_user |> Accounts.is_already_admin?() do %>
<li class="mx-2 my-1">
<.link
navigate={Routes.invite_index_path(Endpoint, :index)}
class="text-primary-400 text-primary-400 hover:underline"
@ -73,6 +74,7 @@ defmodule MemexWeb.Components.Topbar do
<%= gettext("invites") %>
</.link>
</li>
<% end %>
<li class="mx-2 my-1">
<.link
@ -93,12 +95,8 @@ defmodule MemexWeb.Components.Topbar do
</.link>
</li>
<li
:if={
@current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2)
}
class="mx-2 my-1"
>
<%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %>
<li class="mx-2 my-1">
<.link
navigate={Routes.live_dashboard_path(Endpoint, :home)}
class="text-primary-400 text-primary-400 hover:underline"
@ -106,8 +104,10 @@ defmodule MemexWeb.Components.Topbar do
<i class="fas fa-gauge"></i>
</.link>
</li>
<% end %>
<% else %>
<li :if={Accounts.allow_registration?()} class="mx-2 my-1">
<%= if Accounts.allow_registration?() do %>
<li class="mx-2 my-1">
<.link
navigate={Routes.user_registration_path(Endpoint, :new)}
class="text-primary-400 text-primary-400 hover:underline truncate"
@ -115,6 +115,7 @@ defmodule MemexWeb.Components.Topbar do
<%= dgettext("actions", "register") %>
</.link>
</li>
<% end %>
<li class="mx-2 my-1">
<.link

View File

@ -19,29 +19,27 @@ defmodule MemexWeb.Components.UserCard do
<h3 class="px-4 py-2 rounded-lg title text-lg">
<p>
<%= if @user.confirmed_at do %>
<%= gettext(
"user confirmed on%{confirmed_datetime}",
confirmed_datetime: ""
) %>
<.datetime datetime={@user.confirmed_at} />
<% else %>
<%= if @user.confirmed_at |> is_nil() do %>
<%= gettext("email unconfirmed") %>
<% else %>
<p>
<%= gettext("user confirmed on") %>
<%= @user.confirmed_at |> display_datetime() %>
</p>
<% end %>
</p>
<p>
<%= gettext(
"user registered on%{registered_datetime}",
registered_datetime: ""
) %>
<.datetime datetime={@user.inserted_at} />
<%= gettext("user registered on") %>
<%= @user.inserted_at |> display_datetime() %>
</p>
</h3>
<div :if={@inner_block} class="px-4 py-2 flex space-x-4 justify-center items-center">
<%= if @inner_block do %>
<div class="px-4 py-2 flex space-x-4 justify-center items-center">
<%= render_slot(@inner_block) %>
</div>
<% end %>
</div>
"""
end

View File

@ -1,17 +0,0 @@
defmodule MemexWeb.ExportController do
use MemexWeb, :controller
alias Memex.{Contexts, Notes, Pipelines, Pipelines.Steps}
def export(%{assigns: %{current_user: current_user}} = conn, %{"mode" => "json"}) do
pipelines =
Pipelines.list_pipelines(current_user)
|> Enum.map(fn pipeline -> Steps.preload_steps(pipeline, current_user) end)
json(conn, %{
user: current_user,
notes: Notes.list_notes(current_user),
contexts: Contexts.list_contexts(current_user),
pipelines: pipelines
})
end
end

View File

@ -1,12 +1,14 @@
defmodule MemexWeb.UserRegistrationController do
use MemexWeb, :controller
import MemexWeb.Gettext
alias Memex.{Accounts, Accounts.Invites}
alias MemexWeb.{Endpoint, HomeLive}
alias Memex.{Accounts, Invites}
alias MemexWeb.HomeLive
def new(conn, %{"invite" => invite_token}) do
if Invites.valid_invite_token?(invite_token) do
conn |> render_new(invite_token)
invite = Invites.get_invite_by_token(invite_token)
if invite do
conn |> render_new(invite)
else
conn
|> put_flash(:error, dgettext("errors", "Sorry, this invite was not found or expired"))
@ -25,17 +27,19 @@ defmodule MemexWeb.UserRegistrationController do
end
# renders new user registration page
defp render_new(conn, invite_token \\ nil) do
defp render_new(conn, invite \\ nil) do
render(conn, "new.html",
changeset: Accounts.change_user_registration(),
invite_token: invite_token,
invite: invite,
page_title: gettext("register")
)
end
def create(conn, %{"user" => %{"invite_token" => invite_token}} = attrs) do
if Invites.valid_invite_token?(invite_token) do
conn |> create_user(attrs, invite_token)
invite = Invites.get_invite_by_token(invite_token)
if invite do
conn |> create_user(attrs, invite)
else
conn
|> put_flash(:error, dgettext("errors", "Sorry, this invite was not found or expired"))
@ -53,25 +57,24 @@ defmodule MemexWeb.UserRegistrationController do
end
end
defp create_user(conn, %{"user" => user_params}, invite_token \\ nil) do
case Accounts.register_user(user_params, invite_token) do
defp create_user(conn, %{"user" => user_params}, invite \\ nil) do
case Accounts.register_user(user_params) do
{:ok, user} ->
unless invite |> is_nil() do
invite |> Invites.use_invite!()
end
Accounts.deliver_user_confirmation_instructions(
user,
&Routes.user_confirmation_url(conn, :confirm, &1)
)
conn
|> put_flash(:info, dgettext("prompts", "please check your email to verify your account"))
|> put_flash(:info, dgettext("prompts", "Please check your email to verify your account"))
|> redirect(to: Routes.user_session_path(Endpoint, :new))
{:error, :invalid_token} ->
conn
|> put_flash(:error, dgettext("errors", "sorry, this invite was not found or expired"))
|> redirect(to: Routes.live_path(Endpoint, HomeLive))
{:error, %Ecto.Changeset{} = changeset} ->
conn |> render("new.html", changeset: changeset, invite_token: invite_token)
conn |> render("new.html", changeset: changeset, invite: invite)
end
end
end

View File

@ -7,7 +7,7 @@ defmodule MemexWeb.UserSettingsController do
plug :assign_email_and_password_changesets
def edit(conn, _params) do
render(conn, "edit.html", page_title: gettext("settings"))
render(conn, "edit.html", page_title: gettext("Settings"))
end
def update(%{assigns: %{current_user: user}} = conn, %{
@ -28,7 +28,7 @@ defmodule MemexWeb.UserSettingsController do
:info,
dgettext(
"prompts",
"a link to confirm your email change has been sent to the new address."
"A link to confirm your email change has been sent to the new address."
)
)
|> redirect(to: Routes.user_settings_path(conn, :edit))
@ -46,7 +46,7 @@ defmodule MemexWeb.UserSettingsController do
case Accounts.update_user_password(user, password, user_params) do
{:ok, user} ->
conn
|> put_flash(:info, dgettext("prompts", "password updated successfully."))
|> put_flash(:info, dgettext("prompts", "Password updated successfully."))
|> put_session(:user_return_to, Routes.user_settings_path(conn, :edit))
|> UserAuth.log_in_user(user)
@ -62,7 +62,7 @@ defmodule MemexWeb.UserSettingsController do
case Accounts.update_user_locale(user, locale) do
{:ok, _user} ->
conn
|> put_flash(:info, dgettext("prompts", "language updated successfully."))
|> put_flash(:info, dgettext("prompts", "Language updated successfully."))
|> redirect(to: Routes.user_settings_path(conn, :edit))
{:error, changeset} ->
@ -74,14 +74,14 @@ defmodule MemexWeb.UserSettingsController do
case Accounts.update_user_email(user, token) do
:ok ->
conn
|> put_flash(:info, dgettext("prompts", "email changed successfully."))
|> put_flash(:info, dgettext("prompts", "Email changed successfully."))
|> redirect(to: Routes.user_settings_path(conn, :edit))
:error ->
conn
|> put_flash(
:error,
dgettext("errors", "email change link is invalid or it has expired.")
dgettext("errors", "Email change link is invalid or it has expired.")
)
|> redirect(to: Routes.user_settings_path(conn, :edit))
end
@ -92,11 +92,11 @@ defmodule MemexWeb.UserSettingsController do
current_user |> Accounts.delete_user!(current_user)
conn
|> put_flash(:error, dgettext("prompts", "your account has been deleted"))
|> put_flash(:error, dgettext("prompts", "Your account has been deleted"))
|> redirect(to: Routes.live_path(conn, HomeLive))
else
conn
|> put_flash(:error, dgettext("errors", "unable to delete user"))
|> put_flash(:error, dgettext("errors", "Unable to delete user"))
|> redirect(to: Routes.user_settings_path(conn, :edit))
end
end

View File

@ -30,15 +30,16 @@
contexts={@contexts}
>
<:actions :let={context}>
<%= if is_owner?(context, @current_user) do %>
<.link
:if={is_owner?(context, @current_user)}
patch={Routes.context_index_path(@socket, :edit, context.slug)}
data-qa={"context-edit-#{context.id}"}
>
<%= dgettext("actions", "edit") %>
</.link>
<% end %>
<%= if is_owner_or_admin?(context, @current_user) do %>
<.link
:if={is_owner_or_admin?(context, @current_user)}
href="#"
phx-click="delete"
phx-value-id={context.id}
@ -47,20 +48,20 @@
>
<%= dgettext("actions", "delete") %>
</.link>
<% end %>
</:actions>
</.live_component>
<% end %>
<.link
:if={@current_user}
patch={Routes.context_index_path(@socket, :new)}
class="self-end btn btn-primary"
>
<%= if @current_user do %>
<.link patch={Routes.context_index_path(@socket, :new)} class="self-end btn btn-primary">
<%= dgettext("actions", "new context") %>
</.link>
<% end %>
</div>
<.modal :if={@live_action in [:new, :edit]} return_to={Routes.context_index_path(@socket, :index)}>
<%= if @live_action in [:new, :edit] do %>
<.modal return_to={Routes.context_index_path(@socket, :index)}>
<.live_component
module={MemexWeb.ContextLive.FormComponent}
id={@context.id || :new}
@ -71,3 +72,4 @@
return_to={Routes.context_index_path(@socket, :index)}
/>
</.modal>
<% end %>

View File

@ -11,7 +11,7 @@ defmodule MemexWeb.ContextLive.Show do
@impl true
def handle_params(
%{"slug" => slug},
_params,
_,
%{assigns: %{live_action: live_action, current_user: current_user}} = socket
) do
context =

View File

@ -4,13 +4,11 @@
</h1>
<div class="flex flex-wrap space-x-1">
<.link
:for={tag <- @context.tags}
navigate={Routes.context_index_path(Endpoint, :search, tag)}
class="link"
>
<%= for tag <- @context.tags do %>
<.link navigate={Routes.context_index_path(Endpoint, :search, tag)} class="link">
<%= tag %>
</.link>
<% end %>
</div>
<.context_content context={@context} />
@ -23,15 +21,16 @@
<.link class="btn btn-primary" navigate={Routes.context_index_path(@socket, :index)}>
<%= dgettext("actions", "back") %>
</.link>
<%= if is_owner?(@context, @current_user) do %>
<.link
:if={is_owner?(@context, @current_user)}
class="btn btn-primary"
patch={Routes.context_show_path(@socket, :edit, @context.slug)}
>
<%= dgettext("actions", "edit") %>
</.link>
<% end %>
<%= if is_owner_or_admin?(@context, @current_user) do %>
<button
:if={is_owner_or_admin?(@context, @current_user)}
type="button"
class="btn btn-primary"
phx-click="delete"
@ -40,13 +39,12 @@
>
<%= dgettext("actions", "delete") %>
</button>
<% end %>
</div>
</div>
<.modal
:if={@live_action == :edit}
return_to={Routes.context_show_path(@socket, :show, @context.slug)}
>
<%= if @live_action in [:edit] do %>
<.modal return_to={Routes.context_show_path(@socket, :show, @context.slug)}>
<.live_component
module={MemexWeb.ContextLive.FormComponent}
id={@context.id}
@ -57,3 +55,4 @@
return_to={Routes.context_show_path(@socket, :show, @context.slug)}
/>
</.modal>
<% end %>

View File

@ -3,12 +3,12 @@ defmodule MemexWeb.HomeLive do
Liveview for the main home page
"""
@version Mix.Project.config()[:version]
use MemexWeb, :live_view
alias Memex.Accounts
alias MemexWeb.{Endpoint, FaqLive}
@version Mix.Project.config()[:version]
@impl true
def mount(_params, _session, socket) do
admins = Accounts.list_users_by_role(:admin)

View File

@ -38,7 +38,7 @@
navigate={Routes.live_path(Endpoint, FaqLive)}
class="link title text-primary-400 text-lg"
>
<%= gettext("read more on how to use memEx") %>
<%= gettext("read more on how to use %{name}", name: "memEx") %>
</.link>
</li>
</ul>
@ -92,13 +92,15 @@
<p>
<%= if @admins |> Enum.empty?() do %>
<.link href={Routes.user_registration_path(Endpoint, :new)} class="link">
<%= dgettext("prompts", "register to setup memEx") %>
<%= dgettext("prompts", "register to setup %{name}", name: "memEx") %>
</.link>
<% else %>
<div class="flex flex-wrap justify-center space-x-2">
<a :for={%{email: email} <- @admins} class="link" href={"mailto:#{email}"}>
<%= email %>
<%= for admin <- @admins do %>
<a class="link" href={"mailto:#{admin.email}"}>
<%= admin.email %>
</a>
<% end %>
</div>
<% end %>
</p>
@ -107,7 +109,8 @@
<li class="flex flex-row justify-center space-x-2">
<b><%= gettext("registration:") %></b>
<p>
<%= case Application.get_env(:memex, Memex.Accounts)[:registration] do
<%= Application.get_env(:memex, Endpoint)[:registration]
|> case do
"public" -> gettext("public signups")
_ -> gettext("invite only")
end %>

View File

@ -1,11 +1,11 @@
defmodule MemexWeb.InviteLive.FormComponent do
@moduledoc """
Livecomponent that can update or create an Memex.Accounts.Invite
Livecomponent that can update or create an Memex.Invites.Invite
"""
use MemexWeb, :live_component
alias Ecto.Changeset
alias Memex.Accounts.{Invite, Invites, User}
alias Memex.{Accounts.User, Invites, Invites.Invite}
alias Phoenix.LiveView.Socket
@impl true
@ -13,44 +13,23 @@ defmodule MemexWeb.InviteLive.FormComponent do
%{:invite => Invite.t(), :current_user => User.t(), optional(any) => any},
Socket.t()
) :: {:ok, Socket.t()}
def update(%{invite: _invite} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign_changeset(%{})}
def update(%{invite: invite} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign(:changeset, Invites.change_invite(invite))}
end
@impl true
def handle_event("validate", %{"invite" => invite_params}, socket) do
{:noreply, socket |> assign_changeset(invite_params)}
def handle_event(
"validate",
%{"invite" => invite_params},
%{assigns: %{invite: invite}} = socket
) do
{:noreply, socket |> assign(:changeset, invite |> Invites.change_invite(invite_params))}
end
def handle_event("save", %{"invite" => invite_params}, %{assigns: %{action: action}} = socket) do
save_invite(socket, action, invite_params)
end
defp assign_changeset(
%{assigns: %{action: action, current_user: user, invite: invite}} = socket,
invite_params
) do
changeset_action =
case action do
:new -> :insert
:edit -> :update
end
changeset =
case action do
:new -> Invite.create_changeset(user, "example_token", invite_params)
:edit -> invite |> Invite.update_changeset(invite_params)
end
changeset =
case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset
{:error, changeset} -> changeset
end
socket |> assign(:changeset, changeset)
end
defp save_invite(
%{assigns: %{current_user: current_user, invite: invite, return_to: return_to}} = socket,
:edit,
@ -59,7 +38,9 @@ defmodule MemexWeb.InviteLive.FormComponent do
socket =
case invite |> Invites.update_invite(invite_params, current_user) do
{:ok, %{name: invite_name}} ->
prompt = dgettext("prompts", "%{name} updated successfully", name: invite_name)
prompt =
dgettext("prompts", "%{invite_name} updated successfully", invite_name: invite_name)
socket |> put_flash(:info, prompt) |> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} ->
@ -77,7 +58,9 @@ defmodule MemexWeb.InviteLive.FormComponent do
socket =
case current_user |> Invites.create_invite(invite_params) do
{:ok, %{name: invite_name}} ->
prompt = dgettext("prompts", "%{name} created successfully", name: invite_name)
prompt =
dgettext("prompts", "%{invite_name} created successfully", invite_name: invite_name)
socket |> put_flash(:info, prompt) |> push_navigate(to: return_to)
{:error, %Changeset{} = changeset} ->

View File

@ -11,12 +11,11 @@
phx-change="validate"
phx-submit="save"
>
<div
:if={@changeset.action && not @changeset.valid?()}
class="invalid-feedback col-span-3 text-center"
>
<%= if @changeset.action && not @changeset.valid? do %>
<div class="invalid-feedback col-span-3 text-center">
<%= changeset_errors(@changeset) %>
</div>
<% end %>
<%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-400") %>
<%= text_input(f, :name, class: "input input-primary col-span-2") %>

View File

@ -1,13 +1,12 @@
defmodule MemexWeb.InviteLive.Index do
@moduledoc """
Liveview to show a Memex.Accounts.Invite index
Liveview to show a Memex.Invites.Invite index
"""
use MemexWeb, :live_view
import MemexWeb.Components.{InviteCard, UserCard}
alias Memex.Accounts
alias Memex.Accounts.{Invite, Invites}
alias MemexWeb.{Endpoint, HomeLive}
alias Memex.{Accounts, Invites, Invites.Invite}
alias MemexWeb.HomeLive
alias Phoenix.LiveView.JS
@impl true
@ -16,9 +15,9 @@ defmodule MemexWeb.InviteLive.Index do
if current_user |> Map.get(:role) == :admin do
socket |> display_invites()
else
prompt = dgettext("errors", "you are not authorized to view this page")
prompt = dgettext("errors", "You are not authorized to view this page")
return_to = Routes.live_path(Endpoint, HomeLive)
socket |> put_flash(:error, prompt) |> push_redirect(to: return_to)
socket |> put_flash(:error, prompt) |> push_navigate(to: return_to)
end
{:ok, socket}
@ -62,7 +61,7 @@ defmodule MemexWeb.InviteLive.Index do
) do
socket =
Invites.get_invite!(id, current_user)
|> Invites.update_invite(%{uses_left: nil}, current_user)
|> Invites.update_invite(%{"uses_left" => nil}, current_user)
|> case do
{:ok, %{name: invite_name}} ->
prompt =
@ -84,7 +83,7 @@ defmodule MemexWeb.InviteLive.Index do
) do
socket =
Invites.get_invite!(id, current_user)
|> Invites.update_invite(%{uses_left: nil, disabled_at: nil}, current_user)
|> Invites.update_invite(%{"uses_left" => nil, "disabled_at" => nil}, current_user)
|> case do
{:ok, %{name: invite_name}} ->
prompt =
@ -108,7 +107,7 @@ defmodule MemexWeb.InviteLive.Index do
socket =
Invites.get_invite!(id, current_user)
|> Invites.update_invite(%{uses_left: 0, disabled_at: now}, current_user)
|> Invites.update_invite(%{"uses_left" => 0, "disabled_at" => now}, current_user)
|> case do
{:ok, %{name: invite_name}} ->
prompt =
@ -124,8 +123,8 @@ defmodule MemexWeb.InviteLive.Index do
end
@impl true
def handle_event("copy_to_clipboard", _params, socket) do
prompt = dgettext("prompts", "copied to clipboard")
def handle_event("copy_to_clipboard", _, socket) do
prompt = dgettext("prompts", "Copied to clipboard")
{:noreply, socket |> put_flash(:info, prompt)}
end

View File

@ -18,7 +18,8 @@
<% end %>
<div class="w-full flex flex-row flex-wrap justify-center items-center">
<.invite_card :for={invite <- @invites} invite={invite} current_user={@current_user}>
<%= for invite <- @invites do %>
<.invite_card invite={invite}>
<:code_actions>
<form phx-submit="copy_to_clipboard">
<button
@ -53,17 +54,18 @@
<i class="fa-fw fa-lg fas fa-trash"></i>
</.link>
<a
href="#"
class="btn btn-primary"
phx-click={if invite.disabled_at, do: "enable_invite", else: "disable_invite"}
phx-value-id={invite.id}
>
<%= if invite.disabled_at, do: gettext("enable"), else: gettext("disable") %>
<%= if invite.disabled_at |> is_nil() do %>
<a href="#" class="btn btn-primary" phx-click="disable_invite" phx-value-id={invite.id}>
<%= gettext("disable") %>
</a>
<% else %>
<a href="#" class="btn btn-primary" phx-click="enable_invite" phx-value-id={invite.id}>
<%= gettext("enable") %>
</a>
<% end %>
<%= if invite.disabled_at |> is_nil() and not (invite.uses_left |> is_nil()) do %>
<a
:if={invite.disabled_at |> is_nil() and not (invite.uses_left |> is_nil())}
href="#"
class="btn btn-primary"
phx-click="set_unlimited"
@ -76,7 +78,9 @@
>
<%= gettext("set unlimited") %>
</a>
<% end %>
</.invite_card>
<% end %>
</div>
<%= unless @admins |> Enum.empty?() do %>
@ -87,7 +91,8 @@
</h1>
<div class="w-full flex flex-row flex-wrap justify-center items-center">
<.user_card :for={admin <- @admins} user={admin}>
<%= for admin <- @admins do %>
<.user_card user={admin}>
<.link
href="#"
class="text-primary-400 link"
@ -104,6 +109,7 @@
<i class="fa-fw fa-lg fas fa-trash"></i>
</.link>
</.user_card>
<% end %>
</div>
<% end %>
@ -115,7 +121,8 @@
</h1>
<div class="w-full flex flex-row flex-wrap justify-center items-center">
<.user_card :for={user <- @users} user={user}>
<%= for user <- @users do %>
<.user_card user={user}>
<.link
href="#"
class="text-primary-400 link"
@ -132,11 +139,13 @@
<i class="fa-fw fa-lg fas fa-trash"></i>
</.link>
</.user_card>
<% end %>
</div>
<% end %>
</div>
<.modal :if={@live_action in [:new, :edit]} return_to={Routes.invite_index_path(Endpoint, :index)}>
<%= if @live_action in [:new, :edit] do %>
<.modal return_to={Routes.invite_index_path(Endpoint, :index)}>
<.live_component
module={MemexWeb.InviteLive.FormComponent}
id={@invite.id || :new}
@ -147,3 +156,4 @@
current_user={@current_user}
/>
</.modal>
<% end %>

View File

@ -1,6 +1,6 @@
defmodule MemexWeb.LiveHelpers do
@moduledoc """
Contains common helper functions for liveviews
Contains resuable methods for all liveviews
"""
import Phoenix.Component
@ -31,7 +31,7 @@ defmodule MemexWeb.LiveHelpers do
patch={@return_to}
id="modal-bg"
class="fade-in fixed z-10 left-0 top-0
w-full h-full overflow-hidden
w-screen h-screen overflow-hidden
p-8 flex flex-col justify-center items-center cursor-auto"
style="background-color: rgba(0,0,0,0.4);"
phx-remove={hide_modal()}
@ -63,7 +63,7 @@ defmodule MemexWeb.LiveHelpers do
<i class="fa-fw fa-lg fas fa-times"></i>
</.link>
<div class="overflow-x-hidden overflow-y-auto w-full p-8 flex flex-col space-y-4 justify-start items-stretch">
<div class="overflow-x-hidden overflow-y-visible p-8 flex flex-col space-y-4 justify-start items-stretch">
<%= render_slot(@inner_block) %>
</div>
</div>
@ -71,57 +71,10 @@ defmodule MemexWeb.LiveHelpers do
"""
end
defp hide_modal(js \\ %JS{}) do
def hide_modal(js \\ %JS{}) do
js
|> JS.hide(to: "#modal", transition: "fade-out")
|> JS.hide(to: "#modal-bg", transition: "fade-out")
|> JS.hide(to: "#modal-content", transition: "fade-out-scale")
end
@doc """
A toggle button element that can be directed to a liveview or a
live_component's `handle_event/3`.
## Examples
<.toggle_button action="my_liveview_action" value={@some_value}>
<span>Toggle me!</span>
</.toggle_button>
<.toggle_button action="my_live_component_action" target={@myself} value={@some_value}>
<span>Whatever you want</span>
</.toggle_button>
"""
def toggle_button(assigns) do
assigns = assigns |> assign_new(:id, fn -> assigns.action end)
~H"""
<label for={@id} class="inline-flex relative items-center cursor-pointer">
<input
id={@id}
type="checkbox"
value={@value}
checked={@value}
class="sr-only peer"
data-qa={@id}
{
if assigns |> Map.has_key?(:target),
do: %{"phx-click": @action, "phx-value-value": @value, "phx-target": @target},
else: %{"phx-click": @action, "phx-value-value": @value}
}
/>
<div class="w-11 h-6 bg-gray-300 rounded-full peer
peer-focus:ring-4 peer-focus:ring-teal-300 dark:peer-focus:ring-teal-800
peer-checked:bg-gray-600
peer-checked:after:translate-x-full peer-checked:after:border-white
after:content-[''] after:absolute after:top-1 after:left-[2px] after:bg-white after:border-gray-300
after:border after:rounded-full after:h-5 after:w-5
after:transition-all after:duration-250 after:ease-in-out
transition-colors duration-250 ease-in-out">
</div>
<span class="ml-3 text-sm font-medium text-gray-900 dark:text-gray-300">
<%= render_slot(@inner_block) %>
</span>
</label>
"""
end
end

View File

@ -30,15 +30,16 @@
notes={@notes}
>
<:actions :let={note}>
<%= if is_owner?(note, @current_user) do %>
<.link
:if={is_owner?(note, @current_user)}
patch={Routes.note_index_path(@socket, :edit, note.slug)}
data-qa={"note-edit-#{note.id}"}
>
<%= dgettext("actions", "edit") %>
</.link>
<% end %>
<%= if is_owner_or_admin?(note, @current_user) do %>
<.link
:if={is_owner_or_admin?(note, @current_user)}
href="#"
phx-click="delete"
phx-value-id={note.id}
@ -47,20 +48,20 @@
>
<%= dgettext("actions", "delete") %>
</.link>
<% end %>
</:actions>
</.live_component>
<% end %>
<.link
:if={@current_user}
patch={Routes.note_index_path(@socket, :new)}
class="self-end btn btn-primary"
>
<%= if @current_user do %>
<.link patch={Routes.note_index_path(@socket, :new)} class="self-end btn btn-primary">
<%= dgettext("actions", "new note") %>
</.link>
<% end %>
</div>
<.modal :if={@live_action in [:new, :edit]} return_to={Routes.note_index_path(@socket, :index)}>
<%= if @live_action in [:new, :edit] do %>
<.modal return_to={Routes.note_index_path(@socket, :index)}>
<.live_component
module={MemexWeb.NoteLive.FormComponent}
id={@note.id || :new}
@ -71,3 +72,4 @@
return_to={Routes.note_index_path(@socket, :index)}
/>
</.modal>
<% end %>

View File

@ -11,7 +11,7 @@ defmodule MemexWeb.NoteLive.Show do
@impl true
def handle_params(
%{"slug" => slug},
_params,
_,
%{assigns: %{live_action: live_action, current_user: current_user}} = socket
) do
note =

View File

@ -4,13 +4,11 @@
</h1>
<div class="flex flex-wrap space-x-1">
<.link
:for={tag <- @note.tags}
navigate={Routes.note_index_path(Endpoint, :search, tag)}
class="link"
>
<%= for tag <- @note.tags do %>
<.link navigate={Routes.note_index_path(Endpoint, :search, tag)} class="link">
<%= tag %>
</.link>
<% end %>
</div>
<.note_content note={@note} />
@ -23,15 +21,13 @@
<.link class="btn btn-primary" navigate={Routes.note_index_path(@socket, :index)}>
<%= dgettext("actions", "back") %>
</.link>
<.link
:if={is_owner?(@note, @current_user)}
class="btn btn-primary"
patch={Routes.note_show_path(@socket, :edit, @note.slug)}
>
<%= if is_owner?(@note, @current_user) do %>
<.link class="btn btn-primary" patch={Routes.note_show_path(@socket, :edit, @note.slug)}>
<%= dgettext("actions", "edit") %>
</.link>
<% end %>
<%= if is_owner_or_admin?(@note, @current_user) do %>
<button
:if={is_owner_or_admin?(@note, @current_user)}
type="button"
class="btn btn-primary"
phx-click="delete"
@ -40,10 +36,12 @@
>
<%= dgettext("actions", "delete") %>
</button>
<% end %>
</div>
</div>
<.modal :if={@live_action == :edit} return_to={Routes.note_show_path(@socket, :show, @note.slug)}>
<%= if @live_action in [:edit] do %>
<.modal return_to={Routes.note_show_path(@socket, :show, @note.slug)}>
<.live_component
module={MemexWeb.NoteLive.FormComponent}
id={@note.id}
@ -54,3 +52,4 @@
return_to={Routes.note_show_path(@socket, :show, @note.slug)}
/>
</.modal>
<% end %>

View File

@ -30,15 +30,16 @@
pipelines={@pipelines}
>
<:actions :let={pipeline}>
<%= if is_owner?(pipeline, @current_user) do %>
<.link
:if={is_owner?(pipeline, @current_user)}
patch={Routes.pipeline_index_path(@socket, :edit, pipeline.slug)}
data-qa={"pipeline-edit-#{pipeline.id}"}
>
<%= dgettext("actions", "edit") %>
</.link>
<% end %>
<%= if is_owner_or_admin?(pipeline, @current_user) do %>
<.link
:if={is_owner_or_admin?(pipeline, @current_user)}
href="#"
phx-click="delete"
phx-value-id={pipeline.id}
@ -47,23 +48,20 @@
>
<%= dgettext("actions", "delete") %>
</.link>
<% end %>
</:actions>
</.live_component>
<% end %>
<.link
:if={@current_user}
patch={Routes.pipeline_index_path(@socket, :new)}
class="self-end btn btn-primary"
>
<%= if @current_user do %>
<.link patch={Routes.pipeline_index_path(@socket, :new)} class="self-end btn btn-primary">
<%= dgettext("actions", "new pipeline") %>
</.link>
<% end %>
</div>
<.modal
:if={@live_action in [:new, :edit]}
return_to={Routes.pipeline_index_path(@socket, :index)}
>
<%= if @live_action in [:new, :edit] do %>
<.modal return_to={Routes.pipeline_index_path(@socket, :index)}>
<.live_component
module={MemexWeb.PipelineLive.FormComponent}
id={@pipeline.id || :new}
@ -74,3 +72,4 @@
return_to={Routes.pipeline_index_path(@socket, :index)}
/>
</.modal>
<% end %>

View File

@ -4,17 +4,15 @@
</h1>
<div class="flex flex-wrap space-x-1">
<.link
:for={tag <- @pipeline.tags}
navigate={Routes.pipeline_index_path(Endpoint, :search, tag)}
class="link"
>
<%= for tag <- @pipeline.tags do %>
<.link navigate={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link">
<%= tag %>
</.link>
<% end %>
</div>
<%= if @pipeline.description do %>
<textarea
:if={@pipeline.description}
id="show-pipeline-description"
class="input input-primary h-32 min-h-32"
phx-hook="MaintainAttrs"
@ -22,6 +20,7 @@
readonly
phx-no-format
><%= @pipeline.description %></textarea>
<% end %>
<p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @pipeline.visibility) %>
@ -31,15 +30,16 @@
<.link class="btn btn-primary" navigate={Routes.pipeline_index_path(@socket, :index)}>
<%= dgettext("actions", "back") %>
</.link>
<%= if is_owner?(@pipeline, @current_user) do %>
<.link
:if={is_owner?(@pipeline, @current_user)}
class="btn btn-primary"
patch={Routes.pipeline_show_path(@socket, :edit, @pipeline.slug)}
>
<%= dgettext("actions", "edit") %>
</.link>
<% end %>
<%= if is_owner_or_admin?(@pipeline, @current_user) do %>
<button
:if={is_owner_or_admin?(@pipeline, @current_user)}
type="button"
class="btn btn-primary"
phx-click="delete"
@ -48,6 +48,7 @@
>
<%= dgettext("actions", "delete") %>
</button>
<% end %>
</div>
<hr class="hr" />
@ -125,14 +126,15 @@
<% end %>
<% end %>
<%= if is_owner?(@pipeline, @current_user) do %>
<.link
:if={is_owner?(@pipeline, @current_user)}
class="self-end btn btn-primary"
patch={Routes.pipeline_show_path(@socket, :add_step, @pipeline.slug)}
data-qa={"add-step-#{@pipeline.id}"}
>
<%= dgettext("actions", "add step") %>
</.link>
<% end %>
</div>
<%= case @live_action do %>
@ -148,7 +150,20 @@
return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}
/>
</.modal>
<% action when action in [:add_step, :edit_step] -> %>
<% :add_step -> %>
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}>
<.live_component
module={MemexWeb.StepLive.FormComponent}
id={@pipeline.id || :new}
current_user={@current_user}
title={@page_title}
action={@live_action}
pipeline={@pipeline}
step={@step}
return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}
/>
</.modal>
<% :edit_step -> %>
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}>
<.live_component
module={MemexWeb.StepLive.FormComponent}

View File

@ -11,17 +11,15 @@ defmodule MemexWeb.Router do
plug :protect_from_forgery
plug :put_secure_browser_headers
plug :fetch_current_user
plug :put_user_locale
plug :put_user_locale, default: Application.compile_env(:gettext, :default_locale, "en_US")
end
defp put_user_locale(%{assigns: %{current_user: %{locale: locale}}} = conn, _opts) do
default = Application.fetch_env!(:gettext, :default_locale)
defp put_user_locale(%{assigns: %{current_user: %{locale: locale}}} = conn, default: default) do
Gettext.put_locale(locale || default)
conn |> put_session(:locale, locale || default)
end
defp put_user_locale(conn, _opts) do
default = Application.fetch_env!(:gettext, :default_locale)
defp put_user_locale(conn, default: default) do
Gettext.put_locale(default)
conn |> put_session(:locale, default)
end
@ -78,7 +76,6 @@ defmodule MemexWeb.Router do
put "/users/settings", UserSettingsController, :update
delete "/users/settings/:id", UserSettingsController, :delete
get "/users/settings/confirm_email/:token", UserSettingsController, :confirm_email
get "/export/:mode", ExportController, :export
end
scope "/", MemexWeb do

View File

@ -57,30 +57,6 @@ defmodule MemexWeb.Telemetry do
"The time the connection spent waiting before being checked out for the query"
),
# Oban Metrics
counter("oban.job.exception",
tags: [:queue, :worker],
event_name: [:oban, :job, :exception],
measurement: :duration,
description: "Number of oban jobs that raised an exception"
),
counter("oban.job.start",
tags: [:queue, :worker],
event_name: [:oban, :job, :start],
measurement: :system_time,
description: "Number of oban jobs started"
),
summary("oban.job.stop.duration",
tags: [:queue, :worker],
unit: {:native, :millisecond},
description: "Length of time spent processing the oban job"
),
summary("oban.job.stop.queue_time",
tags: [:queue, :worker],
unit: {:native, :millisecond},
description: "Time the oban job spent waiting in milliseconds"
),
# VM Metrics
summary("vm.memory.total", unit: {:byte, :kilobyte}),
summary("vm.total_run_queue_lengths.total"),

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
<%= dgettext("errors", "Error") %> | <%= gettext("memEx") %>
<%= dgettext("errors", "Error") %> | memEx
</title>
<link rel="stylesheet" href="/css/app.css" />
<script defer type="text/javascript" src="/js/app.js">

View File

@ -3,12 +3,16 @@
<.topbar current_user={assigns[:current_user]}></.topbar>
<div class="mx-8 my-2 flex flex-col space-y-4 text-center">
<p :if={get_flash(@conn, :info)} class="alert alert-info" role="alert">
<%= if get_flash(@conn, :info) do %>
<p class="alert alert-info" role="alert">
<%= get_flash(@conn, :info) %>
</p>
<p :if={get_flash(@conn, :error)} class="alert alert-danger" role="alert">
<% end %>
<%= if get_flash(@conn, :error) do %>
<p class="alert alert-danger" role="alert">
<%= get_flash(@conn, :error) %>
</p>
<% end %>
</div>
</header>

View File

@ -1,20 +1,16 @@
<main class="pb-8 min-w-full">
<main class="mb-8 min-w-full">
<header>
<.topbar current_user={assigns[:current_user]}></.topbar>
<div class="mx-8 my-2 flex flex-col space-y-4 text-center">
<p
:if={@flash && @flash |> Map.has_key?("info")}
class="alert alert-info"
role="alert"
phx-click="lv:clear-flash"
phx-value-key="info"
>
<%= if @flash && @flash |> Map.has_key?("info") do %>
<p class="alert alert-info" role="alert" phx-click="lv:clear-flash" phx-value-key="info">
<%= live_flash(@flash, "info") %>
</p>
<% end %>
<%= if @flash && @flash |> Map.has_key?("error") do %>
<p
:if={@flash && @flash |> Map.has_key?("error")}
class="alert alert-danger"
role="alert"
phx-click="lv:clear-flash"
@ -22,6 +18,7 @@
>
<%= live_flash(@flash, "error") %>
</p>
<% end %>
</div>
</header>
@ -31,15 +28,27 @@
</main>
<div
id="disconnect"
class="z-50 fixed opacity-0 bottom-12 right-12 px-8 py-4 w-max h-max
border border-primary-400 shadow-lg rounded-lg bg-primary-800 text-primary-400
flex justify-center items-center space-x-4
transition-opacity ease-in-out duration-500 delay-[2000ms]"
id="loading"
class="fixed opacity-0 top-0 left-0 w-screen h-screen bg-primary-900 z-50
flex flex-col justify-center items-center space-y-4
transition-opacity ease-in-out duration-500"
>
<i class="fas fa-fade text-md fa-satellite-dish"></i>
<h1 class="title text-2xl title-primary-500 text-primary-400">
<%= gettext("Loading...") %>
</h1>
<h1 class="title text-md">
<i class="fas fa-3x fa-spin fa-gear text-primary-400"></i>
</div>
<div
id="disconnect"
class="fixed opacity-0 top-0 left-0 w-screen h-screen bg-primary-900 z-50
flex flex-col justify-center items-center space-y-4
transition-opacity ease-in-out duration-500"
>
<h1 class="title text-2xl title-primary-500 text-primary-400">
<%= gettext("Reconnecting...") %>
</h1>
<i class="fas fa-3x fa-fade fa-satellite-dish text-primary-400"></i>
</div>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" class="m-0 p-0 w-full h-full bg-primary-800">
<html lang="en" class="m-0 p-0 w-full h-full">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@ -18,7 +18,7 @@
</script>
</head>
<body class="m-0 p-0 w-full h-full text-primary-400 subpixel-antialiased">
<body class="m-0 p-0 w-full h-full bg-primary-800 text-primary-400 subpixel-antialiased">
<%= @inner_content %>
</body>
</html>

View File

@ -1,4 +1,4 @@
<div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-400 text-xl">
<%= dgettext("actions", "Resend confirmation instructions") %>
</h1>
@ -20,13 +20,11 @@
<hr class="hr" />
<div class="flex flex-row justify-center items-center space-x-4">
<.link
:if={Accounts.allow_registration?()}
href={Routes.user_registration_path(@conn, :new)}
class="btn btn-primary"
>
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "log in") %>
</.link>

View File

@ -1,4 +1,4 @@
<div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-400 text-xl">
<%= dgettext("actions", "register") %>
</h1>
@ -9,12 +9,16 @@
action={Routes.user_registration_path(@conn, :create)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
>
<p :if={@changeset.action && not @changeset.valid?()} class="alert alert-danger col-span-3">
<%= dgettext("errors", "oops, something went wrong! please check the errors below.") %>
<%= if @changeset.action && not @changeset.valid? do %>
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
</div>
<% end %>
<%= if @invite_token do %>
<%= hidden_input(f, :invite_token, value: @invite_token) %>
<%= if @invite do %>
<%= hidden_input(f, :invite_token, value: @invite.token) %>
<% end %>
<%= label(f, :email, class: "title text-lg text-primary-400") %>
@ -25,7 +29,7 @@
<%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
<%= error_tag(f, :password, "col-span-3") %>
<%= label(f, :locale, gettext("language"), class: "title text-lg text-primary-400") %>
<%= label(f, :locale, gettext("Language"), class: "title text-lg text-primary-400") %>
<%= select(
f,
:locale,

View File

@ -1,4 +1,4 @@
<div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-400 text-xl">
<%= dgettext("actions", "Reset password") %>
</h1>
@ -9,11 +9,13 @@
action={Routes.user_reset_password_path(@conn, :update, @token)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
>
<div :if={@changeset.action && not @changeset.valid?()} class="alert alert-danger col-span-3">
<%= if @changeset.action && not @changeset.valid? do %>
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
</div>
<% end %>
<%= label(f, :password, "new password", class: "title text-lg text-primary-400") %>
<%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
@ -36,13 +38,11 @@
<hr class="hr" />
<div class="flex flex-row justify-center items-center space-x-4">
<.link
:if={Accounts.allow_registration?()}
href={Routes.user_registration_path(@conn, :new)}
class="btn btn-primary"
>
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "log in") %>
</.link>

View File

@ -1,4 +1,4 @@
<div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-400 text-xl">
<%= dgettext("actions", "forgot your password?") %>
</h1>
@ -20,13 +20,11 @@
<hr class="hr" />
<div class="flex flex-row justify-center items-center space-x-4">
<.link
:if={Accounts.allow_registration?()}
href={Routes.user_registration_path(@conn, :new)}
class="btn btn-primary"
>
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "log in") %>
</.link>

View File

@ -1,4 +1,4 @@
<div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-400 text-xl">
<%= dgettext("actions", "log in") %>
</h1>
@ -10,11 +10,13 @@
as="user"
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
>
<div :if={@error_message} class="alert alert-danger col-span-3">
<%= if @error_message do %>
<div class="alert alert-danger col-span-3">
<p>
<%= @error_message %>
</p>
</div>
<% end %>
<%= label(f, :email, class: "title text-lg text-primary-400") %>
<%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
@ -33,13 +35,11 @@
<hr class="hr" />
<div class="flex flex-row justify-center items-center space-x-4">
<.link
:if={Accounts.allow_registration?()}
href={Routes.user_registration_path(@conn, :new)}
class="btn btn-primary"
>
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "forgot your password?") %>
</.link>

View File

@ -1,4 +1,4 @@
<div class="mx-auto pb-8 max-w-2xl flex flex-col justify-center items-center text-center space-y-4">
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center text-center space-y-4">
<h1 class="pb-4 title text-primary-400 text-xl">
<%= gettext("settings") %>
</h1>
@ -15,14 +15,13 @@
<%= dgettext("actions", "change email") %>
</h3>
<div
:if={@email_changeset.action && not @email_changeset.valid?()}
class="alert alert-danger col-span-3"
>
<%= if @email_changeset.action && not @email_changeset.valid? do %>
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "oops, something went wrong! Please check the errors below") %>
</p>
</div>
<% end %>
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
@ -59,14 +58,13 @@
<%= dgettext("actions", "change password") %>
</h3>
<div
:if={@password_changeset.action && not @password_changeset.valid?()}
class="alert alert-danger col-span-3"
>
<%= if @password_changeset.action && not @password_changeset.valid? do %>
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
</div>
<% end %>
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
@ -115,14 +113,13 @@
<%= dgettext("actions", "change language") %>
</h3>
<div
:if={@locale_changeset.action && not @locale_changeset.valid?()}
class="alert alert-danger"
>
<%= if @locale_changeset.action && not @locale_changeset.valid? do %>
<div class="alert alert-danger">
<p>
<%= dgettext("errors", "oops, something went wrong! Please check the errors below") %>
</p>
</div>
<% end %>
<%= hidden_input(f, :action, name: "action", value: "update_locale") %>
@ -139,22 +136,12 @@
<hr class="hr" />
<div class="flex justify-center items-center">
<.link
href={Routes.export_path(@conn, :export, :json)}
class="mx-4 my-2 btn btn-primary"
target="_blank"
>
<%= dgettext("actions", "export data as json") %>
</.link>
<.link
href={Routes.user_settings_path(@conn, :delete, @current_user)}
method={:delete}
class="mx-4 my-2 btn btn-alert"
class="btn btn-alert"
data-confirm={dgettext("prompts", "are you sure you want to delete your account?")}
>
<%= dgettext("actions", "delete user") %>
</.link>
</div>
</div>

View File

@ -2,6 +2,7 @@ defmodule MemexWeb.EmailView do
@moduledoc """
A view for email-related helper functions
"""
use MemexWeb, :view
alias MemexWeb.HomeLive
use MemexWeb, :view
end

View File

@ -17,13 +17,11 @@ defmodule MemexWeb.ErrorHelpers do
assigns = %{extra_class: extra_class, form: form, field: field}
~H"""
<span
:for={error <- Keyword.get_values(@form.errors, @field)}
class={["invalid-feedback", @extra_class]}
phx-feedback-for={input_name(@form, @field)}
>
<%= for error <- Keyword.get_values(@form.errors, @field) do %>
<span class={"invalid-feedback #{@extra_class}"} phx-feedback-for={input_name(@form, @field)}>
<%= translate_error(error) %>
</span>
<% end %>
"""
end

View File

@ -8,7 +8,7 @@ defmodule MemexWeb.ErrorView do
case error_path do
"404.html" -> dgettext("errors", "not found")
"401.html" -> dgettext("errors", "unauthorized")
_other_path -> dgettext("errors", "internal server error")
_ -> dgettext("errors", "internal server error")
end
render("error.html", %{error_string: error_string})

View File

@ -7,11 +7,6 @@ defmodule MemexWeb.LayoutView do
# so we instruct Elixir to not warn if the dashboard route is missing.
@compile {:no_warn_undefined, {Routes, :live_dashboard_path, 2}}
def get_title(%{assigns: %{title: title}}) do
gettext("memEx | %{title}", title: title)
end
def get_title(_conn) do
gettext("memEx")
end
def get_title(%{assigns: %{title: title}}), do: gettext("memEx | %{title}", title: title)
def get_title(_conn), do: gettext("memEx")
end

View File

@ -5,92 +5,56 @@ defmodule MemexWeb.ViewHelpers do
:view`
"""
use Phoenix.Component
import Phoenix.Component
@doc """
Phoenix.Component for a <time> element that renders the naivedatetime in the
user's local timezone with Alpine.js
Returns a <time> element that renders the naivedatetime in the user's local
timezone with Alpine.js
"""
@spec display_datetime(NaiveDateTime.t() | nil) :: Phoenix.LiveView.Rendered.t()
def display_datetime(nil), do: ""
attr :datetime, :any, required: true, doc: "A `DateTime` struct or nil"
def display_datetime(datetime) do
assigns = %{
datetime: datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended)
}
def datetime(assigns) do
~H"""
<time
:if={@datetime}
datetime={cast_datetime(@datetime)}
x-data={"{
datetime:
Intl.DateTimeFormat([], {dateStyle: 'short', timeStyle: 'long'})
.format(new Date(\"#{cast_datetime(@datetime)}\"))
}"}
x-text="datetime"
>
<%= cast_datetime(@datetime) %>
</time>
"""
end
@spec cast_datetime(NaiveDateTime.t() | nil) :: String.t()
defp cast_datetime(%NaiveDateTime{} = datetime) do
datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended)
end
defp cast_datetime(_datetime), do: ""
@doc """
Phoenix.Component for a <date> element that renders the Date in the user's
local timezone with Alpine.js
"""
attr :date, :any, required: true, doc: "A `Date` struct or nil"
def date(assigns) do
~H"""
<time
:if={@date}
datetime={@date |> Date.to_iso8601(:extended)}
datetime={@datetime}
x-data={"{
date:
Intl.DateTimeFormat([], {timeZone: 'Etc/UTC', dateStyle: 'short'})
.format(new Date(\"#{@date |> Date.to_iso8601(:extended)}\"))
Intl.DateTimeFormat([], {dateStyle: 'short', timeStyle: 'long'})
.format(new Date(\"#{@datetime}\"))
}"}
x-text="date"
>
<%= @date |> Date.to_iso8601(:extended) %>
<%= @datetime %>
</time>
"""
end
@doc """
Displays content in a QR code as a base64 encoded PNG
Returns a <date> element that renders the Date in the user's local
timezone with Alpine.js
"""
@spec qr_code_image(String.t()) :: String.t()
@spec qr_code_image(String.t(), width :: non_neg_integer()) :: String.t()
def qr_code_image(content, width \\ 384) do
img_data =
content
|> EQRCode.encode()
|> EQRCode.png(width: width, background_color: <<39, 39, 42>>, color: <<255, 255, 255>>)
|> Base.encode64()
@spec display_date(Date.t() | nil) :: Phoenix.LiveView.Rendered.t()
def display_date(nil), do: ""
"data:image/png;base64," <> img_data
end
def display_date(date) do
assigns = %{date: date |> Date.to_iso8601(:extended)}
@doc """
Creates a downloadable QR Code element
"""
attr :content, :string, required: true
attr :filename, :string, default: "qrcode", doc: "filename without .png extension"
attr :image_class, :string, default: "w-64 h-max"
attr :width, :integer, default: 384, doc: "width of png to generate"
def qr_code(assigns) do
~H"""
<a href={qr_code_image(@content)} download={@filename <> ".png"}>
<img class={@image_class} alt={@filename} src={qr_code_image(@content)} />
</a>
<time
datetime={@date}
x-data={"{
date:
Intl.DateTimeFormat([], {timeZone: 'Etc/UTC', dateStyle: 'short'}).format(new Date(\"#{@date}\"))
}"}
x-text="date"
>
<%= @date %>
</time>
"""
end
end

20
mix.exs
View File

@ -4,7 +4,7 @@ defmodule Memex.MixProject do
def project do
[
app: :memex,
version: "0.1.8",
version: "0.1.4",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),
@ -13,7 +13,7 @@ defmodule Memex.MixProject do
deps: deps(),
dialyzer: [plt_add_apps: [:ex_unit]],
consolidate_protocols: Mix.env() not in [:dev, :test],
preferred_cli_env: ["test.all": :test],
preferred_cli_env: [test: :test, "test.all": :test],
# ExDoc
name: "memEx",
source_url: "https://gitea.bubbletea.dev/shibao/memEx",
@ -34,7 +34,7 @@ defmodule Memex.MixProject do
def application do
[
mod: {Memex.Application, []},
extra_applications: [:logger, :runtime_tools, :os_mon, :crypto]
extra_applications: [:logger, :runtime_tools, :os_mon]
]
end
@ -48,29 +48,27 @@ defmodule Memex.MixProject do
defp deps do
[
{:bcrypt_elixir, "~> 2.0"},
{:phoenix, "~> 1.6.0"},
{:phoenix, "~> 1.6.6"},
{:phoenix_ecto, "~> 4.4"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.18.0"},
{:phoenix_view, "~> 1.1"},
{:phoenix_live_dashboard, "~> 0.6"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.18.3"},
{:floki, ">= 0.30.0", only: :test},
{:phoenix_live_dashboard, "~> 0.7.0"},
{:oban, "~> 2.10"},
# {:esbuild, "~> 0.3", runtime: Mix.env() == :dev},
{:ex_doc, "~> 0.27", only: :dev, runtime: false},
{:swoosh, "~> 1.6"},
{:gen_smtp, "~> 1.0"},
{:phoenix_swoosh, "~> 1.0"},
{:oban, "~> 2.10"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.18"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"},
{:ecto_psql_extras, "~> 0.6"},
{:eqrcode, "~> 0.1.10"},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}
]

View File

@ -1,53 +1,56 @@
%{
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.3.1", "5114d780459a04f2b4aeef52307de23de961b69e13a5cd98a911e39fda13f420", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "42182d5f46764def15bf9af83739e3bf4ad22661b1c34fc3e88558efced07279"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"castore": {:hex, :castore, "0.1.22", "4127549e411bedd012ca3a308dede574f43819fe9394254ca55ab4895abfa1a2", [:mix], [], "hexpm", "c17576df47eb5aa1ee40cc4134316a99f5cad3e215d5c77b8dd3cfef12a22cac"},
"castore": {:hex, :castore, "0.1.19", "a2c3e46d62b7f3aa2e6f88541c21d7400381e53704394462b9fd4f06f6d42bb6", [:mix], [], "hexpm", "e96e0161a5dc82ef441da24d5fa74aefc40d920f3a6645d15e1f9f3e66bb2109"},
"comeonin": {:hex, :comeonin, "5.3.3", "2c564dac95a35650e9b6acfe6d2952083d8a08e4a89b93a481acb552b325892e", [:mix], [], "hexpm", "3e38c9c2cb080828116597ca8807bb482618a315bfafd98c90bc22a821cc84df"},
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
"credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"},
"db_connection": {:hex, :db_connection, "2.4.3", "3b9aac9f27347ec65b271847e6baeb4443d8474289bd18c1d6f4de655b70c94d", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c127c15b0fa6cfb32eed07465e05da6c815b032508d4ed7c116122871df73c12"},
"db_connection": {:hex, :db_connection, "2.4.2", "f92e79aff2375299a16bcb069a14ee8615c3414863a6fef93156aee8e86c2ff3", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4fe53ca91b99f55ea249693a0229356a08f4d1a7931d8ffa79289b145fe83668"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},
"earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"},
"ecto": {:hex, :ecto, "3.9.4", "3ee68e25dbe0c36f980f1ba5dd41ee0d3eb0873bccae8aeaf1a2647242bffa35", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "de5f988c142a3aa4ec18b85a4ec34a2390b65b24f02385c1144252ff6ff8ee75"},
"ecto_psql_extras": {:hex, :ecto_psql_extras, "0.7.10", "e14d400930f401ca9f541b3349212634e44027d7f919bbb71224d7ac0d0e8acd", [:mix], [{:ecto_sql, "~> 3.4", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.15.7 or ~> 0.16.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:table_rex, "~> 3.1.1", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "505e8cd81e4f17c090be0f99e92b1b3f0fd915f98e76965130b8ccfb891e7088"},
"ecto_sql": {:hex, :ecto_sql, "3.9.2", "34227501abe92dba10d9c3495ab6770e75e79b836d114c41108a4bf2ce200ad5", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.9.2", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1eb5eeb4358fdbcd42eac11c1fbd87e3affd7904e639d77903c1358b2abd3f70"},
"elixir_make": {:hex, :elixir_make, "0.7.3", "c37fdae1b52d2cc51069713a58c2314877c1ad40800a57efb213f77b078a460d", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "24ada3e3996adbed1fa024ca14995ef2ba3d0d17b678b0f3f2b1f66e6ce2b274"},
"eqrcode": {:hex, :eqrcode, "0.1.10", "6294fece9d68ad64eef1c3c92cf111cfd6469f4fbf230a2d4cc905a682178f3f", [:mix], [], "hexpm", "da30e373c36a0fd37ab6f58664b16029919896d6c45a68a95cc4d713e81076f1"},
"ecto": {:hex, :ecto, "3.9.1", "67173b1687afeb68ce805ee7420b4261649d5e2deed8fe5550df23bab0bc4396", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c80bb3d736648df790f7f92f81b36c922d9dd3203ca65be4ff01d067f54eb304"},
"ecto_psql_extras": {:hex, :ecto_psql_extras, "0.7.4", "5d43fd088d39a158c860b17e8d210669587f63ec89ea122a4654861c8c6e2db4", [:mix], [{:ecto_sql, "~> 3.4", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:postgrex, ">= 0.15.7", [hex: :postgrex, repo: "hexpm", optional: false]}, {:table_rex, "~> 3.1.1", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "311db02f1b772e3d0dc7f56a05044b5e1499d78ed6abf38885e1ca70059449e5"},
"ecto_sql": {:hex, :ecto_sql, "3.9.0", "2bb21210a2a13317e098a420a8c1cc58b0c3421ab8e3acfa96417dab7817918c", [:mix], [{:db_connection, "~> 2.5 or ~> 2.4.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.9.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a8f3f720073b8b1ac4c978be25fa7960ed7fd44997420c304a4a2e200b596453"},
"elixir_make": {:hex, :elixir_make, "0.6.3", "bc07d53221216838d79e03a8019d0839786703129599e9619f4ab74c8c096eac", [:mix], [], "hexpm", "f5cbd651c5678bcaabdbb7857658ee106b12509cd976c2c2fca99688e1daf716"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.29.1", "b1c652fa5f92ee9cf15c75271168027f92039b3877094290a75abcaac82a9f77", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "b7745fa6374a36daf484e2a2012274950e084815b936b1319aeebcf7809574f6"},
"expo": {:hex, :expo, "0.3.0", "13127c1d5f653b2927f2616a4c9ace5ae372efd67c7c2693b87fd0fdc30c6feb", [:mix], [], "hexpm", "fb3cd4bf012a77bc1608915497dae2ff684a06f0fa633c7afa90c4d72b881823"},
"esbuild": {:hex, :esbuild, "0.4.0", "9f17db148aead4cf1e6e6a584214357287a93407b5fb51a031f122b61385d4c2", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "b61e4e6b92ffe45e4ee4755a22de6211a67c67987dc02afb35a425a0add1d447"},
"ex_doc": {:hex, :ex_doc, "0.29.0", "4a1cb903ce746aceef9c1f9ae8a6c12b742a5461e6959b9d3b24d813ffbea146", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "f096adb8bbca677d35d278223361c7792d496b3fc0d0224c9d4bc2f651af5db1"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"floki": {:hex, :floki, "0.34.0", "002d0cc194b48794d74711731db004fafeb328fe676976f160685262d43706a8", [:mix], [], "hexpm", "9c3a9f43f40dde00332a589bd9d389b90c1f518aef500364d00636acc5ebc99c"},
"gen_smtp": {:hex, :gen_smtp, "1.2.0", "9cfc75c72a8821588b9b9fe947ae5ab2aed95a052b81237e0928633a13276fd3", [:rebar3], [{:ranch, ">= 1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "5ee0375680bca8f20c4d85f58c2894441443a743355430ff33a783fe03296779"},
"gettext": {:hex, :gettext, "0.22.0", "a25d71ec21b1848957d9207b81fd61cb25161688d282d58bdafef74c2270bdc4", [:mix], [{:expo, "~> 0.3.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "cb0675141576f73720c8e49b4f0fd3f2c69f0cd8c218202724d4aebab8c70ace"},
"gettext": {:hex, :gettext, "0.20.0", "75ad71de05f2ef56991dbae224d35c68b098dd0e26918def5bb45591d5c8d429", [:mix], [], "hexpm", "1c03b177435e93a47441d7f681a7040bd2a816ece9e2666d1c9001035121eb3d"},
"heex_formatter": {:git, "https://github.com/feliperenan/heex_formatter.git", "efa8f8092afae62d19128bf2bd9f1c0fb86e0b92", []},
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
"hut": {:hex, :hut, "1.3.0", "71f2f054e657c03f959cf1acc43f436ea87580696528ca2a55c8afb1b06c85e7", [:"erlang.mk", :rebar, :rebar3], [], "hexpm", "7e15d28555d8a1f2b5a3a931ec120af0753e4853a4c66053db354f35bf9ab563"},
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"mime": {:hex, :mime, "2.0.3", "3676436d3d1f7b81b5a2d2bd8405f412c677558c81b1c92be58c00562bb59095", [:mix], [], "hexpm", "27a30bf0db44d25eecba73755acf4068cbfe26a4372f9eb3e4ea3a45956bff6b"},
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
"oban": {:hex, :oban, "2.13.6", "a0cb1bce3bd393770512231fb5a3695fa19fd3af10d7575bf73f837aee7abf43", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c1c5eb16f377b3cbbf2ea14be24d20e3d91285af9d1ac86260b7c2af5464887"},
"oban": {:hex, :oban, "2.13.5", "6ba77f96bf8d8c57dd95c31292c76dd50104ac110c0bee8345cdf5e42f8afe89", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e5d93843377c7aa6417a6e89dfa63cb3043a4d959b9e946cb1d0018cafc0219b"},
"phoenix": {:hex, :phoenix, "1.6.15", "0a1d96bbc10747fd83525370d691953cdb6f3ccbac61aa01b4acb012474b047d", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d70ab9fbf6b394755ea88b644d34d79d8b146e490973151f248cacd122d20672"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
"phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.7.1", "b0bf8f3348dec4910907a2ad1453e642f6fe4d444376c1c9b26222d63c73cf97", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.18.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "b6c5d744bf4b40692b1b361d3608bdfd05aeab83e17c7bc217d730f007f31abf"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.18.2", "635cf07de947235deb030cd6b776c71a3b790ab04cebf526aa8c879fe17c7784", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "da287a77327e996cc166e4c440c3ad5ab33ccdb151b91c793209b39ebbce5b75"},
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.7.2", "97cc4ff2dba1ebe504db72cb45098cb8e91f11160528b980bd282cc45c73b29c", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.18.3", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "0e5fdf063c7a3b620c566a30fcf68b7ee02e5e46fe48ee46a6ec3ba382dc05b7"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.0", "4fe222c0be55fdc3f9c711e24955fc42a7cd9b7a2f5f406f2580a567c335a573", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "bebf0fc2d2113b61cb5968f585367234b7b4c21d963d691de7b4b2dc6cdaae6f"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.18.3", "2e3d009422addf8b15c3dccc65ce53baccbe26f7cfd21d264680b5867789a9c1", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c8845177a866e017dcb7083365393c8f00ab061b8b6b2bda575891079dce81b2"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
"phoenix_swoosh": {:hex, :phoenix_swoosh, "1.1.0", "f8e4780705c9f254cc853f7a40e25f7198ba4d91102bcfad2226669b69766b35", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "aa82f10afd9a4b6080fdf3274dbb9432b25b210d42b4b6b55308f6e59cd87c3d"},
"phoenix_view": {:hex, :phoenix_view, "1.1.2", "1b82764a065fb41051637872c7bd07ed2fdb6f5c3bd89684d4dca6e10115c95a", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "7ae90ad27b09091266f6adbb61e1d2516a7c3d7062c6789d46a7554ec40f3a56"},
"phoenix_template": {:hex, :phoenix_template, "1.0.0", "c57bc5044f25f007dc86ab21895688c098a9f846a8dda6bc40e2d0ddc146e38f", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "1b066f99a26fd22064c12b2600a9a6e56700f591bf7b20b418054ea38b4d4357"},
"phoenix_view": {:hex, :phoenix_view, "2.0.2", "6bd4d2fd595ef80d33b439ede6a19326b78f0f1d8d62b9a318e3d9c1af351098", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "a929e7230ea5c7ee0e149ffcf44ce7cf7f4b6d2bfe1752dd7c084cdff152d36f"},
"plug": {:hex, :plug, "1.14.0", "ba4f558468f69cbd9f6b356d25443d0b796fbdc887e03fa89001384a9cac638f", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bf020432c7d4feb7b3af16a0c2701455cbbbb95e5b6866132cb09eb0c29adc14"},
"plug_cowboy": {:hex, :plug_cowboy, "2.6.0", "d1cf12ff96a1ca4f52207c5271a6c351a4733f413803488d75b70ccf44aebec2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "073cf20b753ce6682ed72905cd62a2d4bd9bad1bf9f7feb02a1b8e525bd94fa6"},
"plug_crypto": {:hex, :plug_crypto, "1.2.3", "8f77d13aeb32bfd9e654cb68f0af517b371fb34c56c9f2b58fe3df1235c1251a", [:mix], [], "hexpm", "b5672099c6ad5c202c45f5a403f21a3411247f164e4a8fab056e5cd8a290f4a2"},
"postgrex": {:hex, :postgrex, "0.16.5", "fcc4035cc90e23933c5d69a9cd686e329469446ef7abba2cf70f08e2c4b69810", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "edead639dc6e882618c01d8fc891214c481ab9a3788dfe38dd5e37fd1d5fb2e8"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"swoosh": {:hex, :swoosh, "1.9.1", "0a5d7bf9954eb41d7e55525bc0940379982b090abbaef67cd8e1fd2ed7f8ca1a", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "76dffff3ffcab80f249d5937a592eaef7cc49ac6f4cdd27e622868326ed6371e"},
"swoosh": {:hex, :swoosh, "1.8.2", "af9a22ab2c0d20b266f61acca737fa11a121902de9466a39e91bacdce012101c", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d058ba750eafadb6c09a84a352c14c5d1eeeda6e84945fcc95785b7f3067b7db"},
"table_rex": {:hex, :table_rex, "3.1.1", "0c67164d1714b5e806d5067c1e96ff098ba7ae79413cc075973e17c38a587caa", [:mix], [], "hexpm", "678a23aba4d670419c23c17790f9dcd635a4a89022040df7d5d772cb21012490"},
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
"telemetry": {:hex, :telemetry, "1.1.0", "a589817034a27eab11144ad24d5c0f9fab1f58173274b1e9bae7074af9cbee51", [:rebar3], [], "hexpm", "b727b2a1f75614774cff2d7565b64d0dfa5bd52ba517f16543e6fc7efcc0df48"},
"telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"},
"telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"},
}

View File

@ -10,7 +10,7 @@
msgid ""
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:29
#: lib/memex_web/live/invite_live/index.html.heex:30
#, elixir-autogen, elixir-format
msgid "Copy to clipboard"
msgstr ""
@ -22,30 +22,30 @@ msgid "Resend confirmation instructions"
msgstr ""
#: lib/memex_web/templates/user_reset_password/edit.html.heex:3
#: lib/memex_web/templates/user_reset_password/edit.html.heex:31
#: lib/memex_web/templates/user_reset_password/edit.html.heex:33
#, elixir-autogen, elixir-format
msgid "Reset password"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:29
#: lib/memex_web/live/invite_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Save"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:15
#: lib/memex_web/templates/user_settings/edit.html.heex:45
#: lib/memex_web/templates/user_settings/edit.html.heex:44
#, elixir-autogen, elixir-format
msgid "change email"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:115
#: lib/memex_web/templates/user_settings/edit.html.heex:134
#: lib/memex_web/templates/user_settings/edit.html.heex:113
#: lib/memex_web/templates/user_settings/edit.html.heex:131
#, elixir-autogen, elixir-format
msgid "change language"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:59
#: lib/memex_web/templates/user_settings/edit.html.heex:101
#: lib/memex_web/templates/user_settings/edit.html.heex:58
#: lib/memex_web/templates/user_settings/edit.html.heex:99
#, elixir-autogen, elixir-format
msgid "change password"
msgstr ""
@ -55,29 +55,29 @@ msgstr ""
msgid "create invite"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:48
#: lib/memex_web/live/context_live/show.html.heex:41
#: lib/memex_web/live/note_live/index.html.heex:48
#: lib/memex_web/live/note_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/index.html.heex:48
#: lib/memex_web/live/context_live/index.html.heex:49
#: lib/memex_web/live/context_live/show.html.heex:40
#: lib/memex_web/live/note_live/index.html.heex:49
#: lib/memex_web/live/note_live/show.html.heex:37
#: lib/memex_web/live/pipeline_live/index.html.heex:49
#: lib/memex_web/live/pipeline_live/show.html.heex:49
#: lib/memex_web/live/pipeline_live/show.html.heex:118
#: lib/memex_web/live/pipeline_live/show.html.heex:119
#, elixir-autogen, elixir-format
msgid "delete"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:157
#: lib/memex_web/templates/user_settings/edit.html.heex:145
#, elixir-autogen, elixir-format
msgid "delete user"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:38
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/context_live/show.html.heex:29
#: lib/memex_web/live/note_live/index.html.heex:38
#: lib/memex_web/live/note_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:26
#: lib/memex_web/live/pipeline_live/index.html.heex:38
#: lib/memex_web/live/pipeline_live/show.html.heex:39
#: lib/memex_web/live/pipeline_live/show.html.heex:107
#: lib/memex_web/live/pipeline_live/show.html.heex:38
#: lib/memex_web/live/pipeline_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "edit"
msgstr ""
@ -87,39 +87,39 @@ msgstr ""
msgid "invite someone new!"
msgstr ""
#: lib/memex_web/components/topbar.ex:124
#: lib/memex_web/templates/user_confirmation/new.html.heex:31
#: lib/memex_web/templates/user_registration/new.html.heex:44
#: lib/memex_web/components/topbar.ex:125
#: lib/memex_web/templates/user_confirmation/new.html.heex:29
#: lib/memex_web/templates/user_registration/new.html.heex:48
#: lib/memex_web/templates/user_reset_password/edit.html.heex:47
#: lib/memex_web/templates/user_reset_password/new.html.heex:31
#: lib/memex_web/templates/user_reset_password/new.html.heex:29
#: lib/memex_web/templates/user_session/new.html.heex:3
#: lib/memex_web/templates/user_session/new.html.heex:30
#: lib/memex_web/templates/user_session/new.html.heex:32
#, elixir-autogen, elixir-format
msgid "log in"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:59
#: lib/memex_web/live/context_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "new context"
msgstr ""
#: lib/memex_web/live/note_live/index.html.heex:59
#: lib/memex_web/live/note_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "new note"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.html.heex:59
#: lib/memex_web/live/pipeline_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "new pipeline"
msgstr ""
#: lib/memex_web/components/topbar.ex:115
#: lib/memex_web/templates/user_confirmation/new.html.heex:28
#: lib/memex_web/templates/user_confirmation/new.html.heex:25
#: lib/memex_web/templates/user_registration/new.html.heex:3
#: lib/memex_web/templates/user_registration/new.html.heex:37
#: lib/memex_web/templates/user_reset_password/edit.html.heex:44
#: lib/memex_web/templates/user_reset_password/new.html.heex:28
#: lib/memex_web/templates/user_session/new.html.heex:41
#: lib/memex_web/templates/user_registration/new.html.heex:41
#: lib/memex_web/templates/user_reset_password/edit.html.heex:43
#: lib/memex_web/templates/user_reset_password/new.html.heex:25
#: lib/memex_web/templates/user_session/new.html.heex:40
#, elixir-autogen, elixir-format
msgid "register"
msgstr ""
@ -132,19 +132,19 @@ msgstr ""
msgid "save"
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:32
#: lib/memex_web/live/context_live/show.html.heex:22
#: lib/memex_web/live/note_live/show.html.heex:22
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#, elixir-autogen, elixir-format
msgid "back"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:134
#: lib/memex_web/live/pipeline_live/show.html.heex:135
#, elixir-autogen, elixir-format
msgid "add step"
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:47
#: lib/memex_web/templates/user_registration/new.html.heex:51
#: lib/memex_web/templates/user_reset_password/new.html.heex:3
#: lib/memex_web/templates/user_session/new.html.heex:44
#, elixir-autogen, elixir-format
@ -155,8 +155,3 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "send instructions to reset password"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:148
#, elixir-autogen, elixir-format
msgid "export data as json"
msgstr ""

View File

@ -9,8 +9,9 @@
msgid ""
msgstr ""
"Language: de\n"
"Plural-Forms: nplurals=2\n"
#: lib/memex_web/live/invite_live/index.html.heex:29
#: lib/memex_web/live/invite_live/index.html.heex:30
#, elixir-autogen, elixir-format
msgid "Copy to clipboard"
msgstr ""
@ -22,30 +23,30 @@ msgid "Resend confirmation instructions"
msgstr ""
#: lib/memex_web/templates/user_reset_password/edit.html.heex:3
#: lib/memex_web/templates/user_reset_password/edit.html.heex:31
#: lib/memex_web/templates/user_reset_password/edit.html.heex:33
#, elixir-autogen, elixir-format
msgid "Reset password"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:29
#: lib/memex_web/live/invite_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Save"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:15
#: lib/memex_web/templates/user_settings/edit.html.heex:45
#: lib/memex_web/templates/user_settings/edit.html.heex:44
#, elixir-autogen, elixir-format
msgid "change email"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:115
#: lib/memex_web/templates/user_settings/edit.html.heex:134
#: lib/memex_web/templates/user_settings/edit.html.heex:113
#: lib/memex_web/templates/user_settings/edit.html.heex:131
#, elixir-autogen, elixir-format
msgid "change language"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:59
#: lib/memex_web/templates/user_settings/edit.html.heex:101
#: lib/memex_web/templates/user_settings/edit.html.heex:58
#: lib/memex_web/templates/user_settings/edit.html.heex:99
#, elixir-autogen, elixir-format
msgid "change password"
msgstr ""
@ -55,29 +56,29 @@ msgstr ""
msgid "create invite"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:48
#: lib/memex_web/live/context_live/show.html.heex:41
#: lib/memex_web/live/note_live/index.html.heex:48
#: lib/memex_web/live/note_live/show.html.heex:41
#: lib/memex_web/live/pipeline_live/index.html.heex:48
#: lib/memex_web/live/context_live/index.html.heex:49
#: lib/memex_web/live/context_live/show.html.heex:40
#: lib/memex_web/live/note_live/index.html.heex:49
#: lib/memex_web/live/note_live/show.html.heex:37
#: lib/memex_web/live/pipeline_live/index.html.heex:49
#: lib/memex_web/live/pipeline_live/show.html.heex:49
#: lib/memex_web/live/pipeline_live/show.html.heex:118
#: lib/memex_web/live/pipeline_live/show.html.heex:119
#, elixir-autogen, elixir-format
msgid "delete"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:157
#: lib/memex_web/templates/user_settings/edit.html.heex:145
#, elixir-autogen, elixir-format
msgid "delete user"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:38
#: lib/memex_web/live/context_live/show.html.heex:31
#: lib/memex_web/live/context_live/show.html.heex:29
#: lib/memex_web/live/note_live/index.html.heex:38
#: lib/memex_web/live/note_live/show.html.heex:31
#: lib/memex_web/live/note_live/show.html.heex:26
#: lib/memex_web/live/pipeline_live/index.html.heex:38
#: lib/memex_web/live/pipeline_live/show.html.heex:39
#: lib/memex_web/live/pipeline_live/show.html.heex:107
#: lib/memex_web/live/pipeline_live/show.html.heex:38
#: lib/memex_web/live/pipeline_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "edit"
msgstr ""
@ -87,39 +88,39 @@ msgstr ""
msgid "invite someone new!"
msgstr ""
#: lib/memex_web/components/topbar.ex:124
#: lib/memex_web/templates/user_confirmation/new.html.heex:31
#: lib/memex_web/templates/user_registration/new.html.heex:44
#: lib/memex_web/components/topbar.ex:125
#: lib/memex_web/templates/user_confirmation/new.html.heex:29
#: lib/memex_web/templates/user_registration/new.html.heex:48
#: lib/memex_web/templates/user_reset_password/edit.html.heex:47
#: lib/memex_web/templates/user_reset_password/new.html.heex:31
#: lib/memex_web/templates/user_reset_password/new.html.heex:29
#: lib/memex_web/templates/user_session/new.html.heex:3
#: lib/memex_web/templates/user_session/new.html.heex:30
#: lib/memex_web/templates/user_session/new.html.heex:32
#, elixir-autogen, elixir-format
msgid "log in"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:59
#: lib/memex_web/live/context_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "new context"
msgstr ""
#: lib/memex_web/live/note_live/index.html.heex:59
#: lib/memex_web/live/note_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "new note"
msgstr ""
#: lib/memex_web/live/pipeline_live/index.html.heex:59
#: lib/memex_web/live/pipeline_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "new pipeline"
msgstr ""
#: lib/memex_web/components/topbar.ex:115
#: lib/memex_web/templates/user_confirmation/new.html.heex:28
#: lib/memex_web/templates/user_confirmation/new.html.heex:25
#: lib/memex_web/templates/user_registration/new.html.heex:3
#: lib/memex_web/templates/user_registration/new.html.heex:37
#: lib/memex_web/templates/user_reset_password/edit.html.heex:44
#: lib/memex_web/templates/user_reset_password/new.html.heex:28
#: lib/memex_web/templates/user_session/new.html.heex:41
#: lib/memex_web/templates/user_registration/new.html.heex:41
#: lib/memex_web/templates/user_reset_password/edit.html.heex:43
#: lib/memex_web/templates/user_reset_password/new.html.heex:25
#: lib/memex_web/templates/user_session/new.html.heex:40
#, elixir-autogen, elixir-format
msgid "register"
msgstr ""
@ -132,19 +133,19 @@ msgstr ""
msgid "save"
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:32
#: lib/memex_web/live/context_live/show.html.heex:22
#: lib/memex_web/live/note_live/show.html.heex:22
#: lib/memex_web/live/pipeline_live/show.html.heex:31
#, elixir-autogen, elixir-format
msgid "back"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:134
#: lib/memex_web/live/pipeline_live/show.html.heex:135
#, elixir-autogen, elixir-format
msgid "add step"
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:47
#: lib/memex_web/templates/user_registration/new.html.heex:51
#: lib/memex_web/templates/user_reset_password/new.html.heex:3
#: lib/memex_web/templates/user_session/new.html.heex:44
#, elixir-autogen, elixir-format, fuzzy
@ -155,8 +156,3 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "send instructions to reset password"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:148
#, elixir-autogen, elixir-format
msgid "export data as json"
msgstr ""

View File

@ -21,7 +21,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/memex_web/live/invite_live/index.html.heex:86
#: lib/memex_web/live/invite_live/index.html.heex:90
#, elixir-autogen, elixir-format
msgid "Admins"
msgstr ""
@ -31,17 +31,27 @@ msgstr ""
msgid "Confirm your account"
msgstr ""
#: lib/memex_web/templates/user_session/new.html.heex:25
#: lib/memex_web/templates/user_session/new.html.heex:27
#, elixir-autogen, elixir-format
msgid "Keep me logged in for 60 days"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:21
#: lib/memex_web/templates/user_registration/new.html.heex:32
#, elixir-autogen, elixir-format
msgid "Language"
msgstr ""
#: lib/memex_web/templates/layout/live.html.heex:37
#, elixir-autogen, elixir-format
msgid "Loading..."
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:20
#, elixir-autogen, elixir-format
msgid "Name"
msgstr ""
#: lib/memex_web/templates/layout/live.html.heex:43
#: lib/memex_web/templates/layout/live.html.heex:50
#, elixir-autogen, elixir-format
msgid "Reconnecting..."
msgstr ""
@ -51,14 +61,24 @@ msgstr ""
msgid "Reset your password"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:25
#: lib/memex_web/controllers/user_settings_controller.ex:10
#, elixir-autogen, elixir-format
msgid "Settings"
msgstr ""
#: lib/memex_web/components/invite_card.ex:19
#, elixir-autogen, elixir-format
msgid "Uses Left:"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:24
#, elixir-autogen, elixir-format
msgid "Uses left"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:19
#: lib/memex_web/live/note_live/show.html.heex:19
#: lib/memex_web/live/pipeline_live/show.html.heex:27
#: lib/memex_web/live/context_live/show.html.heex:17
#: lib/memex_web/live/note_live/show.html.heex:17
#: lib/memex_web/live/pipeline_live/show.html.heex:26
#, elixir-autogen, elixir-format
msgid "Visibility: %{visibility}"
msgstr ""
@ -78,7 +98,7 @@ msgstr ""
msgid "built with sharing and collaboration in mind"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:80
#: lib/memex_web/templates/user_settings/edit.html.heex:78
#, elixir-autogen, elixir-format
msgid "confirm new password"
msgstr ""
@ -106,13 +126,13 @@ msgstr ""
msgid "convenient:"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:33
#: lib/memex_web/templates/user_settings/edit.html.heex:89
#: lib/memex_web/templates/user_settings/edit.html.heex:32
#: lib/memex_web/templates/user_settings/edit.html.heex:87
#, elixir-autogen, elixir-format
msgid "current password"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:62
#: lib/memex_web/live/invite_live/index.html.heex:59
#, elixir-autogen, elixir-format
msgid "disable"
msgstr ""
@ -127,28 +147,28 @@ msgstr ""
msgid "document your processes, attaching contexts to each step"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:34
#: lib/memex_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "edit invite"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:29
#: lib/memex_web/templates/user_settings/edit.html.heex:28
#, elixir-autogen, elixir-format
msgid "email"
msgstr ""
#: lib/memex_web/components/user_card.ex:29
#: lib/memex_web/components/user_card.ex:23
#, elixir-autogen, elixir-format
msgid "email unconfirmed"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:62
#: lib/memex_web/live/invite_live/index.html.heex:63
#, elixir-autogen, elixir-format
msgid "enable"
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:32
#: lib/memex_web/templates/user_settings/edit.html.heex:129
#: lib/memex_web/templates/user_registration/new.html.heex:36
#: lib/memex_web/templates/user_settings/edit.html.heex:126
#, elixir-autogen, elixir-format
msgid "english"
msgstr ""
@ -158,12 +178,12 @@ msgstr ""
msgid "features"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:135
#: lib/memex_web/live/home_live.html.heex:138
#, elixir-autogen, elixir-format
msgid "get involved!"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:156
#: lib/memex_web/live/home_live.html.heex:159
#, elixir-autogen, elixir-format
msgid "help translate"
msgstr ""
@ -173,18 +193,18 @@ msgstr ""
msgid "instance information"
msgstr ""
#: lib/memex_web/components/invite_card.ex:42
#: lib/memex_web/components/invite_card.ex:24
#, elixir-autogen, elixir-format
msgid "invite disabled"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:112
#: lib/memex_web/live/home_live.html.heex:115
#, elixir-autogen, elixir-format
msgid "invite only"
msgstr ""
#: lib/memex_web/components/topbar.ex:73
#: lib/memex_web/live/invite_live/index.ex:42
#: lib/memex_web/components/topbar.ex:74
#: lib/memex_web/live/invite_live/index.ex:41
#: lib/memex_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "invites"
@ -200,12 +220,12 @@ msgstr ""
msgid "multi-user:"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:38
#: lib/memex_web/live/invite_live/index.ex:37
#, elixir-autogen, elixir-format
msgid "new invite"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:73
#: lib/memex_web/templates/user_settings/edit.html.heex:71
#, elixir-autogen, elixir-format
msgid "new password"
msgstr ""
@ -261,22 +281,22 @@ msgstr ""
msgid "provide context around a single topic and hotlink to your notes"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:111
#: lib/memex_web/live/home_live.html.heex:114
#, elixir-autogen, elixir-format
msgid "public signups"
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:32
#: lib/memex_web/controllers/user_registration_controller.ex:34
#, elixir-autogen, elixir-format
msgid "register"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:108
#: lib/memex_web/live/home_live.html.heex:110
#, elixir-autogen, elixir-format
msgid "registration:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:167
#: lib/memex_web/live/home_live.html.heex:170
#, elixir-autogen, elixir-format
msgid "report bugs or request features"
msgstr ""
@ -296,12 +316,11 @@ msgstr ""
msgid "select privacy"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:77
#: lib/memex_web/live/invite_live/index.html.heex:79
#, elixir-autogen, elixir-format
msgid "set unlimited"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:10
#: lib/memex_web/templates/user_settings/edit.html.heex:3
#, elixir-autogen, elixir-format
msgid "settings"
@ -321,17 +340,22 @@ msgstr ""
msgid "tags"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:114
#: lib/memex_web/components/invite_card.ex:20
#, elixir-autogen, elixir-format
msgid "unlimited"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:120
#, elixir-autogen, elixir-format
msgid "users"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:118
#: lib/memex_web/live/home_live.html.heex:121
#, elixir-autogen, elixir-format
msgid "version:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:145
#: lib/memex_web/live/home_live.html.heex:148
#, elixir-autogen, elixir-format
msgid "view the source code"
msgstr ""
@ -450,20 +474,24 @@ msgstr ""
#: lib/memex_web/components/topbar.ex:23
#: lib/memex_web/live/home_live.html.heex:3
#: lib/memex_web/templates/error/error.html.heex:8
#: lib/memex_web/templates/layout/root.html.heex:8
#: lib/memex_web/templates/layout/root.html.heex:9
#: lib/memex_web/views/layout_view.ex:15
#: lib/memex_web/views/layout_view.ex:11
#, elixir-autogen, elixir-format
msgid "memEx"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:41
#, elixir-autogen, elixir-format
msgid "read more on how to use %{name}"
msgstr ""
#: lib/memex_web/live/faq_live.html.heex:11
#, elixir-autogen, elixir-format
msgid "what is this?"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:67
#: lib/memex_web/live/pipeline_live/show.html.heex:68
#, elixir-autogen, elixir-format
msgid "%{position}. %{title}"
msgstr ""
@ -488,12 +516,12 @@ msgstr ""
msgid "add step to %{slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:61
#: lib/memex_web/live/pipeline_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "no steps"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:56
#: lib/memex_web/live/pipeline_live/show.html.heex:57
#, elixir-autogen, elixir-format
msgid "steps:"
msgstr ""
@ -598,7 +626,7 @@ msgstr ""
msgid "zettelkasten"
msgstr ""
#: lib/memex_web/views/layout_view.ex:11
#: lib/memex_web/views/layout_view.ex:10
#, elixir-autogen, elixir-format
msgid "memEx | %{title}"
msgstr ""
@ -628,37 +656,12 @@ msgstr ""
msgid "while memEx fully supports multiple users, each memEx instance should be treated as a single cohesive and collaborative document."
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:28
#, elixir-autogen, elixir-format, fuzzy
msgid "language"
msgstr ""
#: lib/memex_web/components/user_card.ex:23
#, elixir-autogen, elixir-format, fuzzy
msgid "user confirmed on%{confirmed_datetime}"
msgstr ""
#: lib/memex_web/components/user_card.ex:34
#, elixir-autogen, elixir-format, fuzzy
msgid "user registered on%{registered_datetime}"
msgstr ""
#: lib/memex_web/components/invite_card.ex:37
#: lib/memex_web/components/user_card.ex:26
#, elixir-autogen, elixir-format
msgid "uses left: unlimited"
msgid "user confirmed on"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:41
#: lib/memex_web/components/user_card.ex:33
#, elixir-autogen, elixir-format, fuzzy
msgid "read more on how to use memEx"
msgstr ""
#: lib/memex_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format, fuzzy
msgid "uses left: %{uses_left_count}"
msgstr ""
#: lib/memex_web/components/invite_card.ex:52
#, elixir-autogen, elixir-format
msgid "uses: %{uses_count}"
msgid "user registered on"
msgstr ""

View File

@ -9,6 +9,7 @@
msgid ""
msgstr ""
"Language: de\n"
"Plural-Forms: nplurals=2\n"
#: lib/memex/accounts/email.ex:30
#, elixir-autogen, elixir-format

View File

@ -9,6 +9,12 @@
msgid ""
msgstr ""
"Language: de\n"
"Plural-Forms: nplurals=2\n"
#: lib/memex_web/controllers/user_settings_controller.ex:84
#, elixir-autogen, elixir-format
msgid "Email change link is invalid or it has expired."
msgstr ""
#: lib/memex_web/templates/error/error.html.heex:8
#, elixir-autogen, elixir-format
@ -20,8 +26,9 @@ msgstr ""
msgid "Invalid email or password"
msgstr ""
#: lib/memex_web/templates/user_reset_password/edit.html.heex:14
#: lib/memex_web/templates/user_settings/edit.html.heex:67
#: lib/memex_web/templates/user_registration/new.html.heex:15
#: lib/memex_web/templates/user_reset_password/edit.html.heex:15
#: lib/memex_web/templates/user_settings/edit.html.heex:64
#, elixir-autogen, elixir-format
msgid "Oops, something went wrong! Please check the errors below."
msgstr ""
@ -31,23 +38,33 @@ msgstr ""
msgid "Reset password link is invalid or it has expired."
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:22
#: lib/memex_web/controllers/user_registration_controller.ex:51
#: lib/memex_web/controllers/user_registration_controller.ex:24
#: lib/memex_web/controllers/user_registration_controller.ex:55
#, elixir-autogen, elixir-format
msgid "Sorry, public registration is disabled"
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:12
#: lib/memex_web/controllers/user_registration_controller.ex:41
#: lib/memex_web/controllers/user_registration_controller.ex:14
#: lib/memex_web/controllers/user_registration_controller.ex:45
#, elixir-autogen, elixir-format
msgid "Sorry, this invite was not found or expired"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:99
#, elixir-autogen, elixir-format
msgid "Unable to delete user"
msgstr ""
#: lib/memex_web/controllers/user_confirmation_controller.ex:54
#, elixir-autogen, elixir-format
msgid "User confirmation link is invalid or it has expired."
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:18
#, elixir-autogen, elixir-format
msgid "You are not authorized to view this page"
msgstr ""
#: lib/memex_web/controllers/user_auth.ex:177
#, elixir-autogen, elixir-format
msgid "You are not authorized to view this page."
@ -59,38 +76,38 @@ msgstr ""
msgid "You must confirm your account and log in to access this page."
msgstr ""
#: lib/memex/accounts/user.ex:144
#: lib/memex/accounts/user.ex:129
#, elixir-autogen, elixir-format
msgid "did not change"
msgstr ""
#: lib/memex/accounts/user.ex:165
#: lib/memex/accounts/user.ex:150
#, elixir-autogen, elixir-format
msgid "does not match password"
msgstr ""
#: lib/memex/accounts/user.ex:202
#: lib/memex/accounts/user.ex:187
#, elixir-autogen, elixir-format
msgid "is not valid"
msgstr ""
#: lib/memex/accounts/user.ex:99
#: lib/memex/accounts/user.ex:85
#, elixir-autogen, elixir-format
msgid "must have the @ sign and no spaces"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:23
#: lib/memex_web/templates/user_settings/edit.html.heex:123
#: lib/memex_web/templates/user_settings/edit.html.heex:21
#: lib/memex_web/templates/user_settings/edit.html.heex:119
#, elixir-autogen, elixir-format
msgid "oops, something went wrong! Please check the errors below"
msgstr ""
#: lib/memex/contexts/context.ex:58
#: lib/memex/contexts/context.ex:71
#: lib/memex/notes/note.ex:57
#: lib/memex/notes/note.ex:70
#: lib/memex/pipelines/pipeline.ex:60
#: lib/memex/pipelines/pipeline.ex:73
#: lib/memex/contexts/context.ex:49
#: lib/memex/contexts/context.ex:62
#: lib/memex/notes/note.ex:48
#: lib/memex/notes/note.ex:61
#: lib/memex/pipelines/pipeline.ex:50
#: lib/memex/pipelines/pipeline.ex:63
#, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted"
msgstr ""
@ -115,34 +132,9 @@ msgstr ""
msgid "unauthorized"
msgstr ""
#: lib/memex/contexts/context.ex:84
#: lib/memex/notes/note.ex:83
#: lib/memex/pipelines/pipeline.ex:86
#: lib/memex/contexts/context.ex:75
#: lib/memex/notes/note.ex:74
#: lib/memex/pipelines/pipeline.ex:76
#, elixir-autogen, elixir-format, fuzzy
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma-delimited"
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:13
#, elixir-autogen, elixir-format, fuzzy
msgid "oops, something went wrong! please check the errors below."
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:70
#, elixir-autogen, elixir-format, fuzzy
msgid "sorry, this invite was not found or expired"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:19
#, elixir-autogen, elixir-format, fuzzy
msgid "you are not authorized to view this page"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:84
#, elixir-autogen, elixir-format, fuzzy
msgid "email change link is invalid or it has expired."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:99
#, elixir-autogen, elixir-format, fuzzy
msgid "unable to delete user"
msgstr ""

View File

@ -9,37 +9,63 @@
msgid ""
msgstr ""
"Language: de\n"
"Plural-Forms: nplurals=2\n"
#: lib/memex_web/controllers/user_confirmation_controller.ex:38
#, elixir-autogen, elixir-format
msgid "%{email} confirmed successfully."
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:54
#: lib/memex_web/live/invite_live/form_component.ex:62
#, elixir-autogen, elixir-format
msgid "%{invite_name} created successfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:53
#, elixir-autogen, elixir-format
msgid "%{invite_name} deleted succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:115
#: lib/memex_web/live/invite_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "%{invite_name} disabled succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:91
#: lib/memex_web/live/invite_live/index.ex:90
#, elixir-autogen, elixir-format
msgid "%{invite_name} enabled succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:69
#: lib/memex_web/live/invite_live/index.ex:68
#, elixir-autogen, elixir-format
msgid "%{invite_name} updated succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:140
#: lib/memex_web/live/invite_live/form_component.ex:42
#, elixir-autogen, elixir-format
msgid "%{invite_name} updated successfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:139
#, elixir-autogen, elixir-format
msgid "%{user_email} deleted succesfully"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:29
#, elixir-autogen, elixir-format
msgid "A link to confirm your email change has been sent to the new address."
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:127
#, elixir-autogen, elixir-format
msgid "Copied to clipboard"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:77
#, elixir-autogen, elixir-format
msgid "Email changed successfully."
msgstr ""
#: lib/memex_web/controllers/user_confirmation_controller.ex:23
#, elixir-autogen, elixir-format
msgid "If your email is in our system and it has not been confirmed yet, you will receive an email with instructions shortly."
@ -50,109 +76,84 @@ msgstr ""
msgid "If your email is in our system, you will receive instructions to reset your password shortly."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:65
#, elixir-autogen, elixir-format
msgid "Language updated successfully."
msgstr ""
#: lib/memex_web/controllers/user_reset_password_controller.ex:46
#, elixir-autogen, elixir-format
msgid "Password reset successfully."
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:31
#: lib/memex_web/controllers/user_settings_controller.ex:49
#, elixir-autogen, elixir-format
msgid "Password updated successfully."
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:73
#, elixir-autogen, elixir-format
msgid "Please check your email to verify your account"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Saving..."
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:136
#: lib/memex_web/controllers/user_settings_controller.ex:95
#, elixir-autogen, elixir-format
msgid "Your account has been deleted"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:133
#, elixir-autogen, elixir-format
msgid "are you sure you want to change your language?"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:97
#: lib/memex_web/live/invite_live/index.html.heex:125
#: lib/memex_web/live/invite_live/index.html.heex:102
#: lib/memex_web/live/invite_live/index.html.heex:132
#, elixir-autogen, elixir-format
msgid "are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:47
#: lib/memex_web/live/invite_live/index.html.heex:48
#, elixir-autogen, elixir-format
msgid "are you sure you want to delete the invite for %{invite_name}?"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:155
#: lib/memex_web/templates/user_settings/edit.html.heex:143
#, elixir-autogen, elixir-format
msgid "are you sure you want to delete your account?"
msgstr ""
#: lib/memex_web/components/topbar.ex:90
#: lib/memex_web/components/topbar.ex:92
#, elixir-autogen, elixir-format
msgid "are you sure you want to log out?"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:72
#: lib/memex_web/live/invite_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "are you sure you want to make %{invite_name} unlimited?"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:45
#: lib/memex_web/live/context_live/show.html.heex:38
#: lib/memex_web/live/note_live/index.html.heex:45
#: lib/memex_web/live/note_live/show.html.heex:38
#: lib/memex_web/live/pipeline_live/index.html.heex:45
#: lib/memex_web/live/context_live/index.html.heex:46
#: lib/memex_web/live/context_live/show.html.heex:37
#: lib/memex_web/live/note_live/index.html.heex:46
#: lib/memex_web/live/note_live/show.html.heex:34
#: lib/memex_web/live/pipeline_live/index.html.heex:46
#: lib/memex_web/live/pipeline_live/show.html.heex:46
#: lib/memex_web/live/pipeline_live/show.html.heex:115
#: lib/memex_web/live/pipeline_live/show.html.heex:116
#, elixir-autogen, elixir-format
msgid "are you sure?"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:95
#, elixir-autogen, elixir-format
msgid "register to setup %{name}"
msgstr ""
#: lib/memex_web/controllers/user_session_controller.ex:23
#, elixir-autogen, elixir-format, fuzzy
msgid "logged out successfully."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:65
#, elixir-autogen, elixir-format, fuzzy
msgid "language updated successfully."
msgstr ""
#: lib/memex_web/live/home_live.html.heex:95
#, elixir-autogen, elixir-format, fuzzy
msgid "register to setup memEx"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.ex:80
#, elixir-autogen, elixir-format, fuzzy
msgid "%{name} created successfully"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.ex:62
#, elixir-autogen, elixir-format, fuzzy
msgid "%{name} updated successfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:128
#, elixir-autogen, elixir-format, fuzzy
msgid "copied to clipboard"
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:65
#, elixir-autogen, elixir-format, fuzzy
msgid "please check your email to verify your account"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:29
#, elixir-autogen, elixir-format, fuzzy
msgid "a link to confirm your email change has been sent to the new address."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:77
#, elixir-autogen, elixir-format, fuzzy
msgid "email changed successfully."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:49
#, elixir-autogen, elixir-format, fuzzy
msgid "password updated successfully."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:95
#, elixir-autogen, elixir-format, fuzzy
msgid "your account has been deleted"
msgstr ""

View File

@ -10,7 +10,7 @@
msgid ""
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:86
#: lib/memex_web/live/invite_live/index.html.heex:90
#, elixir-autogen, elixir-format
msgid "Admins"
msgstr ""
@ -20,17 +20,27 @@ msgstr ""
msgid "Confirm your account"
msgstr ""
#: lib/memex_web/templates/user_session/new.html.heex:25
#: lib/memex_web/templates/user_session/new.html.heex:27
#, elixir-autogen, elixir-format
msgid "Keep me logged in for 60 days"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:21
#: lib/memex_web/templates/user_registration/new.html.heex:32
#, elixir-autogen, elixir-format
msgid "Language"
msgstr ""
#: lib/memex_web/templates/layout/live.html.heex:37
#, elixir-autogen, elixir-format
msgid "Loading..."
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:20
#, elixir-autogen, elixir-format
msgid "Name"
msgstr ""
#: lib/memex_web/templates/layout/live.html.heex:43
#: lib/memex_web/templates/layout/live.html.heex:50
#, elixir-autogen, elixir-format
msgid "Reconnecting..."
msgstr ""
@ -40,14 +50,24 @@ msgstr ""
msgid "Reset your password"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:25
#: lib/memex_web/controllers/user_settings_controller.ex:10
#, elixir-autogen, elixir-format
msgid "Settings"
msgstr ""
#: lib/memex_web/components/invite_card.ex:19
#, elixir-autogen, elixir-format
msgid "Uses Left:"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:24
#, elixir-autogen, elixir-format
msgid "Uses left"
msgstr ""
#: lib/memex_web/live/context_live/show.html.heex:19
#: lib/memex_web/live/note_live/show.html.heex:19
#: lib/memex_web/live/pipeline_live/show.html.heex:27
#: lib/memex_web/live/context_live/show.html.heex:17
#: lib/memex_web/live/note_live/show.html.heex:17
#: lib/memex_web/live/pipeline_live/show.html.heex:26
#, elixir-autogen, elixir-format
msgid "Visibility: %{visibility}"
msgstr ""
@ -67,7 +87,7 @@ msgstr ""
msgid "built with sharing and collaboration in mind"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:80
#: lib/memex_web/templates/user_settings/edit.html.heex:78
#, elixir-autogen, elixir-format
msgid "confirm new password"
msgstr ""
@ -95,13 +115,13 @@ msgstr ""
msgid "convenient:"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:33
#: lib/memex_web/templates/user_settings/edit.html.heex:89
#: lib/memex_web/templates/user_settings/edit.html.heex:32
#: lib/memex_web/templates/user_settings/edit.html.heex:87
#, elixir-autogen, elixir-format
msgid "current password"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:62
#: lib/memex_web/live/invite_live/index.html.heex:59
#, elixir-autogen, elixir-format
msgid "disable"
msgstr ""
@ -116,28 +136,28 @@ msgstr ""
msgid "document your processes, attaching contexts to each step"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:34
#: lib/memex_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "edit invite"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:29
#: lib/memex_web/templates/user_settings/edit.html.heex:28
#, elixir-autogen, elixir-format
msgid "email"
msgstr ""
#: lib/memex_web/components/user_card.ex:29
#: lib/memex_web/components/user_card.ex:23
#, elixir-autogen, elixir-format
msgid "email unconfirmed"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:62
#: lib/memex_web/live/invite_live/index.html.heex:63
#, elixir-autogen, elixir-format
msgid "enable"
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:32
#: lib/memex_web/templates/user_settings/edit.html.heex:129
#: lib/memex_web/templates/user_registration/new.html.heex:36
#: lib/memex_web/templates/user_settings/edit.html.heex:126
#, elixir-autogen, elixir-format
msgid "english"
msgstr ""
@ -147,12 +167,12 @@ msgstr ""
msgid "features"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:135
#: lib/memex_web/live/home_live.html.heex:138
#, elixir-autogen, elixir-format
msgid "get involved!"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:156
#: lib/memex_web/live/home_live.html.heex:159
#, elixir-autogen, elixir-format
msgid "help translate"
msgstr ""
@ -162,18 +182,18 @@ msgstr ""
msgid "instance information"
msgstr ""
#: lib/memex_web/components/invite_card.ex:42
#: lib/memex_web/components/invite_card.ex:24
#, elixir-autogen, elixir-format
msgid "invite disabled"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:112
#: lib/memex_web/live/home_live.html.heex:115
#, elixir-autogen, elixir-format
msgid "invite only"
msgstr ""
#: lib/memex_web/components/topbar.ex:73
#: lib/memex_web/live/invite_live/index.ex:42
#: lib/memex_web/components/topbar.ex:74
#: lib/memex_web/live/invite_live/index.ex:41
#: lib/memex_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "invites"
@ -189,12 +209,12 @@ msgstr ""
msgid "multi-user:"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:38
#: lib/memex_web/live/invite_live/index.ex:37
#, elixir-autogen, elixir-format
msgid "new invite"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:73
#: lib/memex_web/templates/user_settings/edit.html.heex:71
#, elixir-autogen, elixir-format
msgid "new password"
msgstr ""
@ -250,22 +270,22 @@ msgstr ""
msgid "provide context around a single topic and hotlink to your notes"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:111
#: lib/memex_web/live/home_live.html.heex:114
#, elixir-autogen, elixir-format
msgid "public signups"
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:32
#: lib/memex_web/controllers/user_registration_controller.ex:34
#, elixir-autogen, elixir-format
msgid "register"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:108
#: lib/memex_web/live/home_live.html.heex:110
#, elixir-autogen, elixir-format
msgid "registration:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:167
#: lib/memex_web/live/home_live.html.heex:170
#, elixir-autogen, elixir-format
msgid "report bugs or request features"
msgstr ""
@ -285,12 +305,11 @@ msgstr ""
msgid "select privacy"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:77
#: lib/memex_web/live/invite_live/index.html.heex:79
#, elixir-autogen, elixir-format
msgid "set unlimited"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:10
#: lib/memex_web/templates/user_settings/edit.html.heex:3
#, elixir-autogen, elixir-format
msgid "settings"
@ -310,17 +329,22 @@ msgstr ""
msgid "tags"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:114
#: lib/memex_web/components/invite_card.ex:20
#, elixir-autogen, elixir-format
msgid "unlimited"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:120
#, elixir-autogen, elixir-format
msgid "users"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:118
#: lib/memex_web/live/home_live.html.heex:121
#, elixir-autogen, elixir-format
msgid "version:"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:145
#: lib/memex_web/live/home_live.html.heex:148
#, elixir-autogen, elixir-format
msgid "view the source code"
msgstr ""
@ -439,20 +463,24 @@ msgstr ""
#: lib/memex_web/components/topbar.ex:23
#: lib/memex_web/live/home_live.html.heex:3
#: lib/memex_web/templates/error/error.html.heex:8
#: lib/memex_web/templates/layout/root.html.heex:8
#: lib/memex_web/templates/layout/root.html.heex:9
#: lib/memex_web/views/layout_view.ex:15
#: lib/memex_web/views/layout_view.ex:11
#, elixir-autogen, elixir-format
msgid "memEx"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:41
#, elixir-autogen, elixir-format
msgid "read more on how to use %{name}"
msgstr ""
#: lib/memex_web/live/faq_live.html.heex:11
#, elixir-autogen, elixir-format
msgid "what is this?"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:67
#: lib/memex_web/live/pipeline_live/show.html.heex:68
#, elixir-autogen, elixir-format
msgid "%{position}. %{title}"
msgstr ""
@ -477,12 +505,12 @@ msgstr ""
msgid "add step to %{slug}"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:61
#: lib/memex_web/live/pipeline_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "no steps"
msgstr ""
#: lib/memex_web/live/pipeline_live/show.html.heex:56
#: lib/memex_web/live/pipeline_live/show.html.heex:57
#, elixir-autogen, elixir-format
msgid "steps:"
msgstr ""
@ -587,7 +615,7 @@ msgstr ""
msgid "zettelkasten"
msgstr ""
#: lib/memex_web/views/layout_view.ex:11
#: lib/memex_web/views/layout_view.ex:10
#, elixir-autogen, elixir-format
msgid "memEx | %{title}"
msgstr ""
@ -617,37 +645,12 @@ msgstr ""
msgid "while memEx fully supports multiple users, each memEx instance should be treated as a single cohesive and collaborative document."
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:28
#: lib/memex_web/components/user_card.ex:26
#, elixir-autogen, elixir-format
msgid "language"
msgid "user confirmed on"
msgstr ""
#: lib/memex_web/components/user_card.ex:23
#: lib/memex_web/components/user_card.ex:33
#, elixir-autogen, elixir-format
msgid "user confirmed on%{confirmed_datetime}"
msgstr ""
#: lib/memex_web/components/user_card.ex:34
#, elixir-autogen, elixir-format
msgid "user registered on%{registered_datetime}"
msgstr ""
#: lib/memex_web/components/invite_card.ex:37
#, elixir-autogen, elixir-format
msgid "uses left: unlimited"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:41
#, elixir-autogen, elixir-format
msgid "read more on how to use memEx"
msgstr ""
#: lib/memex_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format
msgid "uses left: %{uses_left_count}"
msgstr ""
#: lib/memex_web/components/invite_card.ex:52
#, elixir-autogen, elixir-format
msgid "uses: %{uses_count}"
msgid "user registered on"
msgstr ""

View File

@ -10,6 +10,11 @@
msgid ""
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:84
#, elixir-autogen, elixir-format
msgid "Email change link is invalid or it has expired."
msgstr ""
#: lib/memex_web/templates/error/error.html.heex:8
#, elixir-autogen, elixir-format
msgid "Error"
@ -20,8 +25,9 @@ msgstr ""
msgid "Invalid email or password"
msgstr ""
#: lib/memex_web/templates/user_reset_password/edit.html.heex:14
#: lib/memex_web/templates/user_settings/edit.html.heex:67
#: lib/memex_web/templates/user_registration/new.html.heex:15
#: lib/memex_web/templates/user_reset_password/edit.html.heex:15
#: lib/memex_web/templates/user_settings/edit.html.heex:64
#, elixir-autogen, elixir-format
msgid "Oops, something went wrong! Please check the errors below."
msgstr ""
@ -31,23 +37,33 @@ msgstr ""
msgid "Reset password link is invalid or it has expired."
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:22
#: lib/memex_web/controllers/user_registration_controller.ex:51
#: lib/memex_web/controllers/user_registration_controller.ex:24
#: lib/memex_web/controllers/user_registration_controller.ex:55
#, elixir-autogen, elixir-format
msgid "Sorry, public registration is disabled"
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:12
#: lib/memex_web/controllers/user_registration_controller.ex:41
#: lib/memex_web/controllers/user_registration_controller.ex:14
#: lib/memex_web/controllers/user_registration_controller.ex:45
#, elixir-autogen, elixir-format
msgid "Sorry, this invite was not found or expired"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:99
#, elixir-autogen, elixir-format
msgid "Unable to delete user"
msgstr ""
#: lib/memex_web/controllers/user_confirmation_controller.ex:54
#, elixir-autogen, elixir-format
msgid "User confirmation link is invalid or it has expired."
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:18
#, elixir-autogen, elixir-format
msgid "You are not authorized to view this page"
msgstr ""
#: lib/memex_web/controllers/user_auth.ex:177
#, elixir-autogen, elixir-format
msgid "You are not authorized to view this page."
@ -59,38 +75,38 @@ msgstr ""
msgid "You must confirm your account and log in to access this page."
msgstr ""
#: lib/memex/accounts/user.ex:144
#: lib/memex/accounts/user.ex:129
#, elixir-autogen, elixir-format
msgid "did not change"
msgstr ""
#: lib/memex/accounts/user.ex:165
#: lib/memex/accounts/user.ex:150
#, elixir-autogen, elixir-format
msgid "does not match password"
msgstr ""
#: lib/memex/accounts/user.ex:202
#: lib/memex/accounts/user.ex:187
#, elixir-autogen, elixir-format
msgid "is not valid"
msgstr ""
#: lib/memex/accounts/user.ex:99
#: lib/memex/accounts/user.ex:85
#, elixir-autogen, elixir-format
msgid "must have the @ sign and no spaces"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:23
#: lib/memex_web/templates/user_settings/edit.html.heex:123
#: lib/memex_web/templates/user_settings/edit.html.heex:21
#: lib/memex_web/templates/user_settings/edit.html.heex:119
#, elixir-autogen, elixir-format
msgid "oops, something went wrong! Please check the errors below"
msgstr ""
#: lib/memex/contexts/context.ex:58
#: lib/memex/contexts/context.ex:71
#: lib/memex/notes/note.ex:57
#: lib/memex/notes/note.ex:70
#: lib/memex/pipelines/pipeline.ex:60
#: lib/memex/pipelines/pipeline.ex:73
#: lib/memex/contexts/context.ex:49
#: lib/memex/contexts/context.ex:62
#: lib/memex/notes/note.ex:48
#: lib/memex/notes/note.ex:61
#: lib/memex/pipelines/pipeline.ex:50
#: lib/memex/pipelines/pipeline.ex:63
#, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted"
msgstr ""
@ -115,34 +131,9 @@ msgstr ""
msgid "unauthorized"
msgstr ""
#: lib/memex/contexts/context.ex:84
#: lib/memex/notes/note.ex:83
#: lib/memex/pipelines/pipeline.ex:86
#: lib/memex/contexts/context.ex:75
#: lib/memex/notes/note.ex:74
#: lib/memex/pipelines/pipeline.ex:76
#, elixir-autogen, elixir-format
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma-delimited"
msgstr ""
#: lib/memex_web/templates/user_registration/new.html.heex:13
#, elixir-autogen, elixir-format
msgid "oops, something went wrong! please check the errors below."
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:70
#, elixir-autogen, elixir-format
msgid "sorry, this invite was not found or expired"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:19
#, elixir-autogen, elixir-format
msgid "you are not authorized to view this page"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:84
#, elixir-autogen, elixir-format
msgid "email change link is invalid or it has expired."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:99
#, elixir-autogen, elixir-format
msgid "unable to delete user"
msgstr ""

View File

@ -15,31 +15,56 @@ msgstr ""
msgid "%{email} confirmed successfully."
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:54
#: lib/memex_web/live/invite_live/form_component.ex:62
#, elixir-autogen, elixir-format
msgid "%{invite_name} created successfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:53
#, elixir-autogen, elixir-format
msgid "%{invite_name} deleted succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:115
#: lib/memex_web/live/invite_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "%{invite_name} disabled succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:91
#: lib/memex_web/live/invite_live/index.ex:90
#, elixir-autogen, elixir-format
msgid "%{invite_name} enabled succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:69
#: lib/memex_web/live/invite_live/index.ex:68
#, elixir-autogen, elixir-format
msgid "%{invite_name} updated succesfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:140
#: lib/memex_web/live/invite_live/form_component.ex:42
#, elixir-autogen, elixir-format
msgid "%{invite_name} updated successfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:139
#, elixir-autogen, elixir-format
msgid "%{user_email} deleted succesfully"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:29
#, elixir-autogen, elixir-format
msgid "A link to confirm your email change has been sent to the new address."
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:127
#, elixir-autogen, elixir-format
msgid "Copied to clipboard"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:77
#, elixir-autogen, elixir-format
msgid "Email changed successfully."
msgstr ""
#: lib/memex_web/controllers/user_confirmation_controller.ex:23
#, elixir-autogen, elixir-format
msgid "If your email is in our system and it has not been confirmed yet, you will receive an email with instructions shortly."
@ -50,109 +75,84 @@ msgstr ""
msgid "If your email is in our system, you will receive instructions to reset your password shortly."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:65
#, elixir-autogen, elixir-format
msgid "Language updated successfully."
msgstr ""
#: lib/memex_web/controllers/user_reset_password_controller.ex:46
#, elixir-autogen, elixir-format
msgid "Password reset successfully."
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:31
#: lib/memex_web/controllers/user_settings_controller.ex:49
#, elixir-autogen, elixir-format
msgid "Password updated successfully."
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:73
#, elixir-autogen, elixir-format
msgid "Please check your email to verify your account"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Saving..."
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:136
#: lib/memex_web/controllers/user_settings_controller.ex:95
#, elixir-autogen, elixir-format
msgid "Your account has been deleted"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:133
#, elixir-autogen, elixir-format
msgid "are you sure you want to change your language?"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:97
#: lib/memex_web/live/invite_live/index.html.heex:125
#: lib/memex_web/live/invite_live/index.html.heex:102
#: lib/memex_web/live/invite_live/index.html.heex:132
#, elixir-autogen, elixir-format
msgid "are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:47
#: lib/memex_web/live/invite_live/index.html.heex:48
#, elixir-autogen, elixir-format
msgid "are you sure you want to delete the invite for %{invite_name}?"
msgstr ""
#: lib/memex_web/templates/user_settings/edit.html.heex:155
#: lib/memex_web/templates/user_settings/edit.html.heex:143
#, elixir-autogen, elixir-format
msgid "are you sure you want to delete your account?"
msgstr ""
#: lib/memex_web/components/topbar.ex:90
#: lib/memex_web/components/topbar.ex:92
#, elixir-autogen, elixir-format
msgid "are you sure you want to log out?"
msgstr ""
#: lib/memex_web/live/invite_live/index.html.heex:72
#: lib/memex_web/live/invite_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "are you sure you want to make %{invite_name} unlimited?"
msgstr ""
#: lib/memex_web/live/context_live/index.html.heex:45
#: lib/memex_web/live/context_live/show.html.heex:38
#: lib/memex_web/live/note_live/index.html.heex:45
#: lib/memex_web/live/note_live/show.html.heex:38
#: lib/memex_web/live/pipeline_live/index.html.heex:45
#: lib/memex_web/live/context_live/index.html.heex:46
#: lib/memex_web/live/context_live/show.html.heex:37
#: lib/memex_web/live/note_live/index.html.heex:46
#: lib/memex_web/live/note_live/show.html.heex:34
#: lib/memex_web/live/pipeline_live/index.html.heex:46
#: lib/memex_web/live/pipeline_live/show.html.heex:46
#: lib/memex_web/live/pipeline_live/show.html.heex:115
#: lib/memex_web/live/pipeline_live/show.html.heex:116
#, elixir-autogen, elixir-format
msgid "are you sure?"
msgstr ""
#: lib/memex_web/live/home_live.html.heex:95
#, elixir-autogen, elixir-format
msgid "register to setup %{name}"
msgstr ""
#: lib/memex_web/controllers/user_session_controller.ex:23
#, elixir-autogen, elixir-format
msgid "logged out successfully."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:65
#, elixir-autogen, elixir-format
msgid "language updated successfully."
msgstr ""
#: lib/memex_web/live/home_live.html.heex:95
#, elixir-autogen, elixir-format
msgid "register to setup memEx"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.ex:80
#, elixir-autogen, elixir-format
msgid "%{name} created successfully"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.ex:62
#, elixir-autogen, elixir-format
msgid "%{name} updated successfully"
msgstr ""
#: lib/memex_web/live/invite_live/index.ex:128
#, elixir-autogen, elixir-format
msgid "copied to clipboard"
msgstr ""
#: lib/memex_web/controllers/user_registration_controller.ex:65
#, elixir-autogen, elixir-format
msgid "please check your email to verify your account"
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:29
#, elixir-autogen, elixir-format
msgid "a link to confirm your email change has been sent to the new address."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:77
#, elixir-autogen, elixir-format
msgid "email changed successfully."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:49
#, elixir-autogen, elixir-format
msgid "password updated successfully."
msgstr ""
#: lib/memex_web/controllers/user_settings_controller.ex:95
#, elixir-autogen, elixir-format
msgid "your account has been deleted"
msgstr ""

View File

@ -1,11 +0,0 @@
defmodule Memex.Repo.Migrations.RecordInvites do
use Ecto.Migration
def change do
alter table(:users) do
add :invite_id, references(:invites, type: :binary_id)
end
rename table(:invites), :user_id, to: :created_by_id
end
end

View File

@ -1,176 +0,0 @@
defmodule Memex.InvitesTest do
@moduledoc """
This module tests the Memex.Accounts.Invites context
"""
use Memex.DataCase
alias Ecto.Changeset
alias Memex.Accounts
alias Memex.Accounts.{Invite, Invites}
@moduletag :invites_test
@valid_attrs %{
"name" => "some name"
}
@invalid_attrs %{
"name" => nil,
"token" => nil
}
describe "invites" do
setup do
current_user = admin_fixture()
{:ok, invite} = Invites.create_invite(current_user, @valid_attrs)
[invite: invite, current_user: current_user]
end
test "list_invites/0 returns all invites", %{invite: invite, current_user: current_user} do
assert Invites.list_invites(current_user) == [invite]
end
test "get_invite!/1 returns the invite with given id",
%{invite: invite, current_user: current_user} do
assert Invites.get_invite!(invite.id, current_user) == invite
end
test "valid_invite_token? returns for valid and invalid invite tokens",
%{invite: %{token: token}} do
refute Invites.valid_invite_token?(nil)
refute Invites.valid_invite_token?("")
assert Invites.valid_invite_token?(token)
end
test "valid_invite_token? does not return true for a disabled invite by token",
%{invite: %{token: token} = invite, current_user: current_user} do
assert Invites.valid_invite_token?(token)
{:ok, _invite} = Invites.update_invite(invite, %{uses_left: 1}, current_user)
{:ok, _invite} = Invites.use_invite(token)
refute Invites.valid_invite_token?(token)
end
test "get_use_count/2 returns the correct invite usage",
%{invite: %{token: token} = invite, current_user: current_user} do
assert 0 == Invites.get_use_count(invite, current_user)
assert {:ok, _user} =
Accounts.register_user(
%{"email" => unique_user_email(), "password" => valid_user_password()},
token
)
assert 1 == Invites.get_use_count(invite, current_user)
assert {:ok, _user} =
Accounts.register_user(
%{"email" => unique_user_email(), "password" => valid_user_password()},
token
)
assert 2 == Invites.get_use_count(invite, current_user)
end
test "use_invite/1 successfully uses an unlimited invite",
%{invite: %{token: token} = invite, current_user: current_user} do
{:ok, invite} = Invites.update_invite(invite, %{uses_left: nil}, current_user)
assert {:ok, ^invite} = Invites.use_invite(token)
assert {:ok, ^invite} = Invites.use_invite(token)
assert {:ok, ^invite} = Invites.use_invite(token)
end
test "use_invite/1 successfully decrements an invite",
%{invite: %{token: token} = invite, current_user: current_user} do
{:ok, _invite} = Invites.update_invite(invite, %{uses_left: 10}, current_user)
assert {:ok, %{uses_left: 9}} = Invites.use_invite(token)
assert {:ok, %{uses_left: 8}} = Invites.use_invite(token)
assert {:ok, %{uses_left: 7}} = Invites.use_invite(token)
end
test "use_invite/1 successfully disactivates an invite",
%{invite: %{token: token} = invite, current_user: current_user} do
{:ok, _invite} = Invites.update_invite(invite, %{uses_left: 1}, current_user)
assert {:ok, %{uses_left: 0, disabled_at: disabled_at}} = Invites.use_invite(token)
assert not is_nil(disabled_at)
end
test "use_invite/1 does not work on disactivated invite",
%{invite: %{token: token} = invite, current_user: current_user} do
{:ok, _invite} = Invites.update_invite(invite, %{uses_left: 1}, current_user)
{:ok, _invite} = Invites.use_invite(token)
assert {:error, :invalid_token} = Invites.use_invite(token)
end
test "create_invite/1 with valid data creates an unlimited invite",
%{current_user: current_user} do
assert {:ok, %Invite{} = invite} =
Invites.create_invite(current_user, %{
"name" => "some name"
})
assert invite.name == "some name"
end
test "create_invite/1 with valid data creates a limited invite",
%{current_user: current_user} do
assert {:ok, %Invite{} = invite} =
Invites.create_invite(current_user, %{
"name" => "some name",
"uses_left" => 10
})
assert invite.name == "some name"
assert invite.uses_left == 10
end
test "create_invite/1 with invalid data returns error changeset",
%{current_user: current_user} do
assert {:error, %Changeset{}} = Invites.create_invite(current_user, @invalid_attrs)
end
test "update_invite/2 can set an invite to be limited",
%{invite: invite, current_user: current_user} do
assert {:ok, %Invite{} = new_invite} =
Invites.update_invite(
invite,
%{"name" => "some updated name", "uses_left" => 5},
current_user
)
assert new_invite.name == "some updated name"
assert new_invite.uses_left == 5
end
test "update_invite/2 can set an invite to be unlimited",
%{invite: invite, current_user: current_user} do
{:ok, invite} = Invites.update_invite(invite, %{"uses_left" => 5}, current_user)
assert {:ok, %Invite{} = new_invite} =
Invites.update_invite(
invite,
%{"name" => "some updated name", "uses_left" => nil},
current_user
)
assert new_invite.name == "some updated name"
assert new_invite.uses_left |> is_nil()
end
test "update_invite/2 with invalid data returns error changeset",
%{invite: invite, current_user: current_user} do
assert {:error, %Changeset{}} = Invites.update_invite(invite, @invalid_attrs, current_user)
assert invite == Invites.get_invite!(invite.id, current_user)
end
test "delete_invite/1 deletes the invite", %{invite: invite, current_user: current_user} do
assert {:ok, %Invite{}} = Invites.delete_invite(invite, current_user)
assert_raise Ecto.NoResultsError, fn -> Invites.get_invite!(invite.id, current_user) end
end
test "delete_invite!/1 deletes the invite", %{invite: invite, current_user: current_user} do
assert %Invite{} = Invites.delete_invite!(invite, current_user)
assert_raise Ecto.NoResultsError, fn -> Invites.get_invite!(invite.id, current_user) end
end
end
end

View File

@ -6,12 +6,10 @@ defmodule Memex.AccountsTest do
use Memex.DataCase
alias Ecto.Changeset
alias Memex.Accounts
alias Memex.Accounts.{Invites, User, UserToken}
alias Memex.Accounts.{User, UserToken}
@moduletag :accounts_test
doctest Accounts, import: true
describe "get_user_by_email/1" do
test "does not return the user if the email does not exist" do
refute Accounts.get_user_by_email("unknown@example.com")
@ -102,17 +100,6 @@ defmodule Memex.AccountsTest do
assert is_nil(user.confirmed_at)
assert is_nil(user.password)
end
test "records used invite during registration" do
{:ok, %{id: invite_id, token: token}} =
admin_fixture() |> Invites.create_invite(%{"name" => "my invite"})
assert {:ok, %{invite_id: ^invite_id}} =
Accounts.register_user(
%{"email" => unique_user_email(), "password" => valid_user_password()},
token
)
end
end
describe "change_user_registration/2" do
@ -316,7 +303,7 @@ defmodule Memex.AccountsTest do
end
test "deletes all tokens for the given user", %{user: user} do
_session_token = Accounts.generate_user_session_token(user)
_ = Accounts.generate_user_session_token(user)
{:ok, _} =
Accounts.update_user_password(user, valid_user_password(), %{
@ -513,7 +500,7 @@ defmodule Memex.AccountsTest do
end
test "deletes all tokens for the given user", %{user: user} do
_session_token = Accounts.generate_user_session_token(user)
_ = Accounts.generate_user_session_token(user)
{:ok, _} = Accounts.reset_user_password(user, %{"password" => "new valid password"})
refute Repo.get_by(UserToken, user_id: user.id)
end

View File

@ -0,0 +1,76 @@
defmodule Memex.InvitesTest do
@moduledoc """
This module tests the Invites context
"""
use Memex.DataCase
alias Ecto.Changeset
alias Memex.{Invites, Invites.Invite}
@moduletag :invites_test
@valid_attrs %{
"name" => "some name",
"token" => "some token"
}
@update_attrs %{
"name" => "some updated name",
"token" => "some updated token"
}
@invalid_attrs %{
"name" => nil,
"token" => nil
}
describe "invites" do
setup do
current_user = admin_fixture()
{:ok, invite} = Invites.create_invite(current_user, @valid_attrs)
[invite: invite, current_user: current_user]
end
test "list_invites/0 returns all invites", %{invite: invite, current_user: current_user} do
assert Invites.list_invites(current_user) == [invite]
end
test "get_invite!/1 returns the invite with given id",
%{invite: invite, current_user: current_user} do
assert Invites.get_invite!(invite.id, current_user) == invite
end
test "create_invite/1 with valid data creates a invite",
%{current_user: current_user} do
assert {:ok, %Invite{} = invite} = Invites.create_invite(current_user, @valid_attrs)
assert invite.name == "some name"
end
test "create_invite/1 with invalid data returns error changeset",
%{current_user: current_user} do
assert {:error, %Changeset{}} = Invites.create_invite(current_user, @invalid_attrs)
end
test "update_invite/2 with valid data updates the invite",
%{invite: invite, current_user: current_user} do
assert {:ok, %Invite{} = new_invite} =
Invites.update_invite(invite, @update_attrs, current_user)
assert new_invite.name == "some updated name"
assert new_invite.token == new_invite.token
end
test "update_invite/2 with invalid data returns error changeset",
%{invite: invite, current_user: current_user} do
assert {:error, %Changeset{}} = Invites.update_invite(invite, @invalid_attrs, current_user)
assert invite == Invites.get_invite!(invite.id, current_user)
end
test "delete_invite/1 deletes the invite", %{invite: invite, current_user: current_user} do
assert {:ok, %Invite{}} = Invites.delete_invite(invite, current_user)
assert_raise Ecto.NoResultsError, fn -> Invites.get_invite!(invite.id, current_user) end
end
test "change_invite/1 returns a invite changeset", %{invite: invite} do
assert %Changeset{} = Invites.change_invite(invite)
end
end
end

View File

@ -1,94 +0,0 @@
defmodule MemexWeb.ExportControllerTest do
@moduledoc """
Tests the export function
"""
use MemexWeb.ConnCase
import Memex.{ContextsFixtures, NotesFixtures, PipelinesFixtures, StepsFixtures}
@moduletag :export_controller_test
setup [:register_and_log_in_user]
defp add_data(%{current_user: current_user}) do
note = note_fixture(current_user)
context = context_fixture(current_user)
pipeline = pipeline_fixture(current_user)
step = step_fixture(0, pipeline, current_user)
%{
note: note,
context: context,
pipeline: pipeline,
step: step
}
end
describe "Exports data" do
setup [:add_data]
test "in JSON", %{
conn: conn,
current_user: current_user,
note: note,
context: context,
pipeline: pipeline,
step: step
} do
conn = get(conn, Routes.export_path(conn, :export, :json))
ideal_note = %{
"slug" => note.slug,
"content" => note.content,
"tags" => note.tags,
"visibility" => note.visibility |> to_string(),
"inserted_at" => note.inserted_at |> NaiveDateTime.to_iso8601(),
"updated_at" => note.updated_at |> NaiveDateTime.to_iso8601()
}
ideal_context = %{
"slug" => context.slug,
"content" => context.content,
"tags" => context.tags,
"visibility" => context.visibility |> to_string(),
"inserted_at" => context.inserted_at |> NaiveDateTime.to_iso8601(),
"updated_at" => context.updated_at |> NaiveDateTime.to_iso8601()
}
ideal_pipeline = %{
"slug" => pipeline.slug,
"description" => pipeline.description,
"tags" => pipeline.tags,
"visibility" => pipeline.visibility |> to_string(),
"inserted_at" => pipeline.inserted_at |> NaiveDateTime.to_iso8601(),
"updated_at" => pipeline.updated_at |> NaiveDateTime.to_iso8601(),
"steps" => [
%{
"title" => step.title,
"content" => step.content,
"position" => step.position,
"inserted_at" => step.inserted_at |> NaiveDateTime.to_iso8601(),
"updated_at" => step.updated_at |> NaiveDateTime.to_iso8601()
}
]
}
ideal_user = %{
"confirmed_at" =>
current_user.confirmed_at |> Jason.encode!() |> String.replace(~r/\"/, ""),
"email" => current_user.email,
"id" => current_user.id,
"locale" => current_user.locale,
"role" => to_string(current_user.role),
"inserted_at" => current_user.inserted_at |> NaiveDateTime.to_iso8601(),
"updated_at" => current_user.updated_at |> NaiveDateTime.to_iso8601()
}
json_resp = conn |> json_response(200)
assert %{"notes" => [^ideal_note]} = json_resp
assert %{"contexts" => [^ideal_context]} = json_resp
assert %{"pipelines" => [^ideal_pipeline]} = json_resp
assert %{"user" => ^ideal_user} = json_resp
end
end
end

View File

@ -116,7 +116,7 @@ defmodule MemexWeb.UserAuthTest do
end
test "does not authenticate if data is missing", %{conn: conn, current_user: current_user} do
_session_token = Accounts.generate_user_session_token(current_user)
_ = Accounts.generate_user_session_token(current_user)
conn = UserAuth.fetch_current_user(conn, [])
refute get_session(conn, :user_token)
refute conn.assigns.current_user

View File

@ -5,7 +5,8 @@ defmodule MemexWeb.UserConfirmationControllerTest do
use MemexWeb.ConnCase, async: true
import MemexWeb.Gettext
alias Memex.{Accounts, Repo}
alias Memex.Accounts
alias Memex.Repo
@moduletag :user_confirmation_controller_test

View File

@ -33,7 +33,7 @@ defmodule MemexWeb.UserRegistrationControllerTest do
})
assert get_session(conn, :phoenix_flash) == %{
"info" => dgettext("prompts", "please check your email to verify your account")
"info" => dgettext("prompts", "Please check your email to verify your account")
}
assert redirected_to(conn) =~ "/"

View File

@ -15,7 +15,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
test "renders settings page", %{conn: conn} do
conn = get(conn, Routes.user_settings_path(conn, :edit))
response = html_response(conn, 200)
assert response =~ gettext("settings")
assert response =~ gettext("Settings")
end
test "redirects if user is not logged in" do
@ -27,7 +27,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
describe "PUT /users/settings (change password form)" do
test "updates the user password and resets tokens",
%{conn: conn, current_user: current_user} do
%{conn: conn, user: user} do
new_password_conn =
put(conn, Routes.user_settings_path(conn, :update), %{
"action" => "update_password",
@ -42,9 +42,9 @@ defmodule MemexWeb.UserSettingsControllerTest do
assert get_session(new_password_conn, :user_token) != get_session(conn, :user_token)
assert get_flash(new_password_conn, :info) =~
dgettext("actions", "password updated successfully")
dgettext("actions", "Password updated successfully")
assert Accounts.get_user_by_email_and_password(current_user.email, "new valid password")
assert Accounts.get_user_by_email_and_password(user.email, "new valid password")
end
test "does not update password on invalid data", %{conn: conn} do
@ -70,7 +70,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
describe "PUT /users/settings (change email form)" do
@tag :capture_log
test "updates the user email", %{conn: conn, current_user: current_user} do
test "updates the user email", %{conn: conn, user: user} do
conn =
put(conn, Routes.user_settings_path(conn, :update), %{
"action" => "update_email",
@ -83,10 +83,10 @@ defmodule MemexWeb.UserSettingsControllerTest do
assert get_flash(conn, :info) =~
dgettext(
"prompts",
"a link to confirm your email change has been sent to the new address."
"A link to confirm your email change has been sent to the new address."
)
assert Accounts.get_user_by_email(current_user.email)
assert Accounts.get_user_by_email(user.email)
end
test "does not update email on invalid data", %{conn: conn} do
@ -105,14 +105,14 @@ defmodule MemexWeb.UserSettingsControllerTest do
end
describe "GET /users/settings/confirm_email/:token" do
setup %{current_user: current_user} do
setup %{user: user} do
email = unique_user_email()
token =
extract_user_token(fn url ->
Accounts.deliver_update_email_instructions(
%{current_user | email: email},
current_user.email,
%{user | email: email},
user.email,
url
)
end)
@ -121,28 +121,28 @@ defmodule MemexWeb.UserSettingsControllerTest do
end
test "updates the user email once",
%{conn: conn, current_user: current_user, token: token, email: email} do
%{conn: conn, user: user, token: token, email: email} do
conn = get(conn, Routes.user_settings_path(conn, :confirm_email, token))
assert redirected_to(conn) == Routes.user_settings_path(conn, :edit)
assert get_flash(conn, :info) =~ dgettext("prompts", "email changed successfully")
refute Accounts.get_user_by_email(current_user.email)
assert get_flash(conn, :info) =~ dgettext("prompts", "Email changed successfully")
refute Accounts.get_user_by_email(user.email)
assert Accounts.get_user_by_email(email)
conn = get(conn, Routes.user_settings_path(conn, :confirm_email, token))
assert redirected_to(conn) == Routes.user_settings_path(conn, :edit)
assert get_flash(conn, :error) =~
dgettext("errors", "email change link is invalid or it has expired")
dgettext("errors", "Email change link is invalid or it has expired")
end
test "does not update email with invalid token", %{conn: conn, current_user: current_user} do
test "does not update email with invalid token", %{conn: conn, user: user} do
conn = get(conn, Routes.user_settings_path(conn, :confirm_email, "oops"))
assert redirected_to(conn) == Routes.user_settings_path(conn, :edit)
assert get_flash(conn, :error) =~
dgettext("errors", "email change link is invalid or it has expired")
dgettext("errors", "Email change link is invalid or it has expired")
assert Accounts.get_user_by_email(current_user.email)
assert Accounts.get_user_by_email(user.email)
end
test "redirects if user is not logged in", %{token: token} do

View File

@ -23,8 +23,8 @@ defmodule MemexWeb.ContextLiveTest do
"visibility" => nil
}
defp create_context(%{current_user: current_user}) do
[context: context_fixture(current_user)]
defp create_context(%{user: user}) do
[context: context_fixture(user)]
end
describe "Index" do
@ -57,7 +57,7 @@ defmodule MemexWeb.ContextLiveTest do
|> form("#context-form", context: @invalid_attrs)
|> render_change() =~ "can&#39;t be blank"
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#context-form", context: @create_attrs)
|> render_submit()
@ -79,7 +79,7 @@ defmodule MemexWeb.ContextLiveTest do
|> form("#context-form", context: @invalid_attrs)
|> render_change() =~ "can&#39;t be blank"
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#context-form", context: @update_attrs)
|> render_submit()
@ -122,7 +122,7 @@ defmodule MemexWeb.ContextLiveTest do
assert html =~ "can&#39;t be blank"
assert html =~ "tags must be comma-delimited"
{:ok, _live, html} =
{:ok, _, html} =
show_live
|> form("#context-form", context: Map.put(@update_attrs, "slug", context.slug))
|> render_submit()
@ -148,16 +148,13 @@ defmodule MemexWeb.ContextLiveTest do
describe "show with note" do
setup [:register_and_log_in_user]
setup %{current_user: current_user} do
%{slug: note_slug} = note = note_fixture(current_user)
setup %{user: user} do
%{slug: note_slug} = note = note_fixture(user)
[
note: note,
context:
context_fixture(
%{content: "example with backlink to [[#{note_slug}]] note"},
current_user
)
context_fixture(%{content: "example with backlink to [[#{note_slug}]] note"}, user)
]
end

View File

@ -6,7 +6,7 @@ defmodule MemexWeb.InviteLiveTest do
use MemexWeb.ConnCase
import Phoenix.LiveViewTest
import MemexWeb.Gettext
alias Memex.Accounts.Invites
alias Memex.Invites
@moduletag :invite_live_test
@create_attrs %{"name" => "some name"}
@ -16,9 +16,9 @@ defmodule MemexWeb.InviteLiveTest do
describe "Index" do
setup [:register_and_log_in_user]
setup %{current_user: current_user} do
{:ok, invite} = Invites.create_invite(current_user, @create_attrs)
%{invite: invite, current_user: current_user}
setup %{user: user} do
{:ok, invite} = Invites.create_invite(user, @create_attrs)
%{invite: invite, user: user}
end
test "lists all invites", %{conn: conn, invite: invite} do
@ -40,7 +40,7 @@ defmodule MemexWeb.InviteLiveTest do
# |> form("#invite-form", invite: @invalid_attrs)
# |> render_change() =~ dgettext("errors", "can't be blank")
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#invite-form", invite: @create_attrs)
|> render_submit()
@ -64,7 +64,7 @@ defmodule MemexWeb.InviteLiveTest do
# |> form("#invite-form", invite: @invalid_attrs)
# |> render_change() =~ dgettext("errors", "can't be blank")
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#invite-form", invite: @update_attrs)
|> render_submit()

View File

@ -24,8 +24,8 @@ defmodule MemexWeb.NoteLiveTest do
"visibility" => nil
}
defp create_note(%{current_user: current_user}) do
[note: note_fixture(current_user)]
defp create_note(%{user: user}) do
[note: note_fixture(user)]
end
describe "Index" do
@ -62,7 +62,7 @@ defmodule MemexWeb.NoteLiveTest do
assert html =~ "can&#39;t be blank"
assert html =~ "tags must be comma-delimited"
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#note-form", note: @create_attrs)
|> render_submit()
@ -84,7 +84,7 @@ defmodule MemexWeb.NoteLiveTest do
|> form("#note-form", note: @invalid_attrs)
|> render_change() =~ "can&#39;t be blank"
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#note-form", note: @update_attrs)
|> render_submit()
@ -123,7 +123,7 @@ defmodule MemexWeb.NoteLiveTest do
|> form("#note-form", note: @invalid_attrs)
|> render_change() =~ "can&#39;t be blank"
{:ok, _live, html} =
{:ok, _, html} =
show_live
|> form("#note-form", note: Map.put(@update_attrs, "slug", note.slug))
|> render_submit()
@ -149,13 +149,13 @@ defmodule MemexWeb.NoteLiveTest do
describe "show with note" do
setup [:register_and_log_in_user]
setup %{current_user: current_user} do
%{slug: note_slug} = note = note_fixture(current_user)
setup %{user: user} do
%{slug: note_slug} = note = note_fixture(user)
[
note: note,
backlinked_note:
note_fixture(%{content: "example with backlink to [[#{note_slug}]] note"}, current_user)
note_fixture(%{content: "example with backlink to [[#{note_slug}]] note"}, user)
]
end

View File

@ -34,8 +34,8 @@ defmodule MemexWeb.PipelineLiveTest do
"title" => nil
}
defp create_pipeline(%{current_user: current_user}) do
[pipeline: pipeline_fixture(current_user)]
defp create_pipeline(%{user: user}) do
[pipeline: pipeline_fixture(user)]
end
describe "Index" do
@ -68,7 +68,7 @@ defmodule MemexWeb.PipelineLiveTest do
|> form("#pipeline-form", pipeline: @invalid_attrs)
|> render_change() =~ "can&#39;t be blank"
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#pipeline-form", pipeline: @create_attrs)
|> render_submit()
@ -90,7 +90,7 @@ defmodule MemexWeb.PipelineLiveTest do
|> form("#pipeline-form", pipeline: @invalid_attrs)
|> render_change() =~ "can&#39;t be blank"
{:ok, _live, html} =
{:ok, _, html} =
index_live
|> form("#pipeline-form", pipeline: @update_attrs)
|> render_submit()
@ -136,7 +136,7 @@ defmodule MemexWeb.PipelineLiveTest do
assert html =~ "can&#39;t be blank"
assert html =~ "tags must be comma-delimited"
{:ok, _live, html} =
{:ok, _, html} =
show_live
|> form("#pipeline-form", pipeline: Map.put(@update_attrs, "slug", pipeline.slug))
|> render_submit()
@ -181,9 +181,9 @@ defmodule MemexWeb.PipelineLiveTest do
describe "show with a step" do
setup [:register_and_log_in_user, :create_pipeline]
setup %{pipeline: pipeline, current_user: current_user} do
setup %{pipeline: pipeline, user: user} do
[
step: step_fixture(0, pipeline, current_user)
step: step_fixture(0, pipeline, user)
]
end
@ -236,11 +236,11 @@ defmodule MemexWeb.PipelineLiveTest do
describe "show with multiple steps" do
setup [:register_and_log_in_user, :create_pipeline]
setup %{pipeline: pipeline, current_user: current_user} do
setup %{pipeline: pipeline, user: user} do
[
first_step: step_fixture(%{title: "first step"}, 0, pipeline, current_user),
second_step: step_fixture(%{title: "second step"}, 1, pipeline, current_user),
third_step: step_fixture(%{title: "third step"}, 2, pipeline, current_user)
first_step: step_fixture(%{title: "first step"}, 0, pipeline, user),
second_step: step_fixture(%{title: "second step"}, 1, pipeline, user),
third_step: step_fixture(%{title: "third step"}, 2, pipeline, user)
]
end

View File

@ -5,11 +5,12 @@ defmodule MemexWeb.ErrorViewTest do
use MemexWeb.ConnCase, async: true
import MemexWeb.Gettext
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
@moduletag :error_view_test
# Bring render/3 and render_to_string/3 for testing custom views
import Phoenix.View
test "renders 404.html" do
assert render_to_string(MemexWeb.ErrorView, "404.html", []) =~
dgettext("errors", "not found")

View File

@ -23,12 +23,10 @@ defmodule MemexWeb.ConnCase do
using do
quote do
# Import conveniences for testing with connections
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import Plug.Conn
import Phoenix.ConnTest
import Memex.Fixtures
import MemexWeb.ConnCase
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import Phoenix.ConnTest
import Plug.Conn
alias MemexWeb.Router.Helpers, as: Routes
@ -52,10 +50,10 @@ defmodule MemexWeb.ConnCase do
test context.
"""
@spec register_and_log_in_user(%{conn: Plug.Conn.t()}) ::
%{conn: Plug.Conn.t(), current_user: User.t()}
%{conn: Plug.Conn.t(), user: User.t()}
def register_and_log_in_user(%{conn: conn}) do
current_user = user_fixture() |> confirm_user()
%{conn: log_in_user(conn, current_user), current_user: current_user}
user = user_fixture() |> confirm_user()
%{conn: log_in_user(conn, user), user: user}
end
@spec confirm_user(User.t()) :: User.t()

View File

@ -22,8 +22,10 @@ defmodule Memex.DataCase do
alias Memex.Repo
import Ecto
import Ecto.{Changeset, Query}
import Memex.{DataCase, Fixtures}
import Ecto.Changeset
import Ecto.Query
import Memex.DataCase
import Memex.Fixtures
end
end
@ -43,7 +45,7 @@ defmodule Memex.DataCase do
"""
def errors_on(changeset) do
Ecto.Changeset.traverse_errors(changeset, fn {message, opts} ->
Regex.replace(~r"%{(\w+)}", message, fn _capture, key ->
Regex.replace(~r"%{(\w+)}", message, fn _, key ->
opts |> Keyword.get(String.to_existing_atom(key), key) |> to_string()
end)
end)

View File

@ -29,7 +29,7 @@ defmodule Memex.Fixtures do
})
|> Accounts.register_user()
|> unwrap_ok_tuple()
|> User.role_changeset(:admin)
|> User.role_changeset("admin")
|> Repo.update!()
end