82 Commits

Author SHA1 Message Date
b6b6cecc0a update deps
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-02-01 02:12:41 -05:00
08916a504f add button to resend email verification email 2025-02-01 02:12:41 -05:00
3eda522903 move staging to container 2025-02-01 02:12:41 -05:00
2e6e26006d fix style issues 2025-02-01 02:12:41 -05:00
b66d0ea8a1 add date range to range page 2025-02-01 02:12:41 -05:00
839e1d7124 fix dates not displaying properly 2025-01-31 22:33:07 -05:00
76834845a3 update deps 2025-01-12 16:51:27 -05:00
cc1413ade5 finish updating deps
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-10-26 17:16:04 -04:00
668e4c611b update gettext schema and use macros for cannery app
Some checks failed
continuous-integration/drone/push Build is failing
2024-10-26 17:07:32 -04:00
ab3d3721d6 allow filtering ammo types when creating new packs and fix some form errors not displaying on create 2024-10-26 17:07:32 -04:00
7e14f292a6 add slimselect to select elements with user content 2024-10-26 16:32:47 -04:00
16a5cb9254 fix registration page not offering all translations 2024-10-26 14:20:23 -04:00
f722f9901b update deps 2024-10-26 13:12:34 -04:00
6adae82e94 build armv7
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-16 17:50:43 -04:00
a87bf15f72 build arm
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-16 17:01:35 -04:00
75c0f8642b add project website to readme
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-15 09:44:34 -04:00
ec782515ac improve testing db timeout
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-28 13:49:26 -04:00
e1cb46cb97 fix dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-07-28 13:35:58 -04:00
56a49ed2e3 fix changesets
Some checks failed
continuous-integration/drone/tag Build is failing
continuous-integration/drone/push Build is failing
2024-07-28 13:17:33 -04:00
f25c151956 add debounces to more fields 2024-07-28 13:05:50 -04:00
c2ddc2ae0d update deps 2024-07-28 12:21:36 -04:00
33e4d26a3d fix emails 2024-07-28 12:21:36 -04:00
179d67a896 update versions 2024-07-28 12:21:35 -04:00
15354d6004 update versions
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-18 09:14:53 -04:00
e358cd6e4e downgrade versions until hex is supported in build
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-06-16 12:13:34 -04:00
202b70dc66 fix changeset warning
Some checks failed
continuous-integration/drone/tag Build is failing
continuous-integration/drone/push Build is failing
2024-06-16 11:48:49 -04:00
b963baa49d fix an issue with emails not being able to be sent 2024-06-16 11:46:35 -04:00
70701a27d3 fix issue with oban exception logger 2024-06-16 11:42:00 -04:00
67dc16d222 update deps 2024-06-16 11:42:00 -04:00
fa35038426 update to elixir 1.17 2024-06-16 11:42:00 -04:00
d896257602 actually fix bar graph
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-19 00:28:30 -04:00
4ca51a3f53 update dependencies
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-03-19 00:01:27 -04:00
96b05e8332 Make bar graph ignore gaps 2024-03-19 00:00:51 -04:00
557a2cac3d Improve login page autocomplete behavior
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-18 23:39:06 -04:00
e16e04c114 combine imports
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-18 23:26:41 -04:00
bbe4d82303 Use bar graph instead of line graph 2024-03-18 23:26:32 -04:00
c69d7843ab fix layout issues
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-23 23:34:04 -05:00
c18f59050c fix missing ssl and crypto packages
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-02-23 21:57:25 -05:00
67d688fc1e create italian gettext
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing
2024-02-23 21:22:51 -05:00
28e5fa56c3 Added translation using Weblate (Italian) 2024-02-23 21:21:42 -05:00
e301d3dd17 Added translation using Weblate (Italian) 2024-02-23 21:21:42 -05:00
4881cf6edb Added translation using Weblate (Italian) 2024-02-23 21:21:42 -05:00
6b61c45889 Added translation using Weblate (Italian) 2024-02-23 21:21:42 -05:00
4a674a0504 Added translation using Weblate (Italian) 2024-02-23 21:21:42 -05:00
7e6959fb3b Added translation using Weblate (Italian) 2024-02-23 21:21:42 -05:00
22f13b0c57 make ammo packs in containers directly navigable in table view 2024-02-23 21:20:32 -05:00
31024dcc0d fix test mode warning 2024-02-23 21:16:46 -05:00
e843014502 fix credo check for is_admin? 2024-02-23 21:13:34 -05:00
5d146ce6af fix credo check for is_already_admin? 2024-02-23 21:13:23 -05:00
27cda3733e update elixir deps 2024-02-23 21:12:11 -05:00
1965ecba32 bump version 2024-02-23 21:04:25 -05:00
69e40c6d18 update elixir deps 2024-02-23 21:04:25 -05:00
34b4b24e67 update npm deps 2024-02-23 21:04:25 -05:00
7ebed8d4c0 update tool versions 2024-02-23 21:04:25 -05:00
b5619b8606 run mix format
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-07 19:15:07 -04:00
ef28de53a1 update hex dependencies 2023-09-07 19:11:57 -04:00
fcd5dbc605 bump version
Some checks failed
continuous-integration/drone/push Build is failing
2023-09-07 19:07:56 -04:00
7738e68292 run npm audit fix --force 2023-09-07 19:06:56 -04:00
df645a6188 update node packages 2023-09-07 19:06:21 -04:00
bed4fbaf54 update dependencies 2023-09-07 19:05:35 -04:00
f94ef0a2ca fix range page title
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-05 23:36:25 -04:00
7cdb8af690 update dependencies 2023-06-05 23:32:52 -04:00
52c4ab45d5 fix class filter helper functions
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-05 23:17:43 -04:00
a35f43d6df rename Ammo.get_average_cost and Ammo.get_historical_count 2023-06-05 23:17:43 -04:00
9edeb1e803 improve Ammo.get_grouped_round_count 2023-06-05 23:17:43 -04:00
7e55446b3e improve ActivityLog.list_shot_records 2023-06-05 23:17:43 -04:00
9643e9f46d improve Ammo.get_round_count 2023-06-05 23:17:39 -04:00
8466fcd1f9 improve ActivityLog.get_grouped_used_counts 2023-06-05 23:16:47 -04:00
e713a2e108 improve ActivityLog.get_used_count 2023-06-05 23:16:00 -04:00
a8fa321040 use sr for shot record in sql 2023-06-05 23:16:00 -04:00
f0536f3030 improve Ammo.get_grouped_packs_count 2023-06-05 23:15:57 -04:00
a94d2eebf4 improve Ammo.get_packs_count 2023-06-05 23:06:28 -04:00
cfc56519f5 fix user registration controller 2023-06-04 00:07:31 -04:00
e80c2018be improve Ammo.list_packs 2023-06-04 00:00:51 -04:00
71fdd42d96 improve Ammo.list_types 2023-06-03 20:14:20 -04:00
8e99a57994 improve Containers.list_containers 2023-06-03 20:12:06 -04:00
7c42dd8a3a improve Containers.list_tags 2023-06-03 19:54:51 -04:00
79c97d7502 fix error/404 pages not rendering properly 2023-05-12 22:59:53 -04:00
2e488fa26c fix ammo type sql naming issues 2023-05-12 22:22:46 -04:00
2179bd5d86 fix table component ids 2023-05-12 21:55:59 -04:00
49628cb9bb pattern match on user struct in more cases 2023-05-12 21:48:19 -04:00
8a58d53dc1 fix pack sql naming issues 2023-05-12 21:48:04 -04:00
142 changed files with 12973 additions and 20473 deletions

View File

@ -17,7 +17,7 @@ steps:
- .mix - .mix
- name: test - name: test
image: elixir:1.14.4-alpine image: elixir:1.18.1-otp-27-alpine
environment: environment:
TEST_DATABASE_URL: ecto://postgres:postgres@database/cannery_test TEST_DATABASE_URL: ecto://postgres:postgres@database/cannery_test
HOST: testing.example.tld HOST: testing.example.tld
@ -26,8 +26,8 @@ steps:
MIX_ENV: test MIX_ENV: test
commands: commands:
- apk add --no-cache build-base npm git - apk add --no-cache build-base npm git
- mix local.rebar --force --if-missing - mix local.rebar --force
- mix local.hex --force --if-missing - mix local.hex --force
- mix deps.get - mix deps.get
- npm set cache .npm - npm set cache .npm
- npm --prefix ./assets ci --no-audit --prefer-offline - npm --prefix ./assets ci --no-audit --prefer-offline
@ -36,7 +36,7 @@ steps:
- mix test.all - mix test.all
- name: build and publish stable - name: build and publish stable
image: thegeeklab/drone-docker-buildx image: plugins/docker
privileged: true privileged: true
settings: settings:
repo: shibaobun/cannery repo: shibaobun/cannery
@ -44,6 +44,8 @@ steps:
compress: true compress: true
platforms: platforms:
- linux/amd64 - linux/amd64
- linux/arm64
- linux/arm/v7
username: username:
from_secret: docker_username from_secret: docker_username
password: password:
@ -54,7 +56,7 @@ steps:
- stable - stable
- name: build and publish tagged version - name: build and publish tagged version
image: thegeeklab/drone-docker-buildx image: plugins/docker
privileged: true privileged: true
settings: settings:
repo: shibaobun/cannery repo: shibaobun/cannery
@ -62,6 +64,8 @@ steps:
compress: true compress: true
platforms: platforms:
- linux/amd64 - linux/amd64
- linux/arm64
- linux/arm/v7
username: username:
from_secret: docker_username from_secret: docker_username
password: password:

View File

@ -1,3 +1,3 @@
elixir 1.14.4-otp-25 elixir 1.18.1-otp-27
erlang 25.3 erlang 27.2.1
nodejs 18.15.0 nodejs 23.7.0

View File

@ -1,3 +1,52 @@
# v0.9.13
- Add button to resend email verification email
- Move staging to container, rather than ammo
- Add date restriction dropdown to range page
- Fix dates not rendering properly in table
- Update deps
# v0.9.12
- Allow filtering ammo types when creating new packs
- Add SlimSelect to select elements with user content
- Fix registration page not offering all translations
- Update deps
# v0.9.11
- Fix an issue with emails not being able to be sent for real this time
- Fix some dropdowns not filling in the correct data
- Add debounces to more fields
- Update deps
# v0.9.10
- Fix issue with logger failing on oban exceptions
- Fix an issue with emails not being able to be sent
- Update deps
# v0.9.9
- Actually fix bar graph
# v0.9.8
- Make bar graph ignore empty days
- Update dependencies
# v0.9.7
- Fix margin on bottom of page
- Use bar graph instead of line graph
- Improve login page autocomplete behavior
# v0.9.6
- Make ammo packs in containers directly navigable in table view
- Update dependencies
# v0.9.5
- Update dependencies
# v0.9.4
- Code quality fixes
- Fix error/404 pages not rendering properly
- Update dependencies
- Fix Range page title
# v0.9.3 # v0.9.3
- Update dependencies - Update dependencies
- Add pack lot number to search - Add pack lot number to search

View File

@ -1,4 +1,4 @@
FROM elixir:1.14.4-alpine AS build FROM elixir:1.18.1-otp-27-alpine AS build
# install build dependencies # install build dependencies
RUN apk add --no-cache build-base npm git python3 RUN apk add --no-cache build-base npm git python3
@ -7,8 +7,8 @@ RUN apk add --no-cache build-base npm git python3
WORKDIR /app WORKDIR /app
# install hex + rebar # install hex + rebar
RUN mix local.hex --force && \ RUN mix local.rebar --force && \
mix local.rebar --force mix local.hex --force
# set build ENV # set build ENV
ENV MIX_ENV=prod ENV MIX_ENV=prod
@ -37,7 +37,7 @@ RUN mix do compile, release
FROM alpine:latest AS app FROM alpine:latest AS app
RUN apk upgrade --no-cache && \ RUN apk upgrade --no-cache && \
apk add --no-cache bash openssl libssl1.1 libcrypto1.1 libgcc libstdc++ ncurses-libs apk add --no-cache bash openssl libssl3 libcrypto3 libgcc libstdc++ ncurses-libs
WORKDIR /app WORKDIR /app

View File

