Skip to content

Commit

Permalink
Merge pull request #92 from philipp-kempgen/main
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
wintermeyer authored Feb 29, 2024
2 parents cedce42 + 2fbd03b commit e55db1f
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 20 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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

2 changes: 0 additions & 2 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: Elixir CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 35 additions & 17 deletions lib/animina_web/live/root_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ defmodule AniminaWeb.RootLive do
value: f[:username].value,
type: :text,
required: true,
autofocus: true,
autocomplete: :username,
"phx-debounce": "200"
) %>
Expand Down Expand Up @@ -233,40 +232,54 @@ defmodule AniminaWeb.RootLive do
<%= gettext("Gender") %>
</label>
</div>
<div class="mt-2">
<div class="mt-2" phx-no-format>
<%
item_code = "male" # formerly "m"
item_title = gettext("Male")
%>
<div class="flex items-center mb-4">
<%= 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"
) %>
</div>
<%
item_code = "female" # formerly "f"
item_title = gettext("Female")
%>
<div class="flex items-center mb-4">
<%= 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"
) %>
</div>
<%
item_code = "diverse" # formerly "x"
item_title = gettext("Diverse")
%>
<div class="flex items-center mb-4">
<%= 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"
) %>
</div>
</div>
</div>
Expand All @@ -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"
) %>
Expand All @@ -306,7 +321,6 @@ defmodule AniminaWeb.RootLive do
</span>
</label>
</div>
<div phx-feedback-for={f[:height].name} class="mt-2">
<%= text_input(f, :height,
class:
Expand All @@ -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"
) %>
Expand Down Expand Up @@ -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"
) %>
Expand Down
2 changes: 1 addition & 1 deletion test/animina/accounts/user_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e55db1f

Please sign in to comment.