mirror of
https://git.42l.fr/neil/sncf.git
synced 2024-05-26 20:32:14 +02:00
implement access your forms button, fixes #30
This commit is contained in:
parent
0d38e2f2d4
commit
9fecf9ace9
|
@ -144,6 +144,10 @@ body, html {
|
|||
transition: all .25s ease-in-out;
|
||||
}
|
||||
|
||||
.ncstyle-button:not(:last-child) {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.margin-bottom {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
|
|
@ -13,14 +13,14 @@
|
|||
<script>
|
||||
/* junk javascript with basic spambot protection features.
|
||||
Drunk indentation is vim's fault.
|
||||
unsatisifed? Please make a PR. : ) */
|
||||
window.onload = function() {
|
||||
// retrieved from server-side template
|
||||
let csrf_token = "{{ csrf_token }}";
|
||||
document.getElementById('new_link_button').addEventListener('click', function () {
|
||||
new_link(csrf_token);
|
||||
});
|
||||
}
|
||||
unsatisifed? Please make a PR. : ) */
|
||||
window.onload = function() {
|
||||
// retrieved from server-side template
|
||||
let csrf_token = "{{ csrf_token }}";
|
||||
document.getElementById('new_link_button').addEventListener('click', function () {
|
||||
new_link(csrf_token);
|
||||
});
|
||||
}
|
||||
|
||||
function new_link(csrf) {
|
||||
document.getElementById("csrf_token").value = csrf;
|
||||
|
@ -48,9 +48,13 @@
|
|||
<noscript>
|
||||
<a class="ncstyle-button margin-bottom">{{ "index_nojs"|tr(lang) }}</a>
|
||||
</noscript>
|
||||
{% if sncf_admin_token.is_some() %}
|
||||
<a href="{{ sncf_admin_token.as_ref().unwrap() }}" class="ncstyle-button margin-bottom">{{ "index_continueform_button"|tr(lang) }}</a>
|
||||
{% endif %}
|
||||
<form id="new_link" action="/link" method="post">
|
||||
<input id="csrf_token" name="csrf_token" type="text" class="hidden">
|
||||
<a id="new_link_button" class="click jsonly ncstyle-button margin-bottom">{{ "index_createform_button"|tr(lang) }}</a> </form>
|
||||
<a id="new_link_button" class="click jsonly ncstyle-button margin-bottom">{{ "index_createform_button"|tr(lang) }}</a>
|
||||
</form>
|
||||
<div id="loading_ring" class="hidden lds-ring"><div></div><div></div><div></div><div></div></div>
|
||||
</div>
|
||||
<a class="scroll-down-link scroll-down-arrow"></a>
|
||||
|
|
Loading…
Reference in a new issue