Browse Source

feat: add link to public page from admin

master
Inhji Y. 10 months ago
parent
commit
6a2b001b00
  1. 6
      apps/tomie_web/lib/tomie_web/templates/layout/navigation.html.eex
  2. 8
      apps/tomie_web/lib/tomie_web/views/icon_view.ex

6
apps/tomie_web/lib/tomie_web/templates/layout/navigation.html.eex

@ -43,6 +43,12 @@
<span>Jobs</span>
<% end %>
</li>
<li><%= link to: Routes.home_path(TomieWeb.Endpoint, :index) do %>
<span class="icon">
<%= IconView.icon(:external) %>
</span>
<% end %>
</li>
<%= unless Pow.Plug.current_user(@conn) do %>
<li><%= active_link @conn, "Register", to: Routes.pow_registration_path(@conn, :new) %></li>
<li><%= active_link @conn, "Sign in", to: Routes.pow_session_path(@conn, :new) %></li>

8
apps/tomie_web/lib/tomie_web/views/icon_view.ex

@ -4,6 +4,14 @@ defmodule TomieWeb.IconView do
def icon(nil), do: ""
def icon(name), do: svg_icon(name)
defp svg_icon(:external) do
~E"""
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M9 10V8h2v2h2v2h-2v2H9v-2H7v-2h2zM0 3c0-1.1.9-2 2-2h16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3zm2 2v12h16V5H2z"/>
</svg>
"""
end
defp svg_icon(:star) do
~E"""
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">

Loading…
Cancel
Save