better handling of custom field columns in tables (#1419)

This commit is contained in:
Kevin Papst
2020-01-29 15:18:10 +01:00
committed by GitHub
parent 836a530b86
commit f2c6d8aee1
6 changed files with 22 additions and 12 deletions

View File

@@ -175,8 +175,10 @@ class DoctorController extends AbstractController
$result = [];
if ($iterator->valid()) {
try {
$result = iterator_to_array($iterator);
} catch (\Exception $ex) {
$result = ['ATTENTION: Failed reading log file'];
}
if (!is_writable($logfile)) {

View File

@@ -12,7 +12,7 @@
} %}
{% for field in metaColumns %}
{% set columns = columns|merge({
('mf_' ~ field.name): {'title': field.label, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
('mf_' ~ field.name): {'title': field.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
}) %}
{% endfor %}
{% if showVisibility %}
@@ -58,7 +58,7 @@
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment2html }}</td>
{% for field in metaColumns %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
<td class="{{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
{{ tables.datatable_meta_column(entry, field) }}
</td>
{% endfor %}

View File

@@ -11,7 +11,7 @@
} %}
{% for field in metaColumns %}
{% set columns = columns|merge({
('mf_' ~ field.name): {'title': field.label, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
('mf_' ~ field.name): {'title': field.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
}) %}
{% endfor %}
{% set columns = columns|merge({
@@ -52,7 +52,7 @@
{{ entry.comment|comment2html }}
</td>
{% for field in metaColumns %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
<td class="{{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
{{ tables.datatable_meta_column(entry, field) }}
</td>
{% endfor %}

View File

@@ -83,9 +83,17 @@
{% if logSize > 52428800 %}
<p>Your logfile is larger than 50 MB, consider deleting it (it will be re-created automatically).</p>
{% endif %}
<pre>{% for logLine in logs %}
{{- logLine -}}
{% endfor %}</pre>
<pre>{% for logLine in logs -%}
{%- set logLineClass = '' -%}
{%- if '.CRITICAL' in logLine -%}
{%- set logLineClass = 'text-danger text-bold' -%}
{%- elseif '.ERROR' in logLine -%}
{%- set logLineClass = 'text-warning text-bold' -%}
{%- elseif '.DEBUG' in logLine -%}
{%- set logLineClass = 'text-muted' -%}
{%- endif -%}
<span class="{{ logLineClass }}">{{- logLine -}}</span>
{%- endfor %}</pre>
{% endblock %}
{% endembed %}

View File

@@ -12,7 +12,7 @@
} %}
{% for field in metaColumns %}
{% set columns = columns|merge({
('mf_' ~ field.name): {'title': field.label, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
('mf_' ~ field.name): {'title': field.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
}) %}
{% endfor %}
{% set columns = columns|merge({
@@ -52,7 +52,7 @@
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment2html() }}</td>
{% for field in metaColumns %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
<td class="{{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
{{ tables.datatable_meta_column(entry, field) }}
</td>
{% endfor %}

View File

@@ -14,7 +14,7 @@
}) %}
{% for pref in preferences %}
{% set columns = columns|merge({
('mf_' ~ pref.name): {'title': pref.label, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
('mf_' ~ pref.name): {'title': pref.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
}) %}
{% endfor %}
{% set columns = columns|merge({
@@ -59,7 +59,7 @@
{% endfor %}
</td>
{% for pref in preferences %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'mf_' ~ pref.name) }}">
<td class="{{ tables.data_table_column_class(tableName, columns, 'mf_' ~ pref.name) }}">
{% set metaField = entry.preference(pref.name) %}
{% if not metaField is null and metaField.value is not null and metaField.value is not empty %}
{{ widgets.form_type_value(pref.type, metaField.value, entry) }}