formatting
This commit is contained in:
parent
6aa9a4bd48
commit
fa3645719d
8 changed files with 16 additions and 21 deletions
|
@ -19,8 +19,8 @@ import "../node_modules/bootstrap-icons/icons/key-fill.svg"; // pw confirm field
|
||||||
import "../node_modules/bootstrap-icons/icons/lock.svg"; // current pw field
|
import "../node_modules/bootstrap-icons/icons/lock.svg"; // current pw field
|
||||||
import "../node_modules/bootstrap-icons/icons/shield.svg"; // role
|
import "../node_modules/bootstrap-icons/icons/shield.svg"; // role
|
||||||
// live tables
|
// live tables
|
||||||
import "../node_modules/bootstrap-icons/icons/funnel.svg";
|
import "../node_modules/bootstrap-icons/icons/funnel.svg"; // filter
|
||||||
import "../node_modules/bootstrap-icons/icons/backspace.svg"; // clear filter
|
import "../node_modules/bootstrap-icons/icons/x-circle-fill.svg"; // clear filter
|
||||||
import "../node_modules/bootstrap-icons/icons/sort-down-alt.svg";
|
import "../node_modules/bootstrap-icons/icons/sort-down-alt.svg";
|
||||||
import "../node_modules/bootstrap-icons/icons/sort-up-alt.svg";
|
import "../node_modules/bootstrap-icons/icons/sort-up-alt.svg";
|
||||||
import "../node_modules/bootstrap-icons/icons/chevron-left.svg";
|
import "../node_modules/bootstrap-icons/icons/chevron-left.svg";
|
||||||
|
@ -29,7 +29,6 @@ import "../node_modules/bootstrap-icons/icons/pencil.svg";
|
||||||
import "../node_modules/bootstrap-icons/icons/trash.svg";
|
import "../node_modules/bootstrap-icons/icons/trash.svg";
|
||||||
import "../node_modules/bootstrap-icons/icons/check.svg";
|
import "../node_modules/bootstrap-icons/icons/check.svg";
|
||||||
import "../node_modules/bootstrap-icons/icons/x.svg";
|
import "../node_modules/bootstrap-icons/icons/x.svg";
|
||||||
import "../node_modules/bootstrap-icons/icons/x-circle-fill.svg";
|
|
||||||
// page headers
|
// page headers
|
||||||
import "../node_modules/bootstrap-icons/icons/shield-lock.svg"; // reset password
|
import "../node_modules/bootstrap-icons/icons/shield-lock.svg"; // reset password
|
||||||
import "../node_modules/bootstrap-icons/icons/arrow-repeat.svg"; // resend confirmation
|
import "../node_modules/bootstrap-icons/icons/arrow-repeat.svg"; // resend confirmation
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "reg_form"], fn f -> %>
|
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "reg_form"], fn f -> %>
|
||||||
|
|
||||||
|
|
||||||
<%= label f, :email, class: "form-label" %>
|
<%= label f, :email, class: "form-label" %>
|
||||||
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :email) %>">
|
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :email) %>">
|
||||||
<%= icon_div @socket, "bi-at", [class: "icon is-left text-muted fs-5"] %>
|
<%= icon_div @socket, "bi-at", [class: "icon is-left text-muted fs-5"] %>
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
<%= error_tag f, :password_confirmation %>
|
<%= error_tag f, :password_confirmation %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<%= submit "Reset password",
|
<%= submit "Reset password",
|
||||||
class: "btn btn-primary",
|
class: "btn btn-primary",
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %>
|
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %>
|
||||||
|
|
||||||
|
|
||||||
<%= label f, :email, class: "form-label" %>
|
<%= label f, :email, class: "form-label" %>
|
||||||
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :email) %>">
|
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :email) %>">
|
||||||
<%= icon_div @socket, "bi-at", [class: "icon is-left text-muted fs-5"] %>
|
<%= icon_div @socket, "bi-at", [class: "icon is-left text-muted fs-5"] %>
|
||||||
|
@ -19,7 +18,6 @@
|
||||||
<%= error_tag f, :email %>
|
<%= error_tag f, :email %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<%= label f, :current_password, class: "form-label" %>
|
<%= label f, :current_password, class: "form-label" %>
|
||||||
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :current_password) %>">
|
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :current_password) %>">
|
||||||
<%= icon_div @socket, "bi-lock", [class: "icon is-left text-muted fs-5"] %>
|
<%= icon_div @socket, "bi-lock", [class: "icon is-left text-muted fs-5"] %>
|
||||||
|
@ -31,7 +29,6 @@
|
||||||
<%= error_tag f, :current_password %>
|
<%= error_tag f, :current_password %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<%= submit "Change email",
|
<%= submit "Change email",
|
||||||
class: "btn btn-primary",
|
class: "btn btn-primary",
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %>
|
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %>
|
||||||
|
|
||||||
|
|
||||||
<%= label f, :password, "New password", class: "form-label" %>
|
<%= label f, :password, "New password", class: "form-label" %>
|
||||||
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :password) %>">
|
<div class="inner-addon left-addon mb-3" phx-feedback-for="<%= input_id(f, :password) %>">
|
||||||
<%= icon_div @socket, "bi-key", [class: "icon is-left text-muted fs-5"] %>
|
<%= icon_div @socket, "bi-key", [class: "icon is-left text-muted fs-5"] %>
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
<%= hidden_input f, :role, value: input_value(f, :role) %>
|
<%= hidden_input f, :role, value: input_value(f, :role) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<%= label f, :email, class: "form-label" %>
|
<%= label f, :email, class: "form-label" %>
|
||||||
<div class="inner-addon left-addon mb-3">
|
<div class="inner-addon left-addon mb-3">
|
||||||
<%= icon_div @conn, "bi-at", [class: "icon is-left text-muted fs-5"] %>
|
<%= icon_div @conn, "bi-at", [class: "icon is-left text-muted fs-5"] %>
|
||||||
|
@ -38,7 +37,6 @@
|
||||||
<span class="invalid-feedback">password is required</span>
|
<span class="invalid-feedback">password is required</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-check mb-3 no-valid-style">
|
<div class="form-check mb-3 no-valid-style">
|
||||||
<%= checkbox f, :remember_me, class: "form-check-input" %>
|
<%= checkbox f, :remember_me, class: "form-check-input" %>
|
||||||
<%= label f, :remember_me, "Keep me logged in for 60 days", class: "form-check-label" %>
|
<%= label f, :remember_me, "Keep me logged in for 60 days", class: "form-check-label" %>
|
||||||
|
|
|
@ -52,14 +52,17 @@ count_to_take = 123
|
||||||
|
|
||||||
mock_users = users_json |> File.read!() |> Jason.decode!() |> Enum.take_random(count_to_take)
|
mock_users = users_json |> File.read!() |> Jason.decode!() |> Enum.take_random(count_to_take)
|
||||||
|
|
||||||
mock_users = ~s([
|
extra_mock_users = ~s([
|
||||||
{"email":"adam@73k.us","password":"adamadamA1","role":"admin","inserted_at":"2018-12-14T01:01:01Z","confirmed_at":true},
|
{"email":"adam@73k.us","password":"adamadamA1","role":"admin","inserted_at":"2018-12-14T01:01:01Z","confirmed_at":true},
|
||||||
{"email":"karen@73k.us","password":"karenkarenA1","role":"manager","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":true},
|
{"email":"karen@73k.us","password":"karenkarenA1","role":"manager","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":true},
|
||||||
{"email":"kat@73k.us","password":"katkatA1","role":"manager","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":true}
|
{"email":"kat@73k.us","password":"katkatA1","role":"manager","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":true}
|
||||||
]) |> Jason.decode!() |> Enum.concat(mock_users)
|
])
|
||||||
|
|
||||||
mock_users =
|
mock_users =
|
||||||
Enum.map(mock_users, fn e ->
|
extra_mock_users
|
||||||
|
|> Jason.decode!()
|
||||||
|
|> Enum.concat(mock_users)
|
||||||
|
|> Enum.map(fn e ->
|
||||||
add_dt = NaiveDateTime.from_iso8601!(e["inserted_at"])
|
add_dt = NaiveDateTime.from_iso8601!(e["inserted_at"])
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
@ -112,12 +115,14 @@ props_json = Path.join(this_path, "MOCK_DATA_properties.json")
|
||||||
|
|
||||||
count_to_take = 123
|
count_to_take = 123
|
||||||
|
|
||||||
mock_props = props_json |> File.read!() |> Jason.decode!() |> Enum.take_random(count_to_take)
|
|
||||||
|
|
||||||
random_user_query = from User, order_by: fragment("RANDOM()"), limit: 1
|
random_user_query = from User, order_by: fragment("RANDOM()"), limit: 1
|
||||||
|
|
||||||
mock_props =
|
mock_props =
|
||||||
Enum.map(mock_props, fn e ->
|
props_json
|
||||||
|
|> File.read!()
|
||||||
|
|> Jason.decode!()
|
||||||
|
|> Enum.take_random(count_to_take)
|
||||||
|
|> Enum.map(fn e ->
|
||||||
add_dt = NaiveDateTime.from_iso8601!(e["inserted_at"])
|
add_dt = NaiveDateTime.from_iso8601!(e["inserted_at"])
|
||||||
rand_user = Repo.one(random_user_query)
|
rand_user = Repo.one(random_user_query)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue