Skip to content

Commit

Permalink
chore: upgrade phoenix to 1.7: update formatter to line length 120
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittstruck committed Jan 4, 2024
1 parent c80cbaa commit 380c92b
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 88 deletions.
3 changes: 2 additions & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
import_deps: [:ecto, :ecto_sql, :phoenix],
subdirectories: ["priv/*/migrations"],
plugins: [Phoenix.LiveView.HTMLFormatter],
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"],
line_length: 120
]
3 changes: 1 addition & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ config :phoenix, :json_library, Jason
config :esbuild,
version: "0.19.11",
default: [
args:
~w(js/app.js --bundle --target=es2016 --external:*.webmanifest --outdir=../priv/static/assets),
args: ~w(js/app.js --bundle --target=es2016 --external:*.webmanifest --outdir=../priv/static/assets),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
Expand Down
4 changes: 1 addition & 3 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ config :qrstorage, QrstorageWeb.Endpoint,
watchers: [
# Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
sass:
{DartSass, :install_and_run,
[:default, ~w(--embed-source-map --source-map-urls=absolute --watch)]}
sass: {DartSass, :install_and_run, [:default, ~w(--embed-source-map --source-map-urls=absolute --watch)]}
]

# ## SSL Support
Expand Down
55 changes: 10 additions & 45 deletions lib/qrstorage_web/templates/layout/app.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,16 @@
<meta name="description" content="" />

<link rel="manifest" href={Routes.static_path(@conn, "/site.webmanifest")} />
<link
rel="mask-icon"
href={Routes.static_path(@conn, "/images/safari-pinned-tab.svg")}
color="#5bbad5"
/>
<link rel="mask-icon" href={Routes.static_path(@conn, "/images/safari-pinned-tab.svg")} color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />

<%= csrf_meta_tag() %>
<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/assets/app.css")} />
<link rel="apple-touch-icon" href={Routes.static_path(@conn, "/images/apple-touch-icon.png")} />
<link
rel="icon"
sizes="192x192"
href={Routes.static_path(@conn, "/images/favicon-192x192.png")}
/>
<link rel="icon" sizes="192x192" href={Routes.static_path(@conn, "/images/favicon-192x192.png")} />
<link rel="icon" sizes="96x96" href={Routes.static_path(@conn, "/images/favicon-96x96.png")} />
<script
defer
phx-track-static
type="text/javascript"
src={Routes.static_path(@conn, "/assets/app.js")}
>
<script defer phx-track-static type="text/javascript" src={Routes.static_path(@conn, "/assets/app.js")}>
</script>
</head>
<body>
Expand All @@ -54,22 +41,13 @@
<% end %>
</div>
<div class="col-11 col-sm-10 d-flex justify-content-end">
<a
href="https://github.com/kitsteam/qrstorage"
class="text-white px-lg-2 p-2 text-decoration-none"
>
<a href="https://github.com/kitsteam/qrstorage" class="text-white px-lg-2 p-2 text-decoration-none">
GitHub
</a>
<a
href="https://kits.blog/impressum/"
class="text-white px-lg-2 p-2 text-decoration-none"
>
<a href="https://kits.blog/impressum/" class="text-white px-lg-2 p-2 text-decoration-none">
Impressum
</a>
<a
href="https://kits.blog/datenschutzerklaerung/"
class="text-white p-2 text-decoration-none"
>
<a href="https://kits.blog/datenschutzerklaerung/" class="text-white p-2 text-decoration-none">
Datenschutz
</a>
</div>
Expand All @@ -94,22 +72,13 @@
<% end %>
</div>
<div id="footer-links" class="d-flex align-items-center mb-1">
<a
href="https://github.com/kitsteam/qrstorage"
class="text-white px-lg-2 p-2 text-decoration-none"
>
<a href="https://github.com/kitsteam/qrstorage" class="text-white px-lg-2 p-2 text-decoration-none">
GitHub
</a>
<a
href="https://kits.blog/impressum/"
class="text-white px-lg-2 p-2 text-decoration-none"
>
<a href="https://kits.blog/impressum/" class="text-white px-lg-2 p-2 text-decoration-none">
Impressum
</a>
<a
href="https://kits.blog/datenschutzerklaerung/"
class="text-white p-2 text-decoration-none"
>
<a href="https://kits.blog/datenschutzerklaerung/" class="text-white p-2 text-decoration-none">
Datenschutz
</a>
</div>
Expand All @@ -122,11 +91,7 @@
<div class="g-0 d-flex justify-content-end px-3">
<div class="pt-3">
<a href="https://kits.blog/tools/">
<img
src={Routes.static_path(@conn, "/images/kits-logo.svg")}
class="img-fluid d-block"
alt="Kits Logo"
/>
<img src={Routes.static_path(@conn, "/images/kits-logo.svg")} class="img-fluid d-block" alt="Kits Logo" />
</a>
</div>
</div>
Expand Down
14 changes: 2 additions & 12 deletions lib/qrstorage_web/templates/qr_code/download.html.heex
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<%= if @qr_code.content_type == :link do %>
<div
id="canvas"
class="py-3"
data-color={@qr_code.color}
data-url={@qr_code.text}
data-dots-type={@qr_code.dots_type}
>
<div id="canvas" class="py-3" data-color={@qr_code.color} data-url={@qr_code.text} data-dots-type={@qr_code.dots_type}>
</div>
<br />
<% else %>
Expand Down Expand Up @@ -63,11 +57,7 @@
>
<%= gettext("Download") %>
</button>
<ul
class="dropdown-menu"
id="qr-download-dropdown-menu"
aria-labelledby="qr-download-dropdown-button"
>
<ul class="dropdown-menu" id="qr-download-dropdown-menu" aria-labelledby="qr-download-dropdown-button">
<li><a class="dropdown-item" data-file-type="svg" href="#"><%= gettext("SVG") %></a></li>
<li><a class="dropdown-item" data-file-type="png" href="#"><%= gettext("PNG") %></a></li>
</ul>
Expand Down
6 changes: 1 addition & 5 deletions lib/qrstorage_web/templates/qr_code/form.html.heex
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<div
class="btn-group mb-3 w-100 d-flex justify-content-between"
id="content-type-selector"
role="group"
>
<div class="btn-group mb-3 w-100 d-flex justify-content-between" id="content-type-selector" role="group">
<%= radio_button(:qr_code, :content_type, "audio",
class: "btn-check content-type",
autocomplete: "off",
Expand Down
3 changes: 2 additions & 1 deletion lib/qrstorage_web/templates/qr_code/form_text.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<div id="editor-container"></div>
<span id="character-count" data-max-characters={QrCode.text_length_limits()[:text]}>
<%= QrCode.text_length_limits()[:text] %>
</span> <span><%= gettext("character(s) left") %></span>
</span>
<span><%= gettext("character(s) left") %></span>
<p class="form-text text-muted">
<%= gettext(
"This tool may only be used in Teaching/Learning situations. It is not permitted to enter personal information."
Expand Down
18 changes: 4 additions & 14 deletions lib/qrstorage_web/templates/qr_code/partials/_player.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,15 @@
<div class="position-absolute top-0 start-0"></div>
<div id="progressbar"></div>
<div class="position-absolute top-50 start-50 translate-middle">
<div
id="play"
class="amplitude-play-pause position-absolute top-50 start-50 translate-middle"
>
<div id="play" class="amplitude-play-pause position-absolute top-50 start-50 translate-middle">
<span id="play-icon" class="d-none">
<svg class="feather">
<use href={
Routes.static_path(@conn, "/images/feather-icons/feather-sprite.svg#play")
} />
<use href={Routes.static_path(@conn, "/images/feather-icons/feather-sprite.svg#play")} />
</svg>
</span>
<span id="pause-icon" class="d-none">
<svg class="feather">
<use href={
Routes.static_path(@conn, "/images/feather-icons/feather-sprite.svg#pause")
} />
<use href={Routes.static_path(@conn, "/images/feather-icons/feather-sprite.svg#pause")} />
</svg>
</span>
</div>
Expand All @@ -29,10 +22,7 @@
data-skip-back-seconds="10"
class="position-absolute bottom-0 start-0 translate-middle badge border border-light rounded-circle bg-secondary p-4 translate-middle-x"
>
<img
src={Routes.static_path(@conn, "/images/feather-icons/rotate-ccw.svg")}
class="feather"
/>
<img src={Routes.static_path(@conn, "/images/feather-icons/rotate-ccw.svg")} class="feather" />
</span>
<span
id="stop"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
</div>
<div class="row">
<div class="col-auto mx-auto">
<small
id="voice-help"
data-languages-with-male-voice={languages_with_male_voice()}
class="d-none text-muted"
>
<small id="voice-help" data-languages-with-male-voice={languages_with_male_voice()} class="d-none text-muted">
<%= gettext("This language supports only a female voice.") %>
</small>
</div>
Expand Down

0 comments on commit 380c92b

Please sign in to comment.