<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title><%= title %></title>
    <meta name="theme-color" content="#c17f59" />
    <link rel="manifest" href="/manifest.json" />
    <link rel="icon" type="image/png" sizes="32x32" href="/ios/32.png" />
    <link rel="icon" type="image/png" sizes="192x192" href="/android/android-launchericon-192-192.png" />
    <link rel="apple-touch-icon" sizes="180x180" href="/ios/180.png" />
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css"
    />
    <link rel="stylesheet" href="/styles.css" />
  </head>
  <body>
    <nav class="navbar is-white" role="navigation" aria-label="main navigation">
      <div class="navbar-brand">
        <a class="navbar-item brand" href="/">
          <img class="brand-logo" src="/ios/256.png" alt="Pedal logo" />
          <span>Pedal</span>
        </a>
      </div>
      <div class="navbar-menu">
        <div class="navbar-start">
          <a class="navbar-item" href="/">Pads</a>
        </div>
        <div class="navbar-end">
          <% if (currentUser && currentUser.is_admin) { %>
          <a class="navbar-item" href="/admin">Admin</a>
          <% } %>
          <% if (currentUser) { %>
          <div class="navbar-item">Hi, <strong><%= currentUser.username %></strong></div>
          <form class="navbar-item" method="post" action="/logout">
            <button class="button is-light" type="submit">Log out</button>
          </form>
          <% } else { %>
          <a class="navbar-item" href="/login">Log in</a>
          <a class="navbar-item" href="/register">Sign up</a>
          <% } %>
        </div>
      </div>
    </nav>

    <section class="section">
      <div class="container">
        <% if (flash) { %>
        <div class="notification is-<%= flash.type %>"><%= flash.message %></div>
        <% } %>
