Browse Source

improve layout and header

main
Inhji Y. 10 months ago
parent
commit
ab9b8978fe
  1. 21
      lib/mirage_web/live/page_live.html.leex
  2. 22
      lib/mirage_web/templates/layout/_header.html.eex
  3. 14
      lib/mirage_web/templates/layout/_user_menu.html.eex
  4. 17
      lib/mirage_web/templates/layout/root.html.leex

21
lib/mirage_web/live/page_live.html.leex

@ -1,5 +1,5 @@
<section class="phx-hero">
<h1><%= gettext "Welcome to %{name}!", name: "Phoenix" %></h1>
<h1><%= gettext "Hello my name is %{name}!", name: "Inhji" %></h1>
<p>Peace of mind from prototype to production</p>
<form phx-change="suggest" phx-submit="search">
@ -15,33 +15,28 @@
<section class="row">
<article class="column">
<h2>Resources</h2>
<h2>Profiles</h2>
<ul>
<li>
<a href="https://hexdocs.pm/phoenix/overview.html">Guides &amp; Docs</a>
<a href="https://chaos.social/@inhji" target="_blank">Mastodon</a>
</li>
<li>
<a href="https://github.com/phoenixframework/phoenix">Source</a>
<a href="https://www.openstreetmap.org/user/inhji" target="_blank">OpenStreetMap</a>
</li>
<li>
<a href="https://github.com/phoenixframework/phoenix/blob/v1.5/CHANGELOG.md">v1.5 Changelog</a>
<a href="https://listenbrainz.org/user/inhji" target="_blank">Listenbrainz</a>
</li>
</ul>
</article>
<article class="column">
<h2>Help</h2>
<h2>Hosted</h2>
<ul>
<li>
<a href="https://elixirforum.com/c/phoenix-forum">Forum</a>
<a href="https://git.inhji.de" target="_blank">Gitea Instance</a>
</li>
<li>
<a href="https://webchat.freenode.net/?channels=elixir-lang">#elixir-lang on Freenode IRC</a>
<a href="https://reader.inhji.de" target="_blank">Miniflux RSS</a>
</li>
<li>
<a href="https://twitter.com/elixirphoenix">Twitter @elixirphoenix</a>
</li>
<li>
<a href="https://elixir-slackin.herokuapp.com/">Elixir on Slack</a>
</li>
</ul>
</article>

22
lib/mirage_web/templates/layout/_header.html.eex

@ -0,0 +1,22 @@
<header>
<section class="container">
<nav role="navigation" class="row">
<div class="column">
<ul class="row">
<li class="column">
<a href="/">Home</a>
</li>
<li class="column">
<a href="/notes">Notes</a>
</li>
<li class="column">
<a href="/wiki">Wiki</a>
</li>
</ul>
</div>
<div class="column">
<%= render "_user_menu.html", assigns %>
</div>
</nav>
</section>
</header>

14
lib/mirage_web/templates/layout/_user_menu.html.eex

@ -1,10 +1,10 @@
<ul>
<ul class="row">
<%= 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>
<li class="column"><%= @current_user.email %></li>
<li class="column"><%= link "Settings", to: Routes.user_settings_path(@conn, :edit) %></li>
<li class="column"><%= 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>
<li class="column"><%= link "Register", to: Routes.user_registration_path(@conn, :new) %></li>
<li class="column"><%= link "Log in", to: Routes.user_session_path(@conn, :new) %></li>
<% end %>
</ul>
</ul>

17
lib/mirage_web/templates/layout/root.html.leex

@ -10,22 +10,7 @@
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</head>
<body>
<header>
<section class="container">
<nav role="navigation">
<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>
<%= render "_header.html", assigns %>
<%= @inner_content %>
</body>
</html>

Loading…
Cancel
Save