diff --git a/.formatter.exs b/.formatter.exs index d2cda26ed..d491bed1c 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,4 +1,6 @@ # Used by "mix format" [ - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] + plugins: [Phoenix.LiveView.HTMLFormatter], + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{heex,ex,exs}"], + heex_line_length: 200 ] diff --git a/lib/nerves_hub_web/templates/account/delete.html.heex b/lib/nerves_hub_web/templates/account/delete.html.heex index a267effc0..773e89619 100644 --- a/lib/nerves_hub_web/templates/account/delete.html.heex +++ b/lib/nerves_hub_web/templates/account/delete.html.heex @@ -5,10 +5,10 @@ <%= form_for @conn, Routes.account_path(@conn, :delete, @user.username), [method: "delete"], fn f -> %>
- <%= text_input f, :confirm_username, class: "form-control", id: "username_input" %> + <%= text_input(f, :confirm_username, class: "form-control", id: "username_input") %>
- <%= submit "I understand the consequences, delete this account", class: "btn btn-primary" %> + <%= submit("I understand the consequences, delete this account", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/account/edit.html.heex b/lib/nerves_hub_web/templates/account/edit.html.heex index 8722ac250..f69cce2f1 100644 --- a/lib/nerves_hub_web/templates/account/edit.html.heex +++ b/lib/nerves_hub_web/templates/account/edit.html.heex @@ -3,44 +3,42 @@
- <%= - link( - "Delete Account", - class: "btn btn-outline-light", - aria_label: "Delete Account", - to: Routes.account_path(@conn, :confirm_delete, @user.username) - ) - %> + <%= link( + "Delete Account", + class: "btn btn-outline-light", + aria_label: "Delete Account", + to: Routes.account_path(@conn, :confirm_delete, @user.username) + ) %>
<%= form_for @changeset, Routes.account_path(@conn, :update, @user.username), fn f -> %>
- <%= text_input f, :username, class: "form-control", id: "username_input" %> -
<%= error_tag f, :username %>
+ <%= text_input(f, :username, class: "form-control", id: "username_input") %> +
<%= error_tag(f, :username) %>
- <%= email_input f, :email, class: "form-control", id: "email_input" %> -
<%= error_tag f, :email %>
+ <%= email_input(f, :email, class: "form-control", id: "email_input") %> +
<%= error_tag(f, :email) %>

Change Password

- <%= password_input f, :current_password, class: "form-control", id: "current_password_input" %> -
<%= error_tag f, :current_password %>
+ <%= password_input(f, :current_password, class: "form-control", id: "current_password_input") %> +
<%= error_tag(f, :current_password) %>
- <%= password_input f, :password, class: "form-control", id: "password_input" %> -
<%= error_tag f, :password %>
+ <%= password_input(f, :password, class: "form-control", id: "password_input") %> +
<%= error_tag(f, :password) %>
- <%= submit "Save Changes", class: "btn btn-primary" %> + <%= submit("Save Changes", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/account/invite.html.heex b/lib/nerves_hub_web/templates/account/invite.html.heex index 7bace3848..a5b6a7c23 100644 --- a/lib/nerves_hub_web/templates/account/invite.html.heex +++ b/lib/nerves_hub_web/templates/account/invite.html.heex @@ -2,20 +2,20 @@

Create New Account

-
<%= gettext "You will be added to the %{organization_name} organization", organization_name: @org.name %>
+
<%= gettext("You will be added to the %{organization_name} organization", organization_name: @org.name) %>
<%= form_for @changeset, Routes.account_path(@conn, :accept_invite, @token), [as: :user, method: "post", class: "form-page"], fn f -> %>
- <%= text_input f, :username, class: "form-control", id: "username_input" %> -
<%= error_tag f, :username %>
+ <%= text_input(f, :username, class: "form-control", id: "username_input") %> +
<%= error_tag(f, :username) %>
- <%= password_input f, :password, class: "form-control", id: "password_input" %> -
<%= error_tag f, :password %>
+ <%= password_input(f, :password, class: "form-control", id: "password_input") %> +
<%= error_tag(f, :password) %>
- <%= submit "Register", class: "btn btn-primary btn-lg w-100" %> + <%= submit("Register", class: "btn btn-primary btn-lg w-100") %> <% end %> diff --git a/lib/nerves_hub_web/templates/archive/index.html.heex b/lib/nerves_hub_web/templates/archive/index.html.heex index 7ec8c879c..379aa1379 100644 --- a/lib/nerves_hub_web/templates/archive/index.html.heex +++ b/lib/nerves_hub_web/templates/archive/index.html.heex @@ -75,7 +75,12 @@ diff --git a/lib/nerves_hub_web/templates/audit_log/_audit_log_feed.html.heex b/lib/nerves_hub_web/templates/audit_log/_audit_log_feed.html.heex index 7eda467de..d505bf534 100644 --- a/lib/nerves_hub_web/templates/audit_log/_audit_log_feed.html.heex +++ b/lib/nerves_hub_web/templates/audit_log/_audit_log_feed.html.heex @@ -6,7 +6,7 @@ <% else %> <%= for audit_log <- @audit_logs do %>
-
+

<%= audit_log.description %>

diff --git a/lib/nerves_hub_web/templates/deployment/edit.html.heex b/lib/nerves_hub_web/templates/deployment/edit.html.heex index 09a8c618c..d2f7bf836 100644 --- a/lib/nerves_hub_web/templates/deployment/edit.html.heex +++ b/lib/nerves_hub_web/templates/deployment/edit.html.heex @@ -1,4 +1,4 @@ -<%= link "Back to Deployment", to: Routes.deployment_path(@conn, :show, @org.name, @product.name, @deployment.name), class: "back-link"%> +<%= link("Back to Deployment", to: Routes.deployment_path(@conn, :show, @org.name, @product.name, @deployment.name), class: "back-link") %>

Edit Deployment

Firmware version details
@@ -10,12 +10,10 @@
Version

- <%= - case @firmware.version do - nil -> "--" - version -> version - end - %> + <%= case @firmware.version do + nil -> "--" + version -> version + end %>

@@ -31,12 +29,12 @@
<%= form_for @changeset, Routes.deployment_path(@conn, :update, @org.name, @product.name, @deployment.name), [as: :deployment], fn f -> %> - <%= hidden_input f, :firmware_id, value: @firmware.id %> + <%= hidden_input(f, :firmware_id, value: @firmware.id) %>
- <%= text_input f, :name, class: "form-control", id: "name_input" %> -
<%= error_tag f, :name %>
+ <%= text_input(f, :name, class: "form-control", id: "name_input") %> +
<%= error_tag(f, :name) %>
@@ -45,9 +43,9 @@ Firmware listed is the same platform and architecture as the currently selected firmware. - <%= select f, :firmware_id, firmware_dropdown_options(@firmwares), required: true, id: "firmware_id", class: "form-control" %> + <%= select(f, :firmware_id, firmware_dropdown_options(@firmwares), required: true, id: "firmware_id", class: "form-control") %>
-
<%= error_tag f, :firmware_id %>
+
<%= error_tag(f, :firmware_id) %>

Conditions

@@ -60,15 +58,15 @@ Changing tags will reset all devices on this deployment - <%= text_input f, :tags, - class: "form-control", - id: "tags_input", - value: - @changeset - |> Ecto.Changeset.get_change(:conditions, %{}) - |> Map.get("tags", "") - %> -
<%= error_tag f, :tags %>
+ <%= text_input(f, :tags, + class: "form-control", + id: "tags_input", + value: + @changeset + |> Ecto.Changeset.get_change(:conditions, %{}) + |> Map.get("tags", "") + ) %> +
<%= error_tag(f, :tags) %>
@@ -77,15 +75,15 @@ Changing the version requirement will reset all devices on this deployment - <%= text_input f, :version, - class: "form-control", - id: "version_requirement", - value: - @changeset - |> Ecto.Changeset.get_change(:conditions, %{}) - |> Map.get("version", "") - %> -
<%= error_tag f, :version %>
+ <%= text_input(f, :version, + class: "form-control", + id: "version_requirement", + value: + @changeset + |> Ecto.Changeset.get_change(:conditions, %{}) + |> Map.get("version", "") + ) %> +
<%= error_tag(f, :version) %>

Rolling Updates

@@ -96,8 +94,8 @@ The number of devices that will update at any given time. This is a soft limit and concurrent updates may be slightly above this number. - <%= number_input f, :concurrent_updates, class: "form-control", id: "concurrent_updates" %> -
<%= error_tag f, :concurrent_updates %>
+ <%= number_input(f, :concurrent_updates, class: "form-control", id: "concurrent_updates") %> +
<%= error_tag(f, :concurrent_updates) %>
@@ -106,10 +104,9 @@ The number of minutes before an inflight update expires to clear the queue - <%= number_input f, :inflight_update_expiration_minutes, class: "form-control", id: "concurrent_updates" %> -
<%= error_tag f, :inflight_update_expiration_minutes %>
+ <%= number_input(f, :inflight_update_expiration_minutes, class: "form-control", id: "concurrent_updates") %> +
<%= error_tag(f, :inflight_update_expiration_minutes) %>
-
@@ -143,11 +140,11 @@ <%= help_message_for(:failure_threshold) %> - <%= number_input f, :failure_threshold, + <%= number_input(f, :failure_threshold, class: "form-control", id: "failure_threshold" - %> -
<%= error_tag f, :failure_threshold %>
+ ) %> +
<%= error_tag(f, :failure_threshold) %>
@@ -157,18 +154,18 @@ <%= help_message_for(:device_failure_rate) %>
- <%= number_input f, :device_failure_rate_amount, + <%= number_input(f, :device_failure_rate_amount, class: "form-control form-control-sm", id: "device_failure_rate_amount" - %> + ) %> failures per - <%= number_input f, :device_failure_rate_seconds, + <%= number_input(f, :device_failure_rate_seconds, class: "form-control form-control-sm", id: "device_failure_rate_input" - %> + ) %> sec
-
<%= error_tag f, :device_failure_rate_seconds %>
+
<%= error_tag(f, :device_failure_rate_seconds) %>
@@ -177,11 +174,11 @@ <%= help_message_for(:device_failure_threshold) %> - <%= number_input f, :device_failure_threshold, + <%= number_input(f, :device_failure_threshold, class: "form-control", id: "device_failure_threshold" - %> -
<%= error_tag f, :device_failure_threshold %>
+ ) %> +
<%= error_tag(f, :device_failure_threshold) %>
@@ -190,11 +187,11 @@ <%= help_message_for(:penalty_timeout_minutes) %> - <%= number_input f, :penalty_timeout_minutes, + <%= number_input(f, :penalty_timeout_minutes, class: "form-control", id: "penalty_timeout_minutes" - %> -
<%= error_tag f, :penalty_timeout_minutes %>
+ ) %> +
<%= error_tag(f, :penalty_timeout_minutes) %>
@@ -204,14 +201,14 @@ Run this code when the device first connects to the console. - <%= textarea f, :connecting_code, rows: 6, class: "form-control", id: "connecting_code" %> + <%= textarea(f, :connecting_code, rows: 6, class: "form-control", id: "connecting_code") %> Make sure this is valid Elixir and will not crash the device. This will run before device specific first connect code. -
<%= error_tag f, :connecting_code %>
+
<%= error_tag(f, :connecting_code) %>
- <%= submit "Save Changes", class: "btn btn-primary" %> + <%= submit("Save Changes", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/deployment/index.html.heex b/lib/nerves_hub_web/templates/deployment/index.html.heex index 6bbb75ef9..1ff768546 100644 --- a/lib/nerves_hub_web/templates/deployment/index.html.heex +++ b/lib/nerves_hub_web/templates/deployment/index.html.heex @@ -48,10 +48,10 @@
Firmware version
- <%= link(to: Routes.firmware_path(@conn, :show, @org.name, @product.name, deployment.firmware.uuid)) do %> - - <%= firmware_simple_display_name(deployment.firmware) %> - + <%= link(to: Routes.firmware_path(@conn, :show, @org.name, @product.name, deployment.firmware.uuid)) do %> + + <%= firmware_simple_display_name(deployment.firmware) %> + <% end %>
@@ -81,9 +81,9 @@ options
Cancel - <%= submit "Next", class: "btn btn-primary" %> + <%= submit("Next", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/deployment/new.html.heex b/lib/nerves_hub_web/templates/deployment/new.html.heex index 89c47349e..471011a78 100644 --- a/lib/nerves_hub_web/templates/deployment/new.html.heex +++ b/lib/nerves_hub_web/templates/deployment/new.html.heex @@ -3,21 +3,21 @@ <%= form_for @changeset, Routes.deployment_path(@conn, :create, @org.name, @product.name), [as: :deployment], fn f -> %>
- <%= text_input f, :name, class: "form-control", id: "name_input" %> -
<%= error_tag f, :name %>
+ <%= text_input(f, :name, class: "form-control", id: "name_input") %> +
<%= error_tag(f, :name) %>
- <%= text_input f, :tags, - class: "form-control", - id: "tags_input", - value: - @changeset - |> Ecto.Changeset.get_change(:conditions, %{}) - |> Map.get("tags", "") - %> -
<%= error_tag f, :tags %>
+ <%= text_input(f, :tags, + class: "form-control", + id: "tags_input", + value: + @changeset + |> Ecto.Changeset.get_change(:conditions, %{}) + |> Map.get("tags", "") + ) %> +
<%= error_tag(f, :tags) %>
@@ -26,26 +26,26 @@ Once selected, deployments will use the same platform and architecture going forward. - <%= select f, :firmware_id, firmware_dropdown_options(@firmwares), required: true, id: "firmware_id", class: "form-control" %> + <%= select(f, :firmware_id, firmware_dropdown_options(@firmwares), required: true, id: "firmware_id", class: "form-control") %>
-
<%= error_tag f, :firmware_id %>
+
<%= error_tag(f, :firmware_id) %>
- <%= text_input f, :version, + <%= text_input(f, :version, class: "form-control", id: "version_input", value: @changeset |> Ecto.Changeset.get_change(:conditions, %{}) |> Map.get("version", "") - %> -
<%= error_tag f, :version %>
+ ) %> +
<%= error_tag(f, :version) %>
Back - <%= submit "Create Deployment", class: "btn btn-primary" %> + <%= submit("Create Deployment", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/deployment/show.html.heex b/lib/nerves_hub_web/templates/deployment/show.html.heex index 8dcad35f1..cc308ced6 100644 --- a/lib/nerves_hub_web/templates/deployment/show.html.heex +++ b/lib/nerves_hub_web/templates/deployment/show.html.heex @@ -1,5 +1,5 @@
- <%= link "All Deployments", to: Routes.deployment_path(@conn, :index, @org.name, @product.name), class: "back-link"%> + <%= link("All Deployments", to: Routes.deployment_path(@conn, :index, @org.name, @product.name), class: "back-link") %>
<%= link(to: Routes.deployment_path(@conn, :toggle, @org.name, @product.name, @deployment.name), class: "btn btn-outline-light btn-action", method: :post, aria: [label: "Turn #{opposite_status(@deployment)} deployment"]) do %> @@ -53,7 +53,7 @@ <% end %>
Firmware version
- <%= firmware_summary(@firmware) %> + <%= firmware_summary(@firmware) %>
Version requirement
diff --git a/lib/nerves_hub_web/templates/device/_header.html.heex b/lib/nerves_hub_web/templates/device/_header.html.heex index a83804518..6eefbc571 100644 --- a/lib/nerves_hub_web/templates/device/_header.html.heex +++ b/lib/nerves_hub_web/templates/device/_header.html.heex @@ -50,12 +50,12 @@ <% @device.updates_enabled == false -> %> Disabled - Firmware blocked icon + Firmware blocked icon <% Devices.device_in_penalty_box?(@device) -> %> In Penalty Box - Firmware penalty box icon + Firmware penalty box icon Clear @@ -63,7 +63,7 @@ <% true -> %> Enabled - Firmware enabled icon + Firmware enabled icon <% end %>

diff --git a/lib/nerves_hub_web/templates/device/edit.html.heex b/lib/nerves_hub_web/templates/device/edit.html.heex index d7ad14a50..13b71eafe 100644 --- a/lib/nerves_hub_web/templates/device/edit.html.heex +++ b/lib/nerves_hub_web/templates/device/edit.html.heex @@ -1,4 +1,4 @@ -<%= link "Back to Device", to: Routes.device_path(@conn, :show, @org.name, @product.name, @device.identifier), class: "back-link"%> +<%= link("Back to Device", to: Routes.device_path(@conn, :show, @org.name, @product.name, @device.identifier), class: "back-link") %>

Edit Device

<%= form_for @changeset, Routes.device_path(@conn, :update, @org.name, @product.name, @device.identifier), [method: :patch], fn f -> %> @@ -8,8 +8,8 @@ Device ID cannot be changed once created - <%= text_input f, :identifier, class: "form-control", id: "identifier_input", disabled: "true" %> -
<%= error_tag f, :identifier %>
+ <%= text_input(f, :identifier, class: "form-control", id: "identifier_input", disabled: "true") %> +
<%= error_tag(f, :identifier) %>
@@ -18,8 +18,8 @@ Description for this device - <%= text_input f, :description, class: "form-control", id: "description_input" %> -
<%= error_tag f, :description %>
+ <%= text_input(f, :description, class: "form-control", id: "description_input") %> +
<%= error_tag(f, :description) %>
@@ -28,11 +28,11 @@ Use tags to manage firmware deployments for different sets of devices. - <%= text_input f, :tags, class: "form-control", id: "tags", value: tags_to_string(@changeset) %> + <%= text_input(f, :tags, class: "form-control", id: "tags", value: tags_to_string(@changeset)) %> Every device is added to the 'all' tag by default. You can have multiple tags separated by commas. -
<%= error_tag f, :tags %>
+
<%= error_tag(f, :tags) %>
@@ -41,14 +41,14 @@ Run this code when the device first connects to the console. - <%= textarea f, :connecting_code, rows: 6, class: "form-control", id: "connecting_code" %> + <%= textarea(f, :connecting_code, rows: 6, class: "form-control", id: "connecting_code") %> Make sure this is valid Elixir and will not crash the device. -
<%= error_tag f, :connecting_code %>
+
<%= error_tag(f, :connecting_code) %>
- <%= submit "Save Changes", class: "btn btn-primary" %> + <%= submit("Save Changes", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/device/index.html.heex b/lib/nerves_hub_web/templates/device/index.html.heex index ae9987c2e..9a0b451d8 100644 --- a/lib/nerves_hub_web/templates/device/index.html.heex +++ b/lib/nerves_hub_web/templates/device/index.html.heex @@ -2,13 +2,20 @@
No devices

<%= @product.name %> doesn’t have any devices yet

-

Or follow these steps to add a device using the terminal.

+

+ Or follow these steps to add a device using the terminal. +

<% else %>

Devices

- <% end %>
- <%= if @show_filters do%> + <%= if @show_filters do %>

Filters

@@ -136,7 +143,9 @@
- +
@@ -146,7 +155,14 @@
- +
Tags Cannot Contain Spaces
@@ -198,7 +214,7 @@ <%= for device <- @devices do %> - +
Identifier
@@ -267,13 +283,13 @@ options
@@ -17,8 +17,8 @@ Description for this device - <%= text_input f, :description, class: "form-control", id: "description_input" %> -
<%= error_tag f, :description %>
+ <%= text_input(f, :description, class: "form-control", id: "description_input") %> +
<%= error_tag(f, :description) %>
- <%= submit "Add Device", class: "btn btn-primary" %> + <%= submit("Add Device", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/device/show.html.heex b/lib/nerves_hub_web/templates/device/show.html.heex index 8f208185b..b7ebd7836 100644 --- a/lib/nerves_hub_web/templates/device/show.html.heex +++ b/lib/nerves_hub_web/templates/device/show.html.heex @@ -14,10 +14,10 @@ <% end %>
- <%= link "All Devices", to: Routes.device_path(@socket, :index, @org.name, @product.name), class: "back-link"%> + <%= link("All Devices", to: Routes.device_path(@socket, :index, @org.name, @product.name), class: "back-link") %>
<%= if @device.deleted_at do %> - @@ -26,15 +26,15 @@ Destroy <% else %> - - - @@ -133,7 +133,12 @@

Latest Activity

- +
@@ -177,17 +182,17 @@ <.live_file_input upload={@uploads.certificate} class="upload-select" />
-
+
<%= if Enum.any?(@device.device_certificates, & &1.org_id != @device.org_id) do %>
Device was previously moved and has certificates associated with a Signer CA from another organization
-
+
In most cases, this should be okay (or was even intentional), but automatic device certificate creation
will not work until the Signer CA is also moved the the same organization as this device.
-
+
If the intention is leave the Signer CA in the other organization, then this will continue to work
so long as certificates are managed manually for this device and other metadata, such as the product
and firmware signing keys appropiately match the existing firmware as well
@@ -240,7 +245,11 @@ <%= link("Organization", class: "dropdown-item", aria_label: "Originating Organization", to: Routes.product_path(@socket, :index, Repo.preload(cert, :org).org.name)) %> <% end %> <%= if cert.der do %> - <%= link("Download", class: "dropdown-item", aria_label: "Download Device Certificate", to: Routes.device_path(@socket, :download_certificate, @org.name, @product.name, @device.identifier, cert.serial)) %> + <%= link("Download", + class: "dropdown-item", + aria_label: "Download Device Certificate", + to: Routes.device_path(@socket, :download_certificate, @org.name, @product.name, @device.identifier, cert.serial) + ) %> <% end %> Delete
diff --git a/lib/nerves_hub_web/templates/error/404.html.heex b/lib/nerves_hub_web/templates/error/404.html.heex index 256f10bfd..48672b421 100644 --- a/lib/nerves_hub_web/templates/error/404.html.heex +++ b/lib/nerves_hub_web/templates/error/404.html.heex @@ -1,61 +1,58 @@ - - - - - + + + + + Page not found · NervesHub - + - + - -
-
-
- No products -
- Sorry, the page you are looking for does not exist. + +
+
+
+ No products +
Sorry, the page you are looking for does not exist.
-
-
- - +
+
+ - diff --git a/lib/nerves_hub_web/templates/firmware/index.html.heex b/lib/nerves_hub_web/templates/firmware/index.html.heex index 52f266715..ed1df667a 100644 --- a/lib/nerves_hub_web/templates/firmware/index.html.heex +++ b/lib/nerves_hub_web/templates/firmware/index.html.heex @@ -76,7 +76,12 @@
diff --git a/lib/nerves_hub_web/templates/firmware/show.html.heex b/lib/nerves_hub_web/templates/firmware/show.html.heex index dd06878fe..08fd56304 100644 --- a/lib/nerves_hub_web/templates/firmware/show.html.heex +++ b/lib/nerves_hub_web/templates/firmware/show.html.heex @@ -1,5 +1,5 @@
- <%= link "All Firmware", to: Routes.firmware_path(@conn, :index, @org.name, @product.name), class: "back-link"%> + <%= link("All Firmware", to: Routes.firmware_path(@conn, :index, @org.name, @product.name), class: "back-link") %>
<%= link( class: "btn btn-outline-light btn-action", diff --git a/lib/nerves_hub_web/templates/firmware/upload.html.heex b/lib/nerves_hub_web/templates/firmware/upload.html.heex index 0c45259d9..9b90b09bc 100644 --- a/lib/nerves_hub_web/templates/firmware/upload.html.heex +++ b/lib/nerves_hub_web/templates/firmware/upload.html.heex @@ -4,10 +4,10 @@ <%= form_for @changeset, Routes.firmware_path(@conn, :do_upload, @org.name, @product.name), [multipart: true], fn f -> %>
- <%= file_input f, :file, required: true, id: "file_input", class: "custom-upload-input hidden" %> -
<%= error_tag f, :file %>
+ <%= file_input(f, :file, required: true, id: "file_input", class: "custom-upload-input hidden") %> +
<%= error_tag(f, :file) %>
- <%= submit "Upload Firmware", class: "btn btn-primary" %> + <%= submit("Upload Firmware", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/layout/_footer.html.heex b/lib/nerves_hub_web/templates/layout/_footer.html.heex index 40374fe6c..71543281b 100644 --- a/lib/nerves_hub_web/templates/layout/_footer.html.heex +++ b/lib/nerves_hub_web/templates/layout/_footer.html.heex @@ -17,5 +17,4 @@
Terms of Service
Privacy Policy
- diff --git a/lib/nerves_hub_web/templates/layout/_navigation.html.heex b/lib/nerves_hub_web/templates/layout/_navigation.html.heex index f18dccc29..e424197d0 100644 --- a/lib/nerves_hub_web/templates/layout/_navigation.html.heex +++ b/lib/nerves_hub_web/templates/layout/_navigation.html.heex @@ -9,7 +9,10 @@
- <%= submit "Create Organization", class: "btn btn-primary" %> + <%= submit("Create Organization", class: "btn btn-primary") %>
- <% end %> diff --git a/lib/nerves_hub_web/templates/org/invite.html.heex b/lib/nerves_hub_web/templates/org/invite.html.heex index e73f46581..f9ab62152 100644 --- a/lib/nerves_hub_web/templates/org/invite.html.heex +++ b/lib/nerves_hub_web/templates/org/invite.html.heex @@ -7,9 +7,9 @@ <%= form_for @changeset, Routes.org_path(@conn, :send_invite, @org.name), fn f -> %>
- <%= email_input f, :email, class: "form-control", id: "email_input", value: assigns[:email] %> -
<%= error_tag f, :email %>
-
<%= error_tag f, :org_users %>
+ <%= email_input(f, :email, class: "form-control", id: "email_input", value: assigns[:email]) %> +
<%= error_tag(f, :email) %>
+
<%= error_tag(f, :org_users) %>
@@ -29,8 +29,6 @@
Cancel - <%= submit "Send Invitation", class: "btn btn-primary" %> + <%= submit("Send Invitation", class: "btn btn-primary") %>
<% end %> - - diff --git a/lib/nerves_hub_web/templates/org/new.html.heex b/lib/nerves_hub_web/templates/org/new.html.heex index ef45148c4..e79b986de 100644 --- a/lib/nerves_hub_web/templates/org/new.html.heex +++ b/lib/nerves_hub_web/templates/org/new.html.heex @@ -1,3 +1,3 @@

Create New Organization

-<%= render "form.html", Map.put(assigns, :action, Routes.org_path(@conn, :create)) %> +<%= render("form.html", Map.put(assigns, :action, Routes.org_path(@conn, :create))) %> diff --git a/lib/nerves_hub_web/templates/org_certificate/edit.html.heex b/lib/nerves_hub_web/templates/org_certificate/edit.html.heex index becb8962a..f5b37588e 100644 --- a/lib/nerves_hub_web/templates/org_certificate/edit.html.heex +++ b/lib/nerves_hub_web/templates/org_certificate/edit.html.heex @@ -2,25 +2,25 @@ <%= form_for @changeset, Routes.org_certificate_path(@conn, :update, @org.name, @serial), fn f -> %>
- <%= label f, :description, for: "description_input" %> - <%= text_input f, :description , class: "form-control", id: "description_input" %> -
<%= error_tag f, :description %>
+ <%= label(f, :description, for: "description_input") %> + <%= text_input(f, :description, class: "form-control", id: "description_input") %> +
<%= error_tag(f, :description) %>
- <%= label f, :check_expiration, for: "check_expiration_input" %> + <%= label(f, :check_expiration, for: "check_expiration_input") %> <%= check_expiration_help_text() %>
- <%= checkbox f, :check_expiration , class: "", id: "check_expiration_input" %> -
<%= error_tag f, :check_expiration %>
+ <%= checkbox(f, :check_expiration, class: "", id: "check_expiration_input") %> +
<%= error_tag(f, :check_expiration) %>
<%= inputs_for f, :jitp, fn fp -> %> - - <%= hidden_input fp, :delete, id: "jitp-delete" %> + + <%= hidden_input(fp, :delete, id: "jitp-delete") %>
- <%= text_input fp, :description, class: "form-control", id: "description_input" %> -
<%= error_tag fp, :description %>
+ <%= text_input(fp, :description, class: "form-control", id: "description_input") %> +
<%= error_tag(fp, :description) %>
<% end %>
- <%= link "Back", to: Routes.org_certificate_path(@conn, :index, @org.name), class: "btn btn-outline-light" %> - <%= submit "Update Certificate", class: "btn btn-primary" %> + <%= link("Back", to: Routes.org_certificate_path(@conn, :index, @org.name), class: "btn btn-outline-light") %> + <%= submit("Update Certificate", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/org_certificate/index.html.heex b/lib/nerves_hub_web/templates/org_certificate/index.html.heex index 7606e378b..d693f6e2c 100644 --- a/lib/nerves_hub_web/templates/org_certificate/index.html.heex +++ b/lib/nerves_hub_web/templates/org_certificate/index.html.heex @@ -15,7 +15,7 @@ Not before Not after Check expiration? - JITP Enabled? + JITP Enabled? @@ -63,8 +63,13 @@ options
diff --git a/lib/nerves_hub_web/templates/org_certificate/new.html.heex b/lib/nerves_hub_web/templates/org_certificate/new.html.heex index e44b1e677..b0587b515 100644 --- a/lib/nerves_hub_web/templates/org_certificate/new.html.heex +++ b/lib/nerves_hub_web/templates/org_certificate/new.html.heex @@ -1,25 +1,25 @@

New Certificate Authority

<%= form_for @changeset, Routes.org_certificate_path(@conn, :create, @org.name), [multipart: true], fn f -> %> -

Step 1

-

Generate a key pair for the private key verification certificate

+

Step 1

+

Generate a key pair for the private key verification certificate


   openssl genrsa -out verificationCert.key 2048
   
-

Step 2

-

Copy this registration code to your clipboard

+

Step 2

+

Copy this registration code to your clipboard


   <%= @registration_code %>
   
-

Step 3

-

Create a CSR with this registration code

+

Step 3

+

Create a CSR with this registration code


   openssl req -new -key verificationCert.key -out verificationCert.csr
   
-

Put the registration code in the Common Name field

+

Put the registration code in the Common Name field


   Country Name (2 letter code) [AU]:
   State or Province Name (full name) [Some-State]:
@@ -30,32 +30,31 @@
   Email Address []:
   
-

Step 4

-

Use the CSR that was signed with the CA private key to create a private key verification certificate

+

Step 4

+

Use the CSR that was signed with the CA private key to create a private key verification certificate


   openssl x509 -req -in verificationCert.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out verificationCert.crt -days 500 -sha256
   
- <%= label f, :description, for: "description_input" %> - <%= text_input f, :description , class: "form-control", id: "description_input" %> -
<%= error_tag f, :description %>
+ <%= label(f, :description, for: "description_input") %> + <%= text_input(f, :description, class: "form-control", id: "description_input") %> +
<%= error_tag(f, :description) %>
- <%= label f, :check_expiration, for: "check_expiration_input" %> + <%= label(f, :check_expiration, for: "check_expiration_input") %> <%= check_expiration_help_text() %>
- <%= checkbox f, :check_expiration , class: "", id: "check_expiration_input" %> -
<%= error_tag f, :check_expiration %>
+ <%= checkbox(f, :check_expiration, class: "", id: "check_expiration_input") %> +
<%= error_tag(f, :check_expiration) %>
- <%= inputs_for f, :jitp, fn fp -> %> - <%= checkbox fp, :jitp_toggle, id: "jitp_toggle" %> + <%= checkbox(fp, :jitp_toggle, id: "jitp_toggle") %> <% end %>
- <%= label f, :cert, "Upload a Certificate Authority file (rootCA.pem)", class: "custom-upload-label not-selected", for: "cert_input" %> - <%= file_input f, :cert, required: true, class: "custom-upload-input hidden", id: "cert_input", accept: ".pem" %> -
<%= error_tag f, :cert %>
+ <%= label(f, :cert, "Upload a Certificate Authority file (rootCA.pem)", class: "custom-upload-label not-selected", for: "cert_input") %> + <%= file_input(f, :cert, required: true, class: "custom-upload-input hidden", id: "cert_input", accept: ".pem") %> +
<%= error_tag(f, :cert) %>
- <%= label f, :csr, "Upload a Certificate Authority file (verificationCert.crt)", class: "custom-upload-label not-selected", for: "csr_input" %> - <%= file_input f, :csr, required: true, class: "custom-upload-input hidden", id: "csr_input", accept: ".crt" %> -
<%= error_tag f, :csr %>
+ <%= label(f, :csr, "Upload a Certificate Authority file (verificationCert.crt)", class: "custom-upload-label not-selected", for: "csr_input") %> + <%= file_input(f, :csr, required: true, class: "custom-upload-input hidden", id: "csr_input", accept: ".crt") %> +
<%= error_tag(f, :csr) %>
- <%= link "Back", to: Routes.org_certificate_path(@conn, :index, @org.name), class: "btn btn-outline-light" %> - <%= submit "Create Certificate", class: "btn btn-primary" %> + <%= link("Back", to: Routes.org_certificate_path(@conn, :index, @org.name), class: "btn btn-outline-light") %> + <%= submit("Create Certificate", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/org_key/edit.html.heex b/lib/nerves_hub_web/templates/org_key/edit.html.heex index 25debf74e..a553099b0 100644 --- a/lib/nerves_hub_web/templates/org_key/edit.html.heex +++ b/lib/nerves_hub_web/templates/org_key/edit.html.heex @@ -1,3 +1,3 @@

Edit Firmware Key

-<%= render "form.html", Map.put(assigns, :action, Routes.org_key_path(@conn, :update, @org.name, @org_key)) %> +<%= render("form.html", Map.put(assigns, :action, Routes.org_key_path(@conn, :update, @org.name, @org_key))) %> diff --git a/lib/nerves_hub_web/templates/org_key/form.html.heex b/lib/nerves_hub_web/templates/org_key/form.html.heex index 5a06aa7e2..a12a17e1a 100644 --- a/lib/nerves_hub_web/templates/org_key/form.html.heex +++ b/lib/nerves_hub_web/templates/org_key/form.html.heex @@ -1,30 +1,34 @@ <%= form_for @changeset, @action, fn f -> %> <%= if @changeset.action do %>
-

<%= top_level_error_message(@changeset) %>

+

<%= top_level_error_message(@changeset) %>

<% end %>
- <%= label f, :name, for: "name_input" %> - <%= text_input f, :name , class: "form-control", id: "name_input" %> -
<%= error_tag f, :name %>
+ <%= label(f, :name, for: "name_input") %> + <%= text_input(f, :name, class: "form-control", id: "name_input") %> +
<%= error_tag(f, :name) %>
- <%= label f, :key, for: "key_input" %> - <%= text_input f, :key , class: "form-control", id: "key_input" %> -
<%= error_tag f, :key %>
+ <%= label(f, :key, for: "key_input") %> + <%= text_input(f, :key, class: "form-control", id: "key_input") %> +
<%= error_tag(f, :key) %>
- <%= link "Back", to: Routes.org_key_path(@conn, :index, @org.name), class: "btn btn-outline-light" %> + <%= link("Back", to: Routes.org_key_path(@conn, :index, @org.name), class: "btn btn-outline-light") %> <%= if assigns[:org_key] do %> - <%= link "Remove", to: Routes.org_key_path(@conn, :delete, @org.name, @org_key), method: :delete, data: [confirm: "Are you sure you want to delete this firmware key? This can not be undone."], class: "btn btn-secondary" %> - <%= submit "Save Changes", class: "btn btn-primary" %> + <%= link("Remove", + to: Routes.org_key_path(@conn, :delete, @org.name, @org_key), + method: :delete, + data: [confirm: "Are you sure you want to delete this firmware key? This can not be undone."], + class: "btn btn-secondary" + ) %> + <%= submit("Save Changes", class: "btn btn-primary") %> <% else %> - <%= submit "Create Key", class: "btn btn-primary" %> + <%= submit("Create Key", class: "btn btn-primary") %> <% end %> -
<% end %> diff --git a/lib/nerves_hub_web/templates/org_key/new.html.heex b/lib/nerves_hub_web/templates/org_key/new.html.heex index c76b189ba..13fdfac36 100644 --- a/lib/nerves_hub_web/templates/org_key/new.html.heex +++ b/lib/nerves_hub_web/templates/org_key/new.html.heex @@ -1,3 +1,3 @@

New Firmware Key

-<%= render "form.html", Map.put(assigns, :action, Routes.org_key_path(@conn, :create, @org.name)) %> +<%= render("form.html", Map.put(assigns, :action, Routes.org_key_path(@conn, :create, @org.name))) %> diff --git a/lib/nerves_hub_web/templates/org_key/show.html.heex b/lib/nerves_hub_web/templates/org_key/show.html.heex index 5f7164dcb..1df4fb674 100644 --- a/lib/nerves_hub_web/templates/org_key/show.html.heex +++ b/lib/nerves_hub_web/templates/org_key/show.html.heex @@ -1,8 +1,6 @@

Show organization keys

- - -<%= link "Edit", to: Routes.org_key_path(@conn, :edit, @org.name, @org_key) %> -<%= link "Back", to: Routes.org_key_path(@conn, :index, @org.name) %> +<%= link("Edit", to: Routes.org_key_path(@conn, :edit, @org.name, @org_key)) %> +<%= link("Back", to: Routes.org_key_path(@conn, :index, @org.name)) %> diff --git a/lib/nerves_hub_web/templates/org_user/edit.html.heex b/lib/nerves_hub_web/templates/org_user/edit.html.heex index 278ef0042..e5ecdc93e 100644 --- a/lib/nerves_hub_web/templates/org_user/edit.html.heex +++ b/lib/nerves_hub_web/templates/org_user/edit.html.heex @@ -8,14 +8,14 @@ Role
- <%= select f, :role, role_options(), class: "form-control", id: "role_input" %> + <%= select(f, :role, role_options(), class: "form-control", id: "role_input") %>
-
<%= error_tag f, :role %>
+
<%= error_tag(f, :role) %>
Cancel - <%= submit "Update", class: "btn btn-primary" %> + <%= submit("Update", class: "btn btn-primary") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/org_user/index.html.heex b/lib/nerves_hub_web/templates/org_user/index.html.heex index ae78e7fbf..b90d29145 100644 --- a/lib/nerves_hub_web/templates/org_user/index.html.heex +++ b/lib/nerves_hub_web/templates/org_user/index.html.heex @@ -66,9 +66,14 @@ options diff --git a/lib/nerves_hub_web/templates/password_reset/new.html.heex b/lib/nerves_hub_web/templates/password_reset/new.html.heex index bfed8a8b8..58f01402b 100644 --- a/lib/nerves_hub_web/templates/password_reset/new.html.heex +++ b/lib/nerves_hub_web/templates/password_reset/new.html.heex @@ -3,10 +3,10 @@ <%= form_for @changeset, Routes.password_reset_path(@conn, :create), [class: "form-page"], fn f -> %>
- <%= email_input f, :email, class: "form-control", id: "email" %> -
<%= error_tag f, :email %>
+ <%= email_input(f, :email, class: "form-control", id: "email") %> +
<%= error_tag(f, :email) %>
- <%= submit "Submit", class: "btn btn-primary btn-lg" %> + <%= submit("Submit", class: "btn btn-primary btn-lg") %> <% end %> diff --git a/lib/nerves_hub_web/templates/password_reset/new_password_form.html.heex b/lib/nerves_hub_web/templates/password_reset/new_password_form.html.heex index c24f00d8b..26b35628e 100644 --- a/lib/nerves_hub_web/templates/password_reset/new_password_form.html.heex +++ b/lib/nerves_hub_web/templates/password_reset/new_password_form.html.heex @@ -3,16 +3,16 @@ <%= form_for @changeset, Routes.password_reset_path(@conn, :reset, @token), [class: "form-page"], fn f -> %>
- <%= password_input f, :password, class: "form-control", id: "password" %> -
<%= error_tag f, :password %>
+ <%= password_input(f, :password, class: "form-control", id: "password") %> +
<%= error_tag(f, :password) %>
- <%= password_input f, :password_confirmation, class: "form-control", id: "password-confirmation" %> -
<%= error_tag f, :password_confirmation %>
+ <%= password_input(f, :password_confirmation, class: "form-control", id: "password-confirmation") %> +
<%= error_tag(f, :password_confirmation) %>
- <%= submit "Submit", class: "btn btn-primary btn-lg" %> + <%= submit("Submit", class: "btn btn-primary btn-lg") %> <% end %> diff --git a/lib/nerves_hub_web/templates/product/edit.html.heex b/lib/nerves_hub_web/templates/product/edit.html.heex index ed3ffcd26..b47333d5a 100644 --- a/lib/nerves_hub_web/templates/product/edit.html.heex +++ b/lib/nerves_hub_web/templates/product/edit.html.heex @@ -1,3 +1,3 @@

Product Settings

-<%= render "form.html", Map.put(assigns, :action, Routes.product_path(@conn, :update, @org.name, @product.name)) %> +<%= render("form.html", Map.put(assigns, :action, Routes.product_path(@conn, :update, @org.name, @product.name))) %> diff --git a/lib/nerves_hub_web/templates/product/form.html.heex b/lib/nerves_hub_web/templates/product/form.html.heex index 317704702..45d3e1cc4 100644 --- a/lib/nerves_hub_web/templates/product/form.html.heex +++ b/lib/nerves_hub_web/templates/product/form.html.heex @@ -12,38 +12,41 @@ Once created, a product name cannot be changed <%= if assigns[:product] do %> - <%= text_input f, :name, class: "form-control", disabled: "true", id: "name_input" %> + <%= text_input(f, :name, class: "form-control", disabled: "true", id: "name_input") %> <% else %> - <%= text_input f, :name, class: "form-control", id: "name_input" %> + <%= text_input(f, :name, class: "form-control", id: "name_input") %> <% end %> -
<%= error_tag f, :name %>
+
<%= error_tag(f, :name) %>
-
<%= if assigns[:product] do %> - <%= link "Remove Product", class: "btn btn-secondary", to: Routes.product_path(@conn, :delete, @org.name, @product.name), method: :delete, data: [confirm: "Are you sure you want to delete this product? This can not be undone."] %> - <%= submit "Save Changes", class: "btn btn-primary" %> + <%= link("Remove Product", + class: "btn btn-secondary", + to: Routes.product_path(@conn, :delete, @org.name, @product.name), + method: :delete, + data: [confirm: "Are you sure you want to delete this product? This can not be undone."] + ) %> + <%= submit("Save Changes", class: "btn btn-primary") %> <% else %> - <%= submit "Create Product", class: "btn btn-primary" %> + <%= submit("Create Product", class: "btn btn-primary") %> <% end %>
<% end %> diff --git a/lib/nerves_hub_web/templates/product/new.html.heex b/lib/nerves_hub_web/templates/product/new.html.heex index 8ba4bb0f7..24f996716 100644 --- a/lib/nerves_hub_web/templates/product/new.html.heex +++ b/lib/nerves_hub_web/templates/product/new.html.heex @@ -1,3 +1,3 @@

Create Product

-<%= render "form.html", Map.put(assigns, :action, Routes.product_path(@conn, :create, @org.name)) %> +<%= render("form.html", Map.put(assigns, :action, Routes.product_path(@conn, :create, @org.name))) %> diff --git a/lib/nerves_hub_web/templates/session/new.html.heex b/lib/nerves_hub_web/templates/session/new.html.heex index d6f629384..a3848e003 100644 --- a/lib/nerves_hub_web/templates/session/new.html.heex +++ b/lib/nerves_hub_web/templates/session/new.html.heex @@ -3,8 +3,8 @@ <%= form_for @conn, Routes.session_path(@conn, :create), [as: :login, class: "form-page"], fn f -> %>
- <%= text_input f, :email_or_username, class: "form-control", id: "email_or_username" %> - <%= error_tag f, :email_or_username %> + <%= text_input(f, :email_or_username, class: "form-control", id: "email_or_username") %> + <%= error_tag(f, :email_or_username) %>
@@ -14,11 +14,11 @@ Forgot Password
- <%= password_input f, :password, class: "form-control", id: "password_input" %> -
<%= error_tag f, :password %>
+ <%= password_input(f, :password, class: "form-control", id: "password_input") %> +
<%= error_tag(f, :password) %>
- <%= submit "Login", class: "btn btn-primary btn-lg w-100" %> + <%= submit("Login", class: "btn btn-primary btn-lg w-100") %>
<% end %> diff --git a/lib/nerves_hub_web/templates/token/new.html.heex b/lib/nerves_hub_web/templates/token/new.html.heex index 505e505f3..815801db6 100644 --- a/lib/nerves_hub_web/templates/token/new.html.heex +++ b/lib/nerves_hub_web/templates/token/new.html.heex @@ -1,9 +1,9 @@ <%= form_for @changeset, Routes.token_path(@conn, :create, @user.username), [class: "form-group"], fn f -> %> - <%= text_input f, :note, class: "form-control" %> -
<%= error_tag f, :note %>
+ <%= text_input(f, :note, class: "form-control") %> +
<%= error_tag(f, :note) %>
<%= link("Cancel", to: Routes.token_path(@conn, :index, @user.username), class: "btn btn-secondary") %> - <%= submit "Generate", class: "btn btn-primary" %> + <%= submit("Generate", class: "btn btn-primary") %>
<% end %>