summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2025-11-06 12:17:07 +0000
committerDirk Engling <erdgeist@erdgeist.org>2025-11-06 12:17:07 +0000
commitbfa1dfa2b79396f8bcc549c3a506105d097ee0b0 (patch)
tree92489eeb50174f26ddde36fc98ac6d1d028a31c1
parent6f1bcc3db2c8ee807b68fa8a47a1a8cb7aabcc48 (diff)
Fix routes, make it 39C3 everywhereHEADmaster
-rwxr-xr-xhalfnarp2.py6
-rw-r--r--static/faq.html4
-rw-r--r--static/halfnarp.js41
-rw-r--r--static/index.html37
4 files changed, 46 insertions, 42 deletions
diff --git a/halfnarp2.py b/halfnarp2.py
index 24d099a..fcc8788 100755
--- a/halfnarp2.py
+++ b/halfnarp2.py
@@ -45,7 +45,7 @@ def get_own_preferences(uid):
45 { 45 {
46 "hashed_uid": pref.public_uid, 46 "hashed_uid": pref.public_uid,
47 "public_url": url_for( 47 "public_url": url_for(
48 "get_preferences", 48 "main.get_preferences",
49 public_uid=public_uid, 49 public_uid=public_uid,
50 _external=True, 50 _external=True,
51 _scheme="https", 51 _scheme="https",
@@ -79,13 +79,13 @@ def store_preferences():
79 "uid": uid, 79 "uid": uid,
80 "hashed_uid": str(public_uid), 80 "hashed_uid": str(public_uid),
81 "public_url": url_for( 81 "public_url": url_for(
82 "get_preferences", 82 "main.get_preferences",
83 public_uid=public_uid, 83 public_uid=public_uid,
84 _external=True, 84 _external=True,
85 _scheme="https", 85 _scheme="https",
86 ), 86 ),
87 "update_url": url_for( 87 "update_url": url_for(
88 "update_preferences", uid=uid, _external=True, _scheme="https" 88 "main.update_preferences", uid=uid, _external=True, _scheme="https"
89 ), 89 ),
90 } 90 }
91 ) 91 )
diff --git a/static/faq.html b/static/faq.html
index a90b4b5..e5f53cd 100644
--- a/static/faq.html
+++ b/static/faq.html
@@ -3,7 +3,7 @@
3<head> 3<head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>halfnarp FAQ</title> 5 <title>halfnarp FAQ</title>
6 <link rel="stylesheet" href="style.css"> 6 <link rel="stylesheet" href="style_39c3.css">
7</head> 7</head>
8<body> 8<body>
9 9
@@ -38,7 +38,7 @@
38</dd> 38</dd>
39<dt>Q: How can I help?</dt> 39<dt>Q: How can I help?</dt>
40<dd> 40<dd>
41 <p>A: Submitting your preferences to the halfnarp servers helps a lot. You can find and create pull requests for <a href="https://github.com/tomster/halfnarp">halfnarp on its github home</a>.</p> 41 <p>A: Submitting your preferences to the halfnarp servers helps a lot. You can the halfnarp living <a href="https://erdgeist.org/gitweb/halfnarp2">halfnarp2 on its git home</a>.</p>
42</dd> 42</dd>
43 43
44</html> 44</html>
diff --git a/static/halfnarp.js b/static/halfnarp.js
index 5cd1ef3..e40c84e 100644
--- a/static/halfnarp.js
+++ b/static/halfnarp.js
@@ -102,14 +102,14 @@ function redraw_calendar(myuid, ids) {
102 } 102 }
103 }); 103 });
104 calendar += 'END:VCALENDAR\r\n'; 104 calendar += 'END:VCALENDAR\r\n';
105 $('.export-url-a').attr( 'href', "data:text/calendar;filename=38C3.ics," + encodeURIComponent(calendar) ); 105 $('.export-url-a').attr( 'href', "data:text/calendar;filename=39C3.ics," + encodeURIComponent(calendar) );
106 $('.export-url').removeClass( 'hidden' ); 106 $('.export-url').removeClass( 'hidden' );
107} 107}
108 108
109function do_the_halfnarp() { 109function do_the_halfnarp() {
110// var halfnarpAPI = 'talks_36C3.json'; 110// var halfnarpAPI = 'talks_36C3.json';
111 var halfnarpAPI = '/-/talkpreferences'; 111 var halfnarpAPI = '/-/talkpreferences';
112 var halfnarpCorrs = 'corr_array_38c3.json'; 112 var halfnarpCorrs = 'corr_array_39c3.json';
113 var halfnarpPubAPI = halfnarpAPI + '/public/'; 113 var halfnarpPubAPI = halfnarpAPI + '/public/';
114 var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); 114 var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));
115 window.top.all_events = new Object(); 115 window.top.all_events = new Object();
@@ -179,8 +179,8 @@ function do_the_halfnarp() {
179 return $(this).attr('event_id'); 179 return $(this).attr('event_id');
180 }).get(); 180 }).get();
181 try { 181 try {
182 localStorage['38C3-halfnarp'] = ids; 182 localStorage['39C3-halfnarp'] = ids;
183 myapi = localStorage.getItem('38C3-halfnarp-api'); 183 myapi = localStorage.getItem('39C3-halfnarp-api');
184 if (myapi) { 184 if (myapi) {
185 myapi = myapi.replace(/.*?:\//g, ""); 185 myapi = myapi.replace(/.*?:\//g, "");
186 myapi = 'https:/' + myapi.replace(/.*?:\//g, ""); 186 myapi = 'https:/' + myapi.replace(/.*?:\//g, "");
@@ -207,9 +207,9 @@ function do_the_halfnarp() {
207 $('.info').text('submitted'); 207 $('.info').text('submitted');
208 $('.info').removeClass('hidden'); 208 $('.info').removeClass('hidden');
209 try { 209 try {
210 localStorage['38C3-halfnarp-api'] = data['update_url']; 210 localStorage['39C3-halfnarp-api'] = data['update_url'];
211 localStorage['38C3-halfnarp-pid'] = mypid = data['hashed_uid']; 211 localStorage['39C3-halfnarp-pid'] = mypid = data['hashed_uid'];
212 localStorage['38C3-halfnarp-uid'] = myuid = data['uid']; 212 localStorage['39C3-halfnarp-uid'] = myuid = data['uid'];
213 window.location.hash = mypid; 213 window.location.hash = mypid;
214 } catch(err) {} 214 } catch(err) {}
215 }, 'json' ).fail(function() { 215 }, 'json' ).fail(function() {
@@ -225,9 +225,9 @@ function do_the_halfnarp() {
225 contentType: "application/json", 225 contentType: "application/json",
226 dataType: 'json', 226 dataType: 'json',
227 }).done(function(data) { 227 }).done(function(data) {
228 localStorage['38C3-halfnarp-uid'] = myuid = data['uid']; 228 localStorage['39C3-halfnarp-uid'] = myuid = data['uid'];
229 if( localStorage['38C3-halfnarp-pid'] ) { 229 if( localStorage['39C3-halfnarp-pid'] ) {
230 window.location.hash = localStorage['38C3-halfnarp-pid']; 230 window.location.hash = localStorage['39C3-halfnarp-pid'];
231 } 231 }
232 $('.info').text('updated'); 232 $('.info').text('updated');
233 $('.info').removeClass('hidden'); 233 $('.info').removeClass('hidden');
@@ -279,18 +279,21 @@ function do_the_halfnarp() {
279 } 279 }
280 280
281 /* Add callbacks for view selector */ 281 /* Add callbacks for view selector */
282 if (0) {
282 document.querySelector('.vlist').onclick = function() { toggle_grid(0); }; 283 document.querySelector('.vlist').onclick = function() { toggle_grid(0); };
283 document.querySelector('.vday1').onclick = function() { toggle_grid(1); }; 284 document.querySelector('.vday1').onclick = function() { toggle_grid(1); };
284 document.querySelector('.vday2').onclick = function() { toggle_grid(2); }; 285 document.querySelector('.vday2').onclick = function() { toggle_grid(2); };
285 document.querySelector('.vday3').onclick = function() { toggle_grid(3); }; 286 document.querySelector('.vday3').onclick = function() { toggle_grid(3); };
286 document.querySelector('.vday4').onclick = function() { toggle_grid(4); }; 287 document.querySelector('.vday4').onclick = function() { toggle_grid(4); };
287 document.querySelector('.vdays').onclick = function() { toggle_grid(5); }; 288 document.querySelector('.vdays').onclick = function() { toggle_grid(5); };
288 289 }
289 document.querySelector('.vlang').onclick = function() { document.body.classList.toggle('languages'); }; 290 document.querySelector('.vlang').onclick = function() { document.body.classList.toggle('languages'); };
290 document.querySelector('.vtrack').onclick = function() { document.body.classList.toggle('all-tracks'); }; 291 document.querySelector('.vtrack').onclick = function() { document.body.classList.toggle('all-tracks'); };
291 document.querySelector('.vnarpr').onclick = function() { $('.narpr').toggleClass('hidden'); set_random_event(); }; 292 document.querySelector('.vnarpr').onclick = function() { $('.narpr').toggleClass('hidden'); set_random_event(); };
292 293
294 if (0) {
293 document.querySelector('.vcorr').onclick = toggle_corr_mode; 295 document.querySelector('.vcorr').onclick = toggle_corr_mode;
296 }
294 297
295 $('.vclass').click( function() { toggle_classifier( $(this).attr('classifier'), $(this).hasClass('track'), $(this).hasClass('two_poles')); }); 298 $('.vclass').click( function() { toggle_classifier( $(this).attr('classifier'), $(this).hasClass('track'), $(this).hasClass('two_poles')); });
296 299
@@ -308,10 +311,10 @@ function do_the_halfnarp() {
308 /* If we've been here before, try to get local preferences. They are authoratative */ 311 /* If we've been here before, try to get local preferences. They are authoratative */
309 var selection = [], friends = { }; 312 var selection = [], friends = { };
310 try { 313 try {
311 selection = localStorage['38C3-halfnarp'] || []; 314 selection = localStorage['39C3-halfnarp'] || [];
312 friends = localStorage['38C3-halfnarp-friends'] || { }; 315 friends = localStorage['39C3-halfnarp-friends'] || { };
313 myuid = localStorage['38C3-halfnarp-uid'] || ''; 316 myuid = localStorage['39C3-halfnarp-uid'] || '';
314 mypid = localStorage['38C3-halfnarp-pid'] || ''; 317 mypid = localStorage['39C3-halfnarp-pid'] || '';
315 } catch(err) { 318 } catch(err) {
316 } 319 }
317 320
@@ -354,7 +357,7 @@ function do_the_halfnarp() {
354 if( hour > 23) 357 if( hour > 23)
355 hour -= 24; 358 hour -= 24;
356 359
357 /* Fix up room for 38C3 */ 360 /* Fix up room for 39C3 */
358 room = (item.room_id || '').toString().replace('1','room1').replace('2','room2').replace('3','room3'); 361 room = (item.room_id || '').toString().replace('1','room1').replace('2','room2').replace('3','room3');
359 362
360 /* Apply attributes to sort events into calendar */ 363 /* Apply attributes to sort events into calendar */
@@ -400,8 +403,8 @@ function do_the_halfnarp() {
400 } 403 }
401 }); 404 });
402 405
403 $.getJSON( halfnarpCorrs, { format: 'json' }).done(function(data) { window.top.all_votes = data; }); 406 // $.getJSON( halfnarpCorrs, { format: 'json' }).done(function(data) { window.top.all_votes = data; });
404 toggle_grid(5); 407 toggle_grid(0);
405 408
406 /* Check for a new friends public uid in location's #hash */ 409 /* Check for a new friends public uid in location's #hash */
407 var shared = window.location.hash; 410 var shared = window.location.hash;
@@ -439,7 +442,7 @@ function do_the_halfnarp() {
439 $.getJSON( halfnarpPubAPI + friends.pid, { format: 'json' }) 442 $.getJSON( halfnarpPubAPI + friends.pid, { format: 'json' })
440 .done(function( data ) { 443 .done(function( data ) {
441 friend.prefs = data.talk_ids; 444 friend.prefs = data.talk_ids;
442 localStorage['38C3-halfnarp-friends'] = friends; 445 localStorage['39C3-halfnarp-friends'] = friends;
443 update_friends(); 446 update_friends();
444 }); 447 });
445 } 448 }
diff --git a/static/index.html b/static/index.html
index bb680d1..bc8da67 100644
--- a/static/index.html
+++ b/static/index.html
@@ -3,8 +3,8 @@
3<head> 3<head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>halfnarp web scheduling helper app</title> 5 <title>halfnarp web scheduling helper app</title>
6 <link rel="stylesheet" href="style_38c3.css"> 6 <link rel="stylesheet" href="style_39c3.css">
7 <link rel="stylesheet" href="style_38c3_tables.css"> 7 <link rel="stylesheet" href="style_39c3_tables.css">
8 <script src="jquery-3.7.1.min.js"></script> 8 <script src="jquery-3.7.1.min.js"></script>
9 <script src="jquery.qrcode.min.js"></script> 9 <script src="jquery.qrcode.min.js"></script>
10 <script src="halfnarp.js"></script> 10 <script src="halfnarp.js"></script>
@@ -14,14 +14,14 @@
14</head> 14</head>
15<body class="size-small in-list halfnarp"> 15<body class="size-small in-list halfnarp">
16 <header class="header"> 16 <header class="header">
17 <!--div class="views touch-only hidden vnarpr">narpr</div--> 17 <!--div class="views touch-only hidden vnarpr">narpr</div>
18 <div class="views vlist" title="Display all events sorted by track (Hotkey: L)">list</div> 18 <div class="views vlist" title="Display all events sorted by track (Hotkey: L)">list</div>
19 <div class="views vdays" title="Display all events in a 4-day-view (Hotkey: 0)">days</div> 19 <div class="views vdays" title="Display all events in a 4-day-view (Hotkey: 0)">days</div>
20 <div class="views vday1" title="Display all events on Day 1 (Hotkey: 1)">day 1</div> 20 <div class="views vday1" title="Display all events on Day 1 (Hotkey: 1)">day 1</div>
21 <div class="views vday2" title="Display all events on Day 2 (Hotkey: 2)">day 2</div> 21 <div class="views vday2" title="Display all events on Day 2 (Hotkey: 2)">day 2</div>
22 <div class="views vday3" title="Display all events on Day 3 (Hotkey: 3)">day 3</div> 22 <div class="views vday3" title="Display all events on Day 3 (Hotkey: 3)">day 3</div>
23 <div class="views vday4" title="Display all events on Day 4 (Hotkey: 4)">day 4</div> 23 <div class="views vday4" title="Display all events on Day 4 (Hotkey: 4)">day 4</div>
24 <div class="views vcorr" title="Enter correlation view (Hotkey: C)">half</div> 24 <div class="views vcorr" title="Enter correlation view (Hotkey: C)">half</div-->
25 <div class="views vtrack" title="Color event by track (Hotkey: T)">track</div> 25 <div class="views vtrack" title="Color event by track (Hotkey: T)">track</div>
26 <div class="views vlang" title="Color event by language (Hotkey: I)">lang</div> 26 <div class="views vlang" title="Color event by language (Hotkey: I)">lang</div>
27 <div class="header__right"> 27 <div class="header__right">
@@ -51,9 +51,9 @@
51</div> 51</div>
52 52
53 <div class="intro"> 53 <div class="intro">
54 <h1>The 38C3 halfnarp</h1> 54 <h1>The 39C3 halfnarp</h1>
55 <div class="touch-only hidden vnarpr narpr-beta">narpr<sup>β</sup></div> 55 <div class="touch-only hidden vnarpr narpr-beta">narpr<sup>β</sup></div>
56 <p>Help us to reduce conflicts of scheduling 38C3's Fahrplan: Click on the talks you would like to watch and press submit.</p> 56 <p>Help us to reduce conflicts of scheduling 39C3's Fahrplan: Click on the talks you would like to watch and press submit.</p>
57 <p>For questions please read <a href="faq.html">our FAQ</a> and <a href="http://events.ccc.de/2014/11/25/lets-do-the-halfnarp/">our blogpost</a> for details. Please report problems to <a href="mailto:erdgeist@ccc.de">erdgeist@ccc.de</a>.</p> 57 <p>For questions please read <a href="faq.html">our FAQ</a> and <a href="http://events.ccc.de/2014/11/25/lets-do-the-halfnarp/">our blogpost</a> for details. Please report problems to <a href="mailto:erdgeist@ccc.de">erdgeist@ccc.de</a>.</p>
58 <p class="corr-hint">Select an event below to display halfnarp correlations, the darker the stronger.</p> 58 <p class="corr-hint">Select an event below to display halfnarp correlations, the darker the stronger.</p>
59 <p class="touch-only hidden">NEW on mobile: Swipe the narpr!</p> 59 <p class="touch-only hidden">NEW on mobile: Swipe the narpr!</p>
@@ -75,10 +75,10 @@
75</div--> 75</div-->
76<div style="clear:both"></div> 76<div style="clear:both"></div>
77 77
78<div class="day_1 room-label room1">Saal 1</div><div class="day_1 room-label room2">Saal GLITCH</div><div class="day_1 room-label room3">Saal ZIGZAG</div> 78<div class="day_1 room-label room1">Saal One</div><div class="day_1 room-label room2">Saal Zero</div><div class="day_1 room-label room3">Saal Ground</div><div class="day_1 room-label room4">Saal Fuse</div>
79<div class="day_2 room-label room1">Saal 1</div><div class="day_2 room-label room2">Saal GLITCH</div><div class="day_2 room-label room3">Saal ZIGZAG</div> 79<div class="day_2 room-label room1">Saal One</div><div class="day_2 room-label room2">Saal Zero</div><div class="day_2 room-label room3">Saal Ground</div><div class="day_2 room-label room4">Saal Fuse</div>
80<div class="day_3 room-label room1">Saal 1</div><div class="day_3 room-label room2">Saal GLITCH</div><div class="day_3 room-label room3">Saal ZIGZAG</div> 80<div class="day_3 room-label room1">Saal One</div><div class="day_3 room-label room2">Saal Zero</div><div class="day_3 room-label room3">Saal Ground</div><div class="day_3 room-label room4">Saal Fuse</div>
81<div class="day_4 room-label room1">Saal 1</div><div class="day_4 room-label room2">Saal GLITCH</div><div class="day_4 room-label room3">Saal ZIGZAG</div> 81<div class="day_4 room-label room1">Saal One</div><div class="day_4 room-label room2">Saal Zero</div><div class="day_4 room-label room3">Saal Ground</div><div class="day_4 room-label room4">Saal Fuse</div>
82 82
83<div class=" time_1815 duration_3600 guide pause pause1">P A U S E</div> 83<div class=" time_1815 duration_3600 guide pause pause1">P A U S E</div>
84<!--div class=" time_1950 duration_3600 guide pause ">P A U S E</div--> 84<!--div class=" time_1950 duration_3600 guide pause ">P A U S E</div-->
@@ -90,13 +90,14 @@
90 <div class="wholeday room1 day_3 guide uneven">Day 3</div> 90 <div class="wholeday room1 day_3 guide uneven">Day 3</div>
91 <div class="wholeday room1 day_4 guide">Day 4</div> 91 <div class="wholeday room1 day_4 guide">Day 4</div>
92 92
93 <div class="track" id="6"><h2>Security</h2></div> 93 <div class="track" id="31"><h2>Security</h2></div>
94 <div class="track" id="4"><h2>Hardware &amp; Making</h2></div> 94 <div class="track" id="32"><h2>Hardware &amp; Making</h2></div>
95 <div class="track" id="7"><h2>Ethics, Society &amp; Politics</h2></div> 95 <div class="track" id="28"><h2>Ethics, Society &amp; Politics</h2></div>
96 <div class="track" id="2"><h2>CCC</h2></div> 96 <div class="track" id="30"><h2>CCC</h2></div>
97 <div class="track" id="3"><h2>Entertainment</h2></div> 97 <div class="track" id="27"><h2>Entertainment</h2></div>
98 <div class="track" id="5"><h2>Science</h2></div> 98 <div class="track" id="29"><h2>Science</h2></div>
99 <div class="track" id="1"><h2>Art &amp; Beauty</div> 99 <div class="track" id="33"><h2>Art &amp; Beauty</div>
100 <!--div class="track" id="999"><h2>Other</div-->
100 101
101<footer class="footer"> 102<footer class="footer">
102 <div class="footer__filter-side"> 103 <div class="footer__filter-side">
@@ -107,7 +108,7 @@
107<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 28" enable-background="new 0 0 22 28"><style type="text/css">.st0{fill:none;}</style><path class="st0" d="M-854-2242h1400v3600h-1400v-3600z"/><path d="M0 0v28l22-14-22-14z"/><path class="st0" d="M-16-10h48v48h-48v-48z"/></svg> 108<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 28" enable-background="new 0 0 22 28"><style type="text/css">.st0{fill:none;}</style><path class="st0" d="M-854-2242h1400v3600h-1400v-3600z"/><path d="M0 0v28l22-14-22-14z"/><path class="st0" d="M-16-10h48v48h-48v-48z"/></svg>
108</div> 109</div>
109 <div class="info hidden"></div> 110 <div class="info hidden"></div>
110 <a class="export-url-a" download="38C3.ics" type="text/calendar" href="#"><div class="export-url hidden">38C3.ics</div></a> 111 <a class="export-url-a" download="39C3.ics" type="text/calendar" href="#"><div class="export-url hidden">39C3.ics</div></a>
111 <div id="qrcode" class="hidden"></div> 112 <div id="qrcode" class="hidden"></div>
112</footer> 113</footer>
113 114