You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
4.7 KiB

3 years ago
3 years ago
3 years ago
3 years ago
  1. <!doctype html>
  2. <html lang="{{ lang }}">
  3. <head>
  4. <title>{{ "link_title"|tr(lang) }} – {{ "index_title"|tr(lang) }}</title>
  5. <meta charset="utf-8" />
  6. <meta name="robots" content="noindex" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <meta name="description" content="{{ "meta_description"|tr(lang) }}" />
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <link rel="icon" type="image/png" sizes="48x48" href="/assets/favicon.ico" />
  11. <link rel="stylesheet" href="/assets/index.css?v=1.0" />
  12. <link rel="stylesheet" href="/assets/cloud.css?v=1.0" />
  13. <script type="text/javascript">
  14. window.onload = function () {
  15. // show link copy button if javascript is enabled
  16. document.getElementById("script-copy").style.display = "unset";
  17. let btn = document.getElementById("script-copy-btn");
  18. btn.style.cursor = "pointer";
  19. btn.addEventListener('click', function() {
  20. var copyText = document.getElementById("link");
  21. /* Select the text field */
  22. copyText.select();
  23. copyText.setSelectionRange(0, 99999);
  24. document.execCommand("copy");
  25. btn.innerHTML = '{{ "link_copied"|tr(lang) }}';
  26. });
  27. document.getElementById("email-register").style.display = "unset";
  28. let btn2 = document.getElementById("email-register-btn");
  29. btn2.style.cursor = "pointer";
  30. btn2.addEventListener('click', function() {
  31. var email = document.getElementById("email").value;
  32. var adtok = document.getElementById("link").value;
  33. console.log(email);
  34. /* var emailjsonstring = JSON.stringify(JSON.parse(document.getElementById('email'))); */
  35. var xhr1=new XMLHttpRequest();
  36. xhr1.open("POST",'link/email', true);
  37. xhr1.send(email + ',' + adtok);
  38. });
  39. }
  40. </script>
  41. <body>
  42. <div class="navbar has-text-centered page-heading"></div>
  43. <div class="fullheight-nav">
  44. <div class="c-flex c-jumbo">
  45. <div class="c-fullwidth">
  46. <div class="has-text-centered">
  47. <br />
  48. <h2>{{ "link_title"|tr(lang) }}</h2>
  49. <p>{{ "link_desc1"|tr(lang)|safe }}</p>
  50. <p>{{ "link_desc2"|tr(lang)|safe }}</p>
  51. <br />
  52. <div class="c-flex">
  53. <input id="link" class="ncstyle-input" type="text" readonly value="{{ config.sncf_url }}/admin/{{ admin_token }}" />
  54. </div>
  55. <br />
  56. <br />
  57. <div id="script-copy">
  58. <br />
  59. <div class="c-flex">
  60. <a id="script-copy-btn" class="ncstyle-button margin-bottom">{{ "link_copy"|tr(lang) }}</a>
  61. </div>
  62. <br />
  63. </div>
  64. <div class="c-flex">
  65. <input id="email" class="ncstyle-input" type="text" value="ivalid@mail.com" />
  66. </div>
  67. <br />
  68. <div id="email-register">
  69. <br />
  70. <div class="c-flex">
  71. <a id="email-register-btn" class="ncstyle-button margin-bottom" href="{{ config.sncf_url }}/admin/{{ admin_token }}">register via email</a>
  72. </div>
  73. <br />
  74. </div>
  75. <p>{{ "link_desc3"|tr(lang) }}</p>
  76. <br />
  77. <div class="c-flex">
  78. <a id="forms-btn" class="ncstyle-button margin-bottom" href="{{ config.sncf_url }}/admin/{{ admin_token }}">{{ "link_access_btn"|tr(lang) }}</a>
  79. </div>
  80. <br />
  81. <p>{{ "link_note"|tr(lang) }}{{ config.prune_days }}{{ "link_note2"|tr(lang) }}</p>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </body>
  87. </html>