summaryrefslogtreecommitdiff
path: root/lib/aggiedit_web/templates/layout
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-04-06 12:13:54 -0600
committerLogan Hunt <loganhunt@simponic.xyz>2022-04-06 12:13:54 -0600
commit2055742911201258e6f755b3eb4031a1b09407f1 (patch)
treea8e0471cab55329e2e00b5d3e2011d37bb67fdb6 /lib/aggiedit_web/templates/layout
downloadaggiedit-2055742911201258e6f755b3eb4031a1b09407f1.tar.gz
aggiedit-2055742911201258e6f755b3eb4031a1b09407f1.zip
Initial commit; generate auth code with phx.gen.auth; added room model and association; generate room model on domain of user emails; allow users to change their email
Diffstat (limited to 'lib/aggiedit_web/templates/layout')
-rw-r--r--lib/aggiedit_web/templates/layout/_user_menu.html.heex10
-rw-r--r--lib/aggiedit_web/templates/layout/app.html.heex5
-rw-r--r--lib/aggiedit_web/templates/layout/live.html.heex11
-rw-r--r--lib/aggiedit_web/templates/layout/root.html.heex31
4 files changed, 57 insertions, 0 deletions
diff --git a/lib/aggiedit_web/templates/layout/_user_menu.html.heex b/lib/aggiedit_web/templates/layout/_user_menu.html.heex
new file mode 100644
index 0000000..f281cfc
--- /dev/null
+++ b/lib/aggiedit_web/templates/layout/_user_menu.html.heex
@@ -0,0 +1,10 @@
+<ul>
+<%= if @current_user do %>
+ <li><%= @current_user.email %></li>
+ <li><%= link "Settings", to: Routes.user_settings_path(@conn, :edit) %></li>
+ <li><%= link "Log out", to: Routes.user_session_path(@conn, :delete), method: :delete %></li>
+<% else %>
+ <li><%= link "Register", to: Routes.user_registration_path(@conn, :new) %></li>
+ <li><%= link "Log in", to: Routes.user_session_path(@conn, :new) %></li>
+<% end %>
+</ul>
diff --git a/lib/aggiedit_web/templates/layout/app.html.heex b/lib/aggiedit_web/templates/layout/app.html.heex
new file mode 100644
index 0000000..169aed9
--- /dev/null
+++ b/lib/aggiedit_web/templates/layout/app.html.heex
@@ -0,0 +1,5 @@
+<main class="container">
+ <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
+ <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
+ <%= @inner_content %>
+</main>
diff --git a/lib/aggiedit_web/templates/layout/live.html.heex b/lib/aggiedit_web/templates/layout/live.html.heex
new file mode 100644
index 0000000..a29d604
--- /dev/null
+++ b/lib/aggiedit_web/templates/layout/live.html.heex
@@ -0,0 +1,11 @@
+<main class="container">
+ <p class="alert alert-info" role="alert"
+ phx-click="lv:clear-flash"
+ phx-value-key="info"><%= live_flash(@flash, :info) %></p>
+
+ <p class="alert alert-danger" role="alert"
+ phx-click="lv:clear-flash"
+ phx-value-key="error"><%= live_flash(@flash, :error) %></p>
+
+ <%= @inner_content %>
+</main>
diff --git a/lib/aggiedit_web/templates/layout/root.html.heex b/lib/aggiedit_web/templates/layout/root.html.heex
new file mode 100644
index 0000000..f653fd8
--- /dev/null
+++ b/lib/aggiedit_web/templates/layout/root.html.heex
@@ -0,0 +1,31 @@
+<!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] || "Aggiedit", suffix: " ยท Phoenix Framework" %>
+ <link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/assets/app.css")}/>
+ <script defer phx-track-static type="text/javascript" src={Routes.static_path(@conn, "/assets/app.js")}></script>
+ </head>
+ <body>
+ <header>
+ <section class="container">
+ <nav>
+ <ul>
+ <li><a href="https://hexdocs.pm/phoenix/overview.html">Get Started</a></li>
+ <%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
+ <li><%= link "LiveDashboard", to: Routes.live_dashboard_path(@conn, :home) %></li>
+ <% end %>
+ </ul>
+ <%= render "_user_menu.html", assigns %>
+ </nav>
+ <a href="https://phoenixframework.org/" class="phx-logo">
+ <img src={Routes.static_path(@conn, "/images/phoenix.png")} alt="Phoenix Framework Logo"/>
+ </a>
+ </section>
+ </header>
+ <%= @inner_content %>
+ </body>
+</html>