Update website

This commit is contained in:
Guilhem Lavaux 2024-11-19 08:02:04 +01:00
parent 4413528994
commit 1d90fbf296
6865 changed files with 1091082 additions and 0 deletions

View file

@ -0,0 +1,119 @@
<form class="rte_form" action="{{ url('/database/events') }}" method="post">
{{ get_hidden_inputs(db) }}
<input name="{{ mode }}_item" type="hidden" value="1">
{% if mode == 'edit' %}
<input name="item_original_name" type="hidden" value="{{ event.item_original_name }}">
{% endif %}
<div class="card">
<div class="card-header">
{% trans 'Details' %}
{% if mode != 'edit' %}
{{ show_mysql_docu('CREATE_EVENT') }}
{% endif %}
</div>
<div class="card-body">
<table class="rte_table table table-borderless table-sm">
<tr>
<td>{% trans 'Event name' %}</td>
<td>
<input type="text" name="item_name" value="{{ event.item_name }}" maxlength="64">
</td>
</tr>
<tr>
<td>{% trans 'Status' %}</td>
<td>
<select name="item_status">
{% for status in status_display %}
<option value="{{ status }}"{{ status == event.item_status ? ' selected' }}>{{ status }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td>{% trans 'Event type' %}</td>
<td>
{% if is_ajax %}
<select name="item_type">
{% for type in event_type %}
<option value="{{ type }}"{{ type == event.item_type ? ' selected' }}>{{ type }}</option>
{% endfor %}
</select>
{% else %}
<input name="item_type" type="hidden" value="{{ event.item_type }}">
<div class="fw-bold text-center w-50">
{{ event.item_type }}
</div>
<input type="submit" name="item_changetype" class="w-50" value="{{ 'Change to %s'|trans|format(event.item_type_toggle) }}">
{% endif %}
</td>
</tr>
<tr class="onetime_event_row{{ event.item_type != 'ONE TIME' ? ' hide' }}">
<td>{% trans 'Execute at' %}</td>
<td class="text-nowrap">
<input type="text" name="item_execute_at" value="{{ event.item_execute_at }}" class="datetimefield">
</td>
</tr>
<tr class="recurring_event_row{{ event.item_type != 'RECURRING' ? ' hide' }}">
<td>{% trans 'Execute every' %}</td>
<td>
<input class="w-50" type="text" name="item_interval_value" value="{{ event.item_interval_value }}">
<select class="w-50" name="item_interval_field">
{% for interval in event_interval %}
<option value="{{ interval }}"{{ interval == event.item_interval_field ? ' selected' }}>{{ interval }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr class="recurring_event_row{{ event.item_type != 'RECURRING' ? ' hide' }}">
<td>{% trans %}Start{% context %}Start of recurring event{% endtrans %}</td>
<td class="text-nowrap">
<input type="text" name="item_starts" value="{{ event.item_starts }}" class="datetimefield">
</td>
</tr>
<tr class="recurring_event_row{{ event.item_type != 'RECURRING' ? ' hide' }}">
<td>{% trans %}End{% context %}End of recurring event{% endtrans %}</td>
<td class="text-nowrap">
<input type="text" name="item_ends" value="{{ event.item_ends }}" class="datetimefield">
</td>
</tr>
<tr>
<td>{% trans 'Definition' %}</td>
<td>
<textarea name="item_definition" rows="15" cols="40">
{{- event.item_definition -}}
</textarea>
</td>
</tr>
<tr>
<td>{% trans 'On completion preserve' %}</td>
<td>
<input type="checkbox" name="item_preserve"{{ event.item_preserve|raw }}>
</td>
</tr>
<tr>
<td>{% trans 'Definer' %}</td>
<td>
<input type="text" name="item_definer" value="{{ event.item_definer }}">
</td>
</tr>
<tr>
<td>{% trans 'Comment' %}</td>
<td>
<input type="text" name="item_comment" value="{{ event.item_comment }}" maxlength="64">
</td>
</tr>
</table>
</div>
{% if is_ajax %}
<input type="hidden" name="editor_process_{{ mode }}" value="true">
<input type="hidden" name="ajax_request" value="true">
{% else %}
<div class="card-footer">
<input class="btn btn-primary" type="submit" name="editor_process_{{ mode }}" value="{% trans 'Go' %}">
</div>
{% endif %}
</div>
</form>

View file

@ -0,0 +1,154 @@
<div class="container-fluid my-3">
<h2>
{{ get_icon('b_events', 'Events'|trans) }}
{{ show_mysql_docu('EVENTS') }}
</h2>
<div class="d-flex flex-wrap my-3">
<div>
<div class="input-group">
<div class="input-group-text">
<div class="form-check mb-0">
<input class="form-check-input checkall_box" type="checkbox" value="" id="checkAllCheckbox" form="rteListForm">
<label class="form-check-label" for="checkAllCheckbox">{% trans 'Check all' %}</label>
</div>
</div>
<button class="btn btn-outline-secondary" id="bulkActionExportButton" type="submit" name="submit_mult" value="export" form="rteListForm" title="{% trans 'Export' %}">
{{ get_icon('b_export', 'Export'|trans) }}
</button>
<button class="btn btn-outline-secondary" id="bulkActionDropButton" type="submit" name="submit_mult" value="drop" form="rteListForm" title="{% trans 'Drop' %}">
{{ get_icon('b_drop', 'Drop'|trans) }}
</button>
</div>
</div>
<div class="ms-auto">
<a class="ajax add_anchor btn btn-primary{{ not has_privilege ? ' disabled' }}" href="{{ url('/database/events', {'db': db, 'add_item': true}) }}" role="button"{{ not has_privilege ? ' tabindex="-1" aria-disabled="true"' }}>
{{ get_icon('b_event_add', 'Create new event'|trans) }}
</a>
</div>
</div>
<form id="rteListForm" class="ajax" action="{{ url('/database/events') }}">
{{ get_hidden_inputs(db) }}
<div id="nothing2display"{{ items is not empty ? ' class="hide"' }}>
{% trans 'There are no events to display.' %}
</div>
<table id="eventsTable" class="table table-striped table-hover{{ items is empty ? ' hide' }} w-auto data">
<thead>
<tr>
<th></th>
<th>{% trans 'Name' %}</th>
<th>{% trans 'Status' %}</th>
<th>{% trans 'Type' %}</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<tr class="hide">{% for i in 0..6 %}<td></td>{% endfor %}</tr>
{% for event in items %}
<tr{{ is_ajax ? ' class="ajaxInsert hide"' }}>
<td>
<input type="checkbox" class="checkall" name="item_name[]" value="{{ event.name }}">
</td>
<td>
<span class="drop_sql hide">{{ 'DROP EVENT IF EXISTS %s'|format(backquote(event.name)) }}</span>
<strong>{{ event.name }}</strong>
</td>
<td>
{{ event.status }}
</td>
<td>
{{ event.type }}
</td>
<td>
{% if has_privilege %}
<a class="ajax edit_anchor" href="{{ url('/database/events', {
'db': db,
'edit_item': true,
'item_name': event.name
}) }}">
{{ get_icon('b_edit', 'Edit'|trans) }}
</a>
{% else %}
{{ get_icon('bd_edit', 'Edit'|trans) }}
{% endif %}
</td>
<td>
<a class="ajax export_anchor" href="{{ url('/database/events', {
'db': db,
'export_item': true,
'item_name': event.name
}) }}">
{{ get_icon('b_export', 'Export'|trans) }}
</a>
</td>
<td>
{% if has_privilege %}
{{ link_or_button(
url('/sql'),
{
'db': db,
'sql_query': 'DROP EVENT IF EXISTS %s'|format(backquote(event.name)),
'goto': url('/database/events', {'db': db})
},
get_icon('b_drop', 'Drop'|trans),
{'class': 'ajax drop_anchor'}
) }}
{% else %}
{{ get_icon('bd_drop', 'Drop'|trans) }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</form>
<div class="card mt-3">
<div class="card-header">{% trans 'Event scheduler status' %}</div>
<div class="card-body">
<div class="wrap">
<div class="wrapper toggleAjax hide">
<div class="toggleButton">
<div title="{% trans 'Click to toggle' %}" class="toggle-container {{ scheduler_state ? 'on' : 'off' }}">
<img src="{{ image('toggle-' ~ text_dir ~ '.png') }}">
<table>
<tbody>
<tr>
<td class="toggleOn">
<span class="hide">
{{- url('/sql', {
'db': db,
'goto': url('/database/events', {'db': db}),
'sql_query': 'SET GLOBAL event_scheduler="ON"',
}) -}}
</span>
<div>{% trans 'ON' %}</div>
</td>
<td><div>&nbsp;</div></td>
<td class="toggleOff">
<span class="hide">
{{- url('/sql', {
'db': db,
'goto': url('/database/events', {'db': db}),
'sql_query': 'SET GLOBAL event_scheduler="OFF"',
}) -}}
</span>
<div>{% trans 'OFF' %}</div>
</td>
</tr>
</tbody>
</table>
<span class="hide callback">Functions.slidingMessage(data.sql_query);</span>
<span class="hide text_direction">{{ text_dir }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,56 @@
<tr{% if row_class is not empty %} class="{{ row_class }}"{% endif %}>
<td>
<input type="checkbox" class="checkall" name="item_name[]" value="{{ event.name }}">
</td>
<td>
<span class='drop_sql hide'>{{ sql_drop }}</span>
<strong>{{ event.name }}</strong>
</td>
<td>
{{ event.status }}
</td>
<td>
{{ event.type }}
</td>
<td>
{% if has_privilege %}
<a class="ajax edit_anchor" href="{{ url('/database/events', {
'db': db,
'table': table,
'edit_item': true,
'item_name': event.name
}) }}">
{{ get_icon('b_edit', 'Edit'|trans) }}
</a>
{% else %}
{{ get_icon('bd_edit', 'Edit'|trans) }}
{% endif %}
</td>
<td>
<a class="ajax export_anchor" href="{{ url('/database/events', {
'db': db,
'table': table,
'export_item': true,
'item_name': event.name
}) }}">
{{ get_icon('b_export', 'Export'|trans) }}
</a>
</td>
<td>
{% if has_privilege %}
{{ link_or_button(
url('/sql'),
{
'db': db,
'table': table,
'sql_query': sql_drop,
'goto': url('/database/events', {'db': db})
},
get_icon('b_drop', 'Drop'|trans),
{'class': 'ajax drop_anchor'}
) }}
{% else %}
{{ get_icon('bd_drop', 'Drop'|trans) }}
{% endif %}
</td>
</tr>