feat: Improved navigation and listing
All checks were successful
Build / build (push) Successful in 3m3s
All checks were successful
Build / build (push) Successful in 3m3s
This commit is contained in:
parent
6278f52ace
commit
0a7c16fe48
15 changed files with 147 additions and 46 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -40,3 +40,4 @@ erl_crash.dump
|
||||||
/xref_graph.dot
|
/xref_graph.dot
|
||||||
/xref_graph.png
|
/xref_graph.png
|
||||||
/scripts
|
/scripts
|
||||||
|
priv/dev_config.yml
|
||||||
|
|
48
flake.lock
48
flake.lock
|
@ -21,11 +21,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690933134,
|
"lastModified": 1693611461,
|
||||||
"narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=",
|
"narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb",
|
"rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,11 +36,11 @@
|
||||||
},
|
},
|
||||||
"flake-root": {
|
"flake-root": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1680964220,
|
"lastModified": 1692742795,
|
||||||
"narHash": "sha256-dIdTYcf+KW9a4pKHsEbddvLVSfR1yiAJynzg2x0nfWg=",
|
"narHash": "sha256-f+Y0YhVCIJ06LemO+3Xx00lIcqQxSKJHXT/yk1RTKxw=",
|
||||||
"owner": "srid",
|
"owner": "srid",
|
||||||
"repo": "flake-root",
|
"repo": "flake-root",
|
||||||
"rev": "f1c0b93d05bdbea6c011136ba1a135c80c5b326c",
|
"rev": "d9a70d9c7a5fd7f3258ccf48da9335e9b47c3937",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -74,11 +74,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1660459072,
|
"lastModified": 1694102001,
|
||||||
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
"narHash": "sha256-vky6VPK1n1od6vXbqzOXnekrQpTL4hbPAwUhT5J9c9E=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "gitignore.nix",
|
"repo": "gitignore.nix",
|
||||||
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
"rev": "9e21c80adf67ebcb077d75bd5e7d724d21eeafd6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -89,11 +89,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691853136,
|
"lastModified": 1696009558,
|
||||||
"narHash": "sha256-wTzDsRV4HN8A2Sl0SVQY0q8ILs90CD43Ha//7gNZE+E=",
|
"narHash": "sha256-/1nNL8lCF0gn38XaFyu2ufpWcBFwCDZyYUxdZkM6GxU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f0451844bbdf545f696f029d1448de4906c7f753",
|
"rev": "c182df2e68bd97deb32c7e4765adfbbbcaf75b60",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -106,11 +106,11 @@
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
"lastModified": 1690881714,
|
"lastModified": 1693471703,
|
||||||
"narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=",
|
"narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9e1960bc196baf6881340d53dccb203a951745a2",
|
"rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -150,11 +150,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691747570,
|
"lastModified": 1696158581,
|
||||||
"narHash": "sha256-J3fnIwJtHVQ0tK2JMBv4oAmII+1mCdXdpeCxtIsrL2A=",
|
"narHash": "sha256-h0vY4E7Lx95lpYQbG2w4QH4yG5wCYOvPJzK93wVQbT0=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "c5ac3aa3324bd8aebe8622a3fc92eeb3975d317a",
|
"rev": "033453f85064ccac434dfd957f95d8457901ecd6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -165,11 +165,11 @@
|
||||||
},
|
},
|
||||||
"process-compose-flake": {
|
"process-compose-flake": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691182187,
|
"lastModified": 1695992918,
|
||||||
"narHash": "sha256-dmHKgFXstdfX7nfnpbzR5H4DWGdWo610zsW9BCtI2WQ=",
|
"narHash": "sha256-5tHNbk0ldLUjAqKRZog/3asiVvkD51VGK9TvwzUBs38=",
|
||||||
"owner": "Platonic-Systems",
|
"owner": "Platonic-Systems",
|
||||||
"repo": "process-compose-flake",
|
"repo": "process-compose-flake",
|
||||||
"rev": "bacdaf54ffe3a2c1734fd973a95e6b39b1560c2e",
|
"rev": "1ebecb83f15736f5d4ae3feb01a8391977dd71da",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -211,11 +211,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691833704,
|
"lastModified": 1695822946,
|
||||||
"narHash": "sha256-ASGhgGduEgcD3gQZhGr8xtmZ3PlVY+m2HuPnIZDbu78=",
|
"narHash": "sha256-IQU3fYo0H+oGlqX5YrgZU3VRhbt2Oqe6KmslQKUO4II=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "19dee4bf6001849006a63f3435247316b0488e99",
|
"rev": "720bd006d855b08e60664e4683ccddb7a9ff614a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
mixRelease = beamPackagesPrev.mixRelease.override { inherit erlang elixir; };
|
mixRelease = beamPackagesPrev.mixRelease.override { inherit erlang elixir; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mix2nix = pkgs.mix2nix.override { inherit elixir erlang; };
|
||||||
|
|
||||||
postgres = pkgs.postgresql_15;
|
postgres = pkgs.postgresql_15;
|
||||||
|
|
||||||
inherit (pkgs.stdenv) isDarwin;
|
inherit (pkgs.stdenv) isDarwin;
|
||||||
|
@ -109,7 +111,7 @@
|
||||||
]);
|
]);
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.mix2nix
|
mix2nix
|
||||||
self'.packages.bdfr-browser-dev
|
self'.packages.bdfr-browser-dev
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -141,7 +143,7 @@
|
||||||
settings = {
|
settings = {
|
||||||
environment = {
|
environment = {
|
||||||
BDFR_BROWSER_BASE_DIRECTORY = "/Volumes/MediaScraper/Reddit";
|
BDFR_BROWSER_BASE_DIRECTORY = "/Volumes/MediaScraper/Reddit";
|
||||||
BDFR_BROWSER_CONFIG_FILE = "./priv/config.yml";
|
BDFR_BROWSER_CONFIG_FILE = "./priv/dev_config.yml";
|
||||||
BDFR_BROWSER_REPO_USER = db-user;
|
BDFR_BROWSER_REPO_USER = db-user;
|
||||||
BDFR_BROWSER_REPO_HOST = db-host;
|
BDFR_BROWSER_REPO_HOST = db-host;
|
||||||
RELEASE_DISTRIBUTION = "none";
|
RELEASE_DISTRIBUTION = "none";
|
||||||
|
|
|
@ -8,9 +8,11 @@ defmodule BdfrBrowser.HTTP.Plug do
|
||||||
|
|
||||||
get "/" do
|
get "/" do
|
||||||
config_file = Application.fetch_env!(:bdfr_browser, :config_file)
|
config_file = Application.fetch_env!(:bdfr_browser, :config_file)
|
||||||
hidden_subreddits = config_file["hidden_subreddits"]
|
archived_subreddits = Enum.sort(config_file["archived_subreddits"])
|
||||||
|
archived_users = Enum.sort(config_file["archived_users"])
|
||||||
|
saved_searches = Enum.sort(config_file["saved_searches"])
|
||||||
|
|
||||||
tpl_args = [subreddits: Subreddit.names_without(hidden_subreddits) |> Repo.all()]
|
tpl_args = [subreddits: archived_subreddits, users: archived_users, searches: saved_searches]
|
||||||
content = render_template("index", tpl_args)
|
content = render_template("index", tpl_args)
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|
@ -18,6 +20,15 @@ defmodule BdfrBrowser.HTTP.Plug do
|
||||||
|> send_resp(200, content)
|
|> send_resp(200, content)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get "/all/subreddits" do
|
||||||
|
tpl_args = [subreddits: Subreddit.names() |> Repo.all()]
|
||||||
|
content = render_template("all_subreddits", tpl_args)
|
||||||
|
|
||||||
|
conn
|
||||||
|
|> put_resp_header("content-type", "text/html; charset=utf-8")
|
||||||
|
|> send_resp(200, content)
|
||||||
|
end
|
||||||
|
|
||||||
get "/r/:subreddit" do
|
get "/r/:subreddit" do
|
||||||
subreddit_record = Repo.get_by(Subreddit, name: subreddit)
|
subreddit_record = Repo.get_by(Subreddit, name: subreddit)
|
||||||
|
|
||||||
|
@ -180,6 +191,13 @@ defmodule BdfrBrowser.HTTP.Plug do
|
||||||
send_resp(conn, 200, "IMPORTING CHANGES")
|
send_resp(conn, 200, "IMPORTING CHANGES")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
post "/_reload" do
|
||||||
|
config_file = YamlElixir.read_from_file!(System.fetch_env!("BDFR_BROWSER_CONFIG_FILE"))
|
||||||
|
:ok = Application.put_env(:bdfr_browser, :config_file, config_file)
|
||||||
|
|
||||||
|
send_resp(conn, 200, "RELOAD")
|
||||||
|
end
|
||||||
|
|
||||||
post "/_cleanup" do
|
post "/_cleanup" do
|
||||||
_ = Importer.cleanup_messages()
|
_ = Importer.cleanup_messages()
|
||||||
send_resp(conn, 200, "CLEANED UP")
|
send_resp(conn, 200, "CLEANED UP")
|
||||||
|
|
6
mix.lock
6
mix.lock
|
@ -4,17 +4,17 @@
|
||||||
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
|
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
|
||||||
"db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"},
|
"db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"},
|
||||||
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
|
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
|
||||||
"earmark": {:hex, :earmark, "1.4.39", "acdb2f02c536471029dbcc509fbd6b94b89f40ad7729fb3f68f4b6944843f01d", [:mix], [{:earmark_parser, "~> 1.4.33", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "156c9d8ec3cbeccdbf26216d8247bdeeacc8c76b4d9eee7554be2f1b623ea440"},
|
"earmark": {:hex, :earmark, "1.4.46", "8c7287bd3137e99d26ae4643e5b7ef2129a260e3dcf41f251750cb4563c8fb81", [:mix], [], "hexpm", "798d86db3d79964e759ddc0c077d5eb254968ed426399fbf5a62de2b5ff8910a"},
|
||||||
"earmark_parser": {:hex, :earmark_parser, "1.4.33", "3c3fd9673bb5dcc9edc28dd90f50c87ce506d1f71b70e3de69aa8154bc695d44", [:mix], [], "hexpm", "2d526833729b59b9fdb85785078697c72ac5e5066350663e5be6a1182da61b8f"},
|
"earmark_parser": {:hex, :earmark_parser, "1.4.33", "3c3fd9673bb5dcc9edc28dd90f50c87ce506d1f71b70e3de69aa8154bc695d44", [:mix], [], "hexpm", "2d526833729b59b9fdb85785078697c72ac5e5066350663e5be6a1182da61b8f"},
|
||||||
"ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [: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", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"},
|
"ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [: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", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"},
|
||||||
"ecto_sql": {:hex, :ecto_sql, "3.10.2", "6b98b46534b5c2f8b8b5f03f126e75e2a73c64f3c071149d32987a5378b0fdbd", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.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", "68c018debca57cb9235e3889affdaec7a10616a4e3a80c99fa1d01fdafaa9007"},
|
"ecto_sql": {:hex, :ecto_sql, "3.10.2", "6b98b46534b5c2f8b8b5f03f126e75e2a73c64f3c071149d32987a5378b0fdbd", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.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", "68c018debca57cb9235e3889affdaec7a10616a4e3a80c99fa1d01fdafaa9007"},
|
||||||
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
|
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
|
||||||
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
|
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
|
||||||
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
|
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
|
||||||
"plug": {:hex, :plug, "1.14.2", "cff7d4ec45b4ae176a227acd94a7ab536d9b37b942c8e8fa6dfc0fff98ff4d80", [: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", "842fc50187e13cf4ac3b253d47d9474ed6c296a8732752835ce4a86acdf68d13"},
|
"plug": {:hex, :plug, "1.15.0", "f40df58e1277fc7189f260daf788d628f03ae3053ce7ac1ca63eaf0423238714", [: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", "e434478d1015d968cf98ae2073e78bd63c4a06a94fe328c2df45fcd01df8ae30"},
|
||||||
"plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [: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", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"},
|
"plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [: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", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"},
|
||||||
"plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"},
|
"plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"},
|
||||||
"postgrex": {:hex, :postgrex, "0.17.2", "a3ec9e3239d9b33f1e5841565c4eb200055c52cc0757a22b63ca2d529bbe764c", [:mix], [{: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", "80a918a9e9531d39f7bd70621422f3ebc93c01618c645f2d91306f50041ed90c"},
|
"postgrex": {:hex, :postgrex, "0.17.3", "c92cda8de2033a7585dae8c61b1d420a1a1322421df84da9a82a6764580c503d", [:mix], [{: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", "946cf46935a4fdca7a81448be76ba3503cff082df42c6ec1ff16a4bdfbfb098d"},
|
||||||
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
|
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
|
||||||
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
|
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
|
||||||
"typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"},
|
"typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"},
|
||||||
|
|
14
mix.nix
14
mix.nix
|
@ -75,15 +75,15 @@ let
|
||||||
|
|
||||||
earmark = buildMix rec {
|
earmark = buildMix rec {
|
||||||
name = "earmark";
|
name = "earmark";
|
||||||
version = "1.4.39";
|
version = "1.4.46";
|
||||||
|
|
||||||
src = fetchHex {
|
src = fetchHex {
|
||||||
pkg = "${name}";
|
pkg = "${name}";
|
||||||
version = "${version}";
|
version = "${version}";
|
||||||
sha256 = "0h547ri1nbxyaisyx7jddg3wib7fpm3q4v914szwvv6bqf79sv0m";
|
sha256 = "02liz1gjppk2bazryf96sj79cm5jbryhf36wkmslx5kr7pdqd3br";
|
||||||
};
|
};
|
||||||
|
|
||||||
beamDeps = [ earmark_parser ];
|
beamDeps = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
earmark_parser = buildMix rec {
|
earmark_parser = buildMix rec {
|
||||||
|
@ -166,12 +166,12 @@ let
|
||||||
|
|
||||||
plug = buildMix rec {
|
plug = buildMix rec {
|
||||||
name = "plug";
|
name = "plug";
|
||||||
version = "1.14.2";
|
version = "1.15.0";
|
||||||
|
|
||||||
src = fetchHex {
|
src = fetchHex {
|
||||||
pkg = "${name}";
|
pkg = "${name}";
|
||||||
version = "${version}";
|
version = "${version}";
|
||||||
sha256 = "04wdyv6nma74bj1m49vkm2bc5mjf8zclfg957fng8g71hw0wabw4";
|
sha256 = "0c5fz0fx1z25vz12iqsgm434lg6nigkp685fk37nin8m226lfd74";
|
||||||
};
|
};
|
||||||
|
|
||||||
beamDeps = [ mime plug_crypto telemetry ];
|
beamDeps = [ mime plug_crypto telemetry ];
|
||||||
|
@ -205,12 +205,12 @@ let
|
||||||
|
|
||||||
postgrex = buildMix rec {
|
postgrex = buildMix rec {
|
||||||
name = "postgrex";
|
name = "postgrex";
|
||||||
version = "0.17.2";
|
version = "0.17.3";
|
||||||
|
|
||||||
src = fetchHex {
|
src = fetchHex {
|
||||||
pkg = "${name}";
|
pkg = "${name}";
|
||||||
version = "${version}";
|
version = "${version}";
|
||||||
sha256 = "036r3q250vrhj4nmyr4cc40krjgbyci18qkhppvkj7akx6liiac0";
|
sha256 = "1389zgxvv90nzz0nwb7l5l4gyg2hldmyg2s4h5xcmzd46mlz8v4l";
|
||||||
};
|
};
|
||||||
|
|
||||||
beamDeps = [ db_connection decimal jason ];
|
beamDeps = [ db_connection decimal jason ];
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
---
|
---
|
||||||
hidden_subreddits:
|
archived_subreddits:
|
||||||
- foo
|
- AskReddit
|
||||||
- bar
|
- NonCredibleDefense
|
||||||
|
|
||||||
|
archived_users:
|
||||||
|
- spez
|
||||||
|
|
18
priv/templates/http/all_subreddits.eex
Normal file
18
priv/templates/http/all_subreddits.eex
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="/">Overview</a></li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">All Subreddits</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<h2>All Subreddits</h2>
|
||||||
|
|
||||||
|
<div class="row text-center">
|
||||||
|
<div class="d-grid gap-2 col-12 mx-auto">
|
||||||
|
<%= for subreddit <- subreddits do %>
|
||||||
|
<a class="btn btn-outline-secondary btn-lg" href="/r/<%= subreddit %>" role="button"><%= subreddit %></a>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
|
@ -1,4 +1,12 @@
|
||||||
<h2>Chats</h2>
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="/">Overview</a></li>
|
||||||
|
<li class="breadcrumb-item"><a href="/chats">Chats</a></li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">Chat</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<h2>Chat</h2>
|
||||||
|
|
||||||
<%= for message <- messages do %>
|
<%= for message <- messages do %>
|
||||||
<div class="row" style="margin-bottom: 2px;"
|
<div class="row" style="margin-bottom: 2px;"
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="/">Overview</a></li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">Chats</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<h2>Chats</h2>
|
<h2>Chats</h2>
|
||||||
|
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<div class="d-grid gap-2 col-12 mx-auto">
|
<div class="d-grid gap-2 col-12 mx-auto">
|
||||||
<a class="btn btn-outline-primary btn-lg" href="/chats" role="button">Chats</a>
|
<a class="btn btn-outline-primary btn-lg" href="/chats" role="button">Chats</a>
|
||||||
|
<a class="btn btn-outline-secondary btn-lg" href="/all/subreddits" role="button">All Subreddits</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@
|
||||||
|
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<div class="d-grid gap-2 col-12 mx-auto">
|
<div class="d-grid gap-2 col-12 mx-auto">
|
||||||
<%= for subreddit <- subreddits, not String.starts_with?(subreddit, "u_") do %>
|
<%= for subreddit <- subreddits do %>
|
||||||
<a class="btn btn-outline-secondary btn-lg" href="/r/<%= subreddit %>" role="button"><%= subreddit %></a>
|
<a class="btn btn-outline-secondary btn-lg" href="/r/<%= subreddit %>" role="button"><%= subreddit %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,9 +37,21 @@
|
||||||
|
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<div class="d-grid gap-2 col-12 mx-auto">
|
<div class="d-grid gap-2 col-12 mx-auto">
|
||||||
<%= for user <- subreddits, String.starts_with?(user, "u_") do %>
|
<%= for user <- users do %>
|
||||||
<a class="btn btn-outline-secondary btn-lg" href="/user/<%= String.replace_leading(user, "u_", "") %>" role="button">
|
<a class="btn btn-outline-secondary btn-lg" href="/user/<%= user %>" role="button"><%= user %></a>
|
||||||
<%= String.replace_leading(user, "u_", "") %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h2>Saved Searches</h2>
|
||||||
|
|
||||||
|
<div class="row text-center">
|
||||||
|
<div class="d-grid gap-2 col-12 mx-auto">
|
||||||
|
<%= for search <- searches do %>
|
||||||
|
<a class="btn btn-outline-secondary btn-lg fst-italic" href="/search?<%= URI.encode_query(%{"search" => search}) %>" role="button">
|
||||||
|
<%= search %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="/">Overview</a></li>
|
||||||
|
<li class="breadcrumb-item"><a href="/r/<%= subreddit %>"><%= subreddit %></a></li>
|
||||||
|
<li class="breadcrumb-item"><a href="/r/<%= subreddit %>/<%= date %>"><%= date %></a></li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">Post</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<h2><%= post.title %></h2>
|
<h2><%= post.title %></h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="/">Overview</a></li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">Search</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<h2>Search: <%= search %></h2>
|
<h2>Search: <%= search %></h2>
|
||||||
|
|
||||||
<ul class="nav nav-pills" id="searchTab" role="tablist">
|
<ul class="nav nav-pills" id="searchTab" role="tablist">
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="/">Overview</a></li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page"><%= subreddit %></li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<h2><%= subreddit %></h2>
|
<h2><%= subreddit %></h2>
|
||||||
|
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="/">Overview</a></li>
|
||||||
|
<li class="breadcrumb-item"><a href="/r/<%= subreddit %>"><%= subreddit %></a></li>
|
||||||
|
<li class="breadcrumb-item active" aria-current="page"><%= date %></li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<h2><%= subreddit %></h2>
|
<h2><%= subreddit %></h2>
|
||||||
|
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
|
|
Reference in a new issue