furmeet_events_htmltable2ics/backend_code/templates/index.html
Adler Neves 4927f75fab
All checks were successful
continuous-integration/drone/push Build is passing
feature: multi-language initial implemeentation
2022-06-11 21:53:41 -03:00

372 lines
23 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Table to ICS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<header>
<h1>HTML Table to ICS</h1>
</header>
<main>
<section>
<h2>Simple</h2>
<form action="/convert.ics" method="get" enctype="application/x-www-form-urlencoded">
<div>
<label for="url">URL</label>
<input type="url" name="url" id="url" style="display: block; width: calc(100% - 10px);" required>
</div>
<div>
<fieldset>
<legend>Format</legend>
<input id="format_html_multi_table" type="radio" name="format" value="html_multi_table" checked>
<label for="format_html_multi_table">Multiple HTML tables</label><br>
<input id="format_html_table" type="radio" name="format" value="html_table">
<label for="format_html_table">Single HTML table</label><br>
<input id="format_csv" type="radio" name="format" value="csv">
<label for="format_csv">CSV</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Axes meaning</legend>
<input id="axis_cis" type="radio" name="axis" value="cis" checked>
<label for="axis_cis">Lines conveys time and columns conveys places</label><br>
<input id="axis_trans" type="radio" name="axis" value="trans">
<label for="axis_trans">Lines conveys places and columns conveys time</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Default language</legend>
<input id="lang_en" type="radio" name="lang" value="EN" checked>
<label for="lang_en">English</label><br>
<input id="lang_es" type="radio" name="lang" value="ES">
<label for="lang_es">Spanish</label><br>
<input id="lang_pt" type="radio" name="lang" value="PT">
<label for="lang_pt">Portuguese</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Non-default language refereces</legend>
<input id="content_suf" type="radio" name="content" value="name_lang" checked>
<label for="content_suf">Suffixed (activity name then language indication)</label><br>
<input id="content_pre" type="radio" name="content" value="lang_name">
<label for="content_pre">Prefixed (language indication then activity name)</label><br>
<input id="content_no" type="radio" name="content" value="name">
<label for="content_no">The table is not multi-language</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Default date (all fields are optional and defaults to the current date of the HTTP
request)</legend>
<label for="year">Year (4-digit number)</label>
<input type="number" name="year" id="year" style="display: block; width: calc(100% - 10px);"
placeholder="{{datetime.date.today().year}} (optional)">
<label for="month">Month (number)</label>
<input type="number" name="month" id="month" style="display: block; width: calc(100% - 10px);"
placeholder="{{datetime.date.today().month}} (optional)">
<label for="day">Day of the month (number)</label>
<input type="number" name="day" id="day" style="display: block; width: calc(100% - 10px);"
placeholder="{{datetime.date.today().day}} (optional)">
</fieldset>
</div>
<div>
<fieldset>
<legend>Timezone</legend>
<label for="tzcode">Code</label>
<input type="text" name="tzcode" id="tzcode" value="UTC"
style="display: block; width: calc(100% - 10px);">
<span>Shortcuts:</span>
<button type="button" class="tz">UTC</button>
<button type="button" class="tz">America/Sao_Paulo</button>
<button type="button" class="tz">America/Buenos_Aires</button>
<button type="button" class="tz">US/Hawaii</button>
<button type="button" class="tz">US/Alaska</button>
<button type="button" class="tz">US/Pacific</button>
<button type="button" class="tz">US/Mountain</button>
<button type="button" class="tz">US/Central</button>
<button type="button" class="tz">US/Eastern</button>
<button type="button" class="tz">Europe/London</button>
<button type="button" class="tz">Europe/Berlin</button>
<button type="button" class="tz">Europe/Lisbon</button>
<button type="button" class="tz">Europe/Rome</button>
<button type="button" class="tz">Europe/Madrid</button>
<button type="button" class="tz">Europe/Paris</button>
</fieldset>
</div>
<div>
<fieldset>
<legend>Ignoring events</legend>
<label for="ignore_names">Event names to ignore</label>
<input type="text" name="ignore_names" id="ignore_names"
style="display: block; width: calc(100% - 10px);"
placeholder="NOTHING,EMPTY,CLOSED,ETC,... (optional)">
<label for="ignore_names_sep">Separator</label>
<input type="text" name="ignore_names_sep" id="ignore_names_sep"
style="display: block; width: calc(100% - 10px);" placeholder="," value="," required>
</fieldset>
</div>
<div><button type="submit">Convert</button></div>
</form>
</section>
<section>
<h2>Multi-language</h2>
<form action="/multiconvert.json" method="get" enctype="application/x-www-form-urlencoded">
<h3>All languages</h3>
<div>
<div>
<fieldset>
<legend>Table merging strategy</legend>
<input id="ml_merging_strategy_positional" type="radio" name="ml_merging_strategy" value="positional"
checked>
<label for="ml_merging_strategy_positional">Positional equivalence</label><br>
<input id="ml_merging_strategy_expression" type="radio" name="ml_merging_strategy" value="expression">
<label for="ml_merging_strategy_expression">Use expression below</label><br>
<label for="ml_merging_expr">Merging expression</label>
<input type="text" name="ml_merging_expr" id="ml_merging_expr" placeholder="ônibus,bus,autobús,autocarro;grupo2,group2;turma3,..."
style="display: block; width: calc(100% - 10px);">
<label for="ml_isep">Inner sepparator</label>
<input type="text" name="ml_isep" id="ml_isep" value=","
style="display: block; width: calc(100% - 10px);">
<label for="ml_osep">Outer sepparator</label>
<input type="text" name="ml_osep" id="ml_osep" value=";"
style="display: block; width: calc(100% - 10px);">
</fieldset>
</div>
<div>
<fieldset>
<legend>Default date (all fields are optional and defaults to the current date of the HTTP
request)</legend>
<label for="ml_year">Year (4-digit number)</label>
<input type="number" name="ml_year" id="ml_year" style="display: block; width: calc(100% - 10px);"
placeholder="{{datetime.date.today().year}} (optional)">
<label for="ml_month">Month (number)</label>
<input type="number" name="ml_month" id="ml_month"
style="display: block; width: calc(100% - 10px);"
placeholder="{{datetime.date.today().month}} (optional)">
<label for="ml_day">Day of the month (number)</label>
<input type="number" name="ml_day" id="ml_day" style="display: block; width: calc(100% - 10px);"
placeholder="{{datetime.date.today().day}} (optional)">
</fieldset>
</div>
<div>
<fieldset>
<legend>Timezone</legend>
<label for="ml_tzcode">Code</label>
<input type="text" name="ml_tzcode" id="ml_tzcode" value="UTC"
style="display: block; width: calc(100% - 10px);">
<span>Shortcuts:</span>
<button type="button" class="tz2">UTC</button>
<button type="button" class="tz2">America/Sao_Paulo</button>
<button type="button" class="tz2">America/Buenos_Aires</button>
<button type="button" class="tz2">US/Hawaii</button>
<button type="button" class="tz2">US/Alaska</button>
<button type="button" class="tz2">US/Pacific</button>
<button type="button" class="tz2">US/Mountain</button>
<button type="button" class="tz2">US/Central</button>
<button type="button" class="tz2">US/Eastern</button>
<button type="button" class="tz2">Europe/London</button>
<button type="button" class="tz2">Europe/Berlin</button>
<button type="button" class="tz2">Europe/Lisbon</button>
<button type="button" class="tz2">Europe/Rome</button>
<button type="button" class="tz2">Europe/Madrid</button>
<button type="button" class="tz2">Europe/Paris</button>
</fieldset>
</div>
<div>
<fieldset>
<legend>Ignoring events</legend>
<label for="ml_ignore_names">Event names to ignore</label>
<input type="text" name="ml_ignore_names" id="ml_ignore_names"
style="display: block; width: calc(100% - 10px);"
placeholder="NOTHING,EMPTY,CLOSED,ETC,... (optional)">
<label for="ml_ignore_names_sep">Separator</label>
<input type="text" name="ml_ignore_names_sep" id="ml_ignore_names_sep"
style="display: block; width: calc(100% - 10px);" placeholder="," value="," required>
</fieldset>
</div>
</div>
<h3>English</h3>
<div>
<div>
<label for="en_url">URL</label>
<input type="en_url" name="en_url" id="en_url" style="display: block; width: calc(100% - 10px);"
required>
</div>
<div>
<fieldset>
<legend>Format</legend>
<input id="en_format_html_multi_table" type="radio" name="en_format" value="html_multi_table"
checked>
<label for="en_format_html_multi_table">Multiple HTML tables</label><br>
<input id="en_format_html_table" type="radio" name="en_format" value="html_table">
<label for="en_format_html_table">Single HTML table</label><br>
<input id="en_format_csv" type="radio" name="en_format" value="csv">
<label for="en_format_csv">CSV</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Axes meaning</legend>
<input id="en_axis_cis" type="radio" name="en_axis" value="cis" checked>
<label for="en_axis_cis">Lines conveys time and columns conveys places</label><br>
<input id="en_axis_trans" type="radio" name="en_axis" value="trans">
<label for="en_axis_trans">Lines conveys places and columns conveys time</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Default language</legend>
<input id="en_lang_en" type="radio" name="en_lang" value="EN" checked>
<label for="en_lang_en">English</label><br>
<input id="en_lang_es" type="radio" name="en_lang" value="ES">
<label for="en_lang_es">Spanish</label><br>
<input id="en_lang_pt" type="radio" name="en_lang" value="PT">
<label for="en_lang_pt">Portuguese</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Non-default language refereces</legend>
<input id="en_content_suf" type="radio" name="en_content" value="name_lang" checked>
<label for="en_content_suf">Suffixed (activity name then language indication)</label><br>
<input id="en_content_pre" type="radio" name="en_content" value="lang_name">
<label for="en_content_pre">Prefixed (language indication then activity name)</label><br>
<input id="en_content_no" type="radio" name="en_content" value="name">
<label for="en_content_no">The table is not multi-language</label><br>
</fieldset>
</div>
</div>
<h3>Spanish</h3>
<div>
<div>
<label for="es_url">URL</label>
<input type="es_url" name="es_url" id="es_url" style="display: block; width: calc(100% - 10px);"
required>
</div>
<div>
<fieldset>
<legend>Format</legend>
<input id="es_format_html_multi_table" type="radio" name="es_format" value="html_multi_table"
checked>
<label for="es_format_html_multi_table">Multiple HTML tables</label><br>
<input id="es_format_html_table" type="radio" name="es_format" value="html_table">
<label for="es_format_html_table">Single HTML table</label><br>
<input id="es_format_csv" type="radio" name="es_format" value="csv">
<label for="es_format_csv">CSV</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Axes meaning</legend>
<input id="es_axis_cis" type="radio" name="es_axis" value="cis" checked>
<label for="es_axis_cis">Lines conveys time and columns conveys places</label><br>
<input id="es_axis_trans" type="radio" name="es_axis" value="trans">
<label for="es_axis_trans">Lines conveys places and columns conveys time</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Default language</legend>
<input id="es_lang_en" type="radio" name="es_lang" value="EN" checked>
<label for="es_lang_en">English</label><br>
<input id="es_lang_es" type="radio" name="es_lang" value="ES">
<label for="es_lang_es">Spanish</label><br>
<input id="es_lang_pt" type="radio" name="es_lang" value="PT">
<label for="es_lang_pt">Portuguese</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Non-default language refereces</legend>
<input id="es_content_suf" type="radio" name="es_content" value="name_lang" checked>
<label for="es_content_suf">Suffixed (activity name then language indication)</label><br>
<input id="es_content_pre" type="radio" name="es_content" value="lang_name">
<label for="es_content_pre">Prefixed (language indication then activity name)</label><br>
<input id="es_content_no" type="radio" name="es_content" value="name">
<label for="es_content_no">The table is not multi-language</label><br>
</fieldset>
</div>
</div>
<h3>Portuguese</h3>
<div>
<div>
<label for="pt_url">URL</label>
<input type="pt_url" name="pt_url" id="pt_url" style="display: block; width: calc(100% - 10px);"
required>
</div>
<div>
<fieldset>
<legend>Format</legend>
<input id="pt_format_html_multi_table" type="radio" name="pt_format" value="html_multi_table"
checked>
<label for="pt_format_html_multi_table">Multiple HTML tables</label><br>
<input id="pt_format_html_table" type="radio" name="pt_format" value="html_table">
<label for="pt_format_html_table">Single HTML table</label><br>
<input id="pt_format_csv" type="radio" name="pt_format" value="csv">
<label for="pt_format_csv">CSV</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Axes meaning</legend>
<input id="pt_axis_cis" type="radio" name="pt_axis" value="cis" checked>
<label for="pt_axis_cis">Lines conveys time and columns conveys places</label><br>
<input id="pt_axis_trans" type="radio" name="pt_axis" value="trans">
<label for="pt_axis_trans">Lines conveys places and columns conveys time</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Default language</legend>
<input id="pt_lang_en" type="radio" name="pt_lang" value="EN" checked>
<label for="pt_lang_en">English</label><br>
<input id="pt_lang_es" type="radio" name="pt_lang" value="ES">
<label for="pt_lang_es">Spanish</label><br>
<input id="pt_lang_pt" type="radio" name="pt_lang" value="PT">
<label for="pt_lang_pt">Portuguese</label><br>
</fieldset>
</div>
<div>
<fieldset>
<legend>Non-default language refereces</legend>
<input id="pt_content_suf" type="radio" name="pt_content" value="name_lang" checked>
<label for="pt_content_suf">Suffixed (activity name then language indication)</label><br>
<input id="pt_content_pre" type="radio" name="pt_content" value="lang_name">
<label for="pt_content_pre">Prefixed (language indication then activity name)</label><br>
<input id="pt_content_no" type="radio" name="pt_content" value="name">
<label for="pt_content_no">The table is not multi-language</label><br>
</fieldset>
</div>
</div>
<h3>Submit</h3>
<div><button type="submit">Convert</button></div>
</form>
</section>
</main>
<footer>
Favicon by <a
href="https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/blob/master/Adwaita/scalable/mimetypes/x-office-calendar-symbolic.svg">Gnome
Project</a>
</footer>
<script>
for (let fsasfdadf of [...document.querySelectorAll('button.tz')])
fsasfdadf.addEventListener('click', (ev) => {
ev.preventDefault();
tzcode.value = fsasfdadf.innerText;
});
for (let fsasfdadf of [...document.querySelectorAll('button.tz2')])
fsasfdadf.addEventListener('click', (ev) => {
ev.preventDefault();
ml_tzcode.value = fsasfdadf.innerText;
});
</script>
</body>
</html>