Search on legal documents using Tensorflow and a web_actix web interface
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.

305 lines
12 KiB

3 years ago
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <title>{{ "link_title"|tr(lang) }} – {{ "index_title"|tr(lang) }}</title>
  7. <meta name="robots" content="noindex" />
  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.svg" />
  11. <link rel="stylesheet" href="/assets/index.css?v=1.0" />
  12. <link rel="stylesheet" href="/assets/cloud.css?v=1.0" />
  13. <link rel="stylesheet" href="/assets/digitalcourage.css" />
  14. <link rel="stylesheet" href="/assets/bootstrap.min.css" />
  15. <script type="text/javascript">
  16. window.onload = function () {
  17. // show link copy button if javascript is enabled
  18. document.getElementById("script-copy").style.display = "unset";
  19. let btn = document.getElementById("script-copy-btn");
  20. btn.style.cursor = "pointer";
  21. let csrf_token = "{{ csrf_token }}";
  22. let lang = "{{ lang }}";
  23. document.getElementById('langs').value=lang;
  24. document.getElementById('new_link_button').addEventListener('click', function () {
  25. new_link(csrf_token);
  26. });
  27. btn.addEventListener('click', function() {
  28. var copyText = document.getElementById("link");
  29. /* Select the text field */
  30. copyText.select();
  31. copyText.setSelectionRange(0, 99999);
  32. document.execCommand("copy");
  33. btn.innerHTML = '{{ "link_copied"|tr(lang) }}';
  34. });
  35. function ValidateEmail(mail)
  36. {
  37. if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(mail))
  38. {
  39. return (true)
  40. }
  41. alert("Die eingegebene Mail Adresse ist ungültig. Sie können sich auch anmelden, ohne den Token zugeschickt zu bekommen.")
  42. return (false)
  43. }
  44. document.getElementById("email-register").style.display = "unset";
  45. let btn2 = document.getElementById("email-register-btn");
  46. btn2.style.cursor = "pointer";
  47. btn2.addEventListener('click', function() {
  48. var email = document.getElementById("email").value;
  49. var adtok = document.getElementById("link").value;
  50. console.log(email);
  51. var validation = ValidateEmail(email);
  52. /* var emailjsonstring = JSON.stringify(JSON.parse(document.getElementById('email'))); */
  53. if (validation == true)
  54. {
  55. var xhr1=new XMLHttpRequest();
  56. xhr1.open("POST",'link/email', true);
  57. xhr1.send(email + ',' + adtok + '\n');
  58. document.getElementById("email").value = "Die Email ist auf dem Weg";
  59. }
  60. });
  61. }
  62. function new_link(csrf) {
  63. var sel = document.getElementById('langs');
  64. let opt = getSelectedOption(sel);
  65. let lang = opt.value;
  66. document.getElementById('langs').value = lang;
  67. document.getElementById("link_lang").value = lang;
  68. document.getElementById("csrf_token").value = csrf;
  69. document.getElementById('new_link').submit();
  70. document.getElementById('new_link_button').classList.add("hidden");
  71. document.getElementById('loading_ring').classList.remove("hidden");
  72. }
  73. function getSelectedOption(sel) {
  74. var opt;
  75. for ( var i = 0, len = sel.options.length; i < len; i++ ) {
  76. opt = sel.options[i];
  77. if ( opt.selected === true ) {
  78. break;
  79. }
  80. }
  81. return opt;
  82. }
  83. </script>
  84. <style>
  85. .break {
  86. flex-basis: 100%;
  87. height: 0;
  88. }
  89. .div_120 {
  90. flex-basis: 100%;
  91. height: 120px;
  92. }
  93. .div_45 {
  94. flex-basis: 100%;
  95. height: 45px;
  96. }
  97. .div_35 {
  98. flex-basis: 100%;
  99. height: 35px;
  100. }
  101. .div_25 {
  102. flex-basis: 100%;
  103. height: 25px;
  104. }
  105. .div_10 {
  106. flex-basis: 100%;
  107. height: 10px;
  108. }
  109. .grid-container {
  110. display: grid;
  111. grid-template-columns: auto auto;
  112. width: 725px;
  113. grid-gap: 25px;
  114. }
  115. .grid-container2 {
  116. display: grid;
  117. grid-template-columns: auto auto auto;
  118. width: 532px;
  119. grid-gap: 20px;
  120. }
  121. @media only screen and (max-width: 768px) {
  122. /* For mobile phones: */
  123. [class*="grid-container"] {
  124. grid-template-columns: auto;
  125. max-width: 100%;
  126. justify-content: center;
  127. }
  128. [class*="grid-container2"] {
  129. grid-template-columns: auto;
  130. max-width: 100%;
  131. justify-content: center;
  132. }
  133. [class*="item2"] {
  134. grid-template-columns: auto;
  135. max-width: 100%;
  136. align-items: center;
  137. }
  138. }
  139. .center {
  140. display: flex;
  141. justify-content: center;
  142. align-items: center;
  143. }
  144. .item1 {
  145. width: 350px;
  146. height: 200px;
  147. display: flex;
  148. justify-content: center;
  149. align-items: center;
  150. }
  151. .item2 {
  152. width: 350px;
  153. height: 200px;
  154. #display: flex;
  155. #justify-content: center;
  156. #align-items: center;
  157. }
  158. .h2 {
  159. font-size: 30pt;
  160. }
  161. p {
  162. font-size: 16pt;
  163. }
  164. .downDC {
  165. height: 90px;
  166. padding: 10px;
  167. }
  168. .c-img-shadow {
  169. height: 200px;
  170. max-width: 100%;
  171. box-shadow: 0 0 5px rgba(0, 0, 0, 0.18),0 5px 5px rgba(0, 0, 0, 0.18);
  172. border-radius: 2px;
  173. }
  174. </style>
  175. <body>
  176. <div class="container ombre">
  177. <header role="banner" class="clearfix">
  178. <form id="new_link" method="post" action="/link" class="hidden-print">
  179. <div class="input-group input-group-sm pull-right col-xs-12 col-sm-2 langs" style="margin-right: 8px">
  180. <select id="langs" name="lang" class="form-control" title="Select language" >
  181. <option lang="fr" value="fr">Fran&ccedil;ais</option>
  182. <option lang="en" selected value="en">English</option>
  183. <option lang="oc" value="oc">Occitan</option>
  184. <option lang="es" value="es">Espa&ntilde;ol</option>
  185. <option lang="de" value="de">Deutsch</option>
  186. <option lang="nl" value="nl">Dutch</option>
  187. <option lang="it" value="it">Italiano</option>
  188. <option lang="br" value="br">Brezhoneg</option>
  189. </select>
  190. <input id="csrf_token" name="csrf_token" type="text" class="hidden">
  191. <input id="link_lang" name="link_lang" type="text" class="hidden">
  192. <span class="input-group-btn">
  193. <a id="new_link_button" class="btn btn-default btn-sm language_button" title="Change language">OK</a>
  194. </span>
  195. </div>
  196. </form>
  197. <a href="https&colon;&sol;&sol;foorms&period;digitalcourage&period;de&sol;" title="Home - foorms" style="margin-left: 8px" >
  198. <img src="/assets/foorms_logo_beta.svg" alt="foorms" class="" height="58vh" />
  199. </a>
  200. <h2 class="lead col-xs-12"></h2> <div class="trait col-xs-12" role="presentation"></div>
  201. </header>
  202. <main role="main">
  203. <center>
  204. <div class="has-text-centered">
  205. <br />
  206. <h2>{{ "link_title"|tr(lang) }}</h2>
  207. <div class="div_25"> </div>
  208. <p>{{ "link_desc1_1"|tr(lang)|safe }}</p>
  209. <div class="break"> </div>
  210. <p>{{ "link_desc1_2"|tr(lang)|safe }}</p>
  211. <div class="div_25"> </div>
  212. <div class="c-flex c-jumbo">
  213. <input id="link" class="ncstyle-input" type="text" style='font-size: 16px; text-align:center' size="80" readonly value="{{ config.sncf_url }}/admin/{{ admin_token }}" />
  214. </div>
  215. <div class="div_35"> </div>
  216. <div id="script-copy">
  217. <div class="c-flex">
  218. <a id="script-copy-btn" class="ncstyle-button margin-bottom">{{ "link_copy"|tr(lang) }}</a>
  219. </div>
  220. </div>
  221. <div class="div_120"> </div>
  222. <p>{{ "link_desc2_1"|tr(lang)|safe }}</p>
  223. <div class="break"> </div>
  224. <p>{{ "link_desc2_2"|tr(lang)|safe }}</p>
  225. <div class="div_25"> </div>
  226. <div class="c-flex">
  227. <input id="email" class="ncstyle-input" style="text-align:center;" type="text" value="Send_Password_Link@invalid" />
  228. </div>
  229. <div class="div_35"> </div>
  230. <div id="email-register">
  231. <div class="c-flex">
  232. <a id="email-register-btn" class="ncstyle-button margin-bottom">{{ "link_mail"|tr(lang) }}</a>
  233. </div>
  234. <div class="div_120"> </div>
  235. </div>
  236. <p>{{ "link_desc3_1"|tr(lang) }}</p>
  237. <div class="break"></div>
  238. <p>{{ "link_desc3_2"|tr(lang) }}</p>
  239. <div class=div_35></div>
  240. <div class="c-flex">
  241. <a id="forms-btn" class="ncstyle-button margin-bottom" href="{{ config.sncf_url }}/admin/{{ admin_token }}">{{ "link_access_btn"|tr(lang) }}</a>
  242. </div>
  243. </div>
  244. <div class="div_120"></div>
  245. </center>
  246. <center>
  247. <div class="c-blue grid-container2">
  248. <a href="https://42l.fr/Rapport-technique" style="font-size:15px;" class="c-button" target="_blank">{{ "index_bottom_docs"|tr(lang) }}</a>
  249. <a href="https://git.42l.fr/neil/sncf" style="font-size:15px;" class="c-button" target="_blank">{{ "index_bottom_source"|tr(lang) }}</a>
  250. <a href="https://git.42l.fr/neil/sncf/src/branch/root/LICENSE" style="font-size:15px;" class="c-button" target="_blank">{{ "index_bottom_lic"|tr(lang) }}</a>
  251. </div>
  252. </center>
  253. <div class="div_10"></div>
  254. <div class="div_10"></div>
  255. <div class="div_10"></div>
  256. </main>
  257. </div> <!-- .container -->
  258. <div class="container ombre downDC" style="display:flex; align-items:center;">
  259. <h2 class="lead"><a target="_blank" href="https://digitalcourage.de/">Digitalcourage</a> | <a target="_blank" href="https://digitalcourage.de/newsletter">Newsletter</a> | <a target="_blank" href="https://digitalcourage.de/spenden">{{ "impressum_donations"|tr(lang)|safe }}</a> | <a target="_blank" href="https://digitalcourage.de/en">Impressum</a> | <a target="_blank" href="https://digitalcourage.de/en">{{ "impressum_privacy"|tr(lang)|safe }}</a> </h2>
  260. </div>
  261. </body>
  262. </html>