Skip to content

Commit 611c21a

Browse files
Settings: Add icon with setting category and variable in settings page (only in dev server mode) - refs #6807
1 parent e7e1d53 commit 611c21a

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

src/CoreBundle/Controller/Admin/SettingsController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ public function updateSetting(Request $request, AccessUrlHelper $accessUrlHelper
206206
$templateMap[$s->getVariable()] = $s->getValueTemplate()->getId();
207207
}
208208
}
209+
$platform = [
210+
'server_type' => (string) $manager->getSetting('platform.server_type', true),
211+
];
209212

210213
return $this->render('@ChamiloCore/Admin/Settings/default.html.twig', [
211214
'schemas' => $schemas,
@@ -216,6 +219,7 @@ public function updateSetting(Request $request, AccessUrlHelper $accessUrlHelper
216219
'template_map' => $templateMap,
217220
'ordered_namespaces' => $ordered,
218221
'namespace_labels' => $labelMap,
222+
'platform' => $platform,
219223
]);
220224
}
221225

src/CoreBundle/Resources/views/Admin/Settings/default.html.twig

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,35 @@
7272
{{ field.vars.label|trans }}
7373
</h3>
7474

75-
{% if template_map[fieldName] is defined %}
76-
<a href="#"
77-
class="text-info hover:text-info-dark show-template flex items-center gap-2"
78-
data-template-id="{{ template_map[fieldName] }}"
79-
title="{{ 'Show JSON Template'|trans }}">
80-
<i class="mdi mdi-information-outline text-info text-lg"></i>
81-
<span class="text-body-2">{{ 'Show JSON Template'|trans }}</span>
82-
</a>
83-
{% endif %}
75+
<div class="flex items-center gap-2">
76+
{% if template_map[fieldName] is defined %}
77+
<a href="#"
78+
class="text-info hover:text-info-dark show-template flex items-center gap-2"
79+
data-template-id="{{ template_map[fieldName] }}"
80+
title="{{ 'Show JSON Template'|trans }}">
81+
<i class="mdi mdi-information-outline text-info text-lg"></i>
82+
<span class="text-body-2">{{ 'Show JSON Template'|trans }}</span>
83+
</a>
84+
{% endif %}
85+
86+
87+
{% if platform is defined and settings.platform.server_type is defined and settings.platform.server_type == 'test' %}
88+
89+
<span
90+
class="ml-3 text-gray-60 text-lg flex items-center cursor-default debug-setting-icon"
91+
title="{{ namespace ~ '.' ~ fieldName }}"
92+
role="img"
93+
aria-hidden="true"
94+
data-field-id="{{ field.vars.id }}"
95+
data-namespace="{{ namespace }}"
96+
data-field-name="{{ fieldName }}"
97+
{% if template_map[fieldName] is defined %} data-template-id="{{ template_map[fieldName] }}" {% endif %}
98+
>
99+
<i class="mdi mdi-alphabetical course-tool__icon bg-primary-bgdisabled text-base" aria-hidden="true"></i>
100+
</span>
101+
{% endif %}
102+
103+
</div>
84104
</div>
85105

86106
<div class="mb-2">

0 commit comments

Comments
 (0)