initial commit

This commit is contained in:
2021-03-11 21:12:55 -05:00
committed by csculley
commit c954fdc600
89 changed files with 20205 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<main role="main" class="container min-h-full min-w-full">
<header class="mb-4 px-8 py-4 w-full bg-primary-400">
<%= render "topbar.html", assigns %>
<%= if get_flash(@conn, :info) do %>
<p class="alert alert-info" role="alert">
<%= get_flash(@conn, :info) %>
</p>
<% end %>
<%= if get_flash(@conn, :error) do %>
<p class="alert alert-danger" role="alert">
<%= get_flash(@conn, :error) %>
</p>
<% end %>
</header>
<%= @inner_content %>
</main>

View File

@ -0,0 +1,5 @@
<main role="main" class="container min-w-full min-h-full">
<%= live_component CanneryWeb.Live.Component.Topbar %>
<%= @inner_content %>
</main>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<%= csrf_meta_tag() %>
<%= live_title_tag assigns[:page_title] || "Cannery", suffix: "" %>
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</head>
<body class="m-0 p-0 min-w-full min-h-full">
<%= @inner_content %>
</body>
</html>

View File

@ -0,0 +1,40 @@
<nav role="navigation">
<div class="flex flex-row justify-between items-center space-x-4">
<%= link to: Routes.page_path(CanneryWeb.Endpoint, :index) do %>
<h1 class="leading-5 text-xl text-white hover:underline">Cannery</h1>
<% end %>
<ul class="flex flex-row flex-wrap justify-center items-center
space-x-4 text-lg text-white">
<%# user settings %>
<%= if assigns |> Map.has_key?(:current_user) && @current_user do %>
<li>
<%= @current_user.email %></li>
<li>
<%= link "Settings", class: "hover:underline",
to: Routes.user_settings_path(CanneryWeb.Endpoint, :edit) %>
</li>
<li>
<%= link "Log out", class: "hover:underline",
to: Routes.user_session_path(CanneryWeb.Endpoint, :delete), method: :delete %>
</li>
<%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
<li>
<%= link "LiveDashboard", class: "hover:underline",
to: Routes.live_dashboard_path(CanneryWeb.Endpoint, :home) %>
</li>
<% end %>
<% else %>
<li>
<%= link "Register", class: "hover:underline",
to: Routes.user_registration_path(CanneryWeb.Endpoint, :new) %>
</li>
<li>
<%= link "Log in", class: "hover:underline",
to: Routes.user_session_path(CanneryWeb.Endpoint, :new) %>
</li>
<% end %>
</ul>
</div>
</nav>

View File

@ -0,0 +1,24 @@
<div class="flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-500 text-xl">
Resend confirmation instructions
</h1>
<%= form_for :user, Routes.user_confirmation_path(@conn, :create),
[class: "flex flex-col justify-center items-center space-y-4"], fn f -> %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :email, class: "title text-lg text-primary-500" %>
<%= email_input f, :email, required: true, class: "input input-primary col-span-2" %>
</div>
<%= submit "Resend confirmation instructions", class: "btn btn-primary" %>
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= link "Register", to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary" %>
<%= link "Log in", to: Routes.user_session_path(@conn, :new),
class: "btn btn-primary" %>
</div>
<% end %>
</div>

View File

@ -0,0 +1,37 @@
<div class="flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-500 text-xl">
Register
</h1>
<%= form_for @changeset, Routes.user_registration_path(@conn, :create),
[class: "flex flex-col justify-center items-center space-y-4"], fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :email, class: "title text-lg text-primary-500" %>
<%= email_input f, :email, required: true, class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :email %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :password, class: "title text-lg text-primary-500" %>
<%= password_input f, :password, required: true, class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :password %>
<%= submit "Register", class: "btn btn-primary" %>
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= link "Log in", to: Routes.user_session_path(@conn, :new),
class: "btn btn-primary" %>
<%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new),
class: "btn btn-primary" %>
</div>
<% end %>
</div>

View File

