]> git.cworth.org Git - turbot-web/commitdiff
Add code to auto-refresh each HTML page main
authorAvram Gottschlich <avram.gottschlich@gmail.com>
Thu, 12 Jan 2023 05:58:23 +0000 (21:58 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 12 Jan 2023 05:58:23 +0000 (21:58 -0800)
This is a simple http-equiv attribute on a meta tag telling the browser
to reload the page every 15 seconds. That should at least get the job
done.

Also add a link to the turbot documentation to the generated pages.

html_generator.py

index 0fef3d421c3f1b9158a7e97932f07b43342b24a6..f18703211897d73f90fdec216645e24f22a53e33 100644 (file)
@@ -145,6 +145,7 @@ def overview(hunt, puzzles, rounds):
      '<head>\n',
      '  <meta charset="utf-8">\n',
      '  <meta name="viewport" content="width=device-width, initial-scale=1">\n',
+     '  <meta http-equiv="refresh" content = "15">\n',
      '\n',
      '  <link rel="stylesheet" href="/overview.css">\n',
      '  <script type="text/javascript">\n',
@@ -162,12 +163,13 @@ def overview(hunt, puzzles, rounds):
      '  <title>Hunt Overview</title>\n',
      '  <script src="/sorttable.js"></script>\n'
      '</head>\n',
-     '    <div class="sidenav">\n'
-     '      <a href="index.html">Hunt Overview</a>'
-     '      <a href="all.html">All Puzzles</a>\n'
-     '      <a href="unsolved.html">Unsolved</a>\n'
-     '      <a href="solved.html">Solved</a>\n'
-     '    </div>\n'
+     '    <div class="sidenav">\n',
+     '      <a href="index.html">Hunt Overview</a>',
+     '      <a href="all.html">All Puzzles</a>\n',
+     '      <a href="unsolved.html">Unsolved</a>\n',
+     '      <a href="solved.html">Solved</a>\n',
+     '      <a href="https://docs.google.com/document/d/14Ww6vWFO4hx1GYz8zDRxP_rI_v4hmRgdgYmN91F-Lqk/edit" target="_blank" rel="noreferrer noopener">Turbot Docs</a>\n'
+     '    </div>\n',
      '<body>\n',]
     columns = ['  <div class="row">\n']
     expanding = []
@@ -238,6 +240,7 @@ def round_overview(hunt, rnd, puzzles):
      '        <link rel="stylesheet" href="/individual.css">\n',
      '        <title>Mystery Hunt 2022</title>\n',
      '        <script src="/sorttable.js"></script>\n',
+     '        <meta http-equiv="refresh" content = "15">\n',
      '    </head>\n',
      '    <body class="{}">\n'.format(status),
      '        <h1><b>{}</b></h1>\n'.format(rnd),
@@ -322,6 +325,7 @@ def puzzle_overview(hunt, puzzle):
      '<head>\n',
      '    <meta charset="utf-8">\n',
      '    <meta name="viewport" content="width=device-width, initial-scale=1">\n',
+     '    <meta http-equiv="refresh" content = "15">\n',
      '    <link rel="stylesheet" href="/individual.css">\n',
      '    <title>{}</title>\n'.format(name+meta),
      '    <p>{}</p>'.format(link(internal_link(hunt, 'index') + ".html", 'Hunt Overview')),
@@ -371,13 +375,15 @@ def puzzle_lists(hunt, puzzles, filt):
      '        <link rel="stylesheet" href="/overview.css">\n',
      '        <title>Mystery Hunt 2022</title>\n',
      '        <script src="/sorttable.js"></script>\n',
+     '        <meta http-equiv="refresh" content = "15">\n',
      '    </head>\n',
-     '    <div class="sidenav">\n'
-     '      <a href="index.html">Hunt Overview</a>'
-     '      <a href="all.html">All Puzzles</a>\n'
-     '      <a href="unsolved.html">Unsolved</a>\n'
-     '      <a href="solved.html">Solved</a>\n'
-     '    </div>\n'
+     '    <div class="sidenav">\n',
+     '      <a href="index.html">Hunt Overview</a>',
+     '      <a href="all.html">All Puzzles</a>\n',
+     '      <a href="unsolved.html">Unsolved</a>\n',
+     '      <a href="solved.html">Solved</a>\n',
+     '      <a href="https://docs.google.com/document/d/14Ww6vWFO4hx1GYz8zDRxP_rI_v4hmRgdgYmN91F-Lqk/edit" target="_blank" rel="noreferrer noopener">Turbot Docs</a>\n'
+     '    </div>\n',
      '    <body>\n',
      '        <h1><b>{}</b></h1>\n'.format('{} Puzzles').format(filt),
      '        <p>{}</p>\n'.format(link(internal_link(hunt, 'index') + ".html", 'Hunt Overview')),