{# # ------------------------------------------------------------------------- # News plugin for GLPI # ------------------------------------------------------------------------- # # LICENSE # # This file is part of News. # # News 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 2 of the License, or # (at your option) any later version. # # News 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 News. If not, see . # ------------------------------------------------------------------------- # @copyright Copyright (C) 2015-2022 by News plugin team. # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html # @link https://github.com/pluginsGLPI/news # ------------------------------------------------------------------------- #} {% extends "generic_show_form.html.twig" %} {% import 'components/form/fields_macros.html.twig' as fields %} {% import '@news/components/news_fields_macros.html.twig' as news_fields %} {% set params = params ?? [] %} {% block form_fields %} {# Horizontal mode solve a few layout problems for this page, such as displaying properly a field on an entire row or splitting the layout into 3 columns without losing too much space #} {% set base_option = { 'is_horizontal' : false, } %} {% set base_option_small = { 'field_class' : 'col-xxl-4 col-xl-6', }|merge(base_option) %} {{ fields.textField( 'name', item.fields.name, __('Name', 'news'), base_option ) }} {{ fields.dropdownYesNo( 'is_active', item.fields.is_active, __('Active', 'news'), base_option ) }} {{ fields.textareaField( 'message', item.fields.message, __('Description', 'news'), { 'full_width': true, 'enable_richtext': true, 'enable_images' : false, }|merge(base_option) ) }} {{ fields.dateTimeField( 'date_start', item.fields.date_start, __('Visibility start date', 'news'), base_option ) }} {{ fields.dateTimeField( 'date_end', item.fields.date_end, __('Visibility end date', 'news'), base_option ) }} {{ news_fields.checkboxesField( "show_on_pages", { 'is_displayed_oncentral' : __('Central page', 'news'), 'is_displayed_onlogin' : __('Login page', 'news'), 'is_displayed_onhelpdesk': __('Helpdesk page', 'news'), }, item.fields, __('Show on pages', 'news'), base_option )}} {{ fields.dropdownYesNo( 'is_close_allowed', item.fields.is_close_allowed, __('Can close alert', 'news'), base_option ) }}
{{ __('Customization', 'news') }}
{{ fields.dropdownArrayField( 'type', item.fields.type, templates, __('Template', 'news'), { 'display_emptychoice': true, }|merge(base_option_small) ) }} {{ fields.nullField() }} {{ fields.dropdownArrayField( 'size', item.fields.size, sizes, __('Size', 'news'), base_option_small ) }} {{ news_fields.iconField( "icon", icons, item.fields.icon, __('Icon', 'news'), { 'display_emptychoice': true, }|merge(base_option_small) ) }} {{ fields.dropdownYesNo( 'display_dates', item.fields.display_dates, __('Show dates', 'news'), base_option_small ) }} {{ news_fields.colorField( "background_color", colors, item.fields.background_color, __('Background color', 'news'), base_option_small )}} {{ news_fields.colorField( "text_color", colors, item.fields.text_color, __('Text color', 'news'), base_option_small )}} {{ news_fields.colorField( "emphasis_color", colors, item.fields.emphasis_color, __('Emphasis color', 'news'), base_option_small )}}
{{ __('Preview', 'news') }}
{% endblock %}