Update website

This commit is contained in:
Guilhem Lavaux 2025-03-24 09:27:39 +01:00
parent a0b0d3dae7
commit ae7ef6ad45
3151 changed files with 566766 additions and 48 deletions

View file

@ -0,0 +1,3 @@
<select class="column-operator" id="ColumnOperator{{ search_index }}" name="criteriaColumnOperators[{{ search_index }}]">
{{ type_operators|raw }}
</select>

View file

@ -0,0 +1,164 @@
<ul class="nav nav-pills m-2">
<li class="nav-item">
<a class="nav-link active" href="{{ url('/table/search', {'db': db, 'table': table, 'pos': 0}) }}">
{{ get_icon('b_search', 'Table search'|trans, false, false, 'TabsMode') }}
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url('/table/zoom-search', {'db': db, 'table': table}) }}">
{{ get_icon('b_select', 'Zoom search'|trans, false, false, 'TabsMode') }}
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url('/table/find-replace', {'db': db, 'table': table}) }}">
{{ get_icon('b_find_replace', 'Find and replace'|trans, false, false, 'TabsMode') }}
</a>
</li>
</ul>
<form method="post" action="{{ url('/table/search') }}" name="insertForm" id="tbl_search_form" class="ajax lock-page">
{{ get_hidden_inputs(db, table) }}
<input type="hidden" name="goto" value="{{ goto }}">
<input type="hidden" name="back" value="{{ url('/table/search') }}">
<fieldset id="fieldset_table_search">
<fieldset id="fieldset_table_qbe">
<legend>
{% trans 'Do a "query by example" (wildcard: "%")' %}
</legend>
<div class="table-responsive-md jsresponsive">
<table class="table table-light table-striped table-hover table-sm w-auto">
<thead class="thead-light">
<tr>
{% if geom_column_flag %}
<th>{% trans 'Function' %}</th>
{% endif %}
<th>{% trans 'Column' %}</th>
<th>{% trans 'Type' %}</th>
<th>{% trans 'Collation' %}</th>
<th>{% trans 'Operator' %}</th>
<th>{% trans 'Value' %}</th>
</tr>
</thead>
<tbody>
{% for column_index in 0..column_names|length - 1 %}
<tr class="noclick">
{# If 'Function' column is present trying to change comment #}
{% if geom_column_flag %}
{# Displays 'Function' column if it is present #}
<td>
{% set geom_types = get_gis_datatypes() %}
{% if column_types[column_index] in geom_types %}
<select class="geom_func" name="geom_func[{{ column_index }}]">
{# get the relevant list of GIS functions #}
{% set funcs = get_gis_functions(column_types[column_index], true, true) %}
{% for func_name, func in funcs %}
{% set name = func['display'] is defined ? func['display'] : func_name %}
<option value="{{ name }}">
{{ name }}
</option>
{% endfor %}
</select>
{% endif %}
</td>
{% endif %}
{# Displays column's name, type, collation and value #}
<th>
{#- Keep this without extra spaces because it is used for a request to build the BETWEEN modal -#}
{{- column_names[column_index] -}}
</th>
{% set properties = self.getColumnProperties(column_index, column_index) %}
<td dir="ltr">
{{ properties['type'] }}
</td>
<td>
{{ properties['collation'] }}
</td>
<td>
{{ properties['func']|raw }}
</td>
{# here, the data-type attribute is needed for a date/time picker #}
<td data-type="{{ properties['type'] }}">
{{ properties['value']|raw }}
{# Displays hidden fields #}
<input type="hidden" name="criteriaColumnNames[{{ column_index }}]" value="{{ column_names[column_index] }}">
<input type="hidden" name="criteriaColumnTypes[{{ column_index }}]" value="{{ column_types[column_index] }}">
<input type="hidden" name="criteriaColumnCollations[{{ column_index }}]" value="{{ column_collations[column_index] }}">
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="gis_editor"></div>
<div id="popup_background"></div>
</fieldset>
<div id="searchoptions"{% if default_sliders_state != 'disabled' -%}
{{- default_sliders_state == 'closed' ? ' style="display: none; overflow:auto;"' }} class="pma_auto_slider" title="{% trans 'Options' %}"
{%- endif %}>
{# Displays columns select list for selecting distinct columns in the search #}
<fieldset id="fieldset_select_fields">
<legend>
{% trans 'Select columns (at least one):' %}
</legend>
<select name="columnsToDisplay[]" size="{{ min(column_names|length, 10) }}" multiple>
{% for each_field in column_names %}
<option value="{{ each_field }}" selected>
{{ each_field }}
</option>
{% endfor %}
</select>
<input type="checkbox" name="distinct" value="DISTINCT" id="oDistinct">
<label for="oDistinct">DISTINCT</label>
</fieldset>
{# Displays input box for custom 'Where' clause to be used in the search #}
<fieldset id="fieldset_search_conditions">
<legend>
<em>{% trans 'Or' %}</em>
{% trans 'Add search conditions (body of the "where" clause):' %}
</legend>
{{ show_mysql_docu('Functions') }}
<input type="text" name="customWhereClause" class="textfield" size="64">
</fieldset>
{# Displays option of changing default number of rows displayed per page #}
<fieldset id="fieldset_limit_rows">
<legend>{% trans 'Number of rows per page' %}</legend>
<input type="number" name="session_max_rows" min="1" value="{{ max_rows }}" class="textfield" required>
</fieldset>
{# Displays option for ordering search results by a column value (Asc or Desc) #}
<fieldset id="fieldset_display_order">
<legend>{% trans 'Display order:' %}</legend>
<select name="orderByColumn"><option value="--nil--"></option>
{% for each_field in column_names %}
<option value="{{ each_field }}">
{{ each_field }}
</option>
{% endfor %}
</select>
<div class="formelement">
<input type="radio" name="order" id="orderByAscRadio" value="ASC" checked>
<label for="orderByAscRadio">{% trans 'Ascending' %}</label>
</div>
<div class="formelement">
<input type="radio" name="order" id="orderByDescRadio" value="DESC">
<label for="orderByDescRadio">{% trans 'Descending' %}</label>
</div>
</fieldset>
<div class="clearfloat"></div>
</div>
</fieldset>
<fieldset class="tblFooters">
<input class="btn btn-primary" type="submit" name="submit" value="{% trans 'Go' %}">
</fieldset>
</form>
<div id="sqlqueryresultsouter"></div>

View file

@ -0,0 +1,98 @@
{# Get inputbox based on different column types (Foreign key, geometrical, enum) #}
{% if foreigners and search_column_in_foreigners(foreigners, column_name) %}
{% if foreign_data['disp_row'] is iterable %}
<select name="criteriaValues[{{ column_index }}]"
id="{{ column_id }}{{ column_index }}">
{{ foreign_dropdown(
foreign_data['disp_row'],
foreign_data['foreign_field'],
foreign_data['foreign_display'],
'',
foreign_max_limit
) }}
</select>
{% elseif foreign_data['foreign_link'] == true %}
<input type="text"
id="{{ column_id }}{{ column_index }}"
name="criteriaValues[{{ column_index }}]"
id="field_{{ column_name_hash }}[{{ column_index }}]"
class="textfield"
{% if criteria_values[column_index] is defined %}
value="{{ criteria_values[column_index] }}"
{% endif %}>
<a class="ajax browse_foreign" href="{{ url('/browse-foreigners') }}" data-post="
{{- get_common({'db': db, 'table': table}, '') -}}
&amp;field={{ column_name|url_encode }}&amp;fieldkey=
{{- column_index }}&amp;fromsearch=1">
{{ get_icon('b_browse', 'Browse foreign values'|trans) }}
</a>
{% endif %}
{% elseif column_type in get_gis_datatypes() %}
<input type="text"
name="criteriaValues[{{ column_index }}]"
size="40"
class="textfield"
id="field_{{ column_index }}">
{% if in_fbs %}
{% set edit_str = get_icon('b_edit', 'Edit/Insert'|trans) %}
<span class="open_search_gis_editor">
{{ link_or_button(url('/gis-data-editor'), edit_str, [], '_blank') }}
</span>
{% endif %}
{% elseif column_type starts with 'enum'
or (column_type starts with 'set' and in_zoom_search_edit) %}
{% set in_zoom_search_edit = false %}
{% set value = column_type|e|slice(5, -1)|replace({'&#039;': ''})|split(', ') %}
{% set cnt_value = value|length %}
{#
Enum in edit mode --> dropdown
Enum in search mode --> multiselect
Set in edit mode --> multiselect
Set in search mode --> input (skipped here, so the 'else' section would handle it)
#}
{% if (column_type starts with 'enum' and not in_zoom_search_edit)
or (column_type starts with 'set' and in_zoom_search_edit) %}
<select name="criteriaValues[{{ column_index }}]"
id="{{ column_id }}{{ column_index }}">
{% else %}
<select name="criteriaValues[{{ column_index }}]"
id="{{ column_id }}{{ column_index }}"
multiple="multiple"
size="{{ min(3, cnt_value) }}">
{% endif %}
{# Add select options #}
<option value=""></option>
{% for i in 0..cnt_value - 1 %}
{% if criteria_values[column_index] is defined
and criteria_values[column_index] is iterable
and value[i] in criteria_values[column_index] %}
<option value="{{ value[i]|raw }}" selected>
{{ value[i]|raw }}
</option>
{% else %}
<option value="{{ value[i]|raw }}">
{{ value[i]|raw }}
</option>
{% endif %}
{% endfor %}
</select>
{% else %}
{% set the_class = 'textfield' %}
{% if column_type == 'date' %}
{% set the_class = the_class ~ ' datefield' %}
{% elseif column_type == 'datetime' or column_type starts with 'timestamp' %}
{% set the_class = the_class ~ ' datetimefield' %}
{% elseif column_type starts with 'bit' %}
{% set the_class = the_class ~ ' bit' %}
{% endif %}
<input type="text"
name="criteriaValues[{{ column_index }}]"
data-type="{{ column_data_type }}"
{{ html_attributes|raw }}
size="40"
class="{{ the_class }}"
id="{{ column_id }}{{ column_index }}"
{% if criteria_values[column_index] is defined %}
value="{{ criteria_values[column_index] }}"
{%- endif %}>
{% endif %}