Skip to content

Commit

Permalink
Yologen : add languages buttons + disclaimer (#2255)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Aubin <[email protected]>
  • Loading branch information
lapineige and alexAubin authored Apr 23, 2024
1 parent 1599c77 commit 6750744
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion tools/app_generator/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,38 @@
{% block content %}
<div class="container" style="max-width: 800px;">
<h1 class="message text-center">{{ gettext("Yunohost application generation form") }}</h1>
<p style="text-align: center; margin-left:5%">Version: {{ generator_info['GENERATOR_VERSION'] }}</p>
<p style="text-align: center">Version: {{ generator_info['GENERATOR_VERSION'] }}</p>

<!--
<script>/*
document.addEventListener('DOMContentLoaded', function() {
var selectField = document.getElementById('selectLanguage');
selectField.addEventListener('change', function() {
var lang = this.value;
// alert("Switching to language: "+ this.value);
if (lang != 'none') {
var url = window.location.href; // Get current URL
var newURL = url + '/language/' + lang
window.location.href = newURL
}
});
});
</script> -->
<script>
function changeLanguage(lang) {
var url = "{{ url_for('set_language', language=lang) }}" + lang;
window.location.href = url;
}
</script>



<div style="text-align:center">
{% for lang in AVAILABLE_LANGUAGES.items() %}
<button type="button" onclick="changeLanguage('{{ lang[0] }}')">{{ lang[1] }}</button>
{% endfor %}
</div>


<form id="main-form" class="form form-horizontal" method="POST" role="form">
{{ main_form.hidden_tag() }}
Expand Down

0 comments on commit 6750744

Please sign in to comment.