<!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"/>
    <meta name="csrf-token" content={csrf_token_value()}>
    <%%= live_title_tag assigns[:page_title] || "<%= context.context_app %>", suffix: " · Phoenix Framework" %>
    
    <%##= By default, load the CSS from an external CDN %>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">

    <%##= Load the app's specific javascript %>
    <script defer phx-track-static type="text/javascript" src={Routes.static_path(@conn, "/assets/app.js")}></script>
  </head>

  <body class="bg-light">
    <%##
    The default layout has the following structure:

    +-----------------------------------------------+
    |                   Navbar                      |
    +-- Sidebar ----|-------------------------------+
    | Link 1        | (maybe empty) flash messages  |
    | Link 2        |-------------------------------|
    | ...           | Main content                  |
    |---------------|                               |
    |               |                               |
    |               |                               |
    +---------------+-------------------------------+
    |                   Footer                      |
    +-----------------------------------------------+

    You are of course free to change it as you see fit.
    User-visible text should be wrapped in a `dgettext()` call so that it can be easily translated.
    Any user-visible text that is *not* wrapped in such a call is a bug that should be reported.
    %>
    <header>
      <nav class="navbar navbar-expand-sm navbar-dark bg-dark">
        <a class="navbar-brand" href="#"><%= inspect context.web_module %></a>
        <ul class="navbar-nav">
          <li class="nav-item active">
            <a class="nav-link" href="/"><%%= dgettext("mandarin.<%= context.basename %>", "Home") %></a>
          </li>
          <%%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
            <li class="nav-item active">
              <a class="nav-link" href={Routes.live_dashboard_path(@conn, :home)}><%%= dgettext("mandarin.<%= context.basename %>", "LiveDashboard") %></a>
            </li>
          <%% end %>
        </ul>
      </nav>
    </header>

    <div class="container-fluid py-3">
      <%## No sidebar! %>
      <%%= @inner_content %>
    </div>

    <%## Footer with Copyright information %>
    <footer class="my-5 pt-5 text-muted text-center text-small">
      <p class="mb-1">
        <%%= raw(
          dgettext("mandarin.<%= context.basename %>", """
          <strong>Copyright &copy; <%= DateTime.utc_now() |> Map.fetch!(:year) %> <a href="#"><%= inspect context.web_module %></a>.</strong> All rights reserved.
          """)) %>
      </p>
    </footer>

    <%%# Forage-specific utilities (loads JQuery by default!) %>
    <%%# - Imports the necessary javascript for the select widget to work at all %>
    <%%= ForageWeb.Assets.forage_select_assets() %>
    <%%# - Runs the necessary javascript so that the select widget plays nice with Forage %>
    <%%= ForageWeb.Assets.activate_forage_select() %>
  </body>
</html>