@ -0,0 +1,37 @@
<div class="flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-500 text-xl">
Reset password
</h1>
<%= form_for @changeset, Routes.user_reset_password_path(@conn, :update, @token),
[class: "flex flex-col justify-center items-center space-y-4"], fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :password, "New password", class: "title text-lg text-primary-500" %>
<%= password_input f, :password, required: true, class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :password %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500" %>
<%= password_input f, :password_confirmation, required: true, class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :password_confirmation %>
<%= submit "Reset password", class: "btn btn-primary" %>
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= link "Register", to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary" %>
<%= link "Log in", to: Routes.user_session_path(@conn, :new),
class: "btn btn-primary" %>
</div>
<% end %>
</div>

View File

@ -0,0 +1,25 @@
<div class="flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-500 text-xl">
Forgot your password?
</h1>
<%= form_for :user, Routes.user_reset_password_path(@conn, :create),
[class: "flex flex-col justify-center items-center space-y-4"], fn f -> %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :email, class: "title text-lg text-primary-500" %>
<%= email_input f, :email, required: true, class: "input input-primary col-span-2" %>
</div>
<%= submit "Send instructions to reset password", class: "btn btn-primary" %>
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= link "Register", to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary" %>
<%= link "Log in", to: Routes.user_session_path(@conn, :new),
class: "btn btn-primary" %>
</div>
<% end %>
</div>

View File

@ -0,0 +1,41 @@
<div class="flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-500 text-xl">
Log in
</h1>
<%= form_for @conn, Routes.user_session_path(@conn, :create), [as: :user,
class: "flex flex-col justify-center items-center space-y-4"], fn f -> %>
<%= if @error_message do %>
<div class="alert alert-danger">
<p><%= @error_message %></p>
</div>
<% end %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :email, class: "title text-lg text-primary-500" %>
<%= email_input f, :email, required: true, class: "input input-primary col-span-2" %>
</div>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :password, class: "title text-lg text-primary-500" %>
<%= password_input f, :password, required: true, class: "input input-primary col-span-2" %>
</div>
<div class="flex flex-row justify-center items-center text-center space-x-4">
<%= label f, :remember_me, "Keep me logged in for 60 days",
class: "title text-lg text-primary-500" %>
<%= checkbox f, :remember_me, class: "checkbox" %>
</div>
<%= submit "Log in", class: "btn btn-primary" %>
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= link "Register", to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary" %>
<%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new),
class: "btn btn-primary" %>
</div>
<% end %>
</div>

View File

@ -0,0 +1,85 @@
<div class="flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-500 text-xl">
Settings
</h1>
<h3 class="title text-primary-500 text-lg">
Change email
</h3>
<%= form_for @email_changeset, Routes.user_settings_path(@conn, :update),
[class: "flex flex-col justify-center items-center space-y-4"], fn f -> %>
<%= if @email_changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<%= hidden_input f, :action, name: "action", value: "update_email" %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :email, class: "title text-lg text-primary-500" %>
<%= email_input f, :email, required: true, class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :email %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :current_password, for: "current_password_for_email", class: "title text-lg text-primary-500" %>
<%= password_input f, :current_password,
required: true,
name: "current_password",
id: "current_password_for_email",
class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :current_password %>
<%= submit "Change email", class: "btn btn-primary" %>
<% end %>
<h3 class="title text-primary-500 text-lg">
Change password
</h3>
<%= form_for @password_changeset, Routes.user_settings_path(@conn, :update),
[class: "flex flex-col justify-center items-center space-y-4"], fn f -> %>
<%= if @password_changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<%= hidden_input f, :action, name: "action", value: "update_password" %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :password, "New password",
class: "title text-lg text-primary-500" %>
<%= password_input f, :password,
required: true,
class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :password %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :password_confirmation, "Confirm new password",
class: "title text-lg text-primary-500" %>
<%= password_input f, :password_confirmation,
required: true,
class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :password_confirmation %>
<div class="grid grid-cols-3 justify-center items-center text-center space-x-4">
<%= label f, :current_password,
for: "current_password_for_password",
class: "title text-lg text-primary-500" %>
<%= password_input f, :current_password,
required: true,
name: "current_password",
id: "current_password_for_password",
class: "input input-primary col-span-2" %>
</div>
<%= error_tag f, :current_password %>
<%= submit "Change password", class: "btn btn-primary" %>
<% end %>
</div>