@ -94,6 +94,7 @@ license can be found at
# Links # Links
- [Website](https://cannery.app): Project website
- [Gitea](https://gitea.bubbletea.dev/shibao/cannery): Main repo, feature - [Gitea](https://gitea.bubbletea.dev/shibao/cannery): Main repo, feature
requests and bug reports requests and bug reports
- [Github](https://github.com/shibaobun/cannery): Source code mirror, please - [Github](https://github.com/shibaobun/cannery): Source code mirror, please

View File

@ -8,6 +8,8 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts";
@import "@fortawesome/fontawesome-free/scss/solid"; @import "@fortawesome/fontawesome-free/scss/solid";
@import "@fortawesome/fontawesome-free/scss/brands"; @import "@fortawesome/fontawesome-free/scss/brands";
@import "slim-select/styles";
@import "components"; @import "components";
/* fix firefox scrollbars */ /* fix firefox scrollbars */
@ -25,7 +27,7 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts";
100% { scale: 1.0; opacity: 1; } 100% { scale: 1.0; opacity: 1; }
} }
// disconnect toast /* disconnect toast */
.phx-connected > #disconnect { .phx-connected > #disconnect {
opacity: 0 !important; opacity: 0 !important;
pointer-events: none; pointer-events: none;
@ -152,3 +154,57 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts";
0% { opacity: 1; } 0% { opacity: 1; }
100% { opacity: 0; } 100% { opacity: 0; }
} }
.ss-main {
@apply input;
}
.ss-main.input-primary {
@apply border-primary-500 hover:border-primary-600 active:border-primary-600;
}
.ss-content {
@apply input;
}
.ss-content.input-primary {
@apply border-primary-500 hover:border-primary-600 active:border-primary-600;
}
.ss-content.ss-open-above {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
.ss-content.ss-open-below {
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
.ss-search input[type="search"] {
@apply input;
}
.ss-content.input-primary .ss-search input[type="search"] {
@apply border-primary-500 hover:border-primary-600 active:border-primary-600;
}
.ss-content.ss-open-above .ss-search {
padding: var(--ss-spacing-l) 0 0 0;
}
.ss-content.ss-open-below .ss-search {
padding: 0 0 var(--ss-spacing-l) 0;
}
.ss-content.ss-open-above .ss-list > *:not(:first-child) {
margin: var(--ss-spacing-l) 0 0 0;
}
.ss-content.ss-open-below .ss-list > *:not(:last-child) {
margin: 0 0 var(--ss-spacing-l) 0;
}
.ss-content .ss-list .ss-option {
border-radius: var(--ss-border-radius);
}

View File

@ -24,15 +24,16 @@ import 'phoenix_html'
// Establish Phoenix Socket and LiveView configuration. // Establish Phoenix Socket and LiveView configuration.
import { Socket } from 'phoenix' import { Socket } from 'phoenix'
import { LiveSocket } from 'phoenix_live_view' import { LiveSocket } from 'phoenix_live_view'
import topbar from 'topbar'
import ShotLogChart from './shot_log_chart'
import Date from './date' import Date from './date'
import DateTime from './datetime' import DateTime from './datetime'
import ShotLogChart from './shot_log_chart'
import SlimSelect from './slim_select'
import topbar from 'topbar'
const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute('content') const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute('content')
const liveSocket = new LiveSocket('/live', Socket, { const liveSocket = new LiveSocket('/live', Socket, {
params: { _csrf_token: csrfToken }, params: { _csrf_token: csrfToken },
hooks: { Date, DateTime, ShotLogChart } hooks: { Date, DateTime, ShotLogChart, SlimSelect }
}) })
// Show progress bar on live navigation and form submits // Show progress bar on live navigation and form submits

View File

@ -1,7 +1,7 @@
export default { export default {
displayDate (el) { displayDate (el) {
const date = const date =
Intl.DateTimeFormat([], { timeZone: 'Etc/UTC', dateStyle: 'short' }) Intl.DateTimeFormat([], { timeZone: 'UTC', dateStyle: 'short' })
.format(new Date(el.dateTime)) .format(new Date(el.dateTime))
el.innerText = date el.innerText = date

View File

@ -1,7 +1,7 @@
export default { export default {
displayDateTime (el) { displayDateTime (el) {
const date = const date =
Intl.DateTimeFormat([], { dateStyle: 'short', timeStyle: 'long' }) Intl.DateTimeFormat([], { timeZone: 'UTC', dateStyle: 'short', timeStyle: 'long' })
.format(new Date(el.dateTime)) .format(new Date(el.dateTime))
el.innerText = date el.innerText = date

View File

@ -1,13 +1,12 @@
import { Chart, Title, Tooltip, Legend, LineController, LineElement, PointElement, TimeScale, LinearScale } from 'chart.js' import Chart from 'chart.js/auto'
import 'chartjs-adapter-date-fns' import 'chartjs-adapter-date-fns'
Chart.register(Title, Tooltip, Legend, LineController, LineElement, PointElement, TimeScale, LinearScale)
export default { export default {
initalizeChart (el) { initalizeChart (el) {
const data = JSON.parse(el.dataset.chartData) const data = JSON.parse(el.dataset.chartData)
this.el.chart = new Chart(el, { this.el.chart = new Chart(el, {
type: 'line', type: 'bar',
data: { data: {
datasets: [{ datasets: [{
label: el.dataset.label, label: el.dataset.label,
@ -51,13 +50,17 @@ export default {
stacked: true, stacked: true,
grace: '15%', grace: '15%',
ticks: { ticks: {
padding: 15 padding: 15,
precision: 0
} }
}, },
x: { x: {
type: 'time', type: 'timeseries',
time: { time: {
unit: 'day' unit: 'day'
},
ticks: {
source: 'data'
} }
} }
}, },

28
assets/js/slim_select.js Normal file
View File

@ -0,0 +1,28 @@
import SlimSelect from 'slim-select'
export default {
initalizeSlimSelect (el) {
// eslint-disable-next-line no-new
el.slimselect = new SlimSelect({
select: el,
settings: {
contentPosition: 'fixed'
}
})
const main = document.querySelector(`.ss-main[data-id="${el.dataset.id}"]`)
main.setAttribute('id', `${el.dataset.id}-main`)
main.setAttribute('phx-update', 'ignore')
const content = document.querySelector(`.ss-content[data-id="${el.dataset.id}"]`)
content.setAttribute('id', `${el.dataset.id}-content`)
content.setAttribute('phx-update', 'ignore')
},
updated () {
this.el.slimselect?.destroy()
this.initalizeSlimSelect(this.el)
},
mounted () {
this.initalizeSlimSelect(this.el)
}
}

23434
assets/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@
"description": " ", "description": " ",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": "v18.15.0", "node": "v23.7.0",
"npm": "9.5.0" "npm": "10.9.2"
}, },
"scripts": { "scripts": {
"deploy": "NODE_ENV=production webpack --mode production", "deploy": "NODE_ENV=production webpack --mode production",
@ -13,37 +13,39 @@
"test": "standard" "test": "standard"
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^6.4.0", "@fortawesome/fontawesome-free": "^6.7.2",
"chart.js": "^4.2.1", "chart.js": "^4.4.7",
"chartjs-adapter-date-fns": "^3.0.0", "chartjs-adapter-date-fns": "^3.0.0",
"date-fns": "^2.29.3", "date-fns": "^4.1.0",
"phoenix": "file:../deps/phoenix", "phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html", "phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view", "phoenix_live_view": "file:../deps/phoenix_live_view",
"topbar": "^2.0.1" "slim-select": "^2.10.0",
"topbar": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.4", "@babel/core": "^7.26.0",
"@babel/preset-env": "^7.21.4", "@babel/preset-env": "^7.26.0",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.20",
"babel-loader": "^9.1.2", "babel-loader": "^9.2.1",
"copy-webpack-plugin": "^11.0.0", "copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.7.3", "css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^5.0.0", "css-minimizer-webpack-plugin": "^7.0.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"mini-css-extract-plugin": "^2.7.5", "glob": "^11.0.1",
"npm-check-updates": "^16.10.8", "mini-css-extract-plugin": "^2.9.2",
"postcss": "^8.4.21", "npm-check-updates": "^17.1.13",
"postcss-import": "^15.1.0", "postcss": "^8.5.1",
"postcss-loader": "^7.2.4", "postcss-import": "^16.1.0",
"postcss-preset-env": "^8.3.1", "postcss-loader": "^8.1.1",
"sass": "^1.62.0", "postcss-preset-env": "^10.1.3",
"sass-loader": "^13.2.2", "sass": "^1.83.1",
"standard": "^17.0.0", "sass-loader": "^16.0.4",
"tailwindcss": "^3.3.1", "standard": "^17.1.2",
"terser-webpack-plugin": "^5.3.7", "tailwindcss": "^3.4.17",
"webpack": "^5.79.0", "terser-webpack-plugin": "^5.3.11",
"webpack-cli": "^5.0.1", "webpack": "^5.97.1",
"webpack-dev-server": "^4.13.2" "webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.0"
} }
} }

View File

@ -8,6 +8,7 @@
import Config import Config
config :cannery, config :cannery,
env: :dev,
ecto_repos: [Cannery.Repo], ecto_repos: [Cannery.Repo],
generators: [binary_id: true] generators: [binary_id: true]
@ -18,7 +19,10 @@ config :cannery, CanneryWeb.Endpoint,
url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"], url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"],
http: [port: String.to_integer(System.get_env("PORT") || "4000")], http: [port: String.to_integer(System.get_env("PORT") || "4000")],
secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I", secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I",
render_errors: [view: CanneryWeb.ErrorView, accepts: ~w(html json), layout: false], render_errors: [
formats: [html: CanneryWeb.ErrorHTML, json: CanneryWeb.ErrorJSON],
layout: false
],
pubsub_server: Cannery.PubSub, pubsub_server: Cannery.PubSub,
live_view: [signing_salt: "zOLgd3lr"] live_view: [signing_salt: "zOLgd3lr"]

View File

@ -14,6 +14,8 @@ config :cannery, CanneryWeb.Endpoint, cache_static_manifest: "priv/static/cache_
# Do not print debug messages in production # Do not print debug messages in production
config :logger, level: :info config :logger, level: :info
config :cannery, env: :prod
# ## SSL Support # ## SSL Support
# #
# To get SSL working, you will need to add the `https` key # To get SSL working, you will need to add the `https` key

View File

@ -9,8 +9,9 @@ config :bcrypt_elixir, :log_rounds, 1
# to provide built-in test partitioning in CI environment. # to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information. # Run `mix help test` for more information.
config :cannery, Cannery.Repo, config :cannery, Cannery.Repo,
pool_size: 10,
pool: Ecto.Adapters.SQL.Sandbox, pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 10 timeout: 60000
# We don't run a server during test. If one is required, # We don't run a server during test. If one is required,
# you can enable the server option below. # you can enable the server option below.
@ -19,6 +20,8 @@ config :cannery, CanneryWeb.Endpoint,
secret_key_base: "S3qq9QtUdsFtlYej+HTjAVN95uP5i5tf2sPYINWSQfCKJghFj2B1+wTAoljZyHOK", secret_key_base: "S3qq9QtUdsFtlYej+HTjAVN95uP5i5tf2sPYINWSQfCKJghFj2B1+wTAoljZyHOK",
server: false server: false
config :cannery, env: :test
# In test we don't send emails. # In test we don't send emails.
config :cannery, Cannery.Mailer, adapter: Swoosh.Adapters.Test config :cannery, Cannery.Mailer, adapter: Swoosh.Adapters.Test
@ -26,10 +29,10 @@ config :cannery, Cannery.Mailer, adapter: Swoosh.Adapters.Test
config :cannery, Cannery.Accounts, registration: "public" config :cannery, Cannery.Accounts, registration: "public"
# Print only warnings and errors during test # Print only warnings and errors during test
config :logger, level: :warn config :logger, level: :warning
# Initialize plugs at runtime for faster test compilation # Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime config :phoenix, :plug_init_mode, :runtime
# Disable Oban # Disable Oban
config :cannery, Oban, queues: false, plugins: false config :cannery, Oban, queues: false, plugins: false, testing: :manual

View File

@ -6,4 +6,34 @@ defmodule Cannery do
Contexts are also responsible for managing your data, regardless Contexts are also responsible for managing your data, regardless
if it comes from the database, an external API or others. if it comes from the database, an external API or others.
""" """
def context do
quote do
use Gettext, backend: CanneryWeb.Gettext
import Ecto.Query
alias Cannery.Accounts.User
alias Cannery.Repo
alias Ecto.{Changeset, Multi, Queryable, UUID}
end
end
def schema do
quote do
use Ecto.Schema
use Gettext, backend: CanneryWeb.Gettext
import Ecto.{Changeset, Query}
alias Cannery.Accounts.User
alias Ecto.{Association, Changeset, Queryable, UUID}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
end
end
@doc """
When used, dispatch to the appropriate context/schema/etc.
"""
defmacro __using__(which) when is_atom(which) do
apply(__MODULE__, which, [])
end
end end

View File

@ -3,10 +3,9 @@ defmodule Cannery.Accounts do
The Accounts context. The Accounts context.
""" """
import Ecto.Query, warn: false use Cannery, :context
alias Cannery.{Mailer, Repo} alias Cannery.Mailer
alias Cannery.Accounts.{Invite, Invites, User, UserToken} alias Cannery.Accounts.{Invite, Invites, UserToken}
alias Ecto.{Changeset, Multi}
alias Oban.Job alias Oban.Job
## Database getters ## Database getters
@ -219,7 +218,7 @@ defmodule Cannery.Accounts do
with {:ok, query} <- UserToken.verify_change_email_token_query(token, context), with {:ok, query} <- UserToken.verify_change_email_token_query(token, context),
%UserToken{sent_to: email} <- Repo.one(query), %UserToken{sent_to: email} <- Repo.one(query),
{:ok, _} <- Repo.transaction(user_email_multi(user, email, context)) do {:ok, _result} <- Repo.transaction(user_email_multi(user, email, context)) do
:ok :ok
else else
_error_tuple -> :error _error_tuple -> :error
@ -404,15 +403,15 @@ defmodule Cannery.Accounts do
## Examples ## Examples
iex> is_admin?(%User{role: :admin}) iex> admin?(%User{role: :admin})
true true
iex> is_admin?(%User{}) iex> admin?(%User{})
false false
""" """
@spec is_admin?(User.t()) :: boolean() @spec admin?(User.t()) :: boolean()
def is_admin?(%User{id: user_id}) do def 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, where: u.role == :admin)
end end
@ -421,16 +420,16 @@ defmodule Cannery.Accounts do
## Examples ## Examples
iex> is_already_admin?(%User{role: :admin}) iex> already_admin?(%User{role: :admin})
true true
iex> is_already_admin?(%User{}) iex> already_admin?(%User{})
false false
""" """
@spec is_already_admin?(User.t() | nil) :: boolean() @spec already_admin?(User.t() | nil) :: boolean()
def is_already_admin?(%User{role: :admin}), do: true def already_admin?(%User{role: :admin}), do: true
def is_already_admin?(_invalid_user), do: false def already_admin?(_invalid_user), do: false
## Confirmation ## Confirmation

View File

@ -5,13 +5,8 @@ defmodule Cannery.Accounts.Invite do
`:uses_left` is defined. `:uses_left` is defined.
""" """
use Ecto.Schema use Cannery, :schema
import Ecto.Changeset
alias Cannery.Accounts.User
alias Ecto.{Association, Changeset, UUID}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "invites" do schema "invites" do
field :name, :string field :name, :string
field :token, :string field :token, :string

View File

@ -3,10 +3,8 @@ defmodule Cannery.Accounts.Invites do
The Invites context. The Invites context.
""" """
import Ecto.Query, warn: false use Cannery, :context
alias Ecto.Multi alias Cannery.Accounts.Invite
alias Cannery.Accounts.{Invite, User}
alias Cannery.Repo
@invite_token_length 20 @invite_token_length 20

View File

@ -3,11 +3,8 @@ defmodule Cannery.Accounts.User do
A Cannery user A Cannery user
""" """
use Ecto.Schema use Cannery, :schema
import Ecto.Changeset alias Cannery.Accounts.Invite
import CanneryWeb.Gettext
alias Ecto.{Association, Changeset, UUID}
alias Cannery.Accounts.{Invite, User}
@derive {Jason.Encoder, @derive {Jason.Encoder,
only: [ only: [
@ -20,8 +17,6 @@ defmodule Cannery.Accounts.User do
:updated_at :updated_at
]} ]}
@derive {Inspect, except: [:password]} @derive {Inspect, except: [:password]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "users" do schema "users" do
field :email, :string field :email, :string
field :password, :string, virtual: true field :password, :string, virtual: true
@ -141,7 +136,7 @@ defmodule Cannery.Accounts.User do
|> cast(attrs, [:email]) |> cast(attrs, [:email])
|> validate_email() |> validate_email()
|> case do |> case do
%{changes: %{email: _}} = changeset -> changeset %{changes: %{email: _email}} = changeset -> changeset
%{} = changeset -> add_error(changeset, :email, dgettext("errors", "did not change")) %{} = changeset -> add_error(changeset, :email, dgettext("errors", "did not change"))
end end
end end

View File

@ -3,10 +3,7 @@ defmodule Cannery.Accounts.UserToken do
Schema for a user's session token Schema for a user's session token
""" """
use Ecto.Schema use Cannery, :schema
import Ecto.Query
alias Cannery.Accounts.User
alias Ecto.{Association, UUID}
@hash_algorithm :sha256 @hash_algorithm :sha256
@rand_size 32 @rand_size 32
@ -18,8 +15,6 @@ defmodule Cannery.Accounts.UserToken do
@change_email_validity_in_days 7 @change_email_validity_in_days 7
@session_validity_in_days 60 @session_validity_in_days 60
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "users_tokens" do schema "users_tokens" do
field :token, :binary field :token, :binary
field :context, :string field :context, :string
@ -155,7 +150,7 @@ defmodule Cannery.Accounts.UserToken do
from t in __MODULE__, where: t.user_id == ^user.id from t in __MODULE__, where: t.user_id == ^user.id
end end
def user_and_contexts_query(user, [_ | _] = contexts) do def user_and_contexts_query(user, [_first | _rest] = contexts) do
from t in __MODULE__, where: t.user_id == ^user.id and t.context in ^contexts from t in __MODULE__, where: t.user_id == ^user.id and t.context in ^contexts
end end
end end

View File

@ -3,43 +3,56 @@ defmodule Cannery.ActivityLog do
The ActivityLog context. The ActivityLog context.
""" """
import Ecto.Query, warn: false use Cannery, :context
alias Cannery.Ammo.{Pack, Type} alias Cannery.{ActivityLog.ShotRecord, Ammo.Pack, Ammo.Type}
alias Cannery.{Accounts.User, ActivityLog.ShotRecord, Repo}
alias Ecto.{Multi, Queryable} @type list_shot_records_option ::
{:search, String.t() | nil}
| {:class, Type.class() | :all | nil}
| {:start_date, String.t() | nil}
| {:end_date, String.t() | nil}
| {:pack_id, Pack.id() | nil}
@type list_shot_records_options :: [list_shot_records_option()]
@doc """ @doc """
Returns the list of shot_records. Returns the list of shot_records.
## Examples ## Examples
iex> list_shot_records(:all, %User{id: 123}) iex> list_shot_records(%User{id: 123})
[%ShotRecord{}, ...] [%ShotRecord{}, ...]
iex> list_shot_records("cool", :all, %User{id: 123}) iex> list_shot_records(%User{id: 123}, search: "cool")
[%ShotRecord{notes: "My cool shot record"}, ...] [%ShotRecord{notes: "My cool shot record"}, ...]
iex> list_shot_records("cool", :rifle, %User{id: 123}) iex> list_shot_records(%User{id: 123}, search: "cool", class: :rifle)
[%ShotRecord{notes: "Shot some rifle rounds"}, ...] [%ShotRecord{notes: "Shot some rifle rounds"}, ...]
iex> list_shot_records(%User{id: 123}, pack_id: 456)
[%ShotRecord{pack_id: 456}, ...]
""" """
@spec list_shot_records(Type.class() | :all, User.t()) :: [ShotRecord.t()] @spec list_shot_records(User.t()) :: [ShotRecord.t()]
@spec list_shot_records(search :: nil | String.t(), Type.class() | :all, User.t()) :: @spec list_shot_records(User.t(), list_shot_records_options()) :: [ShotRecord.t()]
[ShotRecord.t()] def list_shot_records(%User{id: user_id}, opts \\ []) do
def list_shot_records(search \\ nil, type, %{id: user_id}) do from(sr in ShotRecord,
from(sg in ShotRecord, as: :sr,
as: :sg, left_join: p in Pack,
left_join: ag in Pack, as: :p,
as: :ag, on: sr.pack_id == p.id,
on: sg.pack_id == ag.id, on: p.user_id == ^user_id,
left_join: at in Type, left_join: t in Type,
as: :at, as: :t,
on: ag.type_id == at.id, on: p.type_id == t.id,
where: sg.user_id == ^user_id, on: t.user_id == ^user_id,
distinct: sg.id where: sr.user_id == ^user_id,
distinct: sr.id
) )
|> list_shot_records_search(search) |> list_shot_records_search(Keyword.get(opts, :search))
|> list_shot_records_filter_type(type) |> list_shot_records_class(Keyword.get(opts, :class))
|> list_shot_records_pack_id(Keyword.get(opts, :pack_id))
|> list_shot_records_start_date(Keyword.get(opts, :start_date))
|> list_shot_records_end_date(Keyword.get(opts, :end_date))
|> Repo.all() |> Repo.all()
end end
@ -52,45 +65,58 @@ defmodule Cannery.ActivityLog do
query query
|> where( |> where(
[sg: sg, ag: ag, at: at], [sr: sr, p: p, t: t],
fragment( fragment(
"? @@ websearch_to_tsquery('english', ?)", "? @@ websearch_to_tsquery('english', ?)",
sg.search, sr.search,
^trimmed_search ^trimmed_search
) or ) or
fragment( fragment(
"? @@ websearch_to_tsquery('english', ?)", "? @@ websearch_to_tsquery('english', ?)",
ag.search, p.search,
^trimmed_search ^trimmed_search
) or ) or
fragment( fragment(
"? @@ websearch_to_tsquery('english', ?)", "? @@ websearch_to_tsquery('english', ?)",
at.search, t.search,
^trimmed_search ^trimmed_search
) )
) )
|> order_by([sg: sg], { |> order_by([sr: sr], {
:desc, :desc,
fragment( fragment(
"ts_rank_cd(?, websearch_to_tsquery('english', ?), 4)", "ts_rank_cd(?, websearch_to_tsquery('english', ?), 4)",
sg.search, sr.search,
^trimmed_search ^trimmed_search
) )
}) })
end end
@spec list_shot_records_filter_type(Queryable.t(), Type.class() | :all) :: @spec list_shot_records_class(Queryable.t(), Type.class() | :all | nil) :: Queryable.t()
Queryable.t() defp list_shot_records_class(query, class) when class in [:rifle, :pistol, :shotgun],
defp list_shot_records_filter_type(query, :rifle), do: query |> where([t: t], t.class == ^class)
do: query |> where([at: at], at.class == :rifle)
defp list_shot_records_filter_type(query, :pistol), defp list_shot_records_class(query, _all), do: query
do: query |> where([at: at], at.class == :pistol)
defp list_shot_records_filter_type(query, :shotgun), @spec list_shot_records_pack_id(Queryable.t(), Pack.id() | nil) :: Queryable.t()
do: query |> where([at: at], at.class == :shotgun) defp list_shot_records_pack_id(query, pack_id) when pack_id |> is_binary(),
do: query |> where([sr: sr], sr.pack_id == ^pack_id)
defp list_shot_records_filter_type(query, _all), do: query defp list_shot_records_pack_id(query, _all), do: query
@spec list_shot_records_start_date(Queryable.t(), String.t() | nil) :: Queryable.t()
defp list_shot_records_start_date(query, start_date) when start_date |> is_binary() do
query |> where([sr: sr], sr.date >= ^Date.from_iso8601!(start_date))
end
defp list_shot_records_start_date(query, _all), do: query
@spec list_shot_records_end_date(Queryable.t(), String.t() | nil) :: Queryable.t()
defp list_shot_records_end_date(query, end_date) when end_date |> is_binary() do
query |> where([sr: sr], sr.date <= ^Date.from_iso8601!(end_date))
end
defp list_shot_records_end_date(query, _all), do: query
@doc """ @doc """
Returns a count of shot records. Returns a count of shot records.
@ -104,25 +130,13 @@ defmodule Cannery.ActivityLog do
@spec get_shot_record_count!(User.t()) :: integer() @spec get_shot_record_count!(User.t()) :: integer()
def get_shot_record_count!(%User{id: user_id}) do def get_shot_record_count!(%User{id: user_id}) do
Repo.one( Repo.one(
from sg in ShotRecord, from sr in ShotRecord,
where: sg.user_id == ^user_id, where: sr.user_id == ^user_id,
select: count(sg.id), select: count(sr.id),
distinct: true distinct: true
) || 0 ) || 0
end end
@spec list_shot_records_for_pack(Pack.t(), User.t()) :: [ShotRecord.t()]
def list_shot_records_for_pack(
%Pack{id: pack_id, user_id: user_id},
%User{id: user_id}
) do
Repo.all(
from sg in ShotRecord,
where: sg.pack_id == ^pack_id,
where: sg.user_id == ^user_id
)
end
@doc """ @doc """
Gets a single shot_record. Gets a single shot_record.
@ -140,10 +154,10 @@ defmodule Cannery.ActivityLog do
@spec get_shot_record!(ShotRecord.id(), User.t()) :: ShotRecord.t() @spec get_shot_record!(ShotRecord.id(), User.t()) :: ShotRecord.t()
def get_shot_record!(id, %User{id: user_id}) do def get_shot_record!(id, %User{id: user_id}) do
Repo.one!( Repo.one!(
from sg in ShotRecord, from sr in ShotRecord,
where: sg.id == ^id, where: sr.id == ^id,
where: sg.user_id == ^user_id, where: sr.user_id == ^user_id,
order_by: sg.date order_by: sr.date
) )
end end
@ -172,9 +186,9 @@ defmodule Cannery.ActivityLog do
fn _repo, %{create_shot_record: %{pack_id: pack_id, user_id: user_id}} -> fn _repo, %{create_shot_record: %{pack_id: pack_id, user_id: user_id}} ->
pack = pack =
Repo.one( Repo.one(
from ag in Pack, from p in Pack,
where: ag.id == ^pack_id, where: p.id == ^pack_id,
where: ag.user_id == ^user_id where: p.user_id == ^user_id
) )
{:ok, pack} {:ok, pack}
@ -221,7 +235,7 @@ defmodule Cannery.ActivityLog do
|> Multi.run( |> Multi.run(
:pack, :pack,
fn repo, %{update_shot_record: %{pack_id: pack_id, user_id: user_id}} -> fn repo, %{update_shot_record: %{pack_id: pack_id, user_id: user_id}} ->
{:ok, repo.one(from ag in Pack, where: ag.id == ^pack_id and ag.user_id == ^user_id)} {:ok, repo.one(from p in Pack, where: p.id == ^pack_id and p.user_id == ^user_id)}
end end
) )
|> Multi.update( |> Multi.update(
@ -266,7 +280,7 @@ defmodule Cannery.ActivityLog do
|> Multi.run( |> Multi.run(
:pack, :pack,
fn repo, %{delete_shot_record: %{pack_id: pack_id, user_id: user_id}} -> fn repo, %{delete_shot_record: %{pack_id: pack_id, user_id: user_id}} ->
{:ok, repo.one(from ag in Pack, where: ag.id == ^pack_id and ag.user_id == ^user_id)} {:ok, repo.one(from p in Pack, where: p.id == ^pack_id and p.user_id == ^user_id)}
end end
) )
|> Multi.update( |> Multi.update(
@ -287,36 +301,6 @@ defmodule Cannery.ActivityLog do
end end
end end
@doc """
Returns the number of shot rounds for a pack
"""
@spec get_used_count(Pack.t(), User.t()) :: non_neg_integer()
def get_used_count(%Pack{id: pack_id} = pack, user) do
[pack]
|> get_used_counts(user)
|> Map.get(pack_id, 0)
end
@doc """
Returns the number of shot rounds for multiple packs
"""
@spec get_used_counts([Pack.t()], User.t()) ::
%{optional(Pack.id()) => non_neg_integer()}
def get_used_counts(packs, %User{id: user_id}) do
pack_ids =
packs
|> Enum.map(fn %{id: pack_id} -> pack_id end)
Repo.all(
from sg in ShotRecord,
where: sg.pack_id in ^pack_ids,
where: sg.user_id == ^user_id,
group_by: sg.pack_id,
select: {sg.pack_id, sum(sg.count)}
)
|> Map.new()
end
@doc """ @doc """
Returns the last entered shot record date for a pack Returns the last entered shot record date for a pack
""" """
@ -337,15 +321,18 @@ defmodule Cannery.ActivityLog do
|> Enum.map(fn %Pack{id: pack_id, user_id: ^user_id} -> pack_id end) |> Enum.map(fn %Pack{id: pack_id, user_id: ^user_id} -> pack_id end)
Repo.all( Repo.all(
from sg in ShotRecord, from sr in ShotRecord,
where: sg.pack_id in ^pack_ids, where: sr.pack_id in ^pack_ids,
where: sg.user_id == ^user_id, where: sr.user_id == ^user_id,
group_by: sg.pack_id, group_by: sr.pack_id,
select: {sg.pack_id, max(sg.date)} select: {sr.pack_id, max(sr.date)}
) )
|> Map.new() |> Map.new()
end end
@type get_used_count_option :: {:pack_id, Pack.id() | nil} | {:type_id, Type.id() | nil}
@type get_used_count_options :: [get_used_count_option()]
@doc """ @doc """
Gets the total number of rounds shot for a type Gets the total number of rounds shot for a type
@ -353,45 +340,116 @@ defmodule Cannery.ActivityLog do
## Examples ## Examples
iex> get_used_count_for_type(123, %User{id: 123}) iex> get_used_count(%User{id: 123}, type_id: 123)
35 35
iex> get_used_count_for_type(456, %User{id: 123}) iex> get_used_count(%User{id: 123}, pack_id: 456)
** (Ecto.NoResultsError) 50
""" """
@spec get_used_count_for_type(Type.t(), User.t()) :: non_neg_integer() @spec get_used_count(User.t(), get_used_count_options()) :: non_neg_integer()
def get_used_count_for_type(%Type{id: type_id} = type, user) do def get_used_count(%User{id: user_id}, opts) do
[type] from(sr in ShotRecord,
|> get_used_count_for_types(user) as: :sr,
|> Map.get(type_id, 0) left_join: p in Pack,
on: sr.pack_id == p.id,
on: p.user_id == ^user_id,
as: :p,
where: sr.user_id == ^user_id,
where: not (sr.count |> is_nil()),
select: sum(sr.count),
distinct: true
)
|> get_used_count_type_id(Keyword.get(opts, :type_id))
|> get_used_count_pack_id(Keyword.get(opts, :pack_id))
|> Repo.one() || 0
end end
@spec get_used_count_pack_id(Queryable.t(), Pack.id() | nil) :: Queryable.t()
defp get_used_count_pack_id(query, pack_id) when pack_id |> is_binary() do
query |> where([sr: sr], sr.pack_id == ^pack_id)
end
defp get_used_count_pack_id(query, _nil), do: query
@spec get_used_count_type_id(Queryable.t(), Type.id() | nil) :: Queryable.t()
defp get_used_count_type_id(query, type_id) when type_id |> is_binary() do
query |> where([p: p], p.type_id == ^type_id)
end
defp get_used_count_type_id(query, _nil), do: query
@type get_grouped_used_counts_option ::
{:packs, [Pack.t()] | nil}
| {:types, [Type.t()] | nil}
| {:group_by, :type_id | :pack_id}
@type get_grouped_used_counts_options :: [get_grouped_used_counts_option()]
@doc """ @doc """
Gets the total number of rounds shot for multiple types Gets the total number of rounds shot for multiple types or packs
## Examples ## Examples
iex> get_used_count_for_types(123, %User{id: 123}) iex> get_grouped_used_counts(
...> %User{id: 123},
...> group_by: :type_id,
...> types: [%Type{id: 456, user_id: 123}]
...> )
35 35
""" iex> get_grouped_used_counts(
@spec get_used_count_for_types([Type.t()], User.t()) :: ...> %User{id: 123},
%{optional(Type.id()) => non_neg_integer()} ...> group_by: :pack_id,
def get_used_count_for_types(types, %User{id: user_id}) do ...> packs: [%Pack{id: 456, user_id: 123}]
type_ids = ...> )
types 22
|> Enum.map(fn %Type{id: type_id, user_id: ^user_id} -> type_id end)
Repo.all( """
from ag in Pack, @spec get_grouped_used_counts(User.t(), get_grouped_used_counts_options()) ::
left_join: sg in ShotRecord, %{optional(Type.id() | Pack.id()) => non_neg_integer()}
on: ag.id == sg.pack_id, def get_grouped_used_counts(%User{id: user_id}, opts) do
where: ag.type_id in ^type_ids, from(p in Pack,
where: not (sg.count |> is_nil()), as: :p,
group_by: ag.type_id, left_join: sr in ShotRecord,
select: {ag.type_id, sum(sg.count)} on: p.id == sr.pack_id,
on: p.user_id == ^user_id,
as: :sr,
where: sr.user_id == ^user_id,
where: not (sr.count |> is_nil())
) )
|> get_grouped_used_counts_group_by(Keyword.fetch!(opts, :group_by))
|> get_grouped_used_counts_types(Keyword.get(opts, :types))
|> get_grouped_used_counts_packs(Keyword.get(opts, :packs))
|> Repo.all()
|> Map.new() |> Map.new()
end end
@spec get_grouped_used_counts_group_by(Queryable.t(), :type_id | :pack_id) :: Queryable.t()
defp get_grouped_used_counts_group_by(query, :type_id) do
query
|> group_by([p: p], p.type_id)
|> select([sr: sr, p: p], {p.type_id, sum(sr.count)})
end
defp get_grouped_used_counts_group_by(query, :pack_id) do
query
|> group_by([sr: sr], sr.pack_id)
|> select([sr: sr], {sr.pack_id, sum(sr.count)})
end
@spec get_grouped_used_counts_types(Queryable.t(), [Type.t()] | nil) :: Queryable.t()
defp get_grouped_used_counts_types(query, types) when types |> is_list() do
type_ids = types |> Enum.map(fn %Type{id: type_id} -> type_id end)
query |> where([p: p], p.type_id in ^type_ids)
end
defp get_grouped_used_counts_types(query, _nil), do: query
@spec get_grouped_used_counts_packs(Queryable.t(), [Pack.t()] | nil) :: Queryable.t()
defp get_grouped_used_counts_packs(query, packs) when packs |> is_list() do
pack_ids = packs |> Enum.map(fn %Pack{id: pack_id} -> pack_id end)
query |> where([p: p], p.id in ^pack_ids)
end
defp get_grouped_used_counts_packs(query, _nil), do: query
end end

View File

@ -3,11 +3,8 @@ defmodule Cannery.ActivityLog.ShotRecord do
A shot record records a group of ammo shot during a range trip A shot record records a group of ammo shot during a range trip
""" """
use Ecto.Schema use Cannery, :schema
import CanneryWeb.Gettext alias Cannery.{Ammo, Ammo.Pack}
import Ecto.Changeset
alias Cannery.{Accounts.User, Ammo, Ammo.Pack}
alias Ecto.{Changeset, UUID}
@derive {Jason.Encoder, @derive {Jason.Encoder,
only: [ only: [

File diff suppressed because it is too large Load Diff

View File

@ -6,32 +6,24 @@ defmodule Cannery.Ammo.Pack do
amount paid for that ammunition, or what condition it is in amount paid for that ammunition, or what condition it is in
""" """
use Ecto.Schema use Cannery, :schema
import CanneryWeb.Gettext alias Cannery.{Ammo.Type, Containers, Containers.Container}
import Ecto.Changeset
alias Cannery.Ammo.Type
alias Cannery.{Accounts.User, Containers, Containers.Container}
alias Ecto.{Changeset, UUID}
@derive {Jason.Encoder, @derive {Jason.Encoder,
only: [ only: [
:id, :container_id,
:count, :count,
:id,
:lot_number,
:notes, :notes,
:price_paid, :price_paid,
:lot_number, :type_id
:staged,
:type_id,
:container_id
]} ]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "packs" do schema "packs" do
field :count, :integer field :count, :integer
field :lot_number, :string
field :notes, :string field :notes, :string
field :price_paid, :float field :price_paid, :float
field :staged, :boolean, default: false
field :lot_number, :string
field :purchased_on, :date field :purchased_on, :date
belongs_to :type, Type belongs_to :type, Type
@ -42,12 +34,11 @@ defmodule Cannery.Ammo.Pack do
end end
@type t :: %__MODULE__{ @type t :: %__MODULE__{
id: id(),
count: integer, count: integer,
id: id(),
lot_number: String.t() | nil,
notes: String.t() | nil, notes: String.t() | nil,
price_paid: float() | nil, price_paid: float() | nil,
staged: boolean(),
lot_number: String.t() | nil,
purchased_on: Date.t(), purchased_on: Date.t(),
type: Type.t() | nil, type: Type.t() | nil,
type_id: Type.id(), type_id: Type.id(),
@ -70,34 +61,55 @@ defmodule Cannery.Ammo.Pack do
) :: changeset() ) :: changeset()
def create_changeset( def create_changeset(
pack, pack,
%Type{id: type_id}, type,
%Container{id: container_id, user_id: user_id}, container,
%User{id: user_id}, %User{id: user_id},
attrs attrs
) )
when is_binary(type_id) and is_binary(container_id) and is_binary(user_id) do when is_binary(user_id) do
pack type_id =
|> change(type_id: type_id) case type do
|> change(user_id: user_id) %Type{id: type_id} when is_binary(type_id) ->
|> change(container_id: container_id) type_id
|> cast(attrs, [:count, :price_paid, :notes, :staged, :purchased_on, :lot_number])
|> validate_number(:count, greater_than: 0) _invalid_type ->
|> validate_number(:price_paid, greater_than_or_equal_to: 0) nil
|> validate_length(:lot_number, max: 255) end
|> validate_required([:count, :staged, :purchased_on, :type_id, :container_id, :user_id])
container_id =
case container do
%Container{id: container_id, user_id: ^user_id} when is_binary(container_id) ->
container_id
_invalid_container ->
nil
end end
@doc """
Invalid changeset, used to prompt user to select type and container
"""
def create_changeset(pack, _invalid_type, _invalid_container, _invalid_user, attrs) do
pack pack
|> cast(attrs, [:type_id, :container_id]) |> change(type_id: type_id)
|> validate_required([:type_id, :container_id]) |> change(container_id: container_id)
|> change(user_id: user_id)
|> cast(attrs, [
:count,
:lot_number,
:notes,
:price_paid,
:purchased_on
])
|> validate_required(:type_id, message: dgettext("errors", "Please select a valid type"))
|> validate_required(:container_id,
message: dgettext("errors", "Please select a valid container")
)
|> validate_number(:count, greater_than: 0) |> validate_number(:count, greater_than: 0)
|> validate_number(:price_paid, greater_than_or_equal_to: 0) |> validate_number(:price_paid, greater_than_or_equal_to: 0)
|> validate_length(:lot_number, max: 255) |> validate_length(:lot_number, max: 255)
|> add_error(:invalid, dgettext("errors", "Please select a type and container")) |> validate_required([
:container_id,
:count,
:purchased_on,
:type_id,
:user_id
])
end end
@doc false @doc false
@ -105,19 +117,22 @@ defmodule Cannery.Ammo.Pack do
def update_changeset(pack, attrs, user) do def update_changeset(pack, attrs, user) do
pack pack
|> cast(attrs, [ |> cast(attrs, [
:container_id,
:count, :count,
:price_paid,
:notes,
:staged,
:purchased_on,
:lot_number, :lot_number,
:container_id :notes,
:price_paid,
:purchased_on
]) ])
|> validate_number(:count, greater_than_or_equal_to: 0) |> validate_number(:count, greater_than_or_equal_to: 0)
|> validate_number(:price_paid, greater_than_or_equal_to: 0) |> validate_number(:price_paid, greater_than_or_equal_to: 0)
|> validate_container_id(user) |> validate_container_id(user)
|> validate_length(:lot_number, max: 255) |> validate_length(:lot_number, max: 255)
|> validate_required([:count, :staged, :purchased_on, :container_id]) |> validate_required([
:container_id,
:count,
:purchased_on
])
end end
defp validate_container_id(changeset, user) do defp validate_container_id(changeset, user) do
@ -137,7 +152,7 @@ defmodule Cannery.Ammo.Pack do
@spec range_changeset(t() | new_pack(), attrs :: map()) :: changeset() @spec range_changeset(t() | new_pack(), attrs :: map()) :: changeset()
def range_changeset(pack, attrs) do def range_changeset(pack, attrs) do
pack pack
|> cast(attrs, [:count, :staged]) |> cast(attrs, [:count])
|> validate_required([:count, :staged]) |> validate_required([:count])
end end
end end

View File

@ -5,11 +5,8 @@ defmodule Cannery.Ammo.Type do
Contains statistical information about the ammunition. Contains statistical information about the ammunition.
""" """
use Ecto.Schema use Cannery, :schema
import Ecto.Changeset
alias Cannery.Accounts.User
alias Cannery.Ammo.Pack alias Cannery.Ammo.Pack
alias Ecto.{Changeset, UUID}
@derive {Jason.Encoder, @derive {Jason.Encoder,
only: [ only: [
@ -46,8 +43,6 @@ defmodule Cannery.Ammo.Type do
:shot_charge_weight, :shot_charge_weight,
:dram_equivalent :dram_equivalent
]} ]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "types" do schema "types" do
field :name, :string field :name, :string
field :desc, :string field :desc, :string

View File

@ -3,14 +3,17 @@ defmodule Cannery.Containers do
The Containers context. The Containers context.
""" """
import CanneryWeb.Gettext use Cannery, :context
import Ecto.Query, warn: false alias Cannery.Ammo.Pack
alias Cannery.{Accounts.User, Ammo.Pack, Repo}
alias Cannery.Containers.{Container, ContainerTag, Tag} alias Cannery.Containers.{Container, ContainerTag, Tag}
alias Ecto.Changeset
@container_preloads [:tags] @container_preloads [:tags]
@type list_containers_option ::
{:search, String.t() | nil}
| {:staged, boolean() | nil}
@type list_containers_options :: [list_containers_option()]
@doc """ @doc """
Returns the list of containers. Returns the list of containers.
@ -19,30 +22,41 @@ defmodule Cannery.Containers do
iex> list_containers(%User{id: 123}) iex> list_containers(%User{id: 123})
[%Container{}, ...] [%Container{}, ...]
iex> list_containers("cool", %User{id: 123}) iex> list_containers(%User{id: 123},
...> search: "cool",
...> staged: true
...> )
[%Container{name: "my cool container"}, ...] [%Container{name: "my cool container"}, ...]
""" """
@spec list_containers(User.t()) :: [Container.t()] @spec list_containers(User.t()) :: [Container.t()]
@spec list_containers(search :: nil | String.t(), User.t()) :: [Container.t()] @spec list_containers(User.t(), list_containers_options()) :: [Container.t()]
def list_containers(search \\ nil, %User{id: user_id}) do def list_containers(%User{id: user_id}, opts \\ []) do
from(c in Container, from(c in Container,
as: :c, as: :c,
left_join: t in assoc(c, :tags), left_join: t in assoc(c, :tags),
on: c.user_id == t.user_id,
as: :t, as: :t,
where: c.user_id == ^user_id, where: c.user_id == ^user_id,
order_by: c.name,
distinct: c.id, distinct: c.id,
preload: ^@container_preloads preload: ^@container_preloads
) )
|> list_containers_search(search) |> list_containers_search(Keyword.get(opts, :search))
|> list_containers_staged(Keyword.get(opts, :staged))
|> Repo.all() |> Repo.all()
end end
defp list_containers_search(query, nil), do: query @spec list_containers_staged(Queryable.t(), staged :: boolean() | nil) :: Queryable.t()
defp list_containers_search(query, ""), do: query defp list_containers_staged(query, staged) when staged |> is_boolean(),
do: query |> where([c: c], c.staged == ^staged)
defp list_containers_search(query, search) do defp list_containers_staged(query, _nil), do: query
@spec list_containers_search(Queryable.t(), search :: String.t() | nil) :: Queryable.t()
defp list_containers_search(query, search) when search in ["", nil],
do: query |> order_by([c: c], c.name)
defp list_containers_search(query, search) when search |> is_binary() do
trimmed_search = String.trim(search) trimmed_search = String.trim(search)
query query
@ -203,9 +217,9 @@ defmodule Cannery.Containers do
{:ok, Container.t()} | {:error, Container.changeset()} {:ok, Container.t()} | {:error, Container.changeset()}
def delete_container(%Container{user_id: user_id} = container, %User{id: user_id}) do def delete_container(%Container{user_id: user_id} = container, %User{id: user_id}) do
Repo.one( Repo.one(
from ag in Pack, from p in Pack,
where: ag.container_id == ^container.id, where: p.container_id == ^container.id,
select: count(ag.id) select: count(p.id)
) )
|> case do |> case do
0 -> 0 ->
@ -289,6 +303,9 @@ defmodule Cannery.Containers do
# Container Tags # Container Tags
@type list_tags_option :: {:search, String.t() | nil}
@type list_tags_options :: [list_tags_option()]
@doc """ @doc """
Returns the list of tags. Returns the list of tags.
@ -297,38 +314,42 @@ defmodule Cannery.Containers do
iex> list_tags(%User{id: 123}) iex> list_tags(%User{id: 123})
[%Tag{}, ...] [%Tag{}, ...]
iex> list_tags("cool", %User{id: 123}) iex> list_tags(%User{id: 123}, search: "cool")
[%Tag{name: "my cool tag"}, ...] [%Tag{name: "my cool tag"}, ...]
""" """
@spec list_tags(User.t()) :: [Tag.t()] @spec list_tags(User.t()) :: [Tag.t()]
@spec list_tags(search :: nil | String.t(), User.t()) :: [Tag.t()] @spec list_tags(User.t(), list_tags_options()) :: [Tag.t()]
def list_tags(search \\ nil, user) def list_tags(%User{id: user_id}, opts \\ []) do
from(t in Tag, as: :t, where: t.user_id == ^user_id)
|> list_tags_search(Keyword.get(opts, :search))
|> Repo.all()
end
def list_tags(search, %{id: user_id}) when search |> is_nil() or search == "", @spec list_tags_search(Queryable.t(), search :: String.t() | nil) :: Queryable.t()
do: Repo.all(from t in Tag, where: t.user_id == ^user_id, order_by: t.name) defp list_tags_search(query, search) when search in ["", nil],
do: query |> order_by([t: t], t.name)
def list_tags(search, %{id: user_id}) when search |> is_binary() do defp list_tags_search(query, search) when search |> is_binary() do
trimmed_search = String.trim(search) trimmed_search = String.trim(search)
Repo.all( query
from t in Tag, |> where(
where: t.user_id == ^user_id, [t: t],
where:
fragment( fragment(
"? @@ websearch_to_tsquery('english', ?)", "? @@ websearch_to_tsquery('english', ?)",
t.search, t.search,
^trimmed_search ^trimmed_search
), )
order_by: { )
|> order_by([t: t], {
:desc, :desc,
fragment( fragment(
"ts_rank_cd(?, websearch_to_tsquery('english', ?), 4)", "ts_rank_cd(?, websearch_to_tsquery('english', ?), 4)",
t.search, t.search,
^trimmed_search ^trimmed_search
) )
} })
)
end end
@doc """ @doc """

View File

@ -3,26 +3,24 @@ defmodule Cannery.Containers.Container do
A container that holds ammunition and belongs to a user. A container that holds ammunition and belongs to a user.
""" """
use Ecto.Schema use Cannery, :schema
import Ecto.Changeset alias Cannery.{Containers.ContainerTag, Containers.Tag}
alias Ecto.{Changeset, UUID}
alias Cannery.{Accounts.User, Containers.ContainerTag, Containers.Tag}
@derive {Jason.Encoder, @derive {Jason.Encoder,
only: [ only: [
:id,
:name,
:desc, :desc,
:id,
:location, :location,
:type, :name,
:tags :staged,
:tags,
:type
]} ]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "containers" do schema "containers" do
field :name, :string
field :desc, :string field :desc, :string
field :location, :string field :location, :string
field :name, :string
field :staged, :boolean, default: false
field :type, :string field :type, :string
field :user_id, :binary_id field :user_id, :binary_id
@ -33,10 +31,11 @@ defmodule Cannery.Containers.Container do
end end
@type t :: %__MODULE__{ @type t :: %__MODULE__{
id: id(),
name: String.t(),
desc: String.t(), desc: String.t(),
id: id(),
location: String.t(), location: String.t(),
name: String.t(),
staged: boolean(),
type: String.t(), type: String.t(),
user_id: User.id(), user_id: User.id(),
tags: [Tag.t()] | nil, tags: [Tag.t()] | nil,
@ -52,19 +51,40 @@ defmodule Cannery.Containers.Container do
def create_changeset(container, %User{id: user_id}, attrs) do def create_changeset(container, %User{id: user_id}, attrs) do
container container
|> change(user_id: user_id) |> change(user_id: user_id)
|> cast(attrs, [:name, :desc, :type, :location]) |> cast(attrs, [
:desc,
:location,
:name,
:staged,
:type
])
|> validate_length(:name, max: 255) |> validate_length(:name, max: 255)
|> validate_length(:type, max: 255) |> validate_length(:type, max: 255)
|> validate_required([:name, :type, :user_id]) |> validate_required([
:name,
:staged,
:type,
:user_id
])
end end
@doc false @doc false
@spec update_changeset(t() | new_container(), attrs :: map()) :: changeset() @spec update_changeset(t() | new_container(), attrs :: map()) :: changeset()
def update_changeset(container, attrs) do def update_changeset(container, attrs) do
container container
|> cast(attrs, [:name, :desc, :type, :location]) |> cast(attrs, [
:desc,
:location,
:name,
:staged,
:type
])
|> validate_length(:name, max: 255) |> validate_length(:name, max: 255)
|> validate_length(:type, max: 255) |> validate_length(:type, max: 255)
|> validate_required([:name, :type]) |> validate_required([
:name,
:staged,
:type
])
end end
end end

View File

@ -4,13 +4,9 @@ defmodule Cannery.Containers.ContainerTag do
Cannery.Containers.Tag. Cannery.Containers.Tag.
""" """
use Ecto.Schema use Cannery, :schema
import Ecto.Changeset
alias Cannery.Containers.{Container, Tag} alias Cannery.Containers.{Container, Tag}
alias Ecto.{Changeset, UUID}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "container_tags" do schema "container_tags" do
belongs_to :container, Container belongs_to :container, Container
belongs_to :tag, Tag belongs_to :tag, Tag

View File

@ -4,10 +4,7 @@ defmodule Cannery.Containers.Tag do
text and bg colors. text and bg colors.
""" """
use Ecto.Schema use Cannery, :schema
import Ecto.Changeset
alias Cannery.Accounts.User
alias Ecto.{Changeset, UUID}
@derive {Jason.Encoder, @derive {Jason.Encoder,
only: [ only: [
@ -16,8 +13,6 @@ defmodule Cannery.Containers.Tag do
:bg_color, :bg_color,
:text_color :text_color
]} ]}
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "tags" do schema "tags" do
field :name, :string field :name, :string
field :bg_color, :string field :bg_color, :string

View File

@ -7,8 +7,8 @@ defmodule Cannery.Email do
`lib/cannery_web/components/layouts/email_text.txt.eex` for text emails. `lib/cannery_web/components/layouts/email_text.txt.eex` for text emails.
""" """
use Gettext, backend: CanneryWeb.Gettext
import Swoosh.Email import Swoosh.Email
import CanneryWeb.Gettext
import Phoenix.Template import Phoenix.Template
alias Cannery.Accounts.User alias Cannery.Accounts.User
alias CanneryWeb.{EmailHTML, Layouts} alias CanneryWeb.{EmailHTML, Layouts}

View File

@ -14,7 +14,7 @@ defmodule Cannery.Logger do
|> Map.put(:stacktrace, Exception.format_stacktrace(stacktrace)) |> Map.put(:stacktrace, Exception.format_stacktrace(stacktrace))
|> pretty_encode() |> pretty_encode()
Logger.error("#{meta.reason}: #{data}") Logger.error("Oban exception: #{data}")
end end
def handle_event([:oban, :job, :start], measure, meta, _config) do def handle_event([:oban, :job, :start], measure, meta, _config) do

View File

@ -42,9 +42,10 @@ defmodule CanneryWeb do
formats: [:html, :json], formats: [:html, :json],
layouts: [html: CanneryWeb.Layouts] layouts: [html: CanneryWeb.Layouts]
use Gettext, backend: CanneryWeb.Gettext
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse # credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import Plug.Conn import Plug.Conn
import CanneryWeb.Gettext
unquote(verified_routes()) unquote(verified_routes())
end end
@ -69,6 +70,7 @@ defmodule CanneryWeb do
def html do def html do
quote do quote do
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
use Phoenix.Component use Phoenix.Component
# Import convenience functions from controllers # Import convenience functions from controllers
@ -82,12 +84,10 @@ defmodule CanneryWeb do
defp html_helpers do defp html_helpers do
quote do quote do
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse use PhoenixHTMLHelpers
use Phoenix.HTML use Gettext, backend: CanneryWeb.Gettext
import Phoenix.{Component, HTML, HTML.Form}
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse import CanneryWeb.{ErrorHelpers, CoreComponents, HTMLHelpers}
import Phoenix.Component
import CanneryWeb.{ErrorHelpers, Gettext, CoreComponents, HTMLHelpers}
# Shortcut for generating JS commands # Shortcut for generating JS commands
alias Phoenix.LiveView.JS alias Phoenix.LiveView.JS

View File

@ -33,7 +33,9 @@ defmodule CanneryWeb.Components.AddShotRecordComponent do
) do ) do
params = shot_record_params |> process_params(pack) params = shot_record_params |> process_params(pack)
changeset = %ShotRecord{} |> ShotRecord.create_changeset(current_user, pack, params) changeset =
%ShotRecord{}
|> ShotRecord.create_changeset(current_user, pack, params)
changeset = changeset =
case changeset |> Changeset.apply_action(:validate) do case changeset |> Changeset.apply_action(:validate) do

View File

@ -13,7 +13,7 @@
phx-submit="save" phx-submit="save"
> >
<div <div
:if={@changeset.action && not @changeset.valid?()} :if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center" class="invalid-feedback col-span-3 text-center"
> >
<%= changeset_errors(@changeset) %> <%= changeset_errors(@changeset) %>
@ -37,11 +37,12 @@
<%= label(f, :notes, gettext("Notes"), class: "title text-lg text-primary-600") %> <%= label(f, :notes, gettext("Notes"), class: "title text-lg text-primary-600") %>
<%= textarea(f, :notes, <%= textarea(f, :notes,
id: "add-shot-record-form-notes",
class: "input input-primary col-span-2", class: "input input-primary col-span-2",
id: "add-shot-record-form-notes",
maxlength: 255, maxlength: 255,
placeholder: gettext("Really great weather"), phx_debounce: 300,
phx_update: "ignore" phx_update: "ignore",
placeholder: gettext("Really great weather")
) %> ) %>
<%= error_tag(f, :notes, "col-span-3") %> <%= error_tag(f, :notes, "col-span-3") %>

View File

@ -4,6 +4,7 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
""" """
use CanneryWeb, :live_component use CanneryWeb, :live_component
alias Cannery.{Accounts.User, Ammo, Containers.Container} alias Cannery.{Accounts.User, Ammo, Containers.Container}
alias CanneryWeb.Components.TableComponent
alias Ecto.UUID alias Ecto.UUID
alias Phoenix.LiveView.{Rendered, Socket} alias Phoenix.LiveView.{Rendered, Socket}
@ -13,6 +14,7 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
required(:id) => UUID.t(), required(:id) => UUID.t(),
required(:current_user) => User.t(), required(:current_user) => User.t(),
optional(:containers) => [Container.t()], optional(:containers) => [Container.t()],
optional(:range) => Rendered.t(),
optional(:tag_actions) => Rendered.t(), optional(:tag_actions) => Rendered.t(),
optional(:actions) => Rendered.t(), optional(:actions) => Rendered.t(),
optional(any()) => any() optional(any()) => any()
@ -23,6 +25,7 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
socket = socket =
socket socket
|> assign(assigns) |> assign(assigns)
|> assign_new(:range, fn -> [] end)
|> assign_new(:tag_actions, fn -> [] end) |> assign_new(:tag_actions, fn -> [] end)
|> assign_new(:actions, fn -> [] end) |> assign_new(:actions, fn -> [] end)
|> display_containers() |> display_containers()
@ -35,6 +38,7 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
assigns: %{ assigns: %{
containers: containers, containers: containers,
current_user: current_user, current_user: current_user,
range: range,
tag_actions: tag_actions, tag_actions: tag_actions,
actions: actions actions: actions
} }
@ -62,17 +66,34 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
end) end)
|> Enum.concat([ |> Enum.concat([
%{label: gettext("Packs"), key: :packs, type: :integer}, %{label: gettext("Packs"), key: :packs, type: :integer},
%{label: gettext("Rounds"), key: :rounds, type: :integer}, %{label: gettext("Rounds"), key: :rounds, type: :integer}
])
|> Enum.concat(
[
%{label: gettext("Tags"), key: :tags, type: :tags}, %{label: gettext("Tags"), key: :tags, type: :tags},
%{label: gettext("Actions"), key: :actions, sortable: false, type: :actions} %{label: gettext("Actions"), key: :actions, sortable: false, type: :actions}
]) ]
|> TableComponent.maybe_compose_columns(
%{label: gettext("Range"), key: :range},
range != []
)
)
extra_data = %{ extra_data = %{
current_user: current_user, current_user: current_user,
range: range,
tag_actions: tag_actions, tag_actions: tag_actions,
actions: actions, actions: actions,
pack_count: Ammo.get_packs_count_for_containers(containers, current_user), pack_count:
round_count: Ammo.get_round_count_for_containers(containers, current_user) Ammo.get_grouped_packs_count(current_user,
containers: containers,
group_by: :container_id
),
round_count:
Ammo.get_grouped_round_count(current_user,
containers: containers,
group_by: :container_id
)
} }
rows = rows =
@ -128,6 +149,15 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
round_count |> Map.get(container_id, 0) round_count |> Map.get(container_id, 0)
end end
defp get_value_for_key(:range, %{staged: staged} = container, %{range: range}) do
assigns = %{range: range, container: container}
{staged,
~H"""
<%= render_slot(@range, @container) %>
"""}
end
defp get_value_for_key(:tags, container, %{tag_actions: tag_actions}) do defp get_value_for_key(:tags, container, %{tag_actions: tag_actions}) do
assigns = %{tag_actions: tag_actions, container: container} assigns = %{tag_actions: tag_actions, container: container}

View File

@ -4,7 +4,8 @@ defmodule CanneryWeb.CoreComponents do
""" """
use Phoenix.Component use Phoenix.Component
use CanneryWeb, :verified_routes use CanneryWeb, :verified_routes
import CanneryWeb.{Gettext, HTMLHelpers} use Gettext, backend: CanneryWeb.Gettext
import CanneryWeb.HTMLHelpers
alias Cannery.{Accounts, Accounts.Invite, Accounts.User} alias Cannery.{Accounts, Accounts.Invite, Accounts.User}
alias Cannery.{Ammo, Ammo.Pack} alias Cannery.{Ammo, Ammo.Pack}
alias Cannery.{Containers.Container, Containers.Tag} alias Cannery.{Containers.Container, Containers.Tag}
@ -140,6 +141,18 @@ defmodule CanneryWeb.CoreComponents do
""" """
def datetime(assigns) def datetime(assigns)
attr :name, :string, required: true
attr :start_date, :string,
default: Date.utc_today() |> Date.shift(year: -1) |> Date.to_iso8601()
attr :end_date, :string, default: Date.utc_today() |> Date.to_iso8601()
@doc """
Phoenix.Component for an element that generates date fields for a range
"""
def date_range(assigns)
@spec cast_datetime(NaiveDateTime.t() | nil) :: String.t() @spec cast_datetime(NaiveDateTime.t() | nil) :: String.t()
defp cast_datetime(%NaiveDateTime{} = datetime) do defp cast_datetime(%NaiveDateTime{} = datetime) do
datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended) datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended)

View File

@ -27,15 +27,15 @@
<%= @container.location %> <%= @container.location %>
</span> </span>
<%= if @container |> Ammo.get_packs_count_for_container!(@current_user) != 0 do %> <%= if Ammo.get_packs_count(@current_user, container_id: @container.id) != 0 do %>
<span class="rounded-lg title text-lg"> <span class="rounded-lg title text-lg">
<%= gettext("Packs:") %> <%= gettext("Packs:") %>
<%= @container |> Ammo.get_packs_count_for_container!(@current_user) %> <%= Ammo.get_packs_count(@current_user, container_id: @container.id) %>
</span> </span>
<span class="rounded-lg title text-lg"> <span class="rounded-lg title text-lg">
<%= gettext("Rounds:") %> <%= gettext("Rounds:") %>
<%= @container |> Ammo.get_round_count_for_container!(@current_user) %> <%= Ammo.get_round_count(@current_user, container_id: @container.id) %>
</span> </span>
<% end %> <% end %>

View File

@ -0,0 +1,15 @@
<div class="flex items-center mx-4 my-2 space-x-1">
<input
class="w-36 text-center input input-primary"
name={"#{@name}_start"}
type="date"
value={@start_date}
/>
<span>—</span>
<input
class="w-36 text-center input input-primary"
name={"#{@name}_end"}
type="date"
value={@end_date}
/>
</div>

View File

@ -48,7 +48,7 @@
<%= gettext("Range") %> <%= gettext("Range") %>
</.link> </.link>
</li> </li>
<li :if={@current_user |> Accounts.is_already_admin?()} class="mx-2 my-1"> <li :if={@current_user |> Accounts.already_admin?()} class="mx-2 my-1">
<.link navigate={~p"/invites"} class="text-white hover:underline"> <.link navigate={~p"/invites"} class="text-white hover:underline">
<%= gettext("Invites") %> <%= gettext("Invites") %>
</.link> </.link>
@ -70,7 +70,7 @@
</li> </li>
<li <li
:if={ :if={
@current_user |> Accounts.is_already_admin?() and @current_user |> Accounts.already_admin?() and
function_exported?(Routes, :live_dashboard_path, 2) function_exported?(Routes, :live_dashboard_path, 2)
} }
class="mx-2 my-1" class="mx-2 my-1"

View File

@ -1,18 +1,45 @@
<main role="main" class="min-h-full min-w-full"> <main class="pb-8 min-w-full">
<header> <header>
<.topbar current_user={assigns[:current_user]} /> <.topbar current_user={assigns[:current_user]} />
<div class="mx-8 my-2 flex flex-col space-y-4 text-center"> <div class="mx-8 my-2 flex flex-col space-y-4 text-center">
<p :if={@flash["info"]} class="alert alert-info" role="alert"> <p
<%= @flash["info"] %> :if={@flash && @flash |> Map.has_key?("info")}
class="alert alert-info"
role="alert"
phx-click="lv:clear-flash"
phx-value-key="info"
>
<%= Phoenix.Flash.get(@flash, :info) %>
</p> </p>
<p :if={@flash["error"]} class="alert alert-danger" role="alert">
<%= @flash["error"] %> <p
:if={@flash && @flash |> Map.has_key?("error")}
class="alert alert-danger"
role="alert"
phx-click="lv:clear-flash"
phx-value-key="error"
>
<%= Phoenix.Flash.get(@flash, :error) %>
</p> </p>
</div> </div>
</header> </header>
<div class="mx-4 sm:mx-8 md:mx-16"> <div class="mx-4 sm:mx-8 md:mx-16 flex flex-col justify-center items-stretch">
<%= @inner_content %> <%= @inner_content %>
</div> </div>
</main> </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-200 shadow-lg rounded-lg bg-white
flex justify-center items-center space-x-4
transition-opacity ease-in-out duration-500 delay-[2000ms]"
>
<i class="fas fa-fade text-md fa-satellite-dish"></i>
<h1 class="title text-md title-primary-500">
<%= gettext("Reconnecting...") %>
</h1>
</div>

View File

@ -0,0 +1 @@
<%= @inner_block %>

View File

@ -1,45 +0,0 @@
<main class="pb-8 min-w-full">
<header>
<.topbar current_user={assigns[:current_user]} />
<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"
>
<%= live_flash(@flash, "info") %>
</p>
<p
:if={@flash && @flash |> Map.has_key?("error")}
class="alert alert-danger"
role="alert"
phx-click="lv:clear-flash"
phx-value-key="error"
>
<%= live_flash(@flash, "error") %>
</p>
</div>
</header>
<div class="mx-4 sm:mx-8 md:mx-16 flex flex-col justify-center items-stretch">
<%= @inner_content %>
</div>
</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-200 shadow-lg rounded-lg bg-white
flex justify-center items-center space-x-4
transition-opacity ease-in-out duration-500 delay-[2000ms]"
>
<i class="fas fa-fade text-md fa-satellite-dish"></i>
<h1 class="title text-md title-primary-500">
<%= gettext("Reconnecting...") %>
</h1>
</div>

View File

@ -89,7 +89,7 @@ defmodule CanneryWeb.Components.MovePackComponent do
<% else %> <% else %>
<.live_component <.live_component
module={CanneryWeb.Components.TableComponent} module={CanneryWeb.Components.TableComponent}
id="move_pack_table" id="move-pack-table"
columns={@columns} columns={@columns}
rows={@rows} rows={@rows}
/> />

View File

@ -141,7 +141,12 @@ defmodule CanneryWeb.Components.PackTableComponent do
def render(assigns) do def render(assigns) do
~H""" ~H"""
<div id={@id} class="w-full"> <div id={@id} class="w-full">
<.live_component module={TableComponent} id={"table-#{@id}"} columns={@columns} rows={@rows} /> <.live_component
module={TableComponent}
id={"pack-table-#{@id}"}
columns={@columns}
rows={@rows}
/>
</div> </div>
""" """
end end
@ -196,13 +201,12 @@ defmodule CanneryWeb.Components.PackTableComponent do
"""} """}
end end
defp get_value_for_key(:range, %{staged: staged} = pack, %{range: range}) do defp get_value_for_key(:range, pack, %{range: range}) do
assigns = %{range: range, pack: pack} assigns = %{range: range, pack: pack}
{staged,
~H""" ~H"""
<%= render_slot(@range, @pack) %> <%= render_slot(@range, @pack) %>
"""} """
end end
defp get_value_for_key( defp get_value_for_key(

View File

@ -74,7 +74,7 @@ defmodule CanneryWeb.Components.ShotRecordTableComponent do
<div id={@id} class="w-full"> <div id={@id} class="w-full">
<.live_component <.live_component
module={CanneryWeb.Components.TableComponent} module={CanneryWeb.Components.TableComponent}
id={"table-#{@id}"} id={"shot-record-table-#{@id}"}
columns={@columns} columns={@columns}
rows={@rows} rows={@rows}
initial_key={:date} initial_key={:date}

View File

@ -20,6 +20,7 @@ defmodule CanneryWeb.Components.TableComponent do
""" """
use CanneryWeb, :live_component use CanneryWeb, :live_component
alias Cannery.{ComparableDate, ComparableDateTime}
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
require Integer require Integer
@ -110,7 +111,7 @@ defmodule CanneryWeb.Components.TableComponent do
end end
defp sort_by_custom_sort_value_or_value(rows, key, sort_mode, type) defp sort_by_custom_sort_value_or_value(rows, key, sort_mode, type)
when type in [Date, DateTime] do when type in [ComparableDate, ComparableDateTime, Date, DateTime] do
rows rows
|> Enum.sort_by( |> Enum.sort_by(
fn row -> fn row ->

View File

@ -151,17 +151,25 @@ defmodule CanneryWeb.Components.TypeTableComponent do
) )
|> TableComponent.maybe_compose_columns(%{label: gettext("Name"), key: :name, type: :name}) |> TableComponent.maybe_compose_columns(%{label: gettext("Name"), key: :name, type: :name})
round_counts = types |> Ammo.get_round_count_for_types(current_user) round_counts = Ammo.get_grouped_round_count(current_user, types: types, group_by: :type_id)
packs_count = types |> Ammo.get_packs_count_for_types(current_user) packs_count = Ammo.get_grouped_packs_count(current_user, types: types, group_by: :type_id)
average_costs = types |> Ammo.get_average_cost_for_types(current_user) average_costs = Ammo.get_average_costs(types, current_user)
[used_counts, historical_round_counts, historical_pack_counts, used_pack_counts] = [used_counts, historical_round_counts, historical_pack_counts, used_pack_counts] =
if show_used do if show_used do
[ [
types |> ActivityLog.get_used_count_for_types(current_user), ActivityLog.get_grouped_used_counts(current_user, types: types, group_by: :type_id),
types |> Ammo.get_historical_count_for_types(current_user), Ammo.get_historical_counts(types, current_user),
types |> Ammo.get_packs_count_for_types(current_user, true), Ammo.get_grouped_packs_count(current_user,
types |> Ammo.get_used_packs_count_for_types(current_user) types: types,
group_by: :type_id,
show_used: true
),
Ammo.get_grouped_packs_count(current_user,
types: types,
group_by: :type_id,
show_used: :only_used
)
] ]
else else
[nil, nil, nil, nil] [nil, nil, nil, nil]
@ -192,7 +200,12 @@ defmodule CanneryWeb.Components.TypeTableComponent do
def render(assigns) do def render(assigns) do
~H""" ~H"""
<div id={@id} class="w-full"> <div id={@id} class="w-full">
<.live_component module={TableComponent} id={"table-#{@id}"} columns={@columns} rows={@rows} /> <.live_component
module={TableComponent}
id={"type-table-#{@id}"}
columns={@columns}
rows={@rows}
/>
</div> </div>
""" """
end end

View File

@ -1,5 +1,5 @@
defmodule CanneryWeb.ErrorJSON do defmodule CanneryWeb.ErrorJSON do
import CanneryWeb.Gettext use Gettext, backend: CanneryWeb.Gettext
def render(template, _assigns) do def render(template, _assigns) do
error_string = error_string =

View File

@ -3,14 +3,22 @@ defmodule CanneryWeb.ExportController do
alias Cannery.{ActivityLog, Ammo, Containers} alias Cannery.{ActivityLog, Ammo, Containers}
def export(%{assigns: %{current_user: current_user}} = conn, %{"mode" => "json"}) do def export(%{assigns: %{current_user: current_user}} = conn, %{"mode" => "json"}) do
types = Ammo.list_types(current_user, :all) types = Ammo.list_types(current_user)
used_counts = types |> ActivityLog.get_used_count_for_types(current_user)
round_counts = types |> Ammo.get_round_count_for_types(current_user)
pack_counts = types |> Ammo.get_packs_count_for_types(current_user)
total_pack_counts = types |> Ammo.get_packs_count_for_types(current_user, true) used_counts =
ActivityLog.get_grouped_used_counts(current_user, types: types, group_by: :type_id)
average_costs = types |> Ammo.get_average_cost_for_types(current_user) round_counts = Ammo.get_grouped_round_count(current_user, types: types, group_by: :type_id)
pack_counts = Ammo.get_grouped_packs_count(current_user, types: types, group_by: :type_id)
total_pack_counts =
Ammo.get_grouped_packs_count(current_user,
types: types,
group_by: :type_id,
show_used: true
)
average_costs = Ammo.get_average_costs(types, current_user)
types = types =
types types
@ -27,8 +35,11 @@ defmodule CanneryWeb.ExportController do
}) })
end) end)
packs = Ammo.list_packs(nil, :all, current_user, true) packs = Ammo.list_packs(current_user, show_used: true)
used_counts = packs |> ActivityLog.get_used_counts(current_user)
used_counts =
ActivityLog.get_grouped_used_counts(current_user, packs: packs, group_by: :pack_id)
original_counts = packs |> Ammo.get_original_counts(current_user) original_counts = packs |> Ammo.get_original_counts(current_user)
cprs = packs |> Ammo.get_cprs(current_user) cprs = packs |> Ammo.get_cprs(current_user)
percentages_remaining = packs |> Ammo.get_percentages_remaining(current_user) percentages_remaining = packs |> Ammo.get_percentages_remaining(current_user)
@ -47,20 +58,17 @@ defmodule CanneryWeb.ExportController do
}) })
end) end)
shot_records = ActivityLog.list_shot_records(:all, current_user) shot_records = ActivityLog.list_shot_records(current_user)
containers = containers =
Containers.list_containers(current_user) Containers.list_containers(current_user)
|> Enum.map(fn container -> |> Enum.map(fn container ->
pack_count = container |> Ammo.get_packs_count_for_container!(current_user)
round_count = container |> Ammo.get_round_count_for_container!(current_user)
container container
|> Jason.encode!() |> Jason.encode!()
|> Jason.decode!() |> Jason.decode!()
|> Map.merge(%{ |> Map.merge(%{
"pack_count" => pack_count, "pack_count" => Ammo.get_packs_count(current_user, container_id: container.id),
"round_count" => round_count "round_count" => Ammo.get_round_count(current_user, container_id: container.id)
}) })
end) end)

View File

@ -4,9 +4,9 @@ defmodule CanneryWeb.UserAuth do
""" """
use CanneryWeb, :verified_routes use CanneryWeb, :verified_routes
use Gettext, backend: CanneryWeb.Gettext
import Plug.Conn import Plug.Conn
import Phoenix.Controller import Phoenix.Controller
import CanneryWeb.Gettext
alias Cannery.{Accounts, Accounts.User} alias Cannery.{Accounts, Accounts.User}
# Make the remember me cookie valid for 60 days. # Make the remember me cookie valid for 60 days.

View File

@ -1,7 +1,5 @@
defmodule CanneryWeb.UserConfirmationController do defmodule CanneryWeb.UserConfirmationController do
use CanneryWeb, :controller use CanneryWeb, :controller
import CanneryWeb.Gettext
alias Cannery.Accounts alias Cannery.Accounts
def new(conn, _params) do def new(conn, _params) do

View File

@ -1,6 +1,5 @@
defmodule CanneryWeb.UserRegistrationController do defmodule CanneryWeb.UserRegistrationController do
use CanneryWeb, :controller use CanneryWeb, :controller
import CanneryWeb.Gettext
alias Cannery.{Accounts, Accounts.Invites} alias Cannery.{Accounts, Accounts.Invites}
alias Ecto.Changeset alias Ecto.Changeset
@ -71,7 +70,7 @@ defmodule CanneryWeb.UserRegistrationController do
|> redirect(to: ~p"/") |> redirect(to: ~p"/")
{:error, %Changeset{} = changeset} -> {:error, %Changeset{} = changeset} ->
conn |> render("new.html", changeset: changeset, invite_token: invite_token) conn |> render(:new, changeset: changeset, invite_token: invite_token)
end end
end end
end end

View File

@ -9,7 +9,7 @@
action={~p"/users/register"} action={~p"/users/register"}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" 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"> <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.") %> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p> </p>
@ -29,7 +29,12 @@
<%= select( <%= select(
f, f,
:locale, :locale,
[{gettext("English"), "en_US"}], [
{"English", "en_US"},
{"Deutsch", "de"},
{"Français", "fr"},
{"Español", "es"}
],
class: "input input-primary col-span-2" class: "input input-primary col-span-2"
) %> ) %>
<%= error_tag(f, :locale) %> <%= error_tag(f, :locale) %>

View File

@ -40,7 +40,7 @@ defmodule CanneryWeb.UserResetPasswordController do
# leaked token giving the user access to the account. # leaked token giving the user access to the account.
def update(conn, %{"user" => user_params}) do def update(conn, %{"user" => user_params}) do
case Accounts.reset_user_password(conn.assigns.user, user_params) do case Accounts.reset_user_password(conn.assigns.user, user_params) do
{:ok, _} -> {:ok, _socket} ->
conn conn
|> put_flash(:info, dgettext("prompts", "Password reset successfully.")) |> put_flash(:info, dgettext("prompts", "Password reset successfully."))
|> redirect(to: ~p"/users/log_in") |> redirect(to: ~p"/users/log_in")

View File

@ -9,7 +9,7 @@
action={~p"/users/reset_password/#{@token}"} action={~p"/users/reset_password/#{@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" 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"> <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.") %> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p> </p>

View File

@ -15,10 +15,18 @@
</p> </p>
<%= label(f, :email, gettext("Email"), class: "title text-lg text-primary-600") %> <%= label(f, :email, gettext("Email"), class: "title text-lg text-primary-600") %>
<%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %> <%= email_input(f, :email,
autocomplete: :email,
class: "input input-primary col-span-2",
required: true
) %>
<%= label(f, :password, gettext("Password"), class: "title text-lg text-primary-600") %> <%= label(f, :password, gettext("Password"), class: "title text-lg text-primary-600") %>
<%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %> <%= password_input(f, :password,
autocomplete: "current-password",
class: "input input-primary col-span-2",
required: true
) %>
<%= label(f, :remember_me, gettext("Keep me logged in for 60 days"), <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
class: "title text-lg text-primary-600" class: "title text-lg text-primary-600"

View File

@ -1,6 +1,5 @@
defmodule CanneryWeb.UserSettingsController do defmodule CanneryWeb.UserSettingsController do
use CanneryWeb, :controller use CanneryWeb, :controller
import CanneryWeb.Gettext
alias Cannery.Accounts alias Cannery.Accounts
alias CanneryWeb.UserAuth alias CanneryWeb.UserAuth

View File

@ -16,7 +16,7 @@
</h3> </h3>
<div <div
:if={@email_changeset.action && not @email_changeset.valid?()} :if={@email_changeset.action && not @email_changeset.valid?}
class="alert alert-danger col-span-3" class="alert alert-danger col-span-3"
> >
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
@ -58,7 +58,7 @@
</h3> </h3>
<div <div
:if={@password_changeset.action && not @password_changeset.valid?()} :if={@password_changeset.action && not @password_changeset.valid?}
class="alert alert-danger col-span-3" class="alert alert-danger col-span-3"
> >
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
@ -112,7 +112,7 @@
) %> ) %>
<div <div
:if={@locale_changeset.action && not @locale_changeset.valid?()} :if={@locale_changeset.action && not @locale_changeset.valid?}
class="alert alert-danger col-span-3" class="alert alert-danger col-span-3"
> >
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
@ -124,12 +124,12 @@
f, f,
:locale, :locale,
[ [
{gettext("English"), "en_US"}, {"English", "en_US"},
{gettext("German"), "de"}, {"Deutsch", "de"},
{gettext("French"), "fr"}, {"Français", "fr"},
{gettext("Spanish"), "es"} {"Español", "es"}
], ],
class: "mx-2 my-1 min-w-md input input-primary col-span-3" class: "my-1 min-w-md input input-primary col-span-3"
) %> ) %>
<%= error_tag(f, :locale, "col-span-3") %> <%= error_tag(f, :locale, "col-span-3") %>

View File

@ -3,8 +3,8 @@ defmodule CanneryWeb.ErrorHelpers do
Conveniences for translating and building error messages. Conveniences for translating and building error messages.
""" """
use Phoenix.HTML use PhoenixHTMLHelpers
import Phoenix.Component import Phoenix.{Component, HTML.Form}
alias Ecto.Changeset alias Ecto.Changeset
alias Phoenix.{HTML.Form, LiveView.Rendered} alias Phoenix.{HTML.Form, LiveView.Rendered}
@ -65,7 +65,7 @@ defmodule CanneryWeb.ErrorHelpers do
changeset changeset
|> changeset_error_map() |> changeset_error_map()
|> Enum.map_join(". ", fn {key, errors} -> |> Enum.map_join(". ", fn {key, errors} ->
"#{key |> humanize()}: #{errors |> Enum.join(", ")}" "#{key |> Phoenix.Naming.humanize()}: #{errors |> Enum.join(", ")}"
end) end)
end end

View File

@ -5,7 +5,7 @@ defmodule CanneryWeb.Gettext do
By using [Gettext](https://hexdocs.pm/gettext), By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example: your module gains a set of macros for translations, for example:
import CanneryWeb.Gettext use Gettext, backend: CanneryWeb.Gettext
# Simple translation # Simple translation
gettext("Here is the string to translate") gettext("Here is the string to translate")
@ -20,5 +20,5 @@ defmodule CanneryWeb.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
""" """
use Gettext, otp_app: :cannery use Gettext.Backend, otp_app: :cannery
end end

View File

@ -44,7 +44,9 @@
phx-submit="save" phx-submit="save"
> >
<%= select(f, :tag_id, tag_options(@tags, @container), <%= select(f, :tag_id, tag_options(@tags, @container),
class: "text-center col-span-2 input input-primary" class: "text-center col-span-2 input input-primary",
id: "#{@id}-tag-select",
phx_hook: "SlimSelect"
) %> ) %>
<%= error_tag(f, :tag_id, "col-span-3 text-center") %> <%= error_tag(f, :tag_id, "col-span-3 text-center") %>

View File

@ -19,7 +19,7 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
@impl true @impl true
def handle_event("validate", %{"container" => container_params}, socket) do def handle_event("validate", %{"container" => container_params}, socket) do
{:noreply, socket |> assign_changeset(container_params)} {:noreply, socket |> assign_changeset(container_params, :validate)}
end end
def handle_event( def handle_event(
@ -32,14 +32,9 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
defp assign_changeset( defp assign_changeset(
%{assigns: %{action: action, container: container, current_user: user}} = socket, %{assigns: %{action: action, container: container, current_user: user}} = socket,
container_params container_params,
changeset_action \\ nil
) do ) do
changeset_action =
case action do
create when create in [:new, :clone] -> :insert
:edit -> :update
end
changeset = changeset =
case action do case action do
create when create in [:new, :clone] -> create when create in [:new, :clone] ->
@ -50,10 +45,14 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
end end
changeset = changeset =
if changeset_action do
case changeset |> Changeset.apply_action(changeset_action) do case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset {:ok, _data} -> changeset
{:error, changeset} -> changeset {:error, changeset} -> changeset
end end
else
changeset
end
socket |> assign(:changeset, changeset) socket |> assign(:changeset, changeset)
end end

View File

@ -12,7 +12,7 @@
phx-submit="save" phx-submit="save"
> >
<div <div
:if={@changeset.action && not @changeset.valid?()} :if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center" class="invalid-feedback col-span-3 text-center"
> >
<%= changeset_errors(@changeset) %> <%= changeset_errors(@changeset) %>
@ -21,34 +21,38 @@
<%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %> <%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :name, <%= text_input(f, :name,
class: "input input-primary col-span-2", class: "input input-primary col-span-2",
placeholder: gettext("My cool ammo can"), maxlength: 255,
maxlength: 255 phx_debounce: 300,
placeholder: gettext("My cool ammo can")
) %> ) %>
<%= error_tag(f, :name, "col-span-3 text-center") %> <%= error_tag(f, :name, "col-span-3 text-center") %>
<%= label(f, :desc, gettext("Description"), class: "title text-lg text-primary-600") %> <%= label(f, :desc, gettext("Description"), class: "title text-lg text-primary-600") %>
<%= textarea(f, :desc, <%= textarea(f, :desc,
id: "container-form-desc",
class: "input input-primary col-span-2", class: "input input-primary col-span-2",
placeholder: gettext("Metal ammo can with the anime girl sticker"), id: "container-form-desc",
phx_update: "ignore" phx_debounce: 300,
phx_update: "ignore",
placeholder: gettext("Metal ammo can with the anime girl sticker")
) %> ) %>
<%= error_tag(f, :desc, "col-span-3 text-center") %> <%= error_tag(f, :desc, "col-span-3 text-center") %>
<%= label(f, :type, gettext("Type"), class: "title text-lg text-primary-600") %> <%= label(f, :type, gettext("Type"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :type, <%= text_input(f, :type,
class: "input input-primary col-span-2", class: "input input-primary col-span-2",
placeholder: gettext("Magazine, Clip, Ammo Box, etc"), maxlength: 255,
maxlength: 255 phx_debounce: 300,
placeholder: gettext("Magazine, Clip, Ammo Box, etc")
) %> ) %>
<%= error_tag(f, :type, "col-span-3 text-center") %> <%= error_tag(f, :type, "col-span-3 text-center") %>
<%= label(f, :location, gettext("Location"), class: "title text-lg text-primary-600") %> <%= label(f, :location, gettext("Location"), class: "title text-lg text-primary-600") %>
<%= textarea(f, :location, <%= textarea(f, :location,
id: "container-form-location",
class: "input input-primary col-span-2", class: "input input-primary col-span-2",
placeholder: gettext("On the bookshelf"), id: "container-form-location",
phx_update: "ignore" phx_debounce: 300,
phx_update: "ignore",
placeholder: gettext("On the bookshelf")
) %> ) %>
<%= error_tag(f, :location, "col-span-3 text-center") %> <%= error_tag(f, :location, "col-span-3 text-center") %>

View File

@ -112,7 +112,21 @@ defmodule CanneryWeb.ContainerLive.Index do
{:noreply, socket |> push_patch(to: ~p"/containers/search/#{search_term}")} {:noreply, socket |> push_patch(to: ~p"/containers/search/#{search_term}")}
end end
def handle_event(
"toggle_staged",
%{"container_id" => id},
%{assigns: %{current_user: current_user}} = socket
) do
container = Containers.get_container!(id, current_user)
{:ok, _container} =
container
|> Containers.update_container(current_user, %{"staged" => !container.staged})
{:noreply, socket |> display_containers()}
end
defp display_containers(%{assigns: %{search: search, current_user: current_user}} = socket) do defp display_containers(%{assigns: %{search: search, current_user: current_user}} = socket) do
socket |> assign(:containers, Containers.list_containers(search, current_user)) socket |> assign(:containers, Containers.list_containers(current_user, search: search))
end end
end end

View File

@ -1,10 +1,10 @@
<div class="flex flex-col space-y-8 justify-center items-center"> <div class="flex flex-col justify-center items-center space-y-8">
<h1 class="title text-2xl title-primary-500"> <h1 class="text-2xl title title-primary-500">
<%= gettext("Containers") %> <%= gettext("Containers") %>
</h1> </h1>
<%= if @containers |> Enum.empty?() and @search |> is_nil() do %> <%= if @containers |> Enum.empty?() and @search |> is_nil() do %>
<h2 class="title text-xl text-primary-600"> <h2 class="text-xl title text-primary-600">
<%= gettext("No containers") %> <%= gettext("No containers") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h2> </h2>
@ -17,33 +17,33 @@
<%= dgettext("actions", "New Container") %> <%= dgettext("actions", "New Container") %>
</.link> </.link>
<div class="w-full flex flex-col sm:flex-row justify-center items-center space-y-4 sm:space-y-0 sm:space-x-4 max-w-2xl"> <div class="flex flex-col justify-center items-center space-y-4 w-full max-w-2xl sm:flex-row sm:space-y-0 sm:space-x-4">
<.form <.form
:let={f} :let={f}
for={%{}} for={%{}}
as={:search} as={:search}
phx-change="search" phx-change="search"
phx-submit="search" phx-submit="search"
class="grow flex items-center" class="flex items-center grow"
> >
<%= text_input(f, :search_term, <%= text_input(f, :search_term,
class: "grow input input-primary", class: "grow input input-primary",
value: @search,
role: "search",
phx_debounce: 300, phx_debounce: 300,
placeholder: gettext("Search containers") placeholder: gettext("Search containers"),
role: "search",
value: @search
) %> ) %>
</.form> </.form>
<.toggle_button action="toggle_table" value={@view_table}> <.toggle_button action="toggle_table" value={@view_table}>
<span class="title text-lg text-primary-600"> <span class="text-lg title text-primary-600">
<%= gettext("View as table") %> <%= gettext("View as table") %>
</span> </span>
</.toggle_button> </.toggle_button>
</div> </div>
<%= if @containers |> Enum.empty?() do %> <%= if @containers |> Enum.empty?() do %>
<h2 class="title text-xl text-primary-600"> <h2 class="text-xl title text-primary-600">
<%= gettext("No containers") %> <%= gettext("No containers") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h2> </h2>
@ -51,11 +51,25 @@
<%= if @view_table do %> <%= if @view_table do %>
<.live_component <.live_component
module={CanneryWeb.Components.ContainerTableComponent} module={CanneryWeb.Components.ContainerTableComponent}
id="containers_index_table" id="containers-index-table"
action={@live_action} action={@live_action}
containers={@containers} containers={@containers}
current_user={@current_user} current_user={@current_user}
> >
<:range :let={container}>
<div class="flex justify-center items-center px-4 py-2 h-full min-w-20 flex-wrap">
<button
type="button"
class="mx-2 my-1 text-sm btn btn-primary"
phx-click="toggle_staged"
phx-value-container_id={container.id}
>
<%= if container.staged,
do: dgettext("actions", "Unstage"),
else: dgettext("actions", "Stage") %>
</button>
</div>
</:range>
<:tag_actions :let={container}> <:tag_actions :let={container}>
<div class="mx-4 my-2"> <div class="mx-4 my-2">
<.link <.link
@ -109,7 +123,7 @@
</:actions> </:actions>
</.live_component> </.live_component>
<% else %> <% else %>
<div class="w-full flex flex-row flex-wrap justify-center items-stretch"> <div class="flex flex-row flex-wrap justify-center items-stretch w-full">
<.container_card <.container_card
:for={container <- @containers} :for={container <- @containers}
container={container} container={container}

View File

@ -78,6 +78,18 @@ defmodule CanneryWeb.ContainerLive.Show do
{:noreply, socket} {:noreply, socket}
end end
def handle_event(
"toggle_staged",
_params,
%{assigns: %{container: container, current_user: current_user}} = socket
) do
{:ok, _container} =
container
|> Containers.update_container(current_user, %{"staged" => !container.staged})
{:noreply, socket |> render_container()}
end
def handle_event("toggle_table", _params, %{assigns: %{view_table: view_table}} = socket) do def handle_event("toggle_table", _params, %{assigns: %{view_table: view_table}} = socket) do
{:noreply, socket |> assign(:view_table, !view_table) |> render_container()} {:noreply, socket |> assign(:view_table, !view_table) |> render_container()}
end end
@ -104,8 +116,10 @@ defmodule CanneryWeb.ContainerLive.Show do
id, id,
current_user current_user
) do ) do
%{name: container_name} = container = Containers.get_container!(id, current_user) %{id: container_id, name: container_name} =
packs = Ammo.list_packs_for_container(container, class, current_user) container = Containers.get_container!(id, current_user)
packs = Ammo.list_packs(current_user, container_id: container_id, class: class)
original_counts = packs |> Ammo.get_original_counts(current_user) original_counts = packs |> Ammo.get_original_counts(current_user)
cprs = packs |> Ammo.get_cprs(current_user) cprs = packs |> Ammo.get_cprs(current_user)
last_used_dates = packs |> ActivityLog.get_last_used_dates(current_user) last_used_dates = packs |> ActivityLog.get_last_used_dates(current_user)
@ -120,8 +134,8 @@ defmodule CanneryWeb.ContainerLive.Show do
socket socket
|> assign( |> assign(
container: container, container: container,
round_count: Ammo.get_round_count_for_container!(container, current_user), round_count: Ammo.get_round_count(current_user, container_id: container.id),
packs_count: Ammo.get_packs_count_for_container!(container, current_user), packs_count: Ammo.get_packs_count(current_user, container_id: container.id),
packs: packs, packs: packs,
original_counts: original_counts, original_counts: original_counts,
cprs: cprs, cprs: cprs,

View File

@ -1,34 +1,34 @@
<div class="space-y-4 flex flex-col justify-center items-center"> <div class="flex flex-col justify-center items-center space-y-4">
<h1 class="title text-2xl title-primary-500"> <h1 class="text-2xl title title-primary-500">
<%= @container.name %> <%= @container.name %>
</h1> </h1>
<span :if={@container.desc} class="rounded-lg title text-lg"> <span :if={@container.desc} class="text-lg rounded-lg title">
<%= gettext("Description:") %> <%= gettext("Description:") %>
<%= @container.desc %> <%= @container.desc %>
</span> </span>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Type:") %> <%= gettext("Type:") %>
<%= @container.type %> <%= @container.type %>
</span> </span>
<span :if={@container.location} class="rounded-lg title text-lg"> <span :if={@container.location} class="text-lg rounded-lg title">
<%= gettext("Location:") %> <%= gettext("Location:") %>
<%= @container.location %> <%= @container.location %>
</span> </span>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Packs:") %> <%= gettext("Packs:") %>
<%= @packs_count %> <%= @packs_count %>
</span> </span>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Rounds:") %> <%= gettext("Rounds:") %>
<%= @round_count %> <%= @round_count %>
</span> </span>
<div class="flex space-x-4 justify-center items-center text-primary-600"> <div class="flex justify-center items-center space-x-4 text-primary-600">
<.link <.link
patch={~p"/container/edit/#{@container}"} patch={~p"/container/edit/#{@container}"}
class="text-primary-600 link" class="text-primary-600 link"
@ -52,11 +52,19 @@
</.link> </.link>
</div> </div>
<div class="flex flex-wrap justify-center items-center text-primary-600">
<button type="button" class="mx-4 my-2 btn btn-primary" phx-click="toggle_staged">
<%= if @container.staged,
do: dgettext("actions", "Unstage from range"),
else: dgettext("actions", "Stage for range") %>
</button>
</div>
<hr class="mb-4 hr" /> <hr class="mb-4 hr" />
<%= if @container.tags |> Enum.empty?() do %> <%= if @container.tags |> Enum.empty?() do %>
<div class="flex flex-row justify-center items-center space-x-4"> <div class="flex flex-row justify-center items-center space-x-4">
<h2 class="title text-lg text-primary-600"> <h2 class="text-lg title text-primary-600">
<%= gettext("No tags for this container") %> <%= gettext("No tags for this container") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h2> </h2>
@ -105,22 +113,22 @@
</.form> </.form>
<.toggle_button action="toggle_table" value={@view_table}> <.toggle_button action="toggle_table" value={@view_table}>
<span class="title text-lg text-primary-600"> <span class="text-lg title text-primary-600">
<%= gettext("View as table") %> <%= gettext("View as table") %>
</span> </span>
</.toggle_button> </.toggle_button>
</div> </div>
<div class="w-full p-4"> <div class="p-4 w-full">
<%= if @packs |> Enum.empty?() do %> <%= if @packs |> Enum.empty?() do %>
<h2 class="mx-4 title text-lg text-primary-600 text-center"> <h2 class="mx-4 text-lg text-center title text-primary-600">
<%= gettext("No ammo in this container") %> <%= gettext("No ammo in this container") %>
</h2> </h2>
<% else %> <% else %>
<%= if @view_table do %> <%= if @view_table do %>
<.live_component <.live_component
module={CanneryWeb.Components.PackTableComponent} module={CanneryWeb.Components.PackTableComponent}
id="type-show-table" id="pack-show-table"
packs={@packs} packs={@packs}
current_user={@current_user} current_user={@current_user}
show_used={false} show_used={false}
@ -130,6 +138,21 @@
<%= type_name %> <%= type_name %>
</.link> </.link>
</:type> </:type>
<:actions :let={%{count: pack_count} = pack}>
<div class="flex justify-center items-center px-4 py-2 space-x-4 h-full">
<.link
navigate={~p"/ammo/show/#{pack}"}
class="text-primary-600 link"
aria-label={
dgettext("actions", "View pack of %{pack_count} bullets",
pack_count: pack_count
)
}
>
<i class="fa-fw fa-lg fas fa-eye"></i>
</.link>
</div>
</:actions>
</.live_component> </.live_component>
<% else %> <% else %>
<div class="flex flex-wrap justify-center items-stretch"> <div class="flex flex-wrap justify-center items-stretch">

View File

@ -19,7 +19,7 @@ defmodule CanneryWeb.InviteLive.FormComponent do
@impl true @impl true
def handle_event("validate", %{"invite" => invite_params}, socket) do def handle_event("validate", %{"invite" => invite_params}, socket) do
{:noreply, socket |> assign_changeset(invite_params)} {:noreply, socket |> assign_changeset(invite_params, :validate)}
end end
def handle_event("save", %{"invite" => invite_params}, %{assigns: %{action: action}} = socket) do def handle_event("save", %{"invite" => invite_params}, %{assigns: %{action: action}} = socket) do
@ -28,14 +28,9 @@ defmodule CanneryWeb.InviteLive.FormComponent do
defp assign_changeset( defp assign_changeset(
%{assigns: %{action: action, current_user: user, invite: invite}} = socket, %{assigns: %{action: action, current_user: user, invite: invite}} = socket,
invite_params invite_params,
changeset_action \\ nil
) do ) do
changeset_action =
case action do
:new -> :insert
:edit -> :update
end
changeset = changeset =
case action do case action do
:new -> Invite.create_changeset(user, "example_token", invite_params) :new -> Invite.create_changeset(user, "example_token", invite_params)
@ -43,10 +38,14 @@ defmodule CanneryWeb.InviteLive.FormComponent do
end end
changeset = changeset =
if changeset_action do
case changeset |> Changeset.apply_action(changeset_action) do case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset {:ok, _data} -> changeset
{:error, changeset} -> changeset {:error, changeset} -> changeset
end end
else
changeset
end
socket |> assign(:changeset, changeset) socket |> assign(:changeset, changeset)
end end

View File

@ -12,7 +12,7 @@
phx-submit="save" phx-submit="save"
> >
<div <div
:if={@changeset.action && not @changeset.valid?()} :if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center" class="invalid-feedback col-span-3 text-center"
> >
<%= changeset_errors(@changeset) %> <%= changeset_errors(@changeset) %>
@ -22,7 +22,10 @@
class: "title text-lg text-primary-600", class: "title text-lg text-primary-600",
maxlength: 255 maxlength: 255
) %> ) %>
<%= text_input(f, :name, class: "input input-primary col-span-2") %> <%= text_input(f, :name,
class: "input input-primary col-span-2",
phx_debounce: 300
) %>
<%= error_tag(f, :name, "col-span-3") %> <%= error_tag(f, :name, "col-span-3") %>
<%= label(f, :uses_left, gettext("Uses left"), class: "title text-lg text-primary-600") %> <%= label(f, :uses_left, gettext("Uses left"), class: "title text-lg text-primary-600") %>

View File

@ -116,6 +116,20 @@ defmodule CanneryWeb.InviteLive.Index do
{:noreply, socket |> put_flash(:info, dgettext("prompts", "Copied to clipboard"))} {:noreply, socket |> put_flash(:info, dgettext("prompts", "Copied to clipboard"))}
end end
def handle_event("resend_email_verification", %{"id" => id}, socket) do
%{email: user_email} = user = Accounts.get_user!(id)
Accounts.deliver_user_confirmation_instructions(
user,
fn token -> url(CanneryWeb.Endpoint, ~p"/users/confirm/#{token}") end
)
prompt =
dgettext("prompts", "Email resent to %{user_email} succesfully", user_email: user_email)
{:noreply, socket |> put_flash(:info, prompt) |> display_invites()}
end
def handle_event( def handle_event(
"delete_user", "delete_user",
%{"id" => id}, %{"id" => id},

View File

@ -1,10 +1,10 @@
<div class="mx-auto flex flex-col justify-center items-center space-y-4 max-w-3xl"> <div class="flex flex-col justify-center items-center mx-auto space-y-4 max-w-3xl">
<h1 class="title text-2xl title-primary-500"> <h1 class="text-2xl title title-primary-500">
<%= gettext("Invites") %> <%= gettext("Invites") %>
</h1> </h1>
<%= if @invites |> Enum.empty?() do %> <%= if @invites |> Enum.empty?() do %>
<h1 class="title text-xl text-primary-600"> <h1 class="text-xl title text-primary-600">
<%= gettext("No invites") %> <%= gettext("No invites") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h1> </h1>
@ -95,7 +95,7 @@
<%= unless @admins |> Enum.empty?() do %> <%= unless @admins |> Enum.empty?() do %>
<hr class="hr" /> <hr class="hr" />
<h1 class="title text-2xl text-primary-600"> <h1 class="text-2xl title text-primary-600">
<%= gettext("Admins") %> <%= gettext("Admins") %>
</h1> </h1>
@ -123,17 +123,24 @@
<%= unless @users |> Enum.empty?() do %> <%= unless @users |> Enum.empty?() do %>
<hr class="hr" /> <hr class="hr" />
<h1 class="title text-2xl text-primary-600"> <h1 class="text-2xl title text-primary-600">
<%= gettext("Users") %> <%= gettext("Users") %>
</h1> </h1>
<div class="flex flex-col justify-center items-stretch space-y-4"> <div class="flex flex-col justify-center items-stretch space-y-4">
<.user_card :for={user <- @users} user={user}> <.user_card :for={user <- @users} user={user}>
<div class="flex justify-center items-center space-x-2">
<.link <.link
href="#" :if={!user.confirmed_at}
class="text-primary-600 link" class="text-primary-600 link"
phx-click="delete_user" href="#"
phx-click="resend_email_verification"
phx-value-id={user.id} phx-value-id={user.id}
>
<i class="fa-fw fa-lg fas fa-paper-plane"></i>
</.link>
<.link
class="text-primary-600 link"
data-confirm={ data-confirm={
dgettext( dgettext(
"prompts", "prompts",
@ -141,9 +148,13 @@
email: user.email email: user.email
) )
} }
href="#"
phx-click="delete_user"
phx-value-id={user.id}
> >
<i class="fa-fw fa-lg fas fa-trash"></i> <i class="fa-fw fa-lg fas fa-trash"></i>
</.link> </.link>
</div>
</.user_card> </.user_card>
</div> </div>
<% end %> <% end %>

View File

@ -9,7 +9,11 @@ defmodule CanneryWeb.PackLive.FormComponent do
alias Ecto.Changeset alias Ecto.Changeset
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
@pack_create_limit 10_000 @impl true
@spec mount(Socket.t()) :: {:ok, Socket.t()}
def mount(socket) do
{:ok, socket |> assign(:class, :all)}
end
@impl true @impl true
@spec update( @spec update(
@ -22,29 +26,30 @@ defmodule CanneryWeb.PackLive.FormComponent do
@spec update(Socket.t()) :: {:ok, Socket.t()} @spec update(Socket.t()) :: {:ok, Socket.t()}
def update(%{assigns: %{current_user: current_user}} = socket) do def update(%{assigns: %{current_user: current_user}} = socket) do
%{assigns: %{types: types, containers: containers}} =
socket = socket =
socket socket
|> assign(:pack_create_limit, @pack_create_limit) |> assign(:types, Ammo.list_types(current_user))
|> assign(:types, Ammo.list_types(current_user, :all))
|> assign_new(:containers, fn -> Containers.list_containers(current_user) end) |> assign_new(:containers, fn -> Containers.list_containers(current_user) end)
params = {:ok, socket |> assign_changeset(%{})}
if types |> List.first() |> is_nil(),
do: %{},
else: %{} |> Map.put("type_id", types |> List.first() |> Map.get(:id))
params =
if containers |> List.first() |> is_nil(),
do: params,
else: params |> Map.put("container_id", containers |> List.first() |> Map.get(:id))
{:ok, socket |> assign_changeset(params)}
end end
@impl true @impl true
def handle_event("validate", %{"pack" => pack_params}, socket) do def handle_event("validate", %{"pack" => pack_params}, socket) do
{:noreply, socket |> assign_changeset(pack_params, :validate)} matched_class =
case pack_params["class"] do
"rifle" -> :rifle
"shotgun" -> :shotgun
"pistol" -> :pistol
_other -> :all
end
socket =
socket
|> assign_changeset(pack_params, :validate)
|> assign(:class, matched_class)
{:noreply, socket}
end end
def handle_event( def handle_event(
@ -62,11 +67,18 @@ defmodule CanneryWeb.PackLive.FormComponent do
containers |> Enum.map(fn %{id: id, name: name} -> {name, id} end) containers |> Enum.map(fn %{id: id, name: name} -> {name, id} end)
end end
@spec type_options([Type.t()]) :: [{String.t(), Type.id()}] @spec type_options([Type.t()], Type.class() | :all) ::
defp type_options(types) do [{String.t(), Type.id()}]
defp type_options(types, :all) do
types |> Enum.map(fn %{id: id, name: name} -> {name, id} end) types |> Enum.map(fn %{id: id, name: name} -> {name, id} end)
end end
defp type_options(types, selected_class) do
types
|> Enum.filter(fn %{class: class} -> class == selected_class end)
|> Enum.map(fn %{id: id, name: name} -> {name, id} end)
end
# Save Helpers # Save Helpers
defp assign_changeset( defp assign_changeset(
@ -92,10 +104,14 @@ defmodule CanneryWeb.PackLive.FormComponent do
end end
changeset = changeset =
case changeset |> Changeset.apply_action(changeset_action || default_action) do if changeset_action do
case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset {:ok, _data} -> changeset
{:error, changeset} -> changeset {:error, changeset} -> changeset
end end
else
changeset
end
socket |> assign(:changeset, changeset) socket |> assign(:changeset, changeset)
end end
@ -133,53 +149,15 @@ defmodule CanneryWeb.PackLive.FormComponent do
end end
defp save_pack( defp save_pack(
%{assigns: %{changeset: changeset}} = socket, %{assigns: %{changeset: changeset, current_user: current_user, return_to: return_to}} =
socket,
action, action,
%{"multiplier" => multiplier_str} = pack_params %{"multiplier" => multiplier_str} = pack_params
) )
when action in [:new, :clone] do when action in [:new, :clone] do
socket = socket =
case multiplier_str |> Integer.parse() do with {multiplier, _remainder} <- multiplier_str |> Integer.parse(),
{multiplier, _remainder} {:ok, {count, _packs}} <- Ammo.create_packs(pack_params, multiplier, current_user) do
when multiplier >= 1 and multiplier <= @pack_create_limit ->
socket |> create_multiple(pack_params, multiplier)
{multiplier, _remainder} ->
error_msg =
dgettext(
"errors",
"Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}",
max: @pack_create_limit,
multiplier: multiplier
)
save_multiplier_error(socket, changeset, error_msg)
:error ->
error_msg = dgettext("errors", "Could not parse number of copies")
save_multiplier_error(socket, changeset, error_msg)
end
{:noreply, socket}
end
@spec save_multiplier_error(Socket.t(), Changeset.t(), String.t()) :: Socket.t()
defp save_multiplier_error(socket, changeset, error_msg) do
{:error, changeset} =
changeset
|> Changeset.add_error(:multiplier, error_msg)
|> Changeset.apply_action(:insert)
socket |> assign(:changeset, changeset)
end
defp create_multiple(
%{assigns: %{current_user: current_user, return_to: return_to}} = socket,
pack_params,
multiplier
) do
case Ammo.create_packs(pack_params, multiplier, current_user) do
{:ok, {count, _packs}} ->
prompt = prompt =
dngettext( dngettext(
"prompts", "prompts",
@ -189,9 +167,21 @@ defmodule CanneryWeb.PackLive.FormComponent do
) )
socket |> put_flash(:info, prompt) |> push_navigate(to: return_to) socket |> put_flash(:info, prompt) |> push_navigate(to: return_to)
else
{:error, %Changeset{} = changeset} -> {:error, %Changeset{} = changeset} ->
socket |> assign(changeset: changeset) socket |> assign(changeset: changeset)
end
:error ->
error_msg = dgettext("errors", "Could not parse number of copies")
{:error, changeset} =
changeset
|> Changeset.add_error(:multiplier, error_msg)
|> Changeset.apply_action(:insert)
socket |> assign(:changeset, changeset)
end
{:noreply, socket}
end end
end end

View File

@ -13,15 +13,32 @@
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" 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 <div
:if={@changeset.action && not @changeset.valid?()} :if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center" class="invalid-feedback col-span-3 text-center"
> >
<%= changeset_errors(@changeset) %> <%= changeset_errors(@changeset) %>
</div> </div>
<%= label(f, :class, gettext("Class"), class: "title text-lg text-primary-600") %>
<%= select(
f,
:class,
[
{gettext("Any"), :all},
{gettext("Rifle"), :rifle},
{gettext("Shotgun"), :shotgun},
{gettext("Pistol"), :pistol}
],
class: "text-center col-span-2 input input-primary",
value: @class
) %>
<%= error_tag(f, :class, "col-span-3 text-center") %>
<%= label(f, :type_id, gettext("Type"), class: "title text-lg text-primary-600") %> <%= label(f, :type_id, gettext("Type"), class: "title text-lg text-primary-600") %>
<%= select(f, :type_id, type_options(@types), <%= select(f, :type_id, type_options(@types, @class),
class: "text-center col-span-2 input input-primary" class: "text-center col-span-2 input input-primary",
id: "pack-form-type-select",
phx_hook: "SlimSelect"
) %> ) %>
<%= error_tag(f, :type_id, "col-span-3 text-center") %> <%= error_tag(f, :type_id, "col-span-3 text-center") %>
@ -42,7 +59,8 @@
<%= label(f, :lot_number, gettext("Lot number"), class: "title text-lg text-primary-600") %> <%= label(f, :lot_number, gettext("Lot number"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :lot_number, <%= text_input(f, :lot_number,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :price_paid, "col-span-3 text-center") %> <%= error_tag(f, :price_paid, "col-span-3 text-center") %>
@ -56,15 +74,18 @@
<%= label(f, :notes, gettext("Notes"), class: "title text-lg text-primary-600") %> <%= label(f, :notes, gettext("Notes"), class: "title text-lg text-primary-600") %>
<%= textarea(f, :notes, <%= textarea(f, :notes,
id: "pack-form-notes",
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
id: "pack-form-notes",
phx_debounce: 300,
phx_update: "ignore" phx_update: "ignore"
) %> ) %>
<%= error_tag(f, :notes, "col-span-3 text-center") %> <%= error_tag(f, :notes, "col-span-3 text-center") %>
<%= label(f, :container, gettext("Container"), class: "title text-lg text-primary-600") %> <%= label(f, :container, gettext("Container"), class: "title text-lg text-primary-600") %>
<%= select(f, :container_id, container_options(@containers), <%= select(f, :container_id, container_options(@containers),
class: "text-center col-span-2 input input-primary" class: "text-center col-span-2 input input-primary",
id: "pack-form-container-select",
phx_hook: "SlimSelect"
) %> ) %>
<%= error_tag(f, :container_id, "col-span-3 text-center") %> <%= error_tag(f, :container_id, "col-span-3 text-center") %>
@ -74,7 +95,6 @@
<%= label(f, :multiplier, gettext("Copies"), class: "title text-lg text-primary-600") %> <%= label(f, :multiplier, gettext("Copies"), class: "title text-lg text-primary-600") %>
<%= number_input(f, :multiplier, <%= number_input(f, :multiplier,
max: @pack_create_limit,
class: "text-center input input-primary", class: "text-center input input-primary",
value: 1, value: 1,
phx_update: "ignore" phx_update: "ignore"

View File

@ -96,18 +96,6 @@ defmodule CanneryWeb.PackLive.Index do
{:noreply, socket |> put_flash(:info, prompt) |> display_packs()} {:noreply, socket |> put_flash(:info, prompt) |> display_packs()}
end end
def handle_event(
"toggle_staged",
%{"pack_id" => id},
%{assigns: %{current_user: current_user}} = socket
) do
pack = Ammo.get_pack!(id, current_user)
{:ok, _pack} = pack |> Ammo.update_pack(%{"staged" => !pack.staged}, current_user)
{:noreply, socket |> display_packs()}
end
def handle_event("toggle_show_used", _params, %{assigns: %{show_used: show_used}} = socket) do def handle_event("toggle_show_used", _params, %{assigns: %{show_used: show_used}} = socket) do
{:noreply, socket |> assign(:show_used, !show_used) |> display_packs()} {:noreply, socket |> assign(:show_used, !show_used) |> display_packs()}
end end
@ -148,8 +136,8 @@ defmodule CanneryWeb.PackLive.Index do
) do ) do
# get total number of packs to determine whether to display onboarding # get total number of packs to determine whether to display onboarding
# prompts # prompts
packs_count = Ammo.get_packs_count!(current_user, true) packs_count = Ammo.get_packs_count(current_user, show_used: true)
packs = Ammo.list_packs(search, class, current_user, show_used) packs = Ammo.list_packs(current_user, search: search, class: class, show_used: show_used)
types_count = Ammo.get_types_count!(current_user) types_count = Ammo.get_types_count!(current_user)
containers_count = Containers.get_containers_count!(current_user) containers_count = Containers.get_containers_count!(current_user)

View File

@ -1,5 +1,5 @@
<div class="flex flex-col space-y-8 justify-center items-center"> <div class="flex flex-col justify-center items-center space-y-8">
<h1 class="title text-2xl title-primary-500"> <h1 class="text-2xl title title-primary-500">
<%= gettext("Ammo") %> <%= gettext("Ammo") %>
</h1> </h1>
@ -25,7 +25,7 @@
</.link> </.link>
</div> </div>
<% @packs_count == 0 -> %> <% @packs_count == 0 -> %>
<h2 class="title text-xl text-primary-600"> <h2 class="text-xl title text-primary-600">
<%= gettext("No ammo") %> <%= gettext("No ammo") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h2> </h2>
@ -38,7 +38,7 @@
<%= dgettext("actions", "Add Ammo") %> <%= dgettext("actions", "Add Ammo") %>
</.link> </.link>
<div class="w-full flex flex-col sm:flex-row justify-center items-center space-y-4 sm:space-y-0 sm:space-x-4 max-w-2xl"> <div class="flex flex-col justify-center items-center space-y-4 w-full max-w-2xl sm:flex-row sm:space-y-0 sm:space-x-4">
<.form <.form
:let={f} :let={f}
for={%{}} for={%{}}
@ -71,26 +71,26 @@
as={:search} as={:search}
phx-change="search" phx-change="search"
phx-submit="search" phx-submit="search"
class="grow flex items-center" class="flex items-center grow"
> >
<%= text_input(f, :search_term, <%= text_input(f, :search_term,
class: "grow input input-primary", class: "grow input input-primary",
value: @search,
role: "search",
phx_debounce: 300, phx_debounce: 300,
placeholder: gettext("Search ammo") placeholder: gettext("Search ammo"),
role: "search",
value: @search
) %> ) %>
</.form> </.form>
<.toggle_button action="toggle_show_used" value={@show_used}> <.toggle_button action="toggle_show_used" value={@show_used}>
<span class="title text-lg text-primary-600"> <span class="text-lg title text-primary-600">
<%= gettext("Show used") %> <%= gettext("Show used") %>
</span> </span>
</.toggle_button> </.toggle_button>
</div> </div>
<%= if @packs |> Enum.empty?() do %> <%= if @packs |> Enum.empty?() do %>
<h2 class="title text-xl text-primary-600"> <h2 class="text-xl title text-primary-600">
<%= gettext("No Ammo") %> <%= gettext("No Ammo") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h2> </h2>
@ -108,18 +108,7 @@
</.link> </.link>
</:type> </:type>
<:range :let={pack}> <:range :let={pack}>
<div class="min-w-20 py-2 px-4 h-full flex flew-wrap justify-center items-center"> <div class="flex flex-wrap justify-center items-center px-4 py-2 h-full min-w-20">
<button
type="button"
class="mx-2 my-1 text-sm btn btn-primary"
phx-click="toggle_staged"
phx-value-pack_id={pack.id}
>
<%= if pack.staged,
do: dgettext("actions", "Unstage"),
else: dgettext("actions", "Stage") %>
</button>
<.link <.link
patch={~p"/ammo/add_shot_record/#{pack}"} patch={~p"/ammo/add_shot_record/#{pack}"}
class="mx-2 my-1 text-sm btn btn-primary" class="mx-2 my-1 text-sm btn btn-primary"
@ -129,7 +118,7 @@
</div> </div>
</:range> </:range>
<:container :let={{pack, %{name: container_name} = container}}> <:container :let={{pack, %{name: container_name} = container}}>
<div class="min-w-20 py-2 px-4 h-full flex flew-wrap justify-center items-center"> <div class="flex flex-wrap justify-center items-center px-4 py-2 h-full min-w-20">
<.link navigate={~p"/container/#{container}"} class="mx-2 my-1 link"> <.link navigate={~p"/container/#{container}"} class="mx-2 my-1 link">
<%= container_name %> <%= container_name %>
</.link> </.link>
@ -140,12 +129,14 @@
</div> </div>
</:container> </:container>
<:actions :let={%{count: pack_count} = pack}> <:actions :let={%{count: pack_count} = pack}>
<div class="py-2 px-4 h-full space-x-4 flex justify-center items-center"> <div class="flex justify-center items-center px-4 py-2 space-x-4 h-full">
<.link <.link
navigate={~p"/ammo/show/#{pack}"} navigate={~p"/ammo/show/#{pack}"}
class="text-primary-600 link" class="text-primary-600 link"
aria-label={ aria-label={
dgettext("actions", "View pack of %{pack_count} bullets", pack_count: pack_count) dgettext("actions", "View pack of %{pack_count} bullets",
pack_count: pack_count
)
} }
> >
<i class="fa-fw fa-lg fas fa-eye"></i> <i class="fa-fw fa-lg fas fa-eye"></i>
@ -155,7 +146,9 @@
patch={~p"/ammo/edit/#{pack}"} patch={~p"/ammo/edit/#{pack}"}
class="text-primary-600 link" class="text-primary-600 link"
aria-label={ aria-label={
dgettext("actions", "Edit pack of %{pack_count} bullets", pack_count: pack_count) dgettext("actions", "Edit pack of %{pack_count} bullets",
pack_count: pack_count
)
} }
> >
<i class="fa-fw fa-lg fas fa-edit"></i> <i class="fa-fw fa-lg fas fa-edit"></i>

View File

@ -57,22 +57,12 @@ defmodule CanneryWeb.PackLive.Show do
{:noreply, socket |> put_flash(:info, prompt) |> push_navigate(to: redirect_to)} {:noreply, socket |> put_flash(:info, prompt) |> push_navigate(to: redirect_to)}
end end
def handle_event(
"toggle_staged",
_params,
%{assigns: %{pack: pack, current_user: current_user}} = socket
) do
{:ok, pack} = pack |> Ammo.update_pack(%{"staged" => !pack.staged}, current_user)
{:noreply, socket |> display_pack(pack)}
end
def handle_event( def handle_event(
"delete_shot_record", "delete_shot_record",
%{"id" => id}, %{"id" => id},
%{assigns: %{pack: %{id: pack_id}, current_user: current_user}} = socket %{assigns: %{pack: %{id: pack_id}, current_user: current_user}} = socket
) do ) do
{:ok, _} = {:ok, _shot_record} =
ActivityLog.get_shot_record!(id, current_user) ActivityLog.get_shot_record!(id, current_user)
|> ActivityLog.delete_shot_record(current_user) |> ActivityLog.delete_shot_record(current_user)
@ -92,7 +82,7 @@ defmodule CanneryWeb.PackLive.Show do
%{label: gettext("Actions"), key: :actions, sortable: false} %{label: gettext("Actions"), key: :actions, sortable: false}
] ]
shot_records = ActivityLog.list_shot_records_for_pack(pack, current_user) shot_records = ActivityLog.list_shot_records(current_user, pack_id: pack.id)
rows = rows =
shot_records shot_records
@ -136,7 +126,7 @@ defmodule CanneryWeb.PackLive.Show do
:actions -> :actions ->
~H""" ~H"""
<div class="px-4 py-2 space-x-4 flex justify-center items-center"> <div class="flex justify-center items-center px-4 py-2 space-x-4">
<.link <.link
patch={~p"/ammo/show/#{@pack}/edit/#{@shot_record}"} patch={~p"/ammo/show/#{@pack}/edit/#{@shot_record}"}
class="text-primary-600 link" class="text-primary-600 link"

View File

@ -1,43 +1,43 @@
<div class="mx-auto space-y-4 max-w-3xl flex flex-col justify-center items-center"> <div class="flex flex-col justify-center items-center mx-auto space-y-4 max-w-3xl">
<h1 class="title text-2xl title-primary-500"> <h1 class="text-2xl title title-primary-500">
<%= @pack.type.name %> <%= @pack.type.name %>
</h1> </h1>
<div class="space-y-2 flex flex-col justify-center items-center"> <div class="flex flex-col justify-center items-center space-y-2">
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Count:") %> <%= gettext("Count:") %>
<%= @pack.count %> <%= @pack.count %>
</span> </span>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Original count:") %> <%= gettext("Original count:") %>
<%= @original_count %> <%= @original_count %>
</span> </span>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Percentage left:") %> <%= gettext("Percentage left:") %>
<%= gettext("%{percentage}%", percentage: @percentage_remaining) %> <%= gettext("%{percentage}%", percentage: @percentage_remaining) %>
</span> </span>
<%= if @pack.notes do %> <%= if @pack.notes do %>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Notes:") %> <%= gettext("Notes:") %>
<%= @pack.notes %> <%= @pack.notes %>
</span> </span>
<% end %> <% end %>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Purchased on:") %> <%= gettext("Purchased on:") %>
<.date id={"#{@pack.id}-purchased-on"} date={@pack.purchased_on} /> <.date id={"#{@pack.id}-purchased-on"} date={@pack.purchased_on} />
</span> </span>
<%= if @pack.price_paid do %> <%= if @pack.price_paid do %>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Original cost:") %> <%= gettext("Original cost:") %>
<%= gettext("$%{amount}", amount: display_currency(@pack.price_paid)) %> <%= gettext("$%{amount}", amount: display_currency(@pack.price_paid)) %>
</span> </span>
<span class="rounded-lg title text-lg"> <span class="text-lg rounded-lg title">
<%= gettext("Current value:") %> <%= gettext("Current value:") %>
<%= gettext("$%{amount}", <%= gettext("$%{amount}",
amount: display_currency(@pack.price_paid * @percentage_remaining / 100) amount: display_currency(@pack.price_paid * @percentage_remaining / 100)
@ -76,12 +76,6 @@
</div> </div>
<div class="flex flex-wrap justify-center items-center text-primary-600"> <div class="flex flex-wrap justify-center items-center text-primary-600">
<button type="button" class="mx-4 my-2 btn btn-primary" phx-click="toggle_staged">
<%= if @pack.staged,
do: dgettext("actions", "Unstage from range"),
else: dgettext("actions", "Stage for range") %>
</button>
<.link patch={~p"/ammo/show/move/#{@pack}"} class="btn btn-primary"> <.link patch={~p"/ammo/show/move/#{@pack}"} class="btn btn-primary">
<%= dgettext("actions", "Move ammo") %> <%= dgettext("actions", "Move ammo") %>
</.link> </.link>
@ -96,7 +90,7 @@
<div> <div>
<%= if @container do %> <%= if @container do %>
<h1 class="mb-4 px-4 py-2 text-center rounded-lg title text-xl"> <h1 class="px-4 py-2 mb-4 text-xl text-center rounded-lg title">
<%= gettext("Stored in") %> <%= gettext("Stored in") %>
</h1> </h1>
@ -109,13 +103,13 @@
<%= unless @shot_records |> Enum.empty?() do %> <%= unless @shot_records |> Enum.empty?() do %>
<hr class="mb-4 w-full" /> <hr class="mb-4 w-full" />
<h1 class="mb-4 px-4 py-2 text-center rounded-lg title text-xl"> <h1 class="px-4 py-2 mb-4 text-xl text-center rounded-lg title">
<%= gettext("Rounds used") %> <%= gettext("Rounds used") %>
</h1> </h1>
<.live_component <.live_component
module={CanneryWeb.Components.TableComponent} module={CanneryWeb.Components.TableComponent}
id="pack_shot_records_table" id="pack-shot-records-table"
columns={@columns} columns={@columns}
rows={@rows} rows={@rows}
/> />

View File

@ -71,25 +71,26 @@ defmodule CanneryWeb.RangeLive.FormComponent do
} }
} = socket, } = socket,
shot_record_params, shot_record_params,
action \\ nil changeset_action \\ nil
) do ) do
default_action = changeset =
case live_action do case live_action do
:add_shot_record -> :insert :add_shot_record ->
editing when editing in [:edit, :edit_shot_record] -> :update shot_record |> ShotRecord.create_changeset(user, pack, shot_record_params)
editing when editing in [:edit, :edit_shot_record] ->
shot_record |> ShotRecord.update_changeset(user, shot_record_params)
end end
changeset = changeset =
case default_action do if changeset_action do
:insert -> shot_record |> ShotRecord.create_changeset(user, pack, shot_record_params) case changeset |> Changeset.apply_action(changeset_action) do
:update -> shot_record |> ShotRecord.update_changeset(user, shot_record_params)
end
changeset =
case changeset |> Changeset.apply_action(action || default_action) do
{:ok, _data} -> changeset {:ok, _data} -> changeset
{:error, changeset} -> changeset {:error, changeset} -> changeset
end end
else
changeset
end
socket |> assign(:changeset, changeset) socket |> assign(:changeset, changeset)
end end

View File

@ -13,7 +13,7 @@
phx-submit="save" phx-submit="save"
> >
<div <div
:if={@changeset.action && not @changeset.valid?()} :if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center" class="invalid-feedback col-span-3 text-center"
> >
<%= changeset_errors(@changeset) %> <%= changeset_errors(@changeset) %>
@ -29,11 +29,12 @@
<%= label(f, :notes, gettext("Notes"), class: "title text-lg text-primary-600") %> <%= label(f, :notes, gettext("Notes"), class: "title text-lg text-primary-600") %>
<%= textarea(f, :notes, <%= textarea(f, :notes,
id: "shot-record-form-notes",
class: "input input-primary col-span-2", class: "input input-primary col-span-2",
id: "shot-record-form-notes",
maxlength: 255, maxlength: 255,
placeholder: gettext("Really great weather"), phx_debounce: 300,
phx_update: "ignore" phx_update: "ignore",
placeholder: gettext("Really great weather")
) %> ) %>
<%= error_tag(f, :notes, "col-span-3") %> <%= error_tag(f, :notes, "col-span-3") %>

View File

@ -4,16 +4,37 @@ defmodule CanneryWeb.RangeLive.Index do
""" """
use CanneryWeb, :live_view use CanneryWeb, :live_view
alias Cannery.{ActivityLog, ActivityLog.ShotRecord, Ammo} alias Cannery.{ActivityLog, ActivityLog.ShotRecord}
alias Cannery.{Ammo, Containers}
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
@impl true @impl true
def mount(%{"search" => search}, _session, socket) do def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(class: :all, search: search) |> display_shot_records()} socket =
socket
|> assign(
class: :all,
start_date: Date.shift(Date.utc_today(), year: -1),
end_date: Date.utc_today(),
search: search
)
|> display_shot_records()
{:ok, socket}
end end
def mount(_params, _session, socket) do def mount(_params, _session, socket) do
{:ok, socket |> assign(class: :all, search: nil) |> display_shot_records()} socket =
socket
|> assign(
class: :all,
start_date: Date.shift(Date.utc_today(), year: -1),
end_date: Date.utc_today(),
search: nil
)
|> display_shot_records()
{:ok, socket}
end end
@impl true @impl true
@ -44,7 +65,7 @@ defmodule CanneryWeb.RangeLive.Index do
defp apply_action(socket, :new, _params) do defp apply_action(socket, :new, _params) do
socket socket
|> assign( |> assign(
page_title: gettext("New Shot Records"), page_title: gettext("Record Shots"),
shot_record: %ShotRecord{} shot_record: %ShotRecord{}
) )
end end
@ -52,7 +73,7 @@ defmodule CanneryWeb.RangeLive.Index do
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket socket
|> assign( |> assign(
page_title: gettext("Shot Records"), page_title: gettext("Range"),
search: nil, search: nil,
shot_record: nil shot_record: nil
) )
@ -62,7 +83,7 @@ defmodule CanneryWeb.RangeLive.Index do
defp apply_action(socket, :search, %{"search" => search}) do defp apply_action(socket, :search, %{"search" => search}) do
socket socket
|> assign( |> assign(
page_title: gettext("Shot Records"), page_title: gettext("Range"),
search: search, search: search,
shot_record: nil shot_record: nil
) )
@ -71,7 +92,7 @@ defmodule CanneryWeb.RangeLive.Index do
@impl true @impl true
def handle_event("delete", %{"id" => id}, %{assigns: %{current_user: current_user}} = socket) do def handle_event("delete", %{"id" => id}, %{assigns: %{current_user: current_user}} = socket) do
{:ok, _} = {:ok, _shot_record} =
ActivityLog.get_shot_record!(id, current_user) ActivityLog.get_shot_record!(id, current_user)
|> ActivityLog.delete_shot_record(current_user) |> ActivityLog.delete_shot_record(current_user)
@ -81,14 +102,16 @@ defmodule CanneryWeb.RangeLive.Index do
def handle_event( def handle_event(
"toggle_staged", "toggle_staged",
%{"pack_id" => pack_id}, %{"container_id" => container_id},
%{assigns: %{current_user: current_user}} = socket %{assigns: %{current_user: current_user}} = socket
) do ) do
pack = Ammo.get_pack!(pack_id, current_user) container = Containers.get_container!(container_id, current_user)
{:ok, _pack} = pack |> Ammo.update_pack(%{"staged" => !pack.staged}, current_user) {:ok, _container} =
container
|> Containers.update_container(current_user, %{"staged" => !container.staged})
prompt = dgettext("prompts", "Ammo unstaged succesfully") prompt = dgettext("prompts", "Container unstaged succesfully")
{:noreply, socket |> put_flash(:info, prompt) |> display_shot_records()} {:noreply, socket |> put_flash(:info, prompt) |> display_shot_records()}
end end
@ -116,12 +139,50 @@ defmodule CanneryWeb.RangeLive.Index do
{:noreply, socket |> assign(:class, :all) |> display_shot_records()} {:noreply, socket |> assign(:class, :all) |> display_shot_records()}
end end
def handle_event(
"change_dates",
%{
"dates_start" => start_date,
"dates_end" => end_date
},
socket
) do
socket =
socket
|> assign(
start_date: start_date,
end_date: end_date
)
|> display_shot_records()
{:noreply, socket}
end
@spec display_shot_records(Socket.t()) :: Socket.t() @spec display_shot_records(Socket.t()) :: Socket.t()
defp display_shot_records( defp display_shot_records(
%{assigns: %{class: class, search: search, current_user: current_user}} = socket %{
assigns: %{
class: class,
start_date: start_date,
end_date: end_date,
search: search,
current_user: current_user
}
} = socket
) do ) do
shot_records = ActivityLog.list_shot_records(search, class, current_user) shot_records =
packs = Ammo.list_staged_packs(current_user) ActivityLog.list_shot_records(current_user,
class: class,
end_date: end_date,
search: search,
start_date: start_date
)
containers =
Containers.list_containers(current_user, staged: true)
|> Map.new(fn container = %{id: container_id} -> {container_id, container} end)
packs = Ammo.list_packs(current_user, staged: true)
chart_data = shot_records |> get_chart_data_for_shot_record() chart_data = shot_records |> get_chart_data_for_shot_record()
original_counts = packs |> Ammo.get_original_counts(current_user) original_counts = packs |> Ammo.get_original_counts(current_user)
cprs = packs |> Ammo.get_cprs(current_user) cprs = packs |> Ammo.get_cprs(current_user)
@ -130,6 +191,7 @@ defmodule CanneryWeb.RangeLive.Index do
socket socket
|> assign( |> assign(
containers: containers,
packs: packs, packs: packs,
original_counts: original_counts, original_counts: original_counts,
cprs: cprs, cprs: cprs,
@ -153,6 +215,5 @@ defmodule CanneryWeb.RangeLive.Index do
label: gettext("Rounds shot: %{count}", count: sum) label: gettext("Rounds shot: %{count}", count: sum)
} }
end) end)
|> Enum.sort_by(fn %{date: date} -> date end, Date)
end end
end end

View File

@ -1,43 +1,55 @@
<div class="flex flex-col space-y-8 justify-center items-center"> <div class="flex flex-col justify-center items-center space-y-8">
<h1 class="title text-2xl title-primary-500"> <h1 class="text-2xl title title-primary-500">
<%= gettext("Range day") %> <%= gettext("Range day") %>
</h1> </h1>
<%= if @packs |> Enum.empty?() do %> <%= if @containers |> Enum.empty?() do %>
<h1 class="title text-xl text-primary-600"> <h1 class="text-xl title text-primary-600">
<%= gettext("No ammo staged") %> <%= gettext("No containers staged") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h1> </h1>
<.link navigate={~p"/ammo"} class="btn btn-primary"> <.link navigate={~p"/containers"} class="btn btn-primary">
<%= dgettext("actions", "Why not get some ready to shoot?") %> <%= dgettext("actions", "Why not get some ready to shoot?") %>
</.link> </.link>
<% else %> <% else %>
<.link navigate={~p"/ammo"} class="btn btn-primary"> <.link navigate={~p"/containers"} class="btn btn-primary">
<%= dgettext("actions", "Stage ammo") %> <%= dgettext("actions", "Stage containers") %>
</.link> </.link>
<div class="w-full flex flex-row flex-wrap justify-center items-stretch"> <div class="flex flex-row flex-wrap justify-center items-stretch w-full">
<.container_card
:for={{container_id, container} <- @containers}
container={container}
current_user={@current_user}
>
<div class="flex flex-wrap justify-center items-center px-4 py-2 h-full min-w-20">
<button
type="button"
class="mx-2 my-1 text-sm btn btn-primary"
phx-click="toggle_staged"
phx-value-container_id={container_id}
>
<%= if container.staged,
do: dgettext("actions", "Unstage"),
else: dgettext("actions", "Stage") %>
</button>
</div>
</.container_card>
</div>
<hr class="hr" />
<div class="flex flex-row flex-wrap justify-center items-stretch w-full">
<.pack_card <.pack_card
:for={%{id: pack_id} = pack <- @packs} :for={%{id: pack_id, container_id: container_id} = pack <- @packs}
pack={pack} pack={pack}
original_count={Map.fetch!(@original_counts, pack_id)} original_count={Map.fetch!(@original_counts, pack_id)}
cpr={Map.get(@cprs, pack_id)} cpr={Map.get(@cprs, pack_id)}
last_used_date={Map.get(@last_used_dates, pack_id)} last_used_date={Map.get(@last_used_dates, pack_id)}
current_user={@current_user} current_user={@current_user}
container={Map.fetch!(@containers, container_id)}
> >
<button
type="button"
class="btn btn-primary"
phx-click="toggle_staged"
phx-value-pack_id={pack.id}
data-confirm={"#{dgettext("prompts", "Are you sure you want to unstage this ammo?")}"}
>
<%= if pack.staged,
do: dgettext("actions", "Unstage from range"),
else: dgettext("actions", "Stage for range") %>
</button>
<.link patch={~p"/range/add_shot_record/#{pack}"} class="btn btn-primary"> <.link patch={~p"/range/add_shot_record/#{pack}"} class="btn btn-primary">
<%= dgettext("actions", "Record shots") %> <%= dgettext("actions", "Record shots") %>
</.link> </.link>
@ -48,12 +60,12 @@
<hr class="hr" /> <hr class="hr" />
<%= if @shot_record_count == 0 do %> <%= if @shot_record_count == 0 do %>
<h1 class="title text-xl text-primary-600"> <h1 class="text-xl title text-primary-600">
<%= gettext("No shots recorded") %> <%= gettext("No shots recorded") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h1> </h1>
<% else %> <% else %>
<h1 class="title text-2xl text-primary-600"> <h1 class="text-2xl title text-primary-600">
<%= gettext("Shot log") %> <%= gettext("Shot log") %>
</h1> </h1>
@ -71,7 +83,7 @@
<%= dgettext("errors", "Your browser does not support the canvas element.") %> <%= dgettext("errors", "Your browser does not support the canvas element.") %>
</canvas> </canvas>
<div class="w-full flex flex-col sm:flex-row justify-center items-center space-y-4 sm:space-y-0 sm:space-x-4 max-w-2xl"> <div class="flex flex-col justify-center items-center space-y-4 w-full max-w-2xl sm:flex-row sm:space-y-0 sm:space-x-4">
<.form <.form
:let={f} :let={f}
for={%{}} for={%{}}
@ -80,7 +92,9 @@
phx-submit="change_class" phx-submit="change_class"
class="flex items-center" class="flex items-center"
> >
<%= label(f, :class, gettext("Class"), class: "title text-primary-600 text-lg text-center") %> <%= label(f, :class, gettext("Class"),
class: "title text-primary-600 text-lg text-center"
) %>
<%= select( <%= select(
f, f,
@ -102,32 +116,47 @@
as={:search} as={:search}
phx-change="search" phx-change="search"
phx-submit="search" phx-submit="search"
class="grow flex items-center" class="flex items-center grow"
> >
<%= text_input(f, :search_term, <%= text_input(f, :search_term,
class: "grow input input-primary", class: "grow input input-primary",
value: @search,
role: "search",
phx_debounce: 300, phx_debounce: 300,
placeholder: gettext("Search shot records") placeholder: gettext("Search shot records"),
role: "search",
value: @search
) %> ) %>
</.form> </.form>
<.form
:let={f}
for={%{}}
as={:shot_records}
phx-change="change_dates"
phx-submit="change_dates"
class="flex items-center"
>
<%= label(f, :dates_start, gettext("Dates"),
class: "title text-primary-600 text-lg text-center"
) %>
<.date_range name="dates" />
</.form>
</div> </div>
<%= if @shot_records |> Enum.empty?() do %> <%= if @shot_records |> Enum.empty?() do %>
<h1 class="title text-xl text-primary-600"> <h1 class="text-xl title text-primary-600">
<%= gettext("No shots recorded") %> <%= gettext("No shots recorded") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h1> </h1>
<% else %> <% else %>
<.live_component <.live_component
module={CanneryWeb.Components.ShotRecordTableComponent} module={CanneryWeb.Components.ShotRecordTableComponent}
id="shot_records_index_table" id="shot-records-index-table"
shot_records={@shot_records} shot_records={@shot_records}
current_user={@current_user} current_user={@current_user}
> >
<:actions :let={shot_record}> <:actions :let={shot_record}>
<div class="px-4 py-2 space-x-4 flex justify-center items-center"> <div class="flex justify-center items-center px-4 py-2 space-x-4">
<.link <.link
patch={~p"/range/edit/#{shot_record}"} patch={~p"/range/edit/#{shot_record}"}
class="text-primary-600 link" class="text-primary-600 link"

View File

@ -17,7 +17,7 @@ defmodule CanneryWeb.TagLive.FormComponent do
@impl true @impl true
def handle_event("validate", %{"tag" => tag_params}, socket) do def handle_event("validate", %{"tag" => tag_params}, socket) do
{:noreply, socket |> assign_changeset(tag_params)} {:noreply, socket |> assign_changeset(tag_params, :validate)}
end end
def handle_event("save", %{"tag" => tag_params}, %{assigns: %{action: action}} = socket) do def handle_event("save", %{"tag" => tag_params}, %{assigns: %{action: action}} = socket) do
@ -26,14 +26,9 @@ defmodule CanneryWeb.TagLive.FormComponent do
defp assign_changeset( defp assign_changeset(
%{assigns: %{action: action, current_user: user, tag: tag}} = socket, %{assigns: %{action: action, current_user: user, tag: tag}} = socket,
tag_params tag_params,
changeset_action \\ nil
) do ) do
changeset_action =
case action do
:new -> :insert
:edit -> :update
end
changeset = changeset =
case action do case action do
:new -> tag |> Tag.create_changeset(user, tag_params) :new -> tag |> Tag.create_changeset(user, tag_params)
@ -41,10 +36,14 @@ defmodule CanneryWeb.TagLive.FormComponent do
end end
changeset = changeset =
if changeset_action do
case changeset |> Changeset.apply_action(changeset_action) do case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset {:ok, _data} -> changeset
{:error, changeset} -> changeset {:error, changeset} -> changeset
end end
else
changeset
end
socket |> assign(:changeset, changeset) socket |> assign(:changeset, changeset)
end end

View File

@ -12,14 +12,18 @@
phx-submit="save" phx-submit="save"
> >
<div <div
:if={@changeset.action && not @changeset.valid?()} :if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center" class="invalid-feedback col-span-3 text-center"
> >
<%= changeset_errors(@changeset) %> <%= changeset_errors(@changeset) %>
</div> </div>
<%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %> <%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :name, class: "input input-primary col-span-2", maxlength: 255) %> <%= text_input(f, :name,
class: "input input-primary col-span-2",
maxlength: 255,
phx_debounce: 300
) %>
<%= error_tag(f, :name, "col-span-3") %> <%= error_tag(f, :name, "col-span-3") %>
<%= label(f, :bg_color, gettext("Background color"), class: "title text-lg text-primary-600") %> <%= label(f, :bg_color, gettext("Background color"), class: "title text-lg text-primary-600") %>

View File

@ -75,6 +75,6 @@ defmodule CanneryWeb.TagLive.Index do
end end
defp display_tags(%{assigns: %{search: search, current_user: current_user}} = socket) do defp display_tags(%{assigns: %{search: search, current_user: current_user}} = socket) do
socket |> assign(tags: Containers.list_tags(search, current_user)) socket |> assign(tags: Containers.list_tags(current_user, search: search))
end end
end end

View File

@ -30,10 +30,10 @@
> >
<%= text_input(f, :search_term, <%= text_input(f, :search_term,
class: "grow input input-primary", class: "grow input input-primary",
value: @search,
role: "search",
phx_debounce: 300, phx_debounce: 300,
placeholder: gettext("Search tags") placeholder: gettext("Search tags"),
role: "search",
value: @search
) %> ) %>
</.form> </.form>
</div> </div>

View File

@ -19,7 +19,7 @@ defmodule CanneryWeb.TypeLive.FormComponent do
@impl true @impl true
def handle_event("validate", %{"type" => type_params}, socket) do def handle_event("validate", %{"type" => type_params}, socket) do
{:noreply, socket |> assign_changeset(type_params)} {:noreply, socket |> assign_changeset(type_params, :validate)}
end end
def handle_event( def handle_event(
@ -32,14 +32,9 @@ defmodule CanneryWeb.TypeLive.FormComponent do
defp assign_changeset( defp assign_changeset(
%{assigns: %{action: action, type: type, current_user: user}} = socket, %{assigns: %{action: action, type: type, current_user: user}} = socket,
type_params type_params,
changeset_action \\ nil
) do ) do
changeset_action =
case action do
create when create in [:new, :clone] -> :insert
:edit -> :update
end
changeset = changeset =
case action do case action do
create when create in [:new, :clone] -> create when create in [:new, :clone] ->
@ -50,10 +45,14 @@ defmodule CanneryWeb.TypeLive.FormComponent do
end end
changeset = changeset =
if changeset_action do
case changeset |> Changeset.apply_action(changeset_action) do case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset {:ok, _data} -> changeset
{:error, changeset} -> changeset {:error, changeset} -> changeset
end end
else
changeset
end
socket |> assign(changeset: changeset) socket |> assign(changeset: changeset)
end end

View File

@ -12,7 +12,7 @@
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" 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 <div
:if={@changeset.action && not @changeset.valid?()} :if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center" class="invalid-feedback col-span-3 text-center"
> >
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
@ -22,7 +22,11 @@
<%= select( <%= select(
f, f,
:class, :class,
[{gettext("Rifle"), :rifle}, {gettext("Shotgun"), :shotgun}, {gettext("Pistol"), :pistol}], [
{gettext("Rifle"), :rifle},
{gettext("Shotgun"), :shotgun},
{gettext("Pistol"), :pistol}
],
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255
) %> ) %>
@ -31,14 +35,16 @@
<%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %> <%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :name, <%= text_input(f, :name,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :name, "col-span-3 text-center") %> <%= error_tag(f, :name, "col-span-3 text-center") %>
<%= label(f, :desc, gettext("Description"), class: "title text-lg text-primary-600") %> <%= label(f, :desc, gettext("Description"), class: "title text-lg text-primary-600") %>
<%= textarea(f, :desc, <%= textarea(f, :desc,
id: "type-form-desc",
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
id: "type-form-desc",
phx_debounce: 300,
phx_update: "ignore" phx_update: "ignore"
) %> ) %>
<%= error_tag(f, :desc, "col-span-3 text-center") %> <%= error_tag(f, :desc, "col-span-3 text-center") %>
@ -52,6 +58,7 @@
<%= text_input(f, :cartridge, <%= text_input(f, :cartridge,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("5.56x46mm NATO") placeholder: gettext("5.56x46mm NATO")
) %> ) %>
<%= error_tag(f, :cartridge, "col-span-3 text-center") %> <%= error_tag(f, :cartridge, "col-span-3 text-center") %>
@ -71,6 +78,7 @@
<%= text_input(f, :caliber, <%= text_input(f, :caliber,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext(".223") placeholder: gettext(".223")
) %> ) %>
<%= error_tag(f, :caliber, "col-span-3 text-center") %> <%= error_tag(f, :caliber, "col-span-3 text-center") %>
@ -81,21 +89,28 @@
) %> ) %>
<%= text_input(f, :unfired_length, <%= text_input(f, :unfired_length,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :unfired_length, "col-span-3 text-center") %> <%= error_tag(f, :unfired_length, "col-span-3 text-center") %>
<%= label(f, :brass_height, gettext("Brass height"), class: "title text-lg text-primary-600") %> <%= label(f, :brass_height, gettext("Brass height"),
class: "title text-lg text-primary-600"
) %>
<%= text_input(f, :brass_height, <%= text_input(f, :brass_height,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :brass_height, "col-span-3 text-center") %> <%= error_tag(f, :brass_height, "col-span-3 text-center") %>
<%= label(f, :chamber_size, gettext("Chamber size"), class: "title text-lg text-primary-600") %> <%= label(f, :chamber_size, gettext("Chamber size"),
class: "title text-lg text-primary-600"
) %>
<%= text_input(f, :chamber_size, <%= text_input(f, :chamber_size,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :chamber_size, "col-span-3 text-center") %> <%= error_tag(f, :chamber_size, "col-span-3 text-center") %>
<% else %> <% else %>
@ -132,6 +147,7 @@
<%= text_input(f, :bullet_type, <%= text_input(f, :bullet_type,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("FMJ") placeholder: gettext("FMJ")
) %> ) %>
<%= error_tag(f, :bullet_type, "col-span-3 text-center") %> <%= error_tag(f, :bullet_type, "col-span-3 text-center") %>
@ -151,6 +167,7 @@
<%= text_input(f, :bullet_core, <%= text_input(f, :bullet_core,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("Steel") placeholder: gettext("Steel")
) %> ) %>
<%= error_tag(f, :bullet_core, "col-span-3 text-center") %> <%= error_tag(f, :bullet_core, "col-span-3 text-center") %>
@ -160,6 +177,7 @@
<%= text_input(f, :jacket_type, <%= text_input(f, :jacket_type,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("Bimetal") placeholder: gettext("Bimetal")
) %> ) %>
<%= error_tag(f, :jacket_type, "col-span-3 text-center") %> <%= error_tag(f, :jacket_type, "col-span-3 text-center") %>
@ -167,10 +185,13 @@
<%= hidden_input(f, :jacket_type, value: nil) %> <%= hidden_input(f, :jacket_type, value: nil) %>
<% end %> <% end %>
<%= label(f, :case_material, gettext("Case material"), class: "title text-lg text-primary-600") %> <%= label(f, :case_material, gettext("Case material"),
class: "title text-lg text-primary-600"
) %>
<%= text_input(f, :case_material, <%= text_input(f, :case_material,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("Brass") placeholder: gettext("Brass")
) %> ) %>
<%= error_tag(f, :case_material, "col-span-3 text-center") %> <%= error_tag(f, :case_material, "col-span-3 text-center") %>
@ -179,7 +200,8 @@
<%= label(f, :wadding, gettext("Wadding"), class: "title text-lg text-primary-600") %> <%= label(f, :wadding, gettext("Wadding"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :wadding, <%= text_input(f, :wadding,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :wadding, "col-span-3 text-center") %> <%= error_tag(f, :wadding, "col-span-3 text-center") %>
@ -187,6 +209,7 @@
<%= text_input(f, :shot_type, <%= text_input(f, :shot_type,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("Target, bird, buck, etc") placeholder: gettext("Target, bird, buck, etc")
) %> ) %>
<%= error_tag(f, :shot_type, "col-span-3 text-center") %> <%= error_tag(f, :shot_type, "col-span-3 text-center") %>
@ -196,14 +219,16 @@
) %> ) %>
<%= text_input(f, :shot_material, <%= text_input(f, :shot_material,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :shot_material, "col-span-3 text-center") %> <%= error_tag(f, :shot_material, "col-span-3 text-center") %>
<%= label(f, :shot_size, gettext("Shot size"), class: "title text-lg text-primary-600") %> <%= label(f, :shot_size, gettext("Shot size"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :shot_size, <%= text_input(f, :shot_size,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :shot_size, "col-span-3 text-center") %> <%= error_tag(f, :shot_size, "col-span-3 text-center") %>
@ -220,7 +245,8 @@
) %> ) %>
<%= text_input(f, :shot_charge_weight, <%= text_input(f, :shot_charge_weight,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :shot_charge_weight, "col-span-3 text-center") %> <%= error_tag(f, :shot_charge_weight, "col-span-3 text-center") %>
<% else %> <% else %>
@ -239,7 +265,8 @@
<%= label(f, :powder_type, gettext("Powder type"), class: "title text-lg text-primary-600") %> <%= label(f, :powder_type, gettext("Powder type"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :powder_type, <%= text_input(f, :powder_type,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :powder_type, "col-span-3 text-center") %> <%= error_tag(f, :powder_type, "col-span-3 text-center") %>
@ -261,6 +288,7 @@
<%= text_input(f, :pressure, <%= text_input(f, :pressure,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("+P") placeholder: gettext("+P")
) %> ) %>
<%= error_tag(f, :pressure, "col-span-3 text-center") %> <%= error_tag(f, :pressure, "col-span-3 text-center") %>
@ -271,7 +299,8 @@
) %> ) %>
<%= text_input(f, :dram_equivalent, <%= text_input(f, :dram_equivalent,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :dram_equivalent, "col-span-3 text-center") %> <%= error_tag(f, :dram_equivalent, "col-span-3 text-center") %>
<% else %> <% else %>
@ -300,6 +329,7 @@
<%= text_input(f, :primer_type, <%= text_input(f, :primer_type,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("Boxer") placeholder: gettext("Boxer")
) %> ) %>
<%= error_tag(f, :primer_type, "col-span-3 text-center") %> <%= error_tag(f, :primer_type, "col-span-3 text-center") %>
@ -308,6 +338,7 @@
<%= text_input(f, :firing_type, <%= text_input(f, :firing_type,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255, maxlength: 255,
phx_debounce: 300,
placeholder: gettext("Centerfire") placeholder: gettext("Centerfire")
) %> ) %>
<%= error_tag(f, :firing_type, "col-span-3 text-center") %> <%= error_tag(f, :firing_type, "col-span-3 text-center") %>
@ -339,14 +370,16 @@
<%= label(f, :manufacturer, gettext("Manufacturer"), class: "title text-lg text-primary-600") %> <%= label(f, :manufacturer, gettext("Manufacturer"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :manufacturer, <%= text_input(f, :manufacturer,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :manufacturer, "col-span-3 text-center") %> <%= error_tag(f, :manufacturer, "col-span-3 text-center") %>
<%= label(f, :upc, gettext("UPC"), class: "title text-lg text-primary-600") %> <%= label(f, :upc, gettext("UPC"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :upc, <%= text_input(f, :upc,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary",
maxlength: 255 maxlength: 255,
phx_debounce: 300
) %> ) %>
<%= error_tag(f, :upc, "col-span-3 text-center") %> <%= error_tag(f, :upc, "col-span-3 text-center") %>

View File

@ -106,7 +106,7 @@ defmodule CanneryWeb.TypeLive.Index do
) do ) do
socket socket
|> assign( |> assign(
types: Ammo.list_types(search, current_user, class), types: Ammo.list_types(current_user, class: class, search: search),
types_count: Ammo.get_types_count!(current_user) types_count: Ammo.get_types_count!(current_user)
) )
end end

View File

@ -26,7 +26,9 @@
phx-submit="change_class" phx-submit="change_class"
class="flex items-center" class="flex items-center"
> >
<%= label(f, :class, gettext("Class"), class: "title text-primary-600 text-lg text-center") %> <%= label(f, :class, gettext("Class"),
class: "title text-primary-600 text-lg text-center"
) %>
<%= select( <%= select(
f, f,
@ -52,10 +54,10 @@
> >
<%= text_input(f, :search_term, <%= text_input(f, :search_term,
class: "grow input input-primary", class: "grow input input-primary",
value: @search,
role: "search",
phx_debounce: 300, phx_debounce: 300,
placeholder: gettext("Search catalog") placeholder: gettext("Search catalog"),
role: "search",
value: @search
) %> ) %>
</.form> </.form>
@ -74,7 +76,7 @@
<% else %> <% else %>
<.live_component <.live_component
module={CanneryWeb.Components.TypeTableComponent} module={CanneryWeb.Components.TypeTableComponent}
id="types_index_table" id="types-index-table"
action={@live_action} action={@live_action}
types={@types} types={@types}
current_user={@current_user} current_user={@current_user}

View File

@ -40,7 +40,7 @@ defmodule CanneryWeb.TypeLive.Show do
defp display_type( defp display_type(
%{assigns: %{live_action: live_action, current_user: current_user, show_used: show_used}} = %{assigns: %{live_action: live_action, current_user: current_user, show_used: show_used}} =
socket, socket,
%Type{name: type_name} = type %Type{id: type_id, name: type_name} = type
) do ) do
custom_fields? = custom_fields? =
fields_to_display(type) fields_to_display(type)
@ -54,7 +54,7 @@ defmodule CanneryWeb.TypeLive.Show do
type |> Map.get(field) != default_value type |> Map.get(field) != default_value
end) end)
packs = type |> Ammo.list_packs_for_type(current_user, show_used) packs = Ammo.list_packs(current_user, type_id: type_id, show_used: show_used)
[ [
original_counts, original_counts,
@ -66,10 +66,10 @@ defmodule CanneryWeb.TypeLive.Show do
if show_used do if show_used do
[ [
packs |> Ammo.get_original_counts(current_user), packs |> Ammo.get_original_counts(current_user),
type |> Ammo.get_used_packs_count_for_type(current_user), Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used),
type |> Ammo.get_packs_count_for_type(current_user, true), Ammo.get_packs_count(current_user, type_id: type.id, show_used: true),
type |> ActivityLog.get_used_count_for_type(current_user), ActivityLog.get_used_count(current_user, type_id: type.id),
type |> Ammo.get_historical_count_for_type(current_user) Ammo.get_historical_count(type, current_user)
] ]
else else
[nil, nil, nil, nil, nil] [nil, nil, nil, nil, nil]
@ -94,12 +94,12 @@ defmodule CanneryWeb.TypeLive.Show do
containers: containers, containers: containers,
cprs: packs |> Ammo.get_cprs(current_user), cprs: packs |> Ammo.get_cprs(current_user),
last_used_dates: packs |> ActivityLog.get_last_used_dates(current_user), last_used_dates: packs |> ActivityLog.get_last_used_dates(current_user),
avg_cost_per_round: type |> Ammo.get_average_cost_for_type(current_user), avg_cost_per_round: Ammo.get_average_cost(type, current_user),
rounds: type |> Ammo.get_round_count_for_type(current_user), rounds: Ammo.get_round_count(current_user, type_id: type.id),
original_counts: original_counts, original_counts: original_counts,
used_rounds: used_rounds, used_rounds: used_rounds,
historical_round_count: historical_round_count, historical_round_count: historical_round_count,
packs_count: type |> Ammo.get_packs_count_for_type(current_user), packs_count: Ammo.get_packs_count(current_user, type_id: type.id),
used_packs_count: used_packs_count, used_packs_count: used_packs_count,
historical_packs_count: historical_packs_count, historical_packs_count: historical_packs_count,
fields_to_display: fields_to_display(type), fields_to_display: fields_to_display(type),

View File

@ -198,7 +198,9 @@
navigate={~p"/ammo/show/#{pack}"} navigate={~p"/ammo/show/#{pack}"}
class="text-primary-600 link" class="text-primary-600 link"
aria-label={ aria-label={
dgettext("actions", "View pack of %{pack_count} bullets", pack_count: pack_count) dgettext("actions", "View pack of %{pack_count} bullets",
pack_count: pack_count
)
} }
> >
<i class="fa-fw fa-lg fas fa-eye"></i> <i class="fa-fw fa-lg fas fa-eye"></i>

View File

@ -120,7 +120,7 @@ defmodule CanneryWeb.Router do
# #
# Note that preview only shows emails that were sent by the same # Note that preview only shows emails that were sent by the same
# node running the Phoenix server. # node running the Phoenix server.
if Mix.env() == :dev do if Application.compile_env(:cannery, :env) == :dev do
scope "/dev" do scope "/dev" do
pipe_through :browser pipe_through :browser

39
mix.exs
View File

@ -4,8 +4,8 @@ defmodule Cannery.MixProject do
def project do def project do
[ [
app: :cannery, app: :cannery,
version: "0.9.3", version: "0.9.13",
elixir: "1.14.4", elixir: "1.18.1",
elixirc_paths: elixirc_paths(Mix.env()), elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod, start_permanent: Mix.env() == :prod,
aliases: aliases(), aliases: aliases(),
@ -47,29 +47,30 @@ defmodule Cannery.MixProject do
defp deps do defp deps do
[ [
{:bcrypt_elixir, "~> 3.0"}, {:bcrypt_elixir, "~> 3.0"},
{:phoenix, "~> 1.7.0"}, {:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:phoenix_ecto, "~> 4.4"}, {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:phoenix_html, "~> 3.0"}, {:ecto_psql_extras, "~> 0.6"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.18.0"},
{:phoenix_live_dashboard, "~> 0.6"},
{:ecto_sql, "~> 3.6"}, {:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"}, {:eqrcode, "~> 0.1.10"},
{:floki, ">= 0.30.0", only: :test},
# {:esbuild, "~> 0.3", runtime: Mix.env() == :dev}, # {:esbuild, "~> 0.3", runtime: Mix.env() == :dev},
{:ex_doc, "~> 0.27", only: :dev, runtime: false}, {:ex_doc, "~> 0.27", only: :dev, runtime: false},
{:swoosh, "~> 1.6"}, {:floki, ">= 0.30.0", only: :test},
{:gen_smtp, "~> 1.0"}, {:gen_smtp, "~> 1.0"},
{:oban, "~> 2.10"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.18"}, {:gettext, "~> 0.18"},
{:jason, "~> 1.2"}, {:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"}, {:oban, "~> 2.10"},
{:ecto_psql_extras, "~> 0.6"}, {:phoenix_ecto, "~> 4.4"},
{:eqrcode, "~> 0.1.10"}, {:phoenix_html_helpers, "~> 1.0"},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false}, {:phoenix_html, "~> 4.0"},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false} {:phoenix_live_dashboard, "~> 0.8"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.20.0"},
{:phoenix, "~> 1.7.11"},
{:plug_cowboy, "~> 2.7"},
{:postgrex, ">= 0.0.0"},
{:swoosh, "~> 1.6"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"}
] ]
end end

View File

@ -1,54 +1,54 @@
%{ %{
"bcrypt_elixir": {:hex, :bcrypt_elixir, "3.0.1", "9be815469e6bfefec40fa74658ecbbe6897acfb57614df1416eeccd4903f602c", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "486bb95efb645d1efc6794c1ddd776a186a9a713abf06f45708a6ce324fb96cf"}, "bcrypt_elixir": {:hex, :bcrypt_elixir, "3.2.0", "feab711974beba4cb348147170346fe097eea2e840db4e012a145e180ed4ab75", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "563e92a6c77d667b19c5f4ba17ab6d440a085696bdf4c68b9b0f5b30bc5422b8"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"castore": {:hex, :castore, "1.0.1", "240b9edb4e9e94f8f56ab39d8d2d0a57f49e46c56aced8f873892df8ff64ff5a", [:mix], [], "hexpm", "b4951de93c224d44fac71614beabd88b71932d0b1dea80d2f80fb9044e01bbb3"}, "castore": {:hex, :castore, "1.0.11", "4bbd584741601eb658007339ea730b082cc61f3554cf2e8f39bf693a11b49073", [:mix], [], "hexpm", "e03990b4db988df56262852f20de0f659871c35154691427a5047f4967a16a62"},
"comeonin": {:hex, :comeonin, "5.3.3", "2c564dac95a35650e9b6acfe6d2952083d8a08e4a89b93a481acb552b325892e", [:mix], [], "hexpm", "3e38c9c2cb080828116597ca8807bb482618a315bfafd98c90bc22a821cc84df"}, "comeonin": {:hex, :comeonin, "5.5.0", "364d00df52545c44a139bad919d7eacb55abf39e86565878e17cebb787977368", [:mix], [], "hexpm", "6287fc3ba0aad34883cbe3f7949fc1d1e738e5ccdce77165bc99490aa69f47fb"},
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, "cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"},
"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"}, "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"}, "cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"},
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [: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", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"}, "credo": {:hex, :credo, "1.7.11", "d3e805f7ddf6c9c854fd36f089649d7cf6ba74c42bc3795d587814e3c9847102", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "56826b4306843253a66e47ae45e98e7d284ee1f95d53d1612bb483f88a8cf219"},
"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.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"}, "decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"}, "dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
"earmark_parser": {:hex, :earmark_parser, "1.4.31", "a93921cdc6b9b869f519213d5bc79d9e218ba768d7270d46fdcf1c01bacff9e2", [:mix], [], "hexpm", "317d367ee0335ef037a87e46c91a2269fef6306413f731e8ec11fc45a7efd059"}, "earmark_parser": {:hex, :earmark_parser, "1.4.42", "f23d856f41919f17cd06a493923a722d87a2d684f143a1e663c04a2b93100682", [:mix], [], "hexpm", "6915b6ca369b5f7346636a2f41c6a6d78b5af419d61a611079189233358b8b8b"},
"ecto": {:hex, :ecto, "3.10.1", "c6757101880e90acc6125b095853176a02da8f1afe056f91f1f90b80c9389822", [: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", "d2ac4255f1601bdf7ac74c0ed971102c6829dc158719b94bd30041bbad77f87a"}, "ecto": {:hex, :ecto, "3.12.5", "4a312960ce612e17337e7cefcf9be45b95a3be6b36b6f94dfb3d8c361d631866", [:mix], [{:decimal, "~> 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", "6eb18e80bef8bb57e17f5a7f068a1719fbda384d40fc37acb8eb8aeca493b6ea"},
"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_psql_extras": {:hex, :ecto_psql_extras, "0.8.3", "0c1df205bd051eaf599b3671e75356b121aa71eac09b63ecf921cb1a080c072e", [:mix], [{:ecto_sql, "~> 3.7", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:postgrex, "> 0.16.0 and < 0.20.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:table_rex, "~> 3.1.1 or ~> 4.0.0", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "d0e35ea160359e759a2993a00c3a5389a9ca7ece6df5d0753fa927f988c7351a"},
"ecto_sql": {:hex, :ecto_sql, "3.10.1", "6ea6b3036a0b0ca94c2a02613fd9f742614b5cfe494c41af2e6571bb034dd94c", [: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", "f6a25bdbbd695f12c8171eaff0851fa4c8e72eec1e98c7364402dda9ce11c56b"}, "ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 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", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"},
"elixir_make": {:hex, :elixir_make, "0.7.6", "67716309dc5d43e16b5abbd00c01b8df6a0c2ab54a8f595468035a50189f9169", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5a0569756b0f7873a77687800c164cca6dfc03a09418e6fcf853d78991f49940"}, "elixir_make": {:hex, :elixir_make, "0.9.0", "6484b3cd8c0cee58f09f05ecaf1a140a8c97670671a6a0e7ab4dc326c3109726", [:mix], [], "hexpm", "db23d4fd8b757462ad02f8aa73431a426fe6671c80b200d9710caf3d1dd0ffdb"},
"eqrcode": {:hex, :eqrcode, "0.1.10", "6294fece9d68ad64eef1c3c92cf111cfd6469f4fbf230a2d4cc905a682178f3f", [:mix], [], "hexpm", "da30e373c36a0fd37ab6f58664b16029919896d6c45a68a95cc4d713e81076f1"}, "eqrcode": {:hex, :eqrcode, "0.1.10", "6294fece9d68ad64eef1c3c92cf111cfd6469f4fbf230a2d4cc905a682178f3f", [:mix], [], "hexpm", "da30e373c36a0fd37ab6f58664b16029919896d6c45a68a95cc4d713e81076f1"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
"ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [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", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"}, "ex_doc": {:hex, :ex_doc, "0.36.1", "4197d034f93e0b89ec79fac56e226107824adcce8d2dd0a26f5ed3a95efc36b1", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "d7d26a7cf965dacadcd48f9fa7b5953d7d0cfa3b44fa7a65514427da44eafd89"},
"expo": {:hex, :expo, "0.4.1", "1c61d18a5df197dfda38861673d392e642649a9cef7694d2f97a587b2cfb319b", [:mix], [], "hexpm", "2ff7ba7a798c8c543c12550fa0e2cbc81b95d4974c65855d8d15ba7b37a1ce47"}, "expo": {:hex, :expo, "1.1.0", "f7b9ed7fb5745ebe1eeedf3d6f29226c5dd52897ac67c0f8af62a07e661e5c75", [:mix], [], "hexpm", "fbadf93f4700fb44c331362177bdca9eeb8097e8b0ef525c9cc501cb9917c960"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"},
"floki": {:hex, :floki, "0.34.2", "5fad07ef153b3b8ec110b6b155ec3780c4b2c4906297d0b4be1a7162d04a7e02", [:mix], [], "hexpm", "26b9d50f0f01796bc6be611ca815c5e0de034d2128e39cc9702eee6b66a4d1c8"}, "floki": {:hex, :floki, "0.37.0", "b83e0280bbc6372f2a403b2848013650b16640cd2470aea6701f0632223d719e", [:mix], [], "hexpm", "516a0c15a69f78c47dc8e0b9b3724b29608aa6619379f91b1ffa47109b5d0dd3"},
"gen_smtp": {:hex, :gen_smtp, "1.2.0", "9cfc75c72a8821588b9b9fe947ae5ab2aed95a052b81237e0928633a13276fd3", [:rebar3], [{:ranch, ">= 1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "5ee0375680bca8f20c4d85f58c2894441443a743355430ff33a783fe03296779"}, "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.1", "e7942988383c3d9eed4bdc22fc63e712b655ae94a672a27e4900e3d4a2c43581", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "ad105b8dab668ee3f90c0d3d94ba75e9aead27a62495c101d94f2657a190ac5d"}, "gettext": {:hex, :gettext, "0.26.2", "5978aa7b21fada6deabf1f6341ddba50bc69c999e812211903b169799208f2a8", [:mix], [{:expo, "~> 0.5.1 or ~> 1.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "aa978504bcf76511efdc22d580ba08e2279caab1066b76bb9aa81c4a1e0a32a5"},
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"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": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
"mime": {:hex, :mime, "2.0.3", "3676436d3d1f7b81b5a2d2bd8405f412c677558c81b1c92be58c00562bb59095", [:mix], [], "hexpm", "27a30bf0db44d25eecba73755acf4068cbfe26a4372f9eb3e4ea3a45956bff6b"}, "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},
"nimble_parsec": {:hex, :nimble_parsec, "1.3.0", "9e18a119d9efc3370a3ef2a937bf0b24c088d9c4bf0ba9d7c3751d49d347d035", [:mix], [], "hexpm", "7977f183127a7cbe9346981e2f480dc04c55ffddaef746bd58debd566070eef8"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
"oban": {:hex, :oban, "2.15.0", "27b9c2845cdff30c98c8060b11a64318e79bbc1bd32b8dc95fa59a1580a8d90c", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "22e181c540335d1dd5c995be00435927075519207d62b3de32477d95dbf9dfd3"}, "oban": {:hex, :oban, "2.18.3", "1608c04f8856c108555c379f2f56bc0759149d35fa9d3b825cb8a6769f8ae926", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "36ca6ca84ef6518f9c2c759ea88efd438a3c81d667ba23b02b062a0aa785475e"},
"phoenix": {:hex, :phoenix, "1.7.2", "c375ffb482beb4e3d20894f84dd7920442884f5f5b70b9f4528cbe0cedefec63", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, 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]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [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]}, {:websock_adapter, "~> 0.4", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "1ebca94b32b4d0e097ab2444a9742ed8ff3361acad17365e4e6b2e79b4792159"}, "phoenix": {:hex, :phoenix, "1.7.18", "5310c21443514be44ed93c422e15870aef254cf1b3619e4f91538e7529d2b2e4", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, 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]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "1797fcc82108442a66f2c77a643a62980f342bfeb63d6c9a515ab8294870004e"},
"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_ecto": {:hex, :phoenix_ecto, "4.6.3", "f686701b0499a07f2e3b122d84d52ff8a31f5def386e03706c916f6feddf69ef", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "909502956916a657a197f94cc1206d9a65247538de8a5e186f7537c895d95764"},
"phoenix_html": {:hex, :phoenix_html, "3.3.1", "4788757e804a30baac6b3fc9695bf5562465dd3f1da8eb8460ad5b404d9a2178", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "bed1906edd4906a15fd7b412b85b05e521e1f67c9a85418c55999277e553d0d3"}, "phoenix_html": {:hex, :phoenix_html, "4.2.0", "83a4d351b66f472ebcce242e4ae48af1b781866f00ef0eb34c15030d4e2069ac", [:mix], [], "hexpm", "9713b3f238d07043583a94296cc4bbdceacd3b3a6c74667f4df13971e7866ec8"},
"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_html_helpers": {:hex, :phoenix_html_helpers, "1.0.1", "7eed85c52eff80a179391036931791ee5d2f713d76a81d0d2c6ebafe1e11e5ec", [:mix], [{:phoenix_html, "~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "cffd2385d1fa4f78b04432df69ab8da63dc5cf63e07b713a4dcf36a3740e3090"},
"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_dashboard": {:hex, :phoenix_live_dashboard, "0.8.6", "7b1f0327f54c9eb69845fd09a77accf922f488c549a7e7b8618775eb603a62c7", [: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]}, {:ecto_sqlite3_extras, "~> 1.1.7 or ~> 1.2.0", [hex: :ecto_sqlite3_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.19 or ~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "1681ab813ec26ca6915beb3414aa138f298e17721dc6a2bde9e6eb8a62360ff6"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.18.18", "1f38fbd7c363723f19aad1a04b5490ff3a178e37daaf6999594d5f34796c47fc", [: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.3", [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", "a5810d0472f3189ede6d2a95bda7f31c6113156b91784a3426cb0ab6a6d85214"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.5.3", "f2161c207fda0e4fb55165f650f7f8db23f02b29e3bff00ff7ef161d6ac1f09d", [:mix], [{:file_system, "~> 0.3 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "b4ec9cd73cb01ff1bd1cac92e045d13e7030330b74164297d1aee3907b54803c"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"}, "phoenix_live_view": {:hex, :phoenix_live_view, "0.20.17", "f396bbdaf4ba227b82251eb75ac0afa6b3da5e509bc0d030206374237dfc9450", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: true]}, {: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.3 or ~> 4.0", [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]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a61d741ffb78c85fdbca0de084da6a48f8ceb5261a79165b5a0b59e5f65ce98b"},
"phoenix_template": {:hex, :phoenix_template, "1.0.1", "85f79e3ad1b0180abb43f9725973e3b8c2c3354a87245f91431eec60553ed3ef", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "157dc078f6226334c91cb32c1865bf3911686f8bcd6bcff86736f6253e6993ee"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"},
"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"}, "phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"},
"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": {:hex, :plug, "1.16.1", "40c74619c12f82736d2214557dedec2e9762029b2438d6d175c5074c933edc9d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a13ff6b9006b03d7e33874945b2755253841b238c34071ed85b0e86057f8cddc"},
"plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"}, "plug_cowboy": {:hex, :plug_cowboy, "2.7.2", "fdadb973799ae691bf9ecad99125b16625b1c6039999da5fe544d99218e662e4", [: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", "245d8a11ee2306094840c000e8816f0cbed69a23fc0ac2bcf8d7835ae019bb2f"},
"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"}, "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"},
"postgrex": {:hex, :postgrex, "0.19.3", "a0bda6e3bc75ec07fca5b0a89bffd242ca209a4822a9533e7d3e84ee80707e19", [: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", "d31c28053655b78f47f948c85bb1cf86a9c1f8ead346ba1aa0d0df017fa05b61"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, "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.17.6", "27ff070f96246e35b7105ab1c52b2b689f523a3cb83ed9faadb2f33bd653ccba", [:mix], [{:bandit, ">= 1.0.0", [hex: :bandit, repo: "hexpm", optional: true]}, {: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]}, {:mua, "~> 0.2.3", [hex: :mua, repo: "hexpm", optional: true]}, {:multipart, "~> 0.4", [hex: :multipart, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:req, "~> 0.5 or ~> 1.0", [hex: :req, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9798f3e72165f40c950f6762c06dab68afcdcf616138fc4a07965c09c250e1e2"},
"table_rex": {:hex, :table_rex, "3.1.1", "0c67164d1714b5e806d5067c1e96ff098ba7ae79413cc075973e17c38a587caa", [:mix], [], "hexpm", "678a23aba4d670419c23c17790f9dcd635a4a89022040df7d5d772cb21012490"}, "table_rex": {:hex, :table_rex, "4.0.0", "3c613a68ebdc6d4d1e731bc973c233500974ec3993c99fcdabb210407b90959b", [:mix], [], "hexpm", "c35c4d5612ca49ebb0344ea10387da4d2afe278387d4019e4d8111e815df8f55"},
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"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_metrics": {:hex, :telemetry_metrics, "0.6.2", "2caabe9344ec17eafe5403304771c3539f3b6e2f7fb6a6f602558c825d0d0bfb", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9b43db0dc33863930b9ef9d27137e78974756f5f198cae18409970ed6fa5b561"},
"telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"}, "telemetry_poller": {:hex, :telemetry_poller, "1.1.0", "58fa7c216257291caaf8d05678c8d01bd45f4bdbc1286838a28c4bb62ef32999", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9eb9d9cbfd81cbd7cdd24682f8711b6e2b691289a0de6826e58452f28c103c8f"},
"websock": {:hex, :websock, "0.5.0", "f6bbce90226121d62a0715bca7c986c5e43de0ccc9475d79c55381d1796368cc", [:mix], [], "hexpm", "b51ac706df8a7a48a2c622ee02d09d68be8c40418698ffa909d73ae207eb5fb8"}, "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
"websock_adapter": {:hex, :websock_adapter, "0.5.0", "cea35d8bbf1a6964e32d4b02ceb561dfb769c04f16d60d743885587e7d2ca55b", [:mix], [{:bandit, "~> 0.6", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "16318b124effab8209b1eb7906c636374f623dc9511a8278ad09c083cea5bb83"}, "websock_adapter": {:hex, :websock_adapter, "0.5.8", "3b97dc94e407e2d1fc666b2fb9acf6be81a1798a2602294aac000260a7c4a47d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "315b9a1865552212b5f35140ad194e67ce31af45bcee443d4ecb96b5fd3f3782"},
} }

View File

@ -54,9 +54,9 @@ msgstr ""
msgid "Delete User" msgid "Delete User"
msgstr "" msgstr ""
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:47 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:52
#: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:3 #: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:3
#: lib/cannery_web/controllers/user_session_html/new.html.heex:38 #: lib/cannery_web/controllers/user_session_html/new.html.heex:46
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "" msgstr ""
@ -68,11 +68,11 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:94 #: lib/cannery_web/components/core_components/topbar.html.heex:94
#: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:28 #: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:28
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:44 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:49
#: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:41 #: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:41
#: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:28 #: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:28
#: lib/cannery_web/controllers/user_session_html/new.html.heex:3 #: lib/cannery_web/controllers/user_session_html/new.html.heex:3
#: lib/cannery_web/controllers/user_session_html/new.html.heex:28 #: lib/cannery_web/controllers/user_session_html/new.html.heex:36
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Log in" msgid "Log in"
msgstr "" msgstr ""
@ -95,10 +95,10 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:89 #: lib/cannery_web/components/core_components/topbar.html.heex:89
#: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:25 #: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:25
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:3 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:3
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:37 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:42
#: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:38 #: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:38
#: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:25 #: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:25
#: lib/cannery_web/controllers/user_session_html/new.html.heex:35 #: lib/cannery_web/controllers/user_session_html/new.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Register" msgid "Register"
msgstr "" msgstr ""
@ -115,13 +115,13 @@ msgstr ""
msgid "Reset password" msgid "Reset password"
msgstr "" msgstr ""
#: lib/cannery_web/components/add_shot_record_component.html.heex:56 #: lib/cannery_web/components/add_shot_record_component.html.heex:57
#: lib/cannery_web/live/container_live/form_component.html.heex:55 #: lib/cannery_web/live/container_live/form_component.html.heex:59
#: lib/cannery_web/live/invite_live/form_component.html.heex:35 #: lib/cannery_web/live/invite_live/form_component.html.heex:38
#: lib/cannery_web/live/pack_live/form_component.html.heex:90 #: lib/cannery_web/live/pack_live/form_component.html.heex:110
#: lib/cannery_web/live/range_live/form_component.html.heex:44 #: lib/cannery_web/live/range_live/form_component.html.heex:45
#: lib/cannery_web/live/tag_live/form_component.html.heex:37 #: lib/cannery_web/live/tag_live/form_component.html.heex:41
#: lib/cannery_web/live/type_live/form_component.html.heex:353 #: lib/cannery_web/live/type_live/form_component.html.heex:386
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Save" msgid "Save"
msgstr "" msgstr ""
@ -131,29 +131,24 @@ msgstr ""
msgid "Send instructions to reset password" msgid "Send instructions to reset password"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/show.html.heex:65 #: lib/cannery_web/live/container_live/show.html.heex:73
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Why not add one?" msgid "Why not add one?"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:51 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:53
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Add" msgid "Add"
msgstr "" msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "Stage ammo"
msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:13 #: lib/cannery_web/live/range_live/index.html.heex:13
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Why not get some ready to shoot?" msgid "Why not get some ready to shoot?"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:127 #: lib/cannery_web/live/pack_live/index.html.heex:116
#: lib/cannery_web/live/pack_live/show.html.heex:90 #: lib/cannery_web/live/pack_live/show.html.heex:84
#: lib/cannery_web/live/range_live/index.html.heex:42 #: lib/cannery_web/live/range_live/index.html.heex:54
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Record shots" msgid "Record shots"
msgstr "" msgstr ""
@ -178,7 +173,7 @@ msgstr ""
msgid "add a container first" msgid "add a container first"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/form_component.html.heex:83 #: lib/cannery_web/live/pack_live/form_component.html.heex:103
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Create" msgid "Create"
msgstr "" msgstr ""
@ -199,8 +194,8 @@ msgid "View in Catalog"
msgstr "" msgstr ""
#: lib/cannery_web/components/move_pack_component.ex:77 #: lib/cannery_web/components/move_pack_component.ex:77
#: lib/cannery_web/live/pack_live/index.html.heex:138 #: lib/cannery_web/live/pack_live/index.html.heex:127
#: lib/cannery_web/live/pack_live/show.html.heex:86 #: lib/cannery_web/live/pack_live/show.html.heex:80
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Move ammo" msgid "Move ammo"
msgstr "" msgstr ""
@ -210,14 +205,12 @@ msgstr ""
msgid "Set Unlimited" msgid "Set Unlimited"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.html.heex:82 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Stage for range" msgid "Stage for range"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.html.heex:81 #: lib/cannery_web/live/container_live/show.html.heex:58
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Unstage from range" msgid "Unstage from range"
msgstr "" msgstr ""
@ -227,8 +220,8 @@ msgstr ""
msgid "Export Data as JSON" msgid "Export Data as JSON"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:87 #: lib/cannery_web/live/container_live/index.html.heex:101
#: lib/cannery_web/live/container_live/index.html.heex:145 #: lib/cannery_web/live/container_live/index.html.heex:159
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Clone %{container_name}" msgid "Clone %{container_name}"
msgstr "" msgstr ""
@ -238,8 +231,8 @@ msgstr ""
msgid "Copy invite link for %{invite_name}" msgid "Copy invite link for %{invite_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:104 #: lib/cannery_web/live/container_live/index.html.heex:118
#: lib/cannery_web/live/container_live/index.html.heex:162 #: lib/cannery_web/live/container_live/index.html.heex:176
#: lib/cannery_web/live/container_live/show.html.heex:48 #: lib/cannery_web/live/container_live/show.html.heex:48
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Delete %{container_name}" msgid "Delete %{container_name}"
@ -255,8 +248,8 @@ msgstr ""
msgid "Delete invite for %{invite_name}" msgid "Delete invite for %{invite_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:77 #: lib/cannery_web/live/container_live/index.html.heex:91
#: lib/cannery_web/live/container_live/index.html.heex:135 #: lib/cannery_web/live/container_live/index.html.heex:149
#: lib/cannery_web/live/container_live/show.html.heex:35 #: lib/cannery_web/live/container_live/show.html.heex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit %{container_name}" msgid "Edit %{container_name}"
@ -272,69 +265,72 @@ msgstr ""
msgid "Edit invite for %{invite_name}" msgid "Edit invite for %{invite_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:120 #: lib/cannery_web/live/container_live/index.html.heex:69
#: lib/cannery_web/live/range_live/index.html.heex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Stage" msgid "Stage"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:65 #: lib/cannery_web/live/container_live/index.html.heex:79
#: lib/cannery_web/live/container_live/index.html.heex:124 #: lib/cannery_web/live/container_live/index.html.heex:138
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Tag %{container_name}" msgid "Tag %{container_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:119 #: lib/cannery_web/live/container_live/index.html.heex:68
#: lib/cannery_web/live/range_live/index.html.heex:34
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Unstage" msgid "Unstage"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:168 #: lib/cannery_web/live/pack_live/index.html.heex:161
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Clone pack of %{pack_count} bullets" msgid "Clone pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:183 #: lib/cannery_web/live/pack_live/index.html.heex:176
#: lib/cannery_web/live/pack_live/show.html.heex:71 #: lib/cannery_web/live/pack_live/show.html.heex:71
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Delete pack of %{pack_count} bullets" msgid "Delete pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:158 #: lib/cannery_web/live/pack_live/index.html.heex:149
#: lib/cannery_web/live/pack_live/show.html.heex:59 #: lib/cannery_web/live/pack_live/show.html.heex:59
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit pack of %{pack_count} bullets" msgid "Edit pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:148 #: lib/cannery_web/live/container_live/show.html.heex:147
#: lib/cannery_web/live/pack_live/index.html.heex:137
#: lib/cannery_web/live/type_live/show.html.heex:201 #: lib/cannery_web/live/type_live/show.html.heex:201
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "View pack of %{pack_count} bullets" msgid "View pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:159 #: lib/cannery_web/live/pack_live/show.ex:149
#: lib/cannery_web/live/range_live/index.html.heex:152 #: lib/cannery_web/live/range_live/index.html.heex:181
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Delete shot record of %{shot_record_count} shots" msgid "Delete shot record of %{shot_record_count} shots"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:144 #: lib/cannery_web/live/pack_live/show.ex:134
#: lib/cannery_web/live/range_live/index.html.heex:135 #: lib/cannery_web/live/range_live/index.html.heex:164
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit shot record of %{shot_record_count} shots" msgid "Edit shot record of %{shot_record_count} shots"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/index.html.heex:105 #: lib/cannery_web/live/type_live/index.html.heex:107
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Clone %{type_name}" msgid "Clone %{type_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/index.html.heex:122 #: lib/cannery_web/live/type_live/index.html.heex:124
#: lib/cannery_web/live/type_live/show.html.heex:35 #: lib/cannery_web/live/type_live/show.html.heex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Delete %{type_name}" msgid "Delete %{type_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/index.html.heex:97 #: lib/cannery_web/live/type_live/index.html.heex:99
#: lib/cannery_web/live/type_live/show.html.heex:19 #: lib/cannery_web/live/type_live/show.html.heex:19
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit %{type_name}" msgid "Edit %{type_name}"
@ -345,7 +341,7 @@ msgstr ""
msgid "New Type" msgid "New Type"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/index.html.heex:89 #: lib/cannery_web/live/type_live/index.html.heex:91
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "View %{type_name}" msgid "View %{type_name}"
msgstr "" msgstr ""
@ -354,3 +350,8 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "add a type first" msgid "add a type first"
msgstr "" msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "Stage containers"
msgstr ""

View File

@ -67,9 +67,9 @@ msgstr "Einladung erstellen"
msgid "Delete User" msgid "Delete User"
msgstr "Benutzer löschen" msgstr "Benutzer löschen"
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:47 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:52
#: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:3 #: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:3
#: lib/cannery_web/controllers/user_session_html/new.html.heex:38 #: lib/cannery_web/controllers/user_session_html/new.html.heex:46
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "Passwort vergessen?" msgstr "Passwort vergessen?"
@ -81,11 +81,11 @@ msgstr "Laden Sie jemanden ein!"
#: lib/cannery_web/components/core_components/topbar.html.heex:94 #: lib/cannery_web/components/core_components/topbar.html.heex:94
#: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:28 #: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:28
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:44 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:49
#: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:41 #: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:41
#: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:28 #: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:28
#: lib/cannery_web/controllers/user_session_html/new.html.heex:3 #: lib/cannery_web/controllers/user_session_html/new.html.heex:3
#: lib/cannery_web/controllers/user_session_html/new.html.heex:28 #: lib/cannery_web/controllers/user_session_html/new.html.heex:36
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Log in" msgid "Log in"
msgstr "Einloggen" msgstr "Einloggen"
@ -108,10 +108,10 @@ msgstr "Neuer Tag"
#: lib/cannery_web/components/core_components/topbar.html.heex:89 #: lib/cannery_web/components/core_components/topbar.html.heex:89
#: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:25 #: lib/cannery_web/controllers/user_confirmation_html/new.html.heex:25
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:3 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:3
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:37 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:42
#: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:38 #: lib/cannery_web/controllers/user_reset_password_html/edit.html.heex:38
#: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:25 #: lib/cannery_web/controllers/user_reset_password_html/new.html.heex:25
#: lib/cannery_web/controllers/user_session_html/new.html.heex:35 #: lib/cannery_web/controllers/user_session_html/new.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Register" msgid "Register"
msgstr "Registrieren" msgstr "Registrieren"
@ -128,13 +128,13 @@ msgstr "Bestätigungsmail erneut senden"
msgid "Reset password" msgid "Reset password"
msgstr "Passwort zurücksetzen" msgstr "Passwort zurücksetzen"
#: lib/cannery_web/components/add_shot_record_component.html.heex:56 #: lib/cannery_web/components/add_shot_record_component.html.heex:57
#: lib/cannery_web/live/container_live/form_component.html.heex:55 #: lib/cannery_web/live/container_live/form_component.html.heex:59
#: lib/cannery_web/live/invite_live/form_component.html.heex:35 #: lib/cannery_web/live/invite_live/form_component.html.heex:38
#: lib/cannery_web/live/pack_live/form_component.html.heex:90 #: lib/cannery_web/live/pack_live/form_component.html.heex:110
#: lib/cannery_web/live/range_live/form_component.html.heex:44 #: lib/cannery_web/live/range_live/form_component.html.heex:45
#: lib/cannery_web/live/tag_live/form_component.html.heex:37 #: lib/cannery_web/live/tag_live/form_component.html.heex:41
#: lib/cannery_web/live/type_live/form_component.html.heex:353 #: lib/cannery_web/live/type_live/form_component.html.heex:386
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Save" msgid "Save"
msgstr "Speichern" msgstr "Speichern"
@ -144,29 +144,24 @@ msgstr "Speichern"
msgid "Send instructions to reset password" msgid "Send instructions to reset password"
msgstr "Anleitung zum Passwort zurücksetzen zusenden" msgstr "Anleitung zum Passwort zurücksetzen zusenden"
#: lib/cannery_web/live/container_live/show.html.heex:65 #: lib/cannery_web/live/container_live/show.html.heex:73
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Why not add one?" msgid "Why not add one?"
msgstr "Warum fügen Sie keine hinzu?" msgstr "Warum fügen Sie keine hinzu?"
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:51 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:53
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Add" msgid "Add"
msgstr "Hinzufügen" msgstr "Hinzufügen"
#: lib/cannery_web/live/range_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "Stage ammo"
msgstr "Munition markieren"
#: lib/cannery_web/live/range_live/index.html.heex:13 #: lib/cannery_web/live/range_live/index.html.heex:13
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Why not get some ready to shoot?" msgid "Why not get some ready to shoot?"
msgstr "Warum nicht einige für den Schießstand auswählen?" msgstr "Warum nicht einige für den Schießstand auswählen?"
#: lib/cannery_web/live/pack_live/index.html.heex:127 #: lib/cannery_web/live/pack_live/index.html.heex:116
#: lib/cannery_web/live/pack_live/show.html.heex:90 #: lib/cannery_web/live/pack_live/show.html.heex:84
#: lib/cannery_web/live/range_live/index.html.heex:42 #: lib/cannery_web/live/range_live/index.html.heex:54
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Record shots" msgid "Record shots"
msgstr "Schüsse dokumentieren" msgstr "Schüsse dokumentieren"
@ -191,7 +186,7 @@ msgstr "In die Zwischenablage kopieren"
msgid "add a container first" msgid "add a container first"
msgstr "Zuerst einen Behälter hinzufügen" msgstr "Zuerst einen Behälter hinzufügen"
#: lib/cannery_web/live/pack_live/form_component.html.heex:83 #: lib/cannery_web/live/pack_live/form_component.html.heex:103
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Create" msgid "Create"
msgstr "Erstellen" msgstr "Erstellen"
@ -212,8 +207,8 @@ msgid "View in Catalog"
msgstr "" msgstr ""
#: lib/cannery_web/components/move_pack_component.ex:77 #: lib/cannery_web/components/move_pack_component.ex:77
#: lib/cannery_web/live/pack_live/index.html.heex:138 #: lib/cannery_web/live/pack_live/index.html.heex:127
#: lib/cannery_web/live/pack_live/show.html.heex:86 #: lib/cannery_web/live/pack_live/show.html.heex:80
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Move ammo" msgid "Move ammo"
msgstr "" msgstr ""
@ -223,14 +218,12 @@ msgstr ""
msgid "Set Unlimited" msgid "Set Unlimited"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.html.heex:82 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Stage for range" msgid "Stage for range"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.html.heex:81 #: lib/cannery_web/live/container_live/show.html.heex:58
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Unstage from range" msgid "Unstage from range"
msgstr "" msgstr ""
@ -240,8 +233,8 @@ msgstr ""
msgid "Export Data as JSON" msgid "Export Data as JSON"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:87 #: lib/cannery_web/live/container_live/index.html.heex:101
#: lib/cannery_web/live/container_live/index.html.heex:145 #: lib/cannery_web/live/container_live/index.html.heex:159
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Clone %{container_name}" msgid "Clone %{container_name}"
msgstr "" msgstr ""
@ -251,8 +244,8 @@ msgstr ""
msgid "Copy invite link for %{invite_name}" msgid "Copy invite link for %{invite_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:104 #: lib/cannery_web/live/container_live/index.html.heex:118
#: lib/cannery_web/live/container_live/index.html.heex:162 #: lib/cannery_web/live/container_live/index.html.heex:176
#: lib/cannery_web/live/container_live/show.html.heex:48 #: lib/cannery_web/live/container_live/show.html.heex:48
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Delete %{container_name}" msgid "Delete %{container_name}"
@ -268,8 +261,8 @@ msgstr ""
msgid "Delete invite for %{invite_name}" msgid "Delete invite for %{invite_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:77 #: lib/cannery_web/live/container_live/index.html.heex:91
#: lib/cannery_web/live/container_live/index.html.heex:135 #: lib/cannery_web/live/container_live/index.html.heex:149
#: lib/cannery_web/live/container_live/show.html.heex:35 #: lib/cannery_web/live/container_live/show.html.heex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit %{container_name}" msgid "Edit %{container_name}"
@ -285,69 +278,72 @@ msgstr ""
msgid "Edit invite for %{invite_name}" msgid "Edit invite for %{invite_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:120 #: lib/cannery_web/live/container_live/index.html.heex:69
#: lib/cannery_web/live/range_live/index.html.heex:35
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Stage" msgid "Stage"
msgstr "Munition markieren" msgstr "Munition markieren"
#: lib/cannery_web/live/container_live/index.html.heex:65 #: lib/cannery_web/live/container_live/index.html.heex:79
#: lib/cannery_web/live/container_live/index.html.heex:124 #: lib/cannery_web/live/container_live/index.html.heex:138
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Tag %{container_name}" msgid "Tag %{container_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:119 #: lib/cannery_web/live/container_live/index.html.heex:68
#: lib/cannery_web/live/range_live/index.html.heex:34
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Unstage" msgid "Unstage"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:168 #: lib/cannery_web/live/pack_live/index.html.heex:161
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Clone pack of %{pack_count} bullets" msgid "Clone pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:183 #: lib/cannery_web/live/pack_live/index.html.heex:176
#: lib/cannery_web/live/pack_live/show.html.heex:71 #: lib/cannery_web/live/pack_live/show.html.heex:71
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Delete pack of %{pack_count} bullets" msgid "Delete pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:158 #: lib/cannery_web/live/pack_live/index.html.heex:149
#: lib/cannery_web/live/pack_live/show.html.heex:59 #: lib/cannery_web/live/pack_live/show.html.heex:59
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Edit pack of %{pack_count} bullets" msgid "Edit pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:148 #: lib/cannery_web/live/container_live/show.html.heex:147
#: lib/cannery_web/live/pack_live/index.html.heex:137
#: lib/cannery_web/live/type_live/show.html.heex:201 #: lib/cannery_web/live/type_live/show.html.heex:201
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "View pack of %{pack_count} bullets" msgid "View pack of %{pack_count} bullets"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:159 #: lib/cannery_web/live/pack_live/show.ex:149
#: lib/cannery_web/live/range_live/index.html.heex:152 #: lib/cannery_web/live/range_live/index.html.heex:181
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Delete shot record of %{shot_record_count} shots" msgid "Delete shot record of %{shot_record_count} shots"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:144 #: lib/cannery_web/live/pack_live/show.ex:134
#: lib/cannery_web/live/range_live/index.html.heex:135 #: lib/cannery_web/live/range_live/index.html.heex:164
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Edit shot record of %{shot_record_count} shots" msgid "Edit shot record of %{shot_record_count} shots"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/index.html.heex:105 #: lib/cannery_web/live/type_live/index.html.heex:107
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Clone %{type_name}" msgid "Clone %{type_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/index.html.heex:122 #: lib/cannery_web/live/type_live/index.html.heex:124
#: lib/cannery_web/live/type_live/show.html.heex:35 #: lib/cannery_web/live/type_live/show.html.heex:35
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Delete %{type_name}" msgid "Delete %{type_name}"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/index.html.heex:97 #: lib/cannery_web/live/type_live/index.html.heex:99
#: lib/cannery_web/live/type_live/show.html.heex:19 #: lib/cannery_web/live/type_live/show.html.heex:19
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Edit %{type_name}" msgid "Edit %{type_name}"
@ -358,7 +354,7 @@ msgstr ""
msgid "New Type" msgid "New Type"
msgstr "Neue Munitionsart" msgstr "Neue Munitionsart"
#: lib/cannery_web/live/type_live/index.html.heex:89 #: lib/cannery_web/live/type_live/index.html.heex:91
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "View %{type_name}" msgid "View %{type_name}"
msgstr "" msgstr ""
@ -367,3 +363,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "add a type first" msgid "add a type first"
msgstr "" msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "Stage containers"
msgstr ""

View File

@ -38,55 +38,55 @@ msgstr "Admins:"
msgid "Ammo" msgid "Ammo"
msgstr "Munition" msgstr "Munition"
#: lib/cannery_web/live/tag_live/form_component.html.heex:25 #: lib/cannery_web/live/tag_live/form_component.html.heex:29
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Background color" msgid "Background color"
msgstr "Hintergrundfarbe" msgstr "Hintergrundfarbe"
#: lib/cannery_web/components/type_table_component.ex:86 #: lib/cannery_web/components/type_table_component.ex:86
#: lib/cannery_web/live/type_live/form_component.html.heex:327 #: lib/cannery_web/live/type_live/form_component.html.heex:358
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Blank" msgid "Blank"
msgstr "Knallpatrone" msgstr "Knallpatrone"
#: lib/cannery_web/live/type_live/form_component.html.heex:174 #: lib/cannery_web/live/type_live/form_component.html.heex:195
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Brass" msgid "Brass"
msgstr "Messing" msgstr "Messing"
#: lib/cannery_web/components/type_table_component.ex:61 #: lib/cannery_web/components/type_table_component.ex:61
#: lib/cannery_web/live/type_live/form_component.html.heex:147 #: lib/cannery_web/live/type_live/form_component.html.heex:163
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Bullet core" msgid "Bullet core"
msgstr "Projektilkern" msgstr "Projektilkern"
#: lib/cannery_web/components/type_table_component.ex:59 #: lib/cannery_web/components/type_table_component.ex:59
#: lib/cannery_web/live/type_live/form_component.html.heex:121 #: lib/cannery_web/live/type_live/form_component.html.heex:136
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Bullet type" msgid "Bullet type"
msgstr "Patronenart" msgstr "Patronenart"
#: lib/cannery_web/components/type_table_component.ex:51 #: lib/cannery_web/components/type_table_component.ex:51
#: lib/cannery_web/live/type_live/form_component.html.heex:67 #: lib/cannery_web/live/type_live/form_component.html.heex:74
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Caliber" msgid "Caliber"
msgstr "Kaliber" msgstr "Kaliber"
#: lib/cannery_web/components/type_table_component.ex:49 #: lib/cannery_web/components/type_table_component.ex:49
#: lib/cannery_web/live/type_live/form_component.html.heex:51 #: lib/cannery_web/live/type_live/form_component.html.heex:57
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Cartridge" msgid "Cartridge"
msgstr "Patrone" msgstr "Patrone"
#: lib/cannery_web/components/type_table_component.ex:66 #: lib/cannery_web/components/type_table_component.ex:66
#: lib/cannery_web/live/type_live/form_component.html.heex:170 #: lib/cannery_web/live/type_live/form_component.html.heex:188
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Case material" msgid "Case material"
msgstr "Gehäusematerial" msgstr "Gehäusematerial"
#: lib/cannery_web/components/move_pack_component.ex:64 #: lib/cannery_web/components/move_pack_component.ex:64
#: lib/cannery_web/components/pack_table_component.ex:76 #: lib/cannery_web/components/pack_table_component.ex:76
#: lib/cannery_web/live/pack_live/form_component.html.heex:65 #: lib/cannery_web/live/pack_live/form_component.html.heex:84
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Container" msgid "Container"
msgstr "Behälter" msgstr "Behälter"
@ -100,13 +100,13 @@ msgid "Containers"
msgstr "Behälter" msgstr "Behälter"
#: lib/cannery_web/components/type_table_component.ex:87 #: lib/cannery_web/components/type_table_component.ex:87
#: lib/cannery_web/live/type_live/form_component.html.heex:331 #: lib/cannery_web/live/type_live/form_component.html.heex:362
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Corrosive" msgid "Corrosive"
msgstr "Korrosiv" msgstr "Korrosiv"
#: lib/cannery_web/components/pack_table_component.ex:104 #: lib/cannery_web/components/pack_table_component.ex:104
#: lib/cannery_web/live/pack_live/form_component.html.heex:28 #: lib/cannery_web/live/pack_live/form_component.html.heex:45
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Count" msgid "Count"
msgstr "Anzahl" msgstr "Anzahl"
@ -117,9 +117,9 @@ msgstr "Anzahl"
msgid "Count:" msgid "Count:"
msgstr "Anzahl:" msgstr "Anzahl:"
#: lib/cannery_web/components/container_table_component.ex:46 #: lib/cannery_web/components/container_table_component.ex:50
#: lib/cannery_web/live/container_live/form_component.html.heex:29 #: lib/cannery_web/live/container_live/form_component.html.heex:30
#: lib/cannery_web/live/type_live/form_component.html.heex:38 #: lib/cannery_web/live/type_live/form_component.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Description" msgid "Description"
msgstr "Beschreibung" msgstr "Beschreibung"
@ -145,19 +145,19 @@ msgstr "Einladung bearbeiten"
msgid "Edit Tag" msgid "Edit Tag"
msgstr "Tag bearbeiten" msgstr "Tag bearbeiten"
#: lib/cannery_web/live/type_live/form_component.html.heex:135 #: lib/cannery_web/live/type_live/form_component.html.heex:151
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "FMJ" msgid "FMJ"
msgstr "VM" msgstr "VM"
#: lib/cannery_web/components/type_table_component.ex:58 #: lib/cannery_web/components/type_table_component.ex:58
#: lib/cannery_web/live/type_live/form_component.html.heex:111 #: lib/cannery_web/live/type_live/form_component.html.heex:126
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Grains" msgid "Grains"
msgstr "Körner" msgstr "Körner"
#: lib/cannery_web/components/type_table_component.ex:85 #: lib/cannery_web/components/type_table_component.ex:85
#: lib/cannery_web/live/type_live/form_component.html.heex:323 #: lib/cannery_web/live/type_live/form_component.html.heex:354
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Incendiary" msgid "Incendiary"
msgstr "Brandmunition" msgstr "Brandmunition"
@ -184,14 +184,14 @@ msgstr "Nur mit Einladung"
msgid "Invites" msgid "Invites"
msgstr "Einladungen" msgstr "Einladungen"
#: lib/cannery_web/controllers/user_session_html/new.html.heex:23 #: lib/cannery_web/controllers/user_session_html/new.html.heex:31
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Keep me logged in for 60 days" msgid "Keep me logged in for 60 days"
msgstr "Für 60 Tage eingeloggt bleiben" msgstr "Für 60 Tage eingeloggt bleiben"
#: lib/cannery_web/components/container_table_component.ex:47 #: lib/cannery_web/components/container_table_component.ex:51
#: lib/cannery_web/components/move_pack_component.ex:66 #: lib/cannery_web/components/move_pack_component.ex:66
#: lib/cannery_web/live/container_live/form_component.html.heex:46 #: lib/cannery_web/live/container_live/form_component.html.heex:49
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Location" msgid "Location"
msgstr "Standort" msgstr "Standort"
@ -202,34 +202,34 @@ msgstr "Standort"
msgid "Location:" msgid "Location:"
msgstr "Standort:" msgstr "Standort:"
#: lib/cannery_web/live/container_live/form_component.html.heex:41 #: lib/cannery_web/live/container_live/form_component.html.heex:45
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Magazine, Clip, Ammo Box, etc" msgid "Magazine, Clip, Ammo Box, etc"
msgstr "Magazin, Ladestreifen, Munitionskiste usw." msgstr "Magazin, Ladestreifen, Munitionskiste usw."
#: lib/cannery_web/components/type_table_component.ex:88 #: lib/cannery_web/components/type_table_component.ex:88
#: lib/cannery_web/live/type_live/form_component.html.heex:336 #: lib/cannery_web/live/type_live/form_component.html.heex:367
#: lib/cannery_web/live/type_live/form_component.html.heex:339 #: lib/cannery_web/live/type_live/form_component.html.heex:370
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Manufacturer" msgid "Manufacturer"
msgstr "Hersteller" msgstr "Hersteller"
#: lib/cannery_web/live/container_live/form_component.html.heex:33 #: lib/cannery_web/live/container_live/form_component.html.heex:36
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Metal ammo can with the anime girl sticker" msgid "Metal ammo can with the anime girl sticker"
msgstr "Metallene Munitionskiste mit Anime-Girl-Sticker" msgstr "Metallene Munitionskiste mit Anime-Girl-Sticker"
#: lib/cannery_web/live/container_live/form_component.html.heex:24 #: lib/cannery_web/live/container_live/form_component.html.heex:26
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "My cool ammo can" msgid "My cool ammo can"
msgstr "Meine coole Munitionskiste" msgstr "Meine coole Munitionskiste"
#: lib/cannery_web/components/container_table_component.ex:45 #: lib/cannery_web/components/container_table_component.ex:49
#: lib/cannery_web/components/type_table_component.ex:152 #: lib/cannery_web/components/type_table_component.ex:152
#: lib/cannery_web/live/container_live/form_component.html.heex:21 #: lib/cannery_web/live/container_live/form_component.html.heex:21
#: lib/cannery_web/live/invite_live/form_component.html.heex:21 #: lib/cannery_web/live/invite_live/form_component.html.heex:21
#: lib/cannery_web/live/tag_live/form_component.html.heex:21 #: lib/cannery_web/live/tag_live/form_component.html.heex:21
#: lib/cannery_web/live/type_live/form_component.html.heex:31 #: lib/cannery_web/live/type_live/form_component.html.heex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Name" msgid "Name"
msgstr "Name" msgstr "Name"
@ -280,8 +280,8 @@ msgstr "Keine Tags"
#: lib/cannery_web/components/add_shot_record_component.html.heex:38 #: lib/cannery_web/components/add_shot_record_component.html.heex:38
#: lib/cannery_web/components/shot_record_table_component.ex:46 #: lib/cannery_web/components/shot_record_table_component.ex:46
#: lib/cannery_web/live/pack_live/form_component.html.heex:57 #: lib/cannery_web/live/pack_live/form_component.html.heex:75
#: lib/cannery_web/live/pack_live/show.ex:90 #: lib/cannery_web/live/pack_live/show.ex:80
#: lib/cannery_web/live/range_live/form_component.html.heex:30 #: lib/cannery_web/live/range_live/form_component.html.heex:30
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Notes" msgid "Notes"
@ -293,19 +293,19 @@ msgstr "Bemerkungen"
msgid "Notes:" msgid "Notes:"
msgstr "Bemerkungen:" msgstr "Bemerkungen:"
#: lib/cannery_web/live/container_live/form_component.html.heex:50 #: lib/cannery_web/live/container_live/form_component.html.heex:55
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "On the bookshelf" msgid "On the bookshelf"
msgstr "Auf dem Bücherregal" msgstr "Auf dem Bücherregal"
#: lib/cannery_web/components/type_table_component.ex:79 #: lib/cannery_web/components/type_table_component.ex:79
#: lib/cannery_web/live/type_live/form_component.html.heex:260 #: lib/cannery_web/live/type_live/form_component.html.heex:287
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Pressure" msgid "Pressure"
msgstr "Druck" msgstr "Druck"
#: lib/cannery_web/components/pack_table_component.ex:92 #: lib/cannery_web/components/pack_table_component.ex:92
#: lib/cannery_web/live/pack_live/form_component.html.heex:35 #: lib/cannery_web/live/pack_live/form_component.html.heex:52
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Price paid" msgid "Price paid"
msgstr "Kaufpreis" msgstr "Kaufpreis"
@ -316,7 +316,7 @@ msgid "Price paid:"
msgstr "Kaufpreis:" msgstr "Kaufpreis:"
#: lib/cannery_web/components/type_table_component.ex:82 #: lib/cannery_web/components/type_table_component.ex:82
#: lib/cannery_web/live/type_live/form_component.html.heex:299 #: lib/cannery_web/live/type_live/form_component.html.heex:328
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Primer type" msgid "Primer type"
msgstr "Zündertyp" msgstr "Zündertyp"
@ -338,7 +338,7 @@ msgstr ""
"Hosten Sie Ihre eigene Instanz oder verwenden Sie eine Instanz, der Sie " "Hosten Sie Ihre eigene Instanz oder verwenden Sie eine Instanz, der Sie "
"vertrauen." "vertrauen."
#: lib/cannery_web/controllers/user_settings_controller.ex:10 #: lib/cannery_web/controllers/user_settings_controller.ex:9
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:3 #: lib/cannery_web/controllers/user_settings_html/edit.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Settings" msgid "Settings"
@ -349,17 +349,17 @@ msgstr "Einstellungen"
msgid "Simple:" msgid "Simple:"
msgstr "Einfach:" msgstr "Einfach:"
#: lib/cannery_web/live/type_live/form_component.html.heex:154 #: lib/cannery_web/live/type_live/form_component.html.heex:171
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Steel" msgid "Steel"
msgstr "Stahl" msgstr "Stahl"
#: lib/cannery_web/live/pack_live/show.html.heex:100 #: lib/cannery_web/live/pack_live/show.html.heex:94
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Stored in" msgid "Stored in"
msgstr "Gelagert in" msgstr "Gelagert in"
#: lib/cannery_web/components/container_table_component.ex:66 #: lib/cannery_web/components/container_table_component.ex:73
#: lib/cannery_web/components/core_components/topbar.html.heex:28 #: lib/cannery_web/components/core_components/topbar.html.heex:28
#: lib/cannery_web/live/tag_live/index.ex:43 #: lib/cannery_web/live/tag_live/index.ex:43
#: lib/cannery_web/live/tag_live/index.ex:53 #: lib/cannery_web/live/tag_live/index.ex:53
@ -373,7 +373,7 @@ msgstr "Tags"
msgid "Tags can be added to your containers to help you organize" msgid "Tags can be added to your containers to help you organize"
msgstr "Tags können zur besseren Ordnung einem Behälter hinzugefügt werden" msgstr "Tags können zur besseren Ordnung einem Behälter hinzugefügt werden"
#: lib/cannery_web/live/tag_live/form_component.html.heex:31 #: lib/cannery_web/live/tag_live/form_component.html.heex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Text color" msgid "Text color"
msgstr "Textfarbe" msgstr "Textfarbe"
@ -384,16 +384,16 @@ msgid "The self-hosted firearm tracker website"
msgstr "Die selbst-gehostete Website zur Verwaltung von Schusswaffen" msgstr "Die selbst-gehostete Website zur Verwaltung von Schusswaffen"
#: lib/cannery_web/components/type_table_component.ex:84 #: lib/cannery_web/components/type_table_component.ex:84
#: lib/cannery_web/live/type_live/form_component.html.heex:319 #: lib/cannery_web/live/type_live/form_component.html.heex:350
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Tracer" msgid "Tracer"
msgstr "Leuchtspur" msgstr "Leuchtspur"
#: lib/cannery_web/components/container_table_component.ex:48 #: lib/cannery_web/components/container_table_component.ex:52
#: lib/cannery_web/components/move_pack_component.ex:65 #: lib/cannery_web/components/move_pack_component.ex:65
#: lib/cannery_web/components/pack_table_component.ex:108 #: lib/cannery_web/components/pack_table_component.ex:108
#: lib/cannery_web/live/container_live/form_component.html.heex:38 #: lib/cannery_web/live/container_live/form_component.html.heex:40
#: lib/cannery_web/live/pack_live/form_component.html.heex:22 #: lib/cannery_web/live/pack_live/form_component.html.heex:37
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Type" msgid "Type"
msgstr "Art" msgstr "Art"
@ -409,7 +409,7 @@ msgstr "Art:"
msgid "Users" msgid "Users"
msgstr "Benutzer" msgstr "Benutzer"
#: lib/cannery_web/live/invite_live/form_component.html.heex:28 #: lib/cannery_web/live/invite_live/form_component.html.heex:31
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Uses left" msgid "Uses left"
msgstr "Verbleibende Nutzung" msgstr "Verbleibende Nutzung"
@ -419,13 +419,16 @@ msgstr "Verbleibende Nutzung"
msgid "Your data stays with you, period" msgid "Your data stays with you, period"
msgstr "Ihre Daten bleiben bei Ihnen, Punkt" msgstr "Ihre Daten bleiben bei Ihnen, Punkt"
#: lib/cannery_web/live/container_live/show.html.heex:60 #: lib/cannery_web/live/container_live/show.html.heex:68
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No tags for this container" msgid "No tags for this container"
msgstr "Keine Tags für diesen Behälter" msgstr "Keine Tags für diesen Behälter"
#: lib/cannery_web/components/container_table_component.ex:77
#: lib/cannery_web/components/core_components/topbar.html.heex:48 #: lib/cannery_web/components/core_components/topbar.html.heex:48
#: lib/cannery_web/components/pack_table_component.ex:80 #: lib/cannery_web/components/pack_table_component.ex:80
#: lib/cannery_web/live/range_live/index.ex:76
#: lib/cannery_web/live/range_live/index.ex:86
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Range" msgid "Range"
msgstr "Schießplatz" msgstr "Schießplatz"
@ -435,10 +438,10 @@ msgstr "Schießplatz"
msgid "Range day" msgid "Range day"
msgstr "Range Day" msgstr "Range Day"
#: lib/cannery_web/components/add_shot_record_component.html.heex:48 #: lib/cannery_web/components/add_shot_record_component.html.heex:49
#: lib/cannery_web/components/shot_record_table_component.ex:47 #: lib/cannery_web/components/shot_record_table_component.ex:47
#: lib/cannery_web/live/pack_live/show.ex:91 #: lib/cannery_web/live/pack_live/show.ex:81
#: lib/cannery_web/live/range_live/form_component.html.heex:40 #: lib/cannery_web/live/range_live/form_component.html.heex:41
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Date" msgid "Date"
msgstr "Datum" msgstr "Datum"
@ -448,41 +451,25 @@ msgstr "Datum"
msgid "Shots fired" msgid "Shots fired"
msgstr "Schüsse abgegeben" msgstr "Schüsse abgegeben"
#: lib/cannery_web/live/range_live/index.html.heex:8
#, elixir-autogen, elixir-format
msgid "No ammo staged"
msgstr "Keine Munition selektiert"
#: lib/cannery_web/components/add_shot_record_component.html.heex:3 #: lib/cannery_web/components/add_shot_record_component.html.heex:3
#: lib/cannery_web/live/pack_live/index.ex:35 #: lib/cannery_web/live/pack_live/index.ex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Record shots" msgid "Record shots"
msgstr "Schüsse dokumentieren" msgstr "Schüsse dokumentieren"
#: lib/cannery_web/live/range_live/index.ex:47 #: lib/cannery_web/live/range_live/index.html.heex:64
#, elixir-autogen, elixir-format #: lib/cannery_web/live/range_live/index.html.heex:148
msgid "New Shot Records"
msgstr "Neue Schießkladde"
#: lib/cannery_web/live/range_live/index.html.heex:52
#: lib/cannery_web/live/range_live/index.html.heex:119
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No shots recorded" msgid "No shots recorded"
msgstr "Keine Schüsse dokumentiert" msgstr "Keine Schüsse dokumentiert"
#: lib/cannery_web/components/shot_record_table_component.ex:45 #: lib/cannery_web/components/shot_record_table_component.ex:45
#: lib/cannery_web/live/pack_live/show.ex:89 #: lib/cannery_web/live/pack_live/show.ex:79
#: lib/cannery_web/live/range_live/index.html.heex:66 #: lib/cannery_web/live/range_live/index.html.heex:78
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Rounds shot" msgid "Rounds shot"
msgstr "Patronen abgefeuert" msgstr "Patronen abgefeuert"
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Shot Records"
msgstr "Schießkladde"
#: lib/cannery_web/live/pack_live/index.ex:43 #: lib/cannery_web/live/pack_live/index.ex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Move ammo" msgid "Move ammo"
@ -493,16 +480,16 @@ msgstr "Munition verschieben"
msgid "No other containers" msgid "No other containers"
msgstr "Kein weiterer Behälter" msgstr "Kein weiterer Behälter"
#: lib/cannery_web/live/range_live/index.html.heex:57 #: lib/cannery_web/live/range_live/index.html.heex:69
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Shot log" msgid "Shot log"
msgstr "Schießkladde" msgstr "Schießkladde"
#: lib/cannery_web/components/core_components/pack_card.html.heex:42 #: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47 #: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176 #: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:259 #: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/type_table_component.ex:260 #: lib/cannery_web/components/type_table_component.ex:273
#: lib/cannery_web/live/pack_live/show.html.heex:37 #: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42 #: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150 #: lib/cannery_web/live/type_live/show.html.heex:150
@ -510,36 +497,36 @@ msgstr "Schießkladde"
msgid "$%{amount}" msgid "$%{amount}"
msgstr "$%{amount}" msgstr "$%{amount}"
#: lib/cannery_web/live/type_live/form_component.html.heex:163 #: lib/cannery_web/live/type_live/form_component.html.heex:181
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Bimetal" msgid "Bimetal"
msgstr "Bimetall" msgstr "Bimetall"
#: lib/cannery_web/components/type_table_component.ex:65 #: lib/cannery_web/components/type_table_component.ex:65
#: lib/cannery_web/live/type_live/form_component.html.heex:159 #: lib/cannery_web/live/type_live/form_component.html.heex:176
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Jacket type" msgid "Jacket type"
msgstr "Patronenhülse" msgstr "Patronenhülse"
#: lib/cannery_web/components/type_table_component.ex:81 #: lib/cannery_web/components/type_table_component.ex:81
#: lib/cannery_web/live/type_live/form_component.html.heex:282 #: lib/cannery_web/live/type_live/form_component.html.heex:311
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Muzzle velocity" msgid "Muzzle velocity"
msgstr "Mündungsgeschwindigkeit" msgstr "Mündungsgeschwindigkeit"
#: lib/cannery_web/components/type_table_component.ex:75 #: lib/cannery_web/components/type_table_component.ex:75
#: lib/cannery_web/live/type_live/form_component.html.heex:247 #: lib/cannery_web/live/type_live/form_component.html.heex:274
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Powder grains per charge" msgid "Powder grains per charge"
msgstr "Pulverkörner pro Ladung" msgstr "Pulverkörner pro Ladung"
#: lib/cannery_web/components/type_table_component.ex:73 #: lib/cannery_web/components/type_table_component.ex:73
#: lib/cannery_web/live/type_live/form_component.html.heex:239 #: lib/cannery_web/live/type_live/form_component.html.heex:265
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Powder type" msgid "Powder type"
msgstr "Pulverart" msgstr "Pulverart"
#: lib/cannery_web/live/type_live/form_component.html.heex:346 #: lib/cannery_web/live/type_live/form_component.html.heex:378
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "UPC" msgid "UPC"
msgstr "UPC" msgstr "UPC"
@ -563,24 +550,24 @@ msgid "New password"
msgstr "Neues Passwort" msgstr "Neues Passwort"
#: lib/cannery_web/components/type_table_component.ex:83 #: lib/cannery_web/components/type_table_component.ex:83
#: lib/cannery_web/live/type_live/form_component.html.heex:307 #: lib/cannery_web/live/type_live/form_component.html.heex:337
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Firing type" msgid "Firing type"
msgstr "Patronenhülsenform" msgstr "Patronenhülsenform"
#: lib/cannery_web/components/layouts/live.html.heex:43 #: lib/cannery_web/components/layouts/app.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "Neu verbinden..." msgstr "Neu verbinden..."
#: lib/cannery_web/live/container_live/index.ex:28 #: lib/cannery_web/live/container_live/index.ex:28
#: lib/cannery_web/live/container_live/show.ex:116 #: lib/cannery_web/live/container_live/show.ex:130
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit %{name}" msgid "Edit %{name}"
msgstr "%{name} bearbeiten" msgstr "%{name} bearbeiten"
#: lib/cannery_web/live/container_live/index.ex:63 #: lib/cannery_web/live/container_live/index.ex:63
#: lib/cannery_web/live/container_live/show.ex:117 #: lib/cannery_web/live/container_live/show.ex:131
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Edit %{name} tags" msgid "Edit %{name} tags"
msgstr "Editiere %{name} Tags" msgstr "Editiere %{name} Tags"
@ -592,9 +579,9 @@ msgstr "Editiere %{name} Tags"
msgid "Rounds:" msgid "Rounds:"
msgstr "Patronen:" msgstr "Patronen:"
#: lib/cannery_web/components/pack_table_component.ex:173 #: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:255 #: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:259 #: lib/cannery_web/components/type_table_component.ex:272
#: lib/cannery_web/live/type_live/show.html.heex:154 #: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No cost information" msgid "No cost information"
@ -625,12 +612,12 @@ msgstr "Ursprüngliche Anzahl:"
msgid "Percentage left:" msgid "Percentage left:"
msgstr "Prozent verbleibend:" msgstr "Prozent verbleibend:"
#: lib/cannery_web/live/pack_live/show.html.heex:113 #: lib/cannery_web/live/pack_live/show.html.heex:107
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Rounds used" msgid "Rounds used"
msgstr "Patronen verbraucht" msgstr "Patronen verbraucht"
#: lib/cannery_web/controllers/user_confirmation_controller.ex:8 #: lib/cannery_web/controllers/user_confirmation_controller.ex:6
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Confirm your account" msgid "Confirm your account"
msgstr "Bestätigen Sie ihr Nutzerkonto" msgstr "Bestätigen Sie ihr Nutzerkonto"
@ -645,7 +632,7 @@ msgstr "Passwort vergessen?"
msgid "Log in" msgid "Log in"
msgstr "Einloggen" msgstr "Einloggen"
#: lib/cannery_web/controllers/user_registration_controller.ex:32 #: lib/cannery_web/controllers/user_registration_controller.ex:31
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Register" msgid "Register"
msgstr "Registrieren" msgstr "Registrieren"
@ -656,12 +643,13 @@ msgid "Reset your password"
msgstr "Passwort zurücksetzen" msgstr "Passwort zurücksetzen"
#: lib/cannery_web/live/pack_live/show.ex:40 #: lib/cannery_web/live/pack_live/show.ex:40
#: lib/cannery_web/live/range_live/index.ex:31 #: lib/cannery_web/live/range_live/index.ex:52
#: lib/cannery_web/live/range_live/index.ex:68
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Record Shots" msgid "Record Shots"
msgstr "Schüsse dokumentieren" msgstr "Schüsse dokumentieren"
#: lib/cannery_web/live/pack_live/form_component.html.heex:75 #: lib/cannery_web/live/pack_live/form_component.html.heex:96
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Copies" msgid "Copies"
msgstr "Kopien" msgstr "Kopien"
@ -671,22 +659,6 @@ msgstr "Kopien"
msgid "Added on:" msgid "Added on:"
msgstr "Hinzugefügt am:" msgstr "Hinzugefügt am:"
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:32
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:127
#, elixir-autogen, elixir-format
msgid "English"
msgstr "Englisch"
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:129
#, elixir-autogen, elixir-format
msgid "French"
msgstr "Französisch"
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:128
#, elixir-autogen, elixir-format
msgid "German"
msgstr "Deutsch"
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:28 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:28
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Language" msgid "Language"
@ -730,7 +702,7 @@ msgstr "Munitionstyp bearbeiten"
msgid "Move Ammo" msgid "Move Ammo"
msgstr "Munition verschieben" msgstr "Munition verschieben"
#: lib/cannery_web/live/container_live/show.html.heex:117 #: lib/cannery_web/live/container_live/show.html.heex:125
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "No ammo in this container" msgid "No ammo in this container"
msgstr "Keine Munitionsgruppe in diesem Behälter" msgstr "Keine Munitionsgruppe in diesem Behälter"
@ -740,7 +712,7 @@ msgstr "Keine Munitionsgruppe in diesem Behälter"
msgid "Show Ammo" msgid "Show Ammo"
msgstr "Zeige Munitionsarten" msgstr "Zeige Munitionsarten"
#: lib/cannery_web/live/pack_live/show.html.heex:105 #: lib/cannery_web/live/pack_live/show.html.heex:99
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "This ammo is not in a container" msgid "This ammo is not in a container"
msgstr "Diese Munitionsgruppe ist nicht in einem Behälter" msgstr "Diese Munitionsgruppe ist nicht in einem Behälter"
@ -763,7 +735,7 @@ msgstr ""
msgid "isn't he cute >:3" msgid "isn't he cute >:3"
msgstr "" msgstr ""
#: lib/cannery_web/live/invite_live/form_component.html.heex:32 #: lib/cannery_web/live/invite_live/form_component.html.heex:35
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Leave \"Uses left\" blank to make invite unlimited" msgid "Leave \"Uses left\" blank to make invite unlimited"
msgstr "" msgstr ""
@ -774,37 +746,37 @@ msgid "Container:"
msgstr "Behälter" msgstr "Behälter"
#: lib/cannery_web/live/pack_live/index.html.heex:87 #: lib/cannery_web/live/pack_live/index.html.heex:87
#: lib/cannery_web/live/type_live/index.html.heex:64 #: lib/cannery_web/live/type_live/index.html.heex:66
#: lib/cannery_web/live/type_live/show.html.heex:164 #: lib/cannery_web/live/type_live/show.html.heex:164
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Show used" msgid "Show used"
msgstr "" msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214 #: lib/cannery_web/components/pack_table_component.ex:218
#: lib/cannery_web/live/pack_live/show.html.heex:19 #: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "%{percentage}%" msgid "%{percentage}%"
msgstr "" msgstr ""
#: lib/cannery_web/live/range_live/index.ex:153 #: lib/cannery_web/live/range_live/index.ex:215
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Rounds shot: %{count}" msgid "Rounds shot: %{count}"
msgstr "Patronen abgefeuert" msgstr "Patronen abgefeuert"
#: lib/cannery_web/components/container_table_component.ex:64 #: lib/cannery_web/components/container_table_component.ex:68
#: lib/cannery_web/components/type_table_component.ex:122 #: lib/cannery_web/components/type_table_component.ex:122
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Packs" msgid "Packs"
msgstr "" msgstr ""
#: lib/cannery_web/components/container_table_component.ex:65 #: lib/cannery_web/components/container_table_component.ex:69
#: lib/cannery_web/components/type_table_component.ex:143 #: lib/cannery_web/components/type_table_component.ex:143
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Rounds" msgid "Rounds"
msgstr "Patronen:" msgstr "Patronen:"
#: lib/cannery_web/live/container_live/index.html.heex:40 #: lib/cannery_web/live/container_live/index.html.heex:40
#: lib/cannery_web/live/container_live/show.html.heex:109 #: lib/cannery_web/live/container_live/show.html.heex:117
#: lib/cannery_web/live/type_live/show.html.heex:170 #: lib/cannery_web/live/type_live/show.html.heex:170
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "View as table" msgid "View as table"
@ -850,7 +822,7 @@ msgstr ""
msgid "Used rounds:" msgid "Used rounds:"
msgstr "" msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:68 #: lib/cannery_web/live/range_live/index.html.heex:80
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Rounds shot chart" msgid "Rounds shot chart"
msgstr "Patronen abgefeuert" msgstr "Patronen abgefeuert"
@ -957,7 +929,7 @@ msgid "Average CPR"
msgstr "" msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17 #: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263 #: lib/cannery_web/components/pack_table_component.ex:267
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Empty" msgid "Empty"
msgstr "" msgstr ""
@ -997,13 +969,13 @@ msgstr ""
msgid "Last used on:" msgid "Last used on:"
msgstr "" msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194 #: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Never used" msgid "Never used"
msgstr "" msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:71 #: lib/cannery_web/components/pack_table_component.ex:71
#: lib/cannery_web/live/pack_live/form_component.html.heex:49 #: lib/cannery_web/live/pack_live/form_component.html.heex:67
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Purchased on" msgid "Purchased on"
msgstr "" msgstr ""
@ -1024,31 +996,26 @@ msgstr "Munitionstyp bearbeiten"
msgid "Search catalog" msgid "Search catalog"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/index.html.heex:81 #: lib/cannery_web/live/pack_live/index.html.heex:79
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Search ammo" msgid "Search ammo"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:34 #: lib/cannery_web/live/container_live/index.html.heex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Search containers" msgid "Search containers"
msgstr "" msgstr ""
#: lib/cannery_web/live/tag_live/index.html.heex:36 #: lib/cannery_web/live/tag_live/index.html.heex:34
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Search tags" msgid "Search tags"
msgstr "" msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:112 #: lib/cannery_web/live/range_live/index.html.heex:124
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Search shot records" msgid "Search shot records"
msgstr "" msgstr ""
#: lib/cannery_web/controllers/user_settings_html/edit.html.heex:130
#, elixir-autogen, elixir-format
msgid "Spanish"
msgstr ""
#: lib/cannery_web/components/layouts.ex:15 #: lib/cannery_web/components/layouts.ex:15
#: lib/cannery_web/components/layouts/root.html.heex:9 #: lib/cannery_web/components/layouts/root.html.heex:9
#: lib/cannery_web/components/layouts/root.html.heex:10 #: lib/cannery_web/components/layouts/root.html.heex:10
@ -1143,48 +1110,48 @@ msgid "Email"
msgstr "" msgstr ""
#: lib/cannery_web/controllers/user_registration_html/new.html.heex:24 #: lib/cannery_web/controllers/user_registration_html/new.html.heex:24
#: lib/cannery_web/controllers/user_session_html/new.html.heex:20 #: lib/cannery_web/controllers/user_session_html/new.html.heex:24
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Password" msgid "Password"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:264 #: lib/cannery_web/live/type_live/form_component.html.heex:292
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "+P" msgid "+P"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:74 #: lib/cannery_web/live/type_live/form_component.html.heex:82
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid ".223" msgid ".223"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:55 #: lib/cannery_web/live/type_live/form_component.html.heex:62
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "5.56x46mm NATO" msgid "5.56x46mm NATO"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:303 #: lib/cannery_web/live/type_live/form_component.html.heex:333
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Boxer" msgid "Boxer"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:311 #: lib/cannery_web/live/type_live/form_component.html.heex:342
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Centerfire" msgid "Centerfire"
msgstr "" msgstr ""
#: lib/cannery_web/components/add_shot_record_component.html.heex:43 #: lib/cannery_web/components/add_shot_record_component.html.heex:45
#: lib/cannery_web/live/range_live/form_component.html.heex:35 #: lib/cannery_web/live/range_live/form_component.html.heex:37
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Really great weather" msgid "Really great weather"
msgstr "" msgstr ""
#: lib/cannery_web/components/container_table_component.ex:67 #: lib/cannery_web/components/container_table_component.ex:74
#: lib/cannery_web/components/move_pack_component.ex:67 #: lib/cannery_web/components/move_pack_component.ex:67
#: lib/cannery_web/components/pack_table_component.ex:62 #: lib/cannery_web/components/pack_table_component.ex:62
#: lib/cannery_web/components/shot_record_table_component.ex:48 #: lib/cannery_web/components/shot_record_table_component.ex:48
#: lib/cannery_web/components/type_table_component.ex:99 #: lib/cannery_web/components/type_table_component.ex:99
#: lib/cannery_web/live/pack_live/show.ex:92 #: lib/cannery_web/live/pack_live/show.ex:82
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Actions" msgid "Actions"
msgstr "" msgstr ""
@ -1210,21 +1177,21 @@ msgstr ""
msgid "Close modal" msgid "Close modal"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/show.html.heex:97 #: lib/cannery_web/live/container_live/show.html.heex:105
#: lib/cannery_web/live/pack_live/index.html.heex:58 #: lib/cannery_web/live/pack_live/index.html.heex:58
#: lib/cannery_web/live/range_live/index.html.heex:89 #: lib/cannery_web/live/range_live/index.html.heex:103
#: lib/cannery_web/live/type_live/index.html.heex:35 #: lib/cannery_web/live/type_live/index.html.heex:37
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "All" msgid "All"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:316 #: lib/cannery_web/live/type_live/form_component.html.heex:347
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Attributes" msgid "Attributes"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:56 #: lib/cannery_web/components/type_table_component.ex:56
#: lib/cannery_web/live/type_live/form_component.html.heex:88 #: lib/cannery_web/live/type_live/form_component.html.heex:97
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Brass height" msgid "Brass height"
msgstr "Messing" msgstr "Messing"
@ -1235,7 +1202,7 @@ msgid "Brass height:"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:57 #: lib/cannery_web/components/type_table_component.ex:57
#: lib/cannery_web/live/type_live/form_component.html.heex:95 #: lib/cannery_web/live/type_live/form_component.html.heex:107
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Chamber size" msgid "Chamber size"
msgstr "" msgstr ""
@ -1245,13 +1212,13 @@ msgstr ""
msgid "Chamber size:" msgid "Chamber size:"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:47 #: lib/cannery_web/live/type_live/form_component.html.heex:53
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Dimensions" msgid "Dimensions"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:80 #: lib/cannery_web/components/type_table_component.ex:80
#: lib/cannery_web/live/type_live/form_component.html.heex:269 #: lib/cannery_web/live/type_live/form_component.html.heex:297
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Dram equivalent" msgid "Dram equivalent"
msgstr "" msgstr ""
@ -1262,7 +1229,7 @@ msgid "Dram equivalent:"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:51 #: lib/cannery_web/components/type_table_component.ex:51
#: lib/cannery_web/live/type_live/form_component.html.heex:66 #: lib/cannery_web/live/type_live/form_component.html.heex:73
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Gauge" msgid "Gauge"
msgstr "" msgstr ""
@ -1273,7 +1240,7 @@ msgid "Gauge:"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:71 #: lib/cannery_web/components/type_table_component.ex:71
#: lib/cannery_web/live/type_live/form_component.html.heex:210 #: lib/cannery_web/live/type_live/form_component.html.heex:235
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Load grains" msgid "Load grains"
msgstr "" msgstr ""
@ -1293,43 +1260,45 @@ msgstr "Keine Munition"
msgid "None specified" msgid "None specified"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/show.html.heex:100 #: lib/cannery_web/live/container_live/show.html.heex:108
#: lib/cannery_web/live/pack_live/form_component.html.heex:30
#: lib/cannery_web/live/pack_live/index.html.heex:61 #: lib/cannery_web/live/pack_live/index.html.heex:61
#: lib/cannery_web/live/range_live/index.html.heex:92 #: lib/cannery_web/live/range_live/index.html.heex:106
#: lib/cannery_web/live/type_live/form_component.html.heex:25 #: lib/cannery_web/live/type_live/form_component.html.heex:28
#: lib/cannery_web/live/type_live/index.html.heex:38 #: lib/cannery_web/live/type_live/index.html.heex:40
#: lib/cannery_web/live/type_live/show.html.heex:56 #: lib/cannery_web/live/type_live/show.html.heex:56
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Pistol" msgid "Pistol"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:236 #: lib/cannery_web/live/type_live/form_component.html.heex:262
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Powder" msgid "Powder"
msgstr "Pulverart" msgstr "Pulverart"
#: lib/cannery_web/live/type_live/form_component.html.heex:296 #: lib/cannery_web/live/type_live/form_component.html.heex:325
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Primer" msgid "Primer"
msgstr "Zündertyp" msgstr "Zündertyp"
#: lib/cannery_web/live/type_live/form_component.html.heex:108 #: lib/cannery_web/live/type_live/form_component.html.heex:123
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Projectile" msgid "Projectile"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/show.html.heex:98 #: lib/cannery_web/live/container_live/show.html.heex:106
#: lib/cannery_web/live/pack_live/form_component.html.heex:28
#: lib/cannery_web/live/pack_live/index.html.heex:59 #: lib/cannery_web/live/pack_live/index.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:90 #: lib/cannery_web/live/range_live/index.html.heex:104
#: lib/cannery_web/live/type_live/form_component.html.heex:25 #: lib/cannery_web/live/type_live/form_component.html.heex:26
#: lib/cannery_web/live/type_live/index.html.heex:36 #: lib/cannery_web/live/type_live/index.html.heex:38
#: lib/cannery_web/live/type_live/show.html.heex:54 #: lib/cannery_web/live/type_live/show.html.heex:54
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Rifle" msgid "Rifle"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:72 #: lib/cannery_web/components/type_table_component.ex:72
#: lib/cannery_web/live/type_live/form_component.html.heex:218 #: lib/cannery_web/live/type_live/form_component.html.heex:243
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Shot charge weight" msgid "Shot charge weight"
msgstr "" msgstr ""
@ -1340,7 +1309,7 @@ msgid "Shot charge weight:"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:69 #: lib/cannery_web/components/type_table_component.ex:69
#: lib/cannery_web/live/type_live/form_component.html.heex:194 #: lib/cannery_web/live/type_live/form_component.html.heex:217
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Shot material" msgid "Shot material"
msgstr "" msgstr ""
@ -1351,7 +1320,7 @@ msgid "Shot material:"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:70 #: lib/cannery_web/components/type_table_component.ex:70
#: lib/cannery_web/live/type_live/form_component.html.heex:203 #: lib/cannery_web/live/type_live/form_component.html.heex:227
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Shot size" msgid "Shot size"
msgstr "Schüsse abgegeben" msgstr "Schüsse abgegeben"
@ -1362,7 +1331,7 @@ msgid "Shot size:"
msgstr "Schüsse abgegeben" msgstr "Schüsse abgegeben"
#: lib/cannery_web/components/type_table_component.ex:68 #: lib/cannery_web/components/type_table_component.ex:68
#: lib/cannery_web/live/type_live/form_component.html.heex:186 #: lib/cannery_web/live/type_live/form_component.html.heex:208
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Shot type" msgid "Shot type"
msgstr "" msgstr ""
@ -1372,23 +1341,24 @@ msgstr ""
msgid "Shot type:" msgid "Shot type:"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/show.html.heex:99 #: lib/cannery_web/live/container_live/show.html.heex:107
#: lib/cannery_web/live/pack_live/form_component.html.heex:29
#: lib/cannery_web/live/pack_live/index.html.heex:60 #: lib/cannery_web/live/pack_live/index.html.heex:60
#: lib/cannery_web/live/range_live/index.html.heex:91 #: lib/cannery_web/live/range_live/index.html.heex:105
#: lib/cannery_web/live/type_live/form_component.html.heex:25 #: lib/cannery_web/live/type_live/form_component.html.heex:27
#: lib/cannery_web/live/type_live/index.html.heex:37 #: lib/cannery_web/live/type_live/index.html.heex:39
#: lib/cannery_web/live/type_live/show.html.heex:52 #: lib/cannery_web/live/type_live/show.html.heex:52
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Shotgun" msgid "Shotgun"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:61 #: lib/cannery_web/components/type_table_component.ex:61
#: lib/cannery_web/live/type_live/form_component.html.heex:146 #: lib/cannery_web/live/type_live/form_component.html.heex:162
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Slug core" msgid "Slug core"
msgstr "" msgstr ""
#: lib/cannery_web/live/type_live/form_component.html.heex:190 #: lib/cannery_web/live/type_live/form_component.html.heex:213
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Target, bird, buck, etc" msgid "Target, bird, buck, etc"
msgstr "" msgstr ""
@ -1399,13 +1369,13 @@ msgid "Unfired length:"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:55 #: lib/cannery_web/components/type_table_component.ex:55
#: lib/cannery_web/live/type_live/form_component.html.heex:79 #: lib/cannery_web/live/type_live/form_component.html.heex:87
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Unfired shell length" msgid "Unfired shell length"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:67 #: lib/cannery_web/components/type_table_component.ex:67
#: lib/cannery_web/live/type_live/form_component.html.heex:179 #: lib/cannery_web/live/type_live/form_component.html.heex:200
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Wadding" msgid "Wadding"
msgstr "" msgstr ""
@ -1416,9 +1386,10 @@ msgid "Wadding:"
msgstr "" msgstr ""
#: lib/cannery_web/components/type_table_component.ex:149 #: lib/cannery_web/components/type_table_component.ex:149
#: lib/cannery_web/live/container_live/show.html.heex:91 #: lib/cannery_web/live/container_live/show.html.heex:99
#: lib/cannery_web/live/pack_live/form_component.html.heex:22
#: lib/cannery_web/live/pack_live/index.html.heex:50 #: lib/cannery_web/live/pack_live/index.html.heex:50
#: lib/cannery_web/live/range_live/index.html.heex:83 #: lib/cannery_web/live/range_live/index.html.heex:95
#: lib/cannery_web/live/type_live/form_component.html.heex:21 #: lib/cannery_web/live/type_live/form_component.html.heex:21
#: lib/cannery_web/live/type_live/index.html.heex:29 #: lib/cannery_web/live/type_live/index.html.heex:29
#: lib/cannery_web/live/type_live/show.html.heex:46 #: lib/cannery_web/live/type_live/show.html.heex:46
@ -1438,7 +1409,7 @@ msgid "Used up!"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:41 #: lib/cannery_web/live/pack_live/show.ex:41
#: lib/cannery_web/live/range_live/index.ex:39 #: lib/cannery_web/live/range_live/index.ex:60
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Edit Shot Record" msgid "Edit Shot Record"
msgstr "Schießkladde editieren" msgstr "Schießkladde editieren"
@ -1456,13 +1427,13 @@ msgid "New Type"
msgstr "Neuer Munitionstyp" msgstr "Neuer Munitionstyp"
#: lib/cannery_web/live/type_live/index.html.heex:8 #: lib/cannery_web/live/type_live/index.html.heex:8
#: lib/cannery_web/live/type_live/index.html.heex:71 #: lib/cannery_web/live/type_live/index.html.heex:73
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "No Types" msgid "No Types"
msgstr "Art" msgstr "Art"
#: lib/cannery_web/components/pack_table_component.ex:84 #: lib/cannery_web/components/pack_table_component.ex:84
#: lib/cannery_web/live/pack_live/form_component.html.heex:42 #: lib/cannery_web/live/pack_live/form_component.html.heex:59
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Lot number" msgid "Lot number"
msgstr "" msgstr ""
@ -1471,3 +1442,18 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Lot number:" msgid "Lot number:"
msgstr "" msgstr ""
#: lib/cannery_web/live/pack_live/form_component.html.heex:27
#, elixir-autogen, elixir-format
msgid "Any"
msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:138
#, elixir-autogen, elixir-format, fuzzy
msgid "Dates"
msgstr "Datum"
#: lib/cannery_web/live/range_live/index.html.heex:8
#, elixir-autogen, elixir-format, fuzzy
msgid "No containers staged"
msgstr "Kein Behälter"

Some files were not shown because too many files have changed in this diff Show More