summaryrefslogtreecommitdiff
path: root/templates/index.html
blob: c8ccf7137555df010c25232ff183eeadff8f6e80 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<html>
<title>{{ config.get('frab-conference') }} {{ config.get('track') }} rating helper</title>
<head>
<script type="text/javascript">categories = {
  {%- for category in config['categories'] -%}
    'category{{ loop.index }}': '{{ category }}',
  {%- endfor -%}
  };
</script>

<script type=text/javascript src="static/rater.js"></script>
<link rel="stylesheet" type="text/css" href="static/rater.css">
</head>
<body>

<div style="float: left">
<button class="main-button lectures-button" onclick="document.body.classList.toggle('only-lectures')" title="Show only lectures">lects</button>
<button class="main-button todo-button" onclick="document.body.classList.toggle('only-todo')" title="Show only my unrated events">todo</button>
<button class="main-button ratings-button" onclick="document.body.classList.toggle('show-ratings')" title="Show all ratings">rates</button>
<button class="main-button two-columns" onclick="twocol()" title="Display events in two columns">2col</button>
<button class="main-button three-columns" onclick="threecol()" title="Display events in three columns">3col</button>
<button class="main-button four-columns" onclick="fourcol()" title="Display events in four columns">4col</button>
</div>
<div style="float: right; margin: 0">
<button class="main-button" onclick="sort_by(random_sort)" title="Sort events randomly">rand</button>
<button class="main-button" onclick="sort_by(rating_count_sort)" title="Sort events by amount of ratings">rate count</button>
<button class="main-button" onclick="sort_by(myrating_count_sort)" title="Sort my rated events first">my rates</button>
<button class="main-button" onclick="sort_by(coordinator_sort)" title="Sort events by coordinator">coord</button>
<button class="main-button" onclick="sort_by(rating_1_sort)" title="Sort by meter 1">1</button>
<button class="main-button" onclick="sort_by(rating_2_sort)" title="Sort by meter 2">2</button>
<button class="main-button" onclick="sort_by(rating_3_sort)" title="Sort by meter 3">3</button>
<button class="main-button" onclick="sort_by(rating_4_sort)" title="Sort by meter 4">4</button>
<button class="main-button" onclick="sort_by(rating_5_sort)" title="Sort by summation meter">∑</button>
<button class="main-button" onclick="sort_by(state_sort)" title="Sort by event state">state</button>
<button class="main-button" onclick="invert_sort()" title="Invert sort order">⇅</button>
</div>

<div style="display: block; margin: 0.5em; height: 1px; clear: both;"></div>

<div class="username-wrapper">
<input type="text" id="Username" oninput="changed_name()" placeholder="who are you?"><button class="main-button" onclick="confirm_name()" title="Store your username locally">✓</button>
</div>

<input type="text" id="Filter" oninput="changed_filter()" placeholder="Filter">

<div class="event-rating hidden" id="event-rating-new">
  <div class="event-rating-submitter"></div>
  {%- for category in config['categories'] -%}
    <div><meter category="category{{loop.index}}" value="0" min="0" max="100"></meter><span class="event-rating-category-output" category="category{{loop.index}}"> {{ category + " 0 %" }}</span></div>
  {%- endfor -%}
  <div class="event-rating-comment"></div>
</div>

<div id="event-own-rating">
  <hr/>
  <div class="label">comment</div><textarea rows="8" id="event-comment"></textarea>
  {%- for category in config['categories'] -%}
    <div class="category-slider" id="event-category{{loop.index}}-slider">
      <div class="label">{{category}}:</div>
      <div class="slider"><input category="category{{loop.index}}" type="range" min="0" max="100" step="5" oninput="changeVal('event-category{{loop.index}}-output', this.value)"></div>
      <output id="event-category{{loop.index}}-output">0 %</output>
    </div>
  {%- endfor -%}
  <button class="remove-rating hidden" onclick="do_remove_rating()">remove</button>
  <button onclick="do_rate()">rate</button>
</div>

<p id='status'>Please wait …</p>

<ul id="event-list">
{% for ev in events -%}
  <li class="event-list-item" event_state="{{ev.state}}" event_type="{{ev.event_type}}" id="event-{{ev.frab_id}}">
    <div class="event-meter-bar">
    {%- for m in range(1+config['categories']|length) -%}
      <meter class="top-meter meter-{{m}}" id="event-{{ev.frab_id}}-meter-{{m}}" value="0" min="0" max="100"></meter>
    {%- endfor -%}
    </div>
    {%- if not ev.state == 'gone' -%}
      <button onclick="do_set_state('{{ev.frab_id}}', 'accepted')" title="accept this event" class="mini-button accept-button">acc</button><button onclick="do_set_state('{{ev.frab_id}}', 'rejected')" title="reject this event" class="mini-button reject-button">rej</button><button onclick="toggleEdit('{{ev.frab_id}}')"  title="edit this event" class="edit-button mini-button">edit</button><button onclick="do_take('{{ev.frab_id}}')" title="make me coordinator for this event" class="mini-button take-button">take</button>
    {%- else -%}
      <button onclick="do_remove_event('{{ev.frab_id}}')" title="remove this event" class="mini-button remove-button">del</button>
    {%- endif -%}
    <div class="event-title"><a href="{{ config['frab-conf-url'] }}/events/{{ ev.frab_id }}/">{{ ev.title }}</a></div>
    {%- if ev.subtitle -%}
    <div class="event-subtitle"> {{ ev.subtitle }}</div>
    {%- endif -%}
    <div class="event-persons">
      {%- if ev.coordinator -%}
        <div class="event-coordinator" coordinator="{{ev.coordinator}}"><em>coordinator: </em> {{ev.coordinator}}</div>
      {%- endif -%}
      <div class="event-speaker"><em>speakers: </em>
        {%- for speaker_id, speaker_name in json.loads(ev.speakers or '{}').items() -%}
          <a href="{{ config['frab-conf-url'] }}/people/{{speaker_id}}">{{speaker_name}}</a>&nbsp;
        {%- endfor -%}
      </div>
    </div>
    <div class="event-abstract" onclick="this.classList.toggle('full')"><em>abstract:</em> {{ ev.abstract }}</div>
    {%- if ev.description -%}
    <div class="event-description" onclick="this.classList.toggle('full')"><em>description:</em> {{ ev.description }}</div>
    {%- endif -%}
    {%- if ev.notes -%}
    <div class="event-notes" onclick="this.classList.toggle('full')"><em>notes:</em> {{ ev.notes }}</div>
    {%- endif -%}
    <div class="event-ratings">
      {%- for rating in ev.ratings -%}
        <div class="event-rating" id="event-rating-{{ev.frab_id}}" submitter="{{rating.submitter}}">
          <div class="event-rating-submitter">{{rating.submitter}}:</div>
          {%- for category, value in json.loads(rating.rating_dict or '{}').items()|sort -%}
              <div><meter category="{{category}}" value="{{value}}" min="0" max="100"></meter><span class="event-rating-category-output" category="{{category}}"> {{ config['categories'][loop.index-1] + " " + value|string + " %" }}</span></div>
          {%- endfor -%}
          <div class="event-rating-comment">{{rating.comment}}</div>
        </div>
      {%- endfor -%}
    </div>
  </li>
{%- else %}
  <em>No events imported yet</em>
{%- endfor %}
<ul>

<body>
</html>