diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..43b760dd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +[*.{html.heex,ex,exs}] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = false +indent_style = space +indent_size = 2 + diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index a466dbe3..eb26d0b3 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -2,9 +2,7 @@ name: Elixir CI on: push: - branches: [main] pull_request: - branches: [main] jobs: build: diff --git a/docker-compose.yml b/docker-compose.yml index 6257069b..e2bd5d39 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,7 @@ services: - "./mix.lock:/application/mix.lock:ro" - "./priv:/application/priv:ro" - "./priv/static/assets:/application/priv/static/assets:rw" # note: read-write! + - "./priv/static/uploads:/application/priv/static/uploads:rw" # note: read-write! - "./priv/repo/migrations:/application/priv/repo/migrations:rw" # note: read-write! - "./priv/resource_snapshots/repo:/application/priv/resource_snapshots/repo:rw" # note: read-write! - "./test:/application/test:ro" diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 831bb89a..a6ac0c3c 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,6 +7,9 @@ echo "Create the database and run migrations ..." mix ash_postgres.create mix ash_postgres.migrate +echo "Seeding hashtags ..." +mix run priv/repo/flag_seeds.exs || true #TODO No need to run every time. Should these go into a migration? + echo "Starting application ..." mix phx.server #iex -S mix phx.server diff --git a/lib/animina_web/live/root_live.ex b/lib/animina_web/live/root_live.ex index 87a1edd4..9a5a2901 100644 --- a/lib/animina_web/live/root_live.ex +++ b/lib/animina_web/live/root_live.ex @@ -110,7 +110,6 @@ defmodule AniminaWeb.RootLive do value: f[:username].value, type: :text, required: true, - autofocus: true, autocomplete: :username, "phx-debounce": "200" ) %> @@ -233,40 +232,54 @@ defmodule AniminaWeb.RootLive do <%= gettext("Gender") %> -
+
+ + <% + item_code = "male" # formerly "m" + item_title = gettext("Male") + %>
- <%= radio_button(f, :gender, "male", - id: "gender_male", + <%= radio_button(f, :gender, item_code, + id: "gender_" <> item_code, class: "h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-500", checked: true ) %> - <%= label(f, :gender, gettext("Male"), - for: "gender_male", + <%= label(f, :gender, item_title, + for: "gender_" <> item_code, class: "ml-3 block text-sm font-medium text-gray-700" ) %>
- + + <% + item_code = "female" # formerly "f" + item_title = gettext("Female") + %>
- <%= radio_button(f, :gender, "female", - id: "gender_female", + <%= radio_button(f, :gender, item_code, + id: "gender_" <> item_code, class: "h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-500" ) %> - <%= label(f, :gender, gettext("Female"), - for: "gender_female", + <%= label(f, :gender, item_title, + for: "gender_" <> item_code, class: "ml-3 block text-sm font-medium text-gray-700" ) %>
- + + <% + item_code = "diverse" # formerly "x" + item_title = gettext("Diverse") + %>
- <%= radio_button(f, :gender, "diverse", - id: "gender_diverse", + <%= radio_button(f, :gender, item_code, + id: "gender_" <> item_code, class: "h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-500" ) %> - <%= label(f, :gender, gettext("Diverse"), - for: "gender_diverse", + <%= label(f, :gender, item_title, + for: "gender_" <> item_code, class: "ml-3 block text-sm font-medium text-gray-700" ) %>
+
@@ -287,6 +300,8 @@ defmodule AniminaWeb.RootLive do # Postal code of the Bundestag :-) placeholder: "11011", value: f[:zip_code].value, + #pattern: "[0-9]{5}", + inputmode: "numeric", autocomplete: "postal-code", "phx-debounce": "blur" ) %> @@ -306,7 +321,6 @@ defmodule AniminaWeb.RootLive do -
<%= text_input(f, :height, class: @@ -316,6 +330,8 @@ defmodule AniminaWeb.RootLive do else: "ring-gray-300 focus:ring-indigo-600" ), placeholder: "160", + #pattern: "[1-9][0-9]{2}", + inputmode: "numeric", value: f[:height].value, "phx-debounce": "blur" ) %> @@ -344,6 +360,8 @@ defmodule AniminaWeb.RootLive do else: "ring-gray-300 focus:ring-indigo-600" ), placeholder: "0151-12345678", + #pattern: "[0-9+ \-]*", + inputmode: "numeric", value: f[:mobile_phone].value, "phx-debounce": "100" ) %> diff --git a/test/animina/accounts/user_test.exs b/test/animina/accounts/user_test.exs index 930eadba..746fa316 100644 --- a/test/animina/accounts/user_test.exs +++ b/test/animina/accounts/user_test.exs @@ -14,7 +14,7 @@ defmodule Animina.Accounts.UserTest do birthday: "1950-01-01", height: 180, zip_code: "12345", - gender: "male", + gender: "m", mobile_phone: "0151-12345678", language: "en" # subscribed_at: 1706659201,