landing.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html lang='en'>
  3. <head>
  4. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  5. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  6. <title><?=$page->title?></title>
  7. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  8. <!-- CSS files -->
  9. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  10. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>landing.css'/>
  11. <!-- Script files -->
  12. <script src="<?=$path["js"]?>ui.js"></script>
  13. <!-- Meta tags -->
  14. <link rel='canonical' href='<?=$page->canonical?>'/>
  15. <link rel='author' href='<?=$page->author?>'/>
  16. <link rel='publisher' href='<?=$page->author?>'/>
  17. <meta name='description' content='<?=$page->description?>'/>
  18. <meta property='og:title' content='<?=$page->title?>'/>
  19. <meta property='og:url' content='<?=$page->canonical?>'/>
  20. <meta property='og:description' content='<?=$page->description?>'/>
  21. <meta property='og:image' content='<?=$page->icon?>'/>
  22. <meta property='og:site_name' content='<?=$page->name?>'/>
  23. <meta property='og:type' content='website'/>
  24. <meta property='og:locale' content='en'/>
  25. <meta name='twitter:card' content='summary'/>
  26. <meta name='twitter:title' content='<?=$page->title?>'/>
  27. <meta name='twitter:description' content='<?=$page->description?>'/>
  28. <meta name='twitter:image' content='<?=$page->icon?>'/>
  29. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  30. <meta name='robots' content='index follow'/>
  31. <script>
  32. /**
  33. * Performs the login action, andrredirects to the user home page.
  34. *
  35. * Intended to be called before parsing form action.
  36. *
  37. * @return Always false, to stop th actual form to be submitted.
  38. */
  39. function login(){
  40. sel = document.getElementById('uid');
  41. uid = sel.options[sel.selectedIndex].value;
  42. if (uid.match(/^[0-9]{7}$/g) != null){
  43. document.location='/' + uid + '/';
  44. }
  45. //else{
  46. // TODO alert('N UID');
  47. //}
  48. return false;
  49. }
  50. </script>
  51. </head>
  52. <body>
  53. <?php
  54. include __DIR__ . "/inc/header.php";
  55. ?>
  56. <section class='list'>
  57. <h2>
  58. Select player
  59. </h2>
  60. <article>
  61. <!-- TODO: Action via JS, and fllback in controller -->
  62. <form method='GET' action='/' onsubmit="return login();">
  63. <select id='uid' name='uid'>
  64. <option value='0'> </option>
  65. <?php
  66. foreach ($page->players as $player_id => $player_name){
  67. ?>
  68. <option value='<?=$player_id?>'><?=$player_name?></option>
  69. <?php
  70. }
  71. ?>
  72. </select>
  73. <input type='submit' value='Go'/>
  74. </form>
  75. </article>
  76. </section> <!-- #catalog -->
  77. <?php
  78. include __DIR__ . "/inc/footer.php";
  79. ?>
  80. </body>
  81. </html>