Refactor table search templates
Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
This commit is contained in:
parent
d2a282b522
commit
4e81d3f27d
@ -1,7 +1,16 @@
|
||||
<table class="data"{{ search_type == 'zoom' ? ' id="tableFieldsId"' }}>
|
||||
{% include 'table/search/table_header.twig' with {
|
||||
'geom_column_flag': geom_column_flag
|
||||
} only %}
|
||||
<thead>
|
||||
<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>
|
||||
{% if search_type == 'zoom' %}
|
||||
{% include 'table/search/rows_zoom.twig' with {
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
{{ Util_getDivForSliderEffect('searchoptions', 'Options'|trans) }}
|
||||
|
||||
{# 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="multiple">
|
||||
{% for each_field in column_names %}
|
||||
<option value="{{ each_field }}"
|
||||
selected="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>
|
||||
{{ Util_showMySQLDocu('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"
|
||||
required="required"
|
||||
min="1"
|
||||
value="{{ max_rows }}"
|
||||
class="textfield" />
|
||||
</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>
|
||||
|
||||
{{ Util_getRadioFields(
|
||||
'order',
|
||||
{
|
||||
'ASC': 'Ascending'|trans,
|
||||
'DESC': 'Descending'|trans
|
||||
},
|
||||
'ASC',
|
||||
false,
|
||||
true,
|
||||
'formelement'
|
||||
) }}
|
||||
|
||||
</fieldset>
|
||||
<div class="clearfloat"></div>
|
||||
@ -1,43 +0,0 @@
|
||||
<table class="data">
|
||||
{# Select options for data label #}
|
||||
<tr>
|
||||
<td>
|
||||
<label for="dataLabel">
|
||||
{% trans 'Use this column to label each point' %}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<select name="dataLabel" id="dataLabel" >
|
||||
<option value = "">
|
||||
{% trans 'None' %}
|
||||
</option>
|
||||
{% for i in 0..column_names|length - 1 %}
|
||||
{% if data_label is defined and data_label == column_names[i]|e %}
|
||||
<option value="{{ column_names[i] }}" selected="selected">
|
||||
{{ column_names[i] }}
|
||||
</option>
|
||||
{% else %}
|
||||
<option value="{{ column_names[i] }}" >
|
||||
{{ column_names[i] }}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{# Inputbox for changing default maximum rows to plot #}
|
||||
<tr>
|
||||
<td>
|
||||
<label for="maxRowPlotLimit">
|
||||
{% trans 'Maximum rows to plot' %}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number"
|
||||
name="maxPlotLimit"
|
||||
id="maxRowPlotLimit"
|
||||
required="required"
|
||||
value="{{ max_plot_limit }}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1,25 +0,0 @@
|
||||
{% trans 'Find:' %}
|
||||
<input type="text" value="" name="find" required />
|
||||
{% trans 'Replace with:' %}
|
||||
<input type="text" value="" name="replaceWith" />
|
||||
|
||||
{% trans 'Column:' %}
|
||||
<select name="columnIndex">
|
||||
{% for i in 0..column_names|length - 1 %}
|
||||
{% set type = types[column_names[i]] %}
|
||||
|
||||
{% if sql_types.getTypeClass(type) == 'CHAR' %}
|
||||
<option value="{{ i }}">
|
||||
{{- column_names[i] -}}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% include 'checkbox.twig' with {
|
||||
'html_field_id': 'useRegex',
|
||||
'html_field_name': 'useRegex',
|
||||
'label': 'Use regular expression'|trans,
|
||||
'checked': false,
|
||||
'onclick': false
|
||||
} only %}
|
||||
@ -21,12 +21,49 @@
|
||||
'keys' : keys,
|
||||
'criteria_column_names': criteria_column_names,
|
||||
'criteria_column_types': criteria_column_types
|
||||
} only %}
|
||||
{% include 'table/search/options_zoom.twig' with {
|
||||
'data_label': data_label,
|
||||
'column_names': column_names,
|
||||
'max_plot_limit': max_plot_limit
|
||||
} only %}
|
||||
} only %}<table class="data">
|
||||
{# Select options for data label #}
|
||||
<tr>
|
||||
<td>
|
||||
<label for="dataLabel">
|
||||
{% trans 'Use this column to label each point' %}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<select name="dataLabel" id="dataLabel" >
|
||||
<option value = "">
|
||||
{% trans 'None' %}
|
||||
</option>
|
||||
{% for i in 0..column_names|length - 1 %}
|
||||
{% if data_label is defined and data_label == column_names[i]|e %}
|
||||
<option value="{{ column_names[i] }}" selected="selected">
|
||||
{{ column_names[i] }}
|
||||
</option>
|
||||
{% else %}
|
||||
<option value="{{ column_names[i] }}" >
|
||||
{{ column_names[i] }}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{# Inputbox for changing default maximum rows to plot #}
|
||||
<tr>
|
||||
<td>
|
||||
<label for="maxRowPlotLimit">
|
||||
{% trans 'Maximum rows to plot' %}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number"
|
||||
name="maxPlotLimit"
|
||||
id="maxRowPlotLimit"
|
||||
required="required"
|
||||
value="{{ max_plot_limit }}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
{% elseif search_type == 'normal' %}
|
||||
@ -57,10 +94,73 @@
|
||||
<div id="gis_editor"></div>
|
||||
<div id="popup_background"></div>
|
||||
</fieldset>
|
||||
{% include 'table/search/options.twig' with {
|
||||
'column_names': column_names,
|
||||
'max_rows': max_rows
|
||||
} only %}
|
||||
{{ Util_getDivForSliderEffect('searchoptions', 'Options'|trans) }}
|
||||
|
||||
{# 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="multiple">
|
||||
{% for each_field in column_names %}
|
||||
<option value="{{ each_field }}"
|
||||
selected="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>
|
||||
{{ Util_showMySQLDocu('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"
|
||||
required="required"
|
||||
min="1"
|
||||
value="{{ max_rows }}"
|
||||
class="textfield" />
|
||||
</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>
|
||||
|
||||
{{ Util_getRadioFields(
|
||||
'order',
|
||||
{
|
||||
'ASC': 'Ascending'|trans,
|
||||
'DESC': 'Descending'|trans
|
||||
},
|
||||
'ASC',
|
||||
false,
|
||||
true,
|
||||
'formelement'
|
||||
) }}
|
||||
|
||||
</fieldset>
|
||||
<div class="clearfloat"></div>
|
||||
</fieldset>
|
||||
{% elseif search_type == 'replace' %}
|
||||
{% include 'table/search/form_tag.twig' with {
|
||||
@ -74,12 +174,30 @@
|
||||
<fieldset id="fieldset_find">
|
||||
<legend>
|
||||
{% trans 'Find and replace' %}
|
||||
</legend>
|
||||
{% include 'table/search/search_and_replace.twig' with {
|
||||
'column_names': column_names,
|
||||
'column_types': column_types,
|
||||
'sql_types': sql_types,
|
||||
'types': types
|
||||
</legend>{% trans 'Find:' %}
|
||||
<input type="text" value="" name="find" required />
|
||||
{% trans 'Replace with:' %}
|
||||
<input type="text" value="" name="replaceWith" />
|
||||
|
||||
{% trans 'Column:' %}
|
||||
<select name="columnIndex">
|
||||
{% for i in 0..column_names|length - 1 %}
|
||||
{% set type = types[column_names[i]] %}
|
||||
|
||||
{% if sql_types.getTypeClass(type) == 'CHAR' %}
|
||||
<option value="{{ i }}">
|
||||
{{- column_names[i] -}}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% include 'checkbox.twig' with {
|
||||
'html_field_id': 'useRegex',
|
||||
'html_field_name': 'useRegex',
|
||||
'label': 'Use regular expression'|trans,
|
||||
'checked': false,
|
||||
'onclick': false
|
||||
} only %}
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
<thead>
|
||||
<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>
|
||||
Loading…
Reference in New Issue
Block a user