File size: 1,702 Bytes
7da8e48
 
 
 
 
06f9d02
7da8e48
 
ce6aff0
 
 
 
 
 
7da8e48
 
 
ce6aff0
7da8e48
 
 
 
ce6aff0
 
06f9d02
 
ce6aff0
7da8e48
 
 
 
 
 
 
 
ce6aff0
7da8e48
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Chirp App</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css">
    <style>
        .post { margin-bottom: 1rem; }
        .post-author { font-weight: bold; }
        .post-date { color: var(--muted-color); font-size: 0.8rem; }
        .alert { padding: 1rem; margin-bottom: 1rem; border-radius: var(--border-radius); }
        .alert-success { background-color: var(--pico-color-green-100); border: 1px solid var(--pico-color-green-300); }
        .alert-danger { background-color: var(--pico-color-red-100); border: 1px solid var(--pico-color-red-300); }
    </style>
  </head>
  <body>
    <nav class="container-fluid">
      <ul>
        <li><strong><a href="{{ url_for('index') }}">Chirp</a></strong></li>
      </ul>
      <ul>
        {% if 'username' in session %}
          <li>Hello, {{ session.username }}</li>
          <!-- NEW DOWNLOAD BUTTON -->
          <li><a href="{{ url_for('download_data') }}" role="button" class="contrast">Download My Data</a></li>
          <li><a href="{{ url_for('logout') }}" role="button" class="secondary">Logout</a></li>
        {% endif %}
      </ul>
    </nav>
    
    <main class="container">
      {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
          {% for category, message in messages %}
            <div class="alert alert-{{ category }}">{{ message }}</div>
          {% endfor %}
        {% endif %}
      {% endwith %}

      {% block content %}{% endblock %}
    </main>
  </body>
</html>