diff options
Diffstat (limited to 'templates/index.html')
-rw-r--r-- | templates/index.html | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..13a8aec --- /dev/null +++ b/templates/index.html | |||
@@ -0,0 +1,122 @@ | |||
1 | <html> | ||
2 | <title>{{ config.get('frab-conference') }} {{ config.get('track') }} rating helper</title> | ||
3 | <head> | ||
4 | <script type="text/javascript">categories = { | ||
5 | {%- for category in cat -%} | ||
6 | 'category{{ loop.index }}': '{{ category }}', | ||
7 | {%- endfor -%} | ||
8 | }; | ||
9 | </script> | ||
10 | |||
11 | <script type=text/javascript src="static/rater.js"></script> | ||
12 | <link rel="stylesheet" type="text/css" href="static/rater.css"> | ||
13 | </head> | ||
14 | <body> | ||
15 | |||
16 | <div style="float: left"> | ||
17 | <button class="main-button lectures-button" onclick="document.body.classList.toggle('only-lectures')" title="Show only lectures">lects</button> | ||
18 | <button class="main-button todo-button" onclick="document.body.classList.toggle('only-todo')" title="Show only my unrated events">todo</button> | ||
19 | <button class="main-button ratings-button" onclick="document.body.classList.toggle('show-ratings')" title="Show all ratings">rates</button> | ||
20 | <button class="main-button two-columns" onclick="twocol()" title="Display events in two columns">2col</button> | ||
21 | <button class="main-button three-columns" onclick="threecol()" title="Display events in three columns">3col</button> | ||
22 | <button class="main-button four-columns" onclick="fourcol()" title="Display events in four columns">4col</button> | ||
23 | </div> | ||
24 | <div style="float: right; margin: 0"> | ||
25 | <button class="main-button" onclick="sort_by(random_sort)" title="Sort events randomly">rand</button> | ||
26 | <button class="main-button" onclick="sort_by(rating_count_sort)" title="Sort events by amount of ratings">rate count</button> | ||
27 | <button class="main-button" onclick="sort_by(myrating_count_sort)" title="Sort my rated events first">my rates</button> | ||
28 | <button class="main-button" onclick="sort_by(coordinator_sort)" title="Sort events by coordinator">coord</button> | ||
29 | <button class="main-button" onclick="sort_by(rating_1_sort)" title="Sort by meter 1">1</button> | ||
30 | <button class="main-button" onclick="sort_by(rating_2_sort)" title="Sort by meter 2">2</button> | ||
31 | <button class="main-button" onclick="sort_by(rating_3_sort)" title="Sort by meter 3">3</button> | ||
32 | <button class="main-button" onclick="sort_by(rating_4_sort)" title="Sort by meter 4">4</button> | ||
33 | <button class="main-button" onclick="sort_by(rating_5_sort)" title="Sort by summation meter">∑</button> | ||
34 | <button class="main-button" onclick="sort_by(state_sort)" title="Sort by event state">state</button> | ||
35 | <button class="main-button" onclick="invert_sort()" title="Invert sort order">⇅</button> | ||
36 | </div> | ||
37 | |||
38 | <div style="display: block; margin: 0.5em; height: 1px; clear: both;"></div> | ||
39 | |||
40 | <div class="username-wrapper"> | ||
41 | <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> | ||
42 | </div> | ||
43 | |||
44 | <input type="text" id="Filter" oninput="changed_filter()" placeholder="Filter"> | ||
45 | |||
46 | <div class="event-rating hidden" id="event-rating-new"> | ||
47 | <div class="event-rating-submitter"></div> | ||
48 | {%- for category in cat -%} | ||
49 | <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> | ||
50 | {%- endfor -%} | ||
51 | <div class="event-rating-comment"></div> | ||
52 | </div> | ||
53 | |||
54 | <div id="event-own-rating"> | ||
55 | <hr/> | ||
56 | <div class="label">comment</div><textarea rows="8" id="event-comment"></textarea> | ||
57 | {%- for category in cat -%} | ||
58 | <div class="category-slider" id="event-category{{loop.index}}-slider"> | ||
59 | <div class="label">{{category}}:</div> | ||
60 | <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> | ||
61 | <output id="event-category{{loop.index}}-output">0 %</output> | ||
62 | </div> | ||
63 | {%- endfor -%} | ||
64 | <button class="remove-rating hidden" onclick="do_remove_rating()">remove</button> | ||
65 | <button onclick="do_rate()">rate</button> | ||
66 | </div> | ||
67 | |||
68 | <p id='status'>Please wait …</p> | ||
69 | |||
70 | <ul id="event-list"> | ||
71 | {% for ev in events -%} | ||
72 | <li class="event-list-item" event_state="{{ev.state}}" event_type="{{ev.event_type}}" id="event-{{ev.frab_id}}"> | ||
73 | <div class="event-meter-bar"> | ||
74 | {%- for m in range(1+cat|length) -%} | ||
75 | <meter class="top-meter meter-{{m}}" id="event-{{ev.frab_id}}-meter-{{m}}" value="0" min="0" max="100"></meter> | ||
76 | {%- endfor -%} | ||
77 | </div> | ||
78 | {%- if not ev.state == 'gone' -%} | ||
79 | <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> | ||
80 | {%- else -%} | ||
81 | <button onclick="do_remove_event('{{ev.frab_id}}')" title="remove this event" class="mini-button remove-button">del</button> | ||
82 | {%- endif -%} | ||
83 | <div class="event-title"><a href="{{ config.get('frab-url') }}en/{{ config.get('frab-conference')}}/events/{{ ev.frab_id }}/">{{ ev.title }}</a></div> | ||
84 | {%- if ev.subtitle -%} | ||
85 | <div class="event-subtitle"> {{ ev.subtitle }}</div> | ||
86 | {%- endif -%} | ||
87 | <div class="event-persons"> | ||
88 | {%- if ev.coordinator -%} | ||
89 | <div class="event-coordinator" coordinator="{{ev.coordinator}}"><em>coordinator: </em> {{ev.coordinator}}</div> | ||
90 | {%- endif -%} | ||
91 | <div class="event-speaker"><em>speakers: </em> | ||
92 | {%- for speaker_id, speaker_name in json.loads(ev.speakers or '{}').items() -%} | ||
93 | <a href="{{ config.get('frab-url') }}en/{{ config.get('frab-conference') }}/people/{{speaker_id}}">{{speaker_name}}</a> | ||
94 | {%- endfor -%} | ||
95 | </div> | ||
96 | </div> | ||
97 | <div class="event-abstract" onclick="this.classList.toggle('full')"><em>abstract:</em> {{ ev.abstract }}</div> | ||
98 | {%- if ev.description -%} | ||
99 | <div class="event-description" onclick="this.classList.toggle('full')"><em>description:</em> {{ ev.description }}</div> | ||
100 | {%- endif -%} | ||
101 | {%- if ev.notes -%} | ||
102 | <div class="event-notes" onclick="this.classList.toggle('full')"><em>notes:</em> {{ ev.notes }}</div> | ||
103 | {%- endif -%} | ||
104 | <div class="event-ratings"> | ||
105 | {%- for rating in ev.ratings -%} | ||
106 | <div class="event-rating" id="event-rating-{{ev.frab_id}}" submitter="{{rating.submitter}}"> | ||
107 | <div class="event-rating-submitter">{{rating.submitter}}:</div> | ||
108 | {%- for category, value in json.loads(rating.rating_dict or '{}').items()|sort -%} | ||
109 | <div><meter category="{{category}}" value="{{value}}" min="0" max="100"></meter><span class="event-rating-category-output" category="{{category}}"> {{ cat[loop.index-1] + " " + value|string + " %" }}</span></div> | ||
110 | {%- endfor -%} | ||
111 | <div class="event-rating-comment">{{rating.comment}}</div> | ||
112 | </div> | ||
113 | {%- endfor -%} | ||
114 | </div> | ||
115 | </li> | ||
116 | {%- else %} | ||
117 | <em>No events imported yet</em> | ||
118 | {%- endfor %} | ||
119 | <ul> | ||
120 | |||
121 | <body> | ||
122 | </html> | ||