{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2023 Teclib' and contributors. # @copyright 2003-2014 by the INDEPNET Development Team. # @licence https://www.gnu.org/licenses/gpl-3.0.html # # --------------------------------------------------------------------- # # LICENSE # # This file is part of GLPI. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # --------------------------------------------------------------------- #} {% import 'components/form/fields_macros.html.twig' as fields %} {% set field_options = { 'full_width': true, } %} {% set rand = random() %}
{{ fields.colorField( 'color', color, __('Background color'), field_options ) }} {{ fields.dropdownArrayField( 'card_id', card_id, list_cards, __('Data'), field_options|merge({ 'display_emptychoice': not edit }) ) }} {# display widget list #} {% set widgets_list %}
{% for key, current in widget_types %} {% set selected = key == widgettype %} {% set w_displayed = edit and card['widgettype'] is defined and key in card['widgettype'] %} {% endfor %}
{% endset %} {% set displayed = edit %}
{{ fields.field( '', widgets_list, __('Widget'), field_options ) }}
{# display checkbox to use gradient palette or not #} {% set gradient_displayed = edit and widget_def['gradient']|default(false) %}
{{ fields.checkboxField( 'use_gradient', use_gradient, __('Use gradient palette'), field_options ) }}
{# display checkbox to use point label or not #} {% set point_labels_displayed = edit and widget_def['pointlbl']|default(false) %}
{{ fields.checkboxField( 'point_labels', point_labels, __('Display value labels on points/bars'), field_options ) }}
{# show limit #} {% set limit_displayed = edit and widget_def['limit']|default(false) %}
{{ fields.numberField( 'limit', limit, __('Limit number of data'), field_options ) }}