aboutsummaryrefslogtreecommitdiff
path: root/app/templates/index.html
blob: 1606f2a2f5510275c65f14733857f96d5eccb728 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{% extends "base.html" %}

{% block styles %}
  {{ super() }}
  <link rel="stylesheet" href="{{url_for('static', filename='css/index.css')}}">
{% endblock %}

{% block app_content %}
  {% if current_user.is_authenticated %}
    <h1>Hi, {{ current_user.username }}!</h1>
  {% endif %}
  <p>
    Welcome to <i>AnnotateChange</i>, a tool for annotating time series data 
    for changepoint analysis.
  </p>
  {% if not current_user.is_authenticated %}
  <br>
  <p>
    Please <a href="{{ url_for('auth.login') }}">log in</a> or 
    <a href="{{ url_for('auth.register') }}">register</a> to get started.
  </p>
  {% endif %}
  {% if current_user.is_authenticated %}
    <h3>Introduction</h3>
    {% if not current_user.is_introduced %}
      <a href="{{ url_for('main.demo') }}">Click here to start the introduction to AnnotateChange.</a>
      {% if tasks_todo|length == 0 and tasks_done|length == 0 %}
      <br>
      <br>
      <p>
        When you have finished the introduction, the datasets to annotate 
        will appear here.
      </p>
      {% endif %}
    {% else %}
    <p>
      Thank you for completing the introduction. If you want to revisit 
      it, you can do so by <a href="{{ url_for('main.demo') }}">clicking here</a>.
    </p>
      {% if tasks_todo|length == 0 and tasks_done|length == 0 %}
      <br>
      <br>
      <p>
        There are currently no datasets for you to annotate. Please check back
        again later.
      </p>
      {% endif %}
    {% endif %}
    {% if tasks_todo %}
      <h3>Datasets to Annotate</h3>
      <p>
        Below are the datasets that we would like you to annotate, thank you 
        very much for your help!
      </p>
      <div class="tasks-todo">
        <table class="table table-striped">
          <thead class="thead-dark">
            <th scope="col">Name</th>
          </thead>
          {% for task in tasks_todo %}
            <tr>
              <td>
                <a href="{{ url_for('main.annotate', task_id=task.id) }}">
                  {% if current_user.is_admin %}
                  {{ task.dataset.name | title }}
                  {% else %}
                  Dataset {{ task.dataset.id | title }}
                  {% endif %}
                </a>
              </td>
            </tr>
          {% endfor %}
        </table>
      </div>
    {% elif tasks_todo|length == 0 and tasks_done|length > 0 %}
      <div id="done">
        <img src="{{ url_for('static', filename='img/done.png') }}">
        <span>
          No more annotations to do! Thank you so much for your help, 
          <b>you rock!</b>
        </span>
      </div>
    {% endif %}
    {% if tasks_done %}
      <h3>Completed Annotations</h3>
      <div class="tasks-done">
        <table class="table table-striped">
          <thead>
            <th scope="col">Name</th>
            <th scope="col">Completed On</th>
          </thead>
          {% for task in tasks_done %}
            <tr>
              {% if current_user.is_admin %}
              <td>{{ task.dataset.name | title }}</td>
              {% else %}
              <td>Dataset {{ task.dataset.id | title }}</td>
              {% endif %}
              <td>{{ task.annotated_on }}</td>
            </tr>
          {% endfor %}
        </table>
      </div>
    {% endif %}
  {% endif %}
{% endblock %}