{# Renders a symfony form field. @param Object field: represents the form field. #} {% macro field(field) %}
{{ form_label(field) }} {{ form_widget(field) }} {% if field.vars.errors|length %}
{{ form_errors(field) }}
{% endif %} {% if field.vars.attr.help ?? false %} {{ field.vars.attr.help|raw }} {% endif %}
{% endmacro %} {# Renders a "No results found" label. @param {string} message: represents the message to be rendered @param {string} id: represents the id of the component @param {boolean} textCenter: Indicates the text is centered or not @param {string|null} class: The css class to apply. #} {% macro no_result(message, id, textCenter = true, class = null) %}

{% if message %} {{ message }} {% else %} No results found. {% endif %}

{% endmacro %} {# Renders Dots loading component #} {% macro loading_dot() %}
{% endmacro %} {# Renders the form processing overlay component. #} {% macro form_processing() %}
Loading...
{% endmacro %} {# Renders a skeleton loading component @param {string} id Represents the components id. #} {% macro loading_skeleton(id) %} {% set idAttr = 'loading-skeleton' %} {% if id %} {% set idAttr = id %} {% endif %}
{% endmacro %} {# Renders the success flash notification messages caming from symfony controllers. #} {% macro notifications_success() %} {% for message in app.flashes('success') %}
{{ message }}
{% endfor %} {% endmacro %} {# Renders the error flash notification messages caming from symfony controllers. #} {% macro notifications_error() %} {% for message in app.flashes('error') %}
{{ message }}
{% endfor %} {% endmacro %} {# Renders the warning flash notification messages caming from symfony controllers. #} {% macro notifications_warning() %} {% for message in app.flashes('warning') %}
{{ message }}
{% endfor %} {% endmacro %} {# Renders the copyright information #} {% macro copyright() %} {% set startDate = '2022' %} {% set nowYear = 'now' | date('Y') %} {% if nowYear == startDate %} Copyright © {{ startDate }}. {% else %} Copyright © {{ startDate }} - {{ nowYear }} {% endif %} {% endmacro %} {# Use this macro to render an input field with a spinner loader inside. @param {Object} field Represents the field to overlay. #} {% macro inputSpinner(field) %}
{{ form_label(field) }}
{{ form_widget(field) }}
{% if field.vars.errors|length %}
{{ form_errors(field) }}
{% endif %}
{% endmacro %} {# # Use this macro to render the spinner inside a button. #} {% macro buttonSpinner() %} {% endmacro %} {# # Use this macro to render the recaptcha protection message. #} {% macro recaptchaV3Description() %} This site is protected by reCAPTCHA V3 and the Google Privacy Policy and Terms of Service apply. {% endmacro %} {# Use this macro to render the errors within an alert div.bg-danger @param {array} errors: Contains the error messages if any. #} {% macro errors(errors) %} {% if errors is defined and errors is not empty %} {% endif %} {% endmacro %} {% macro alertError(message) %}
{{ message }}
{% endmacro %} {# Use this macro to render the boolean icon. Check in green id true , Times in reds if false. @param {boolean} value: Indicator wether it's valid or not. #} {% macro booleanIcon(value) %} {% if value %} {% else %} {% endif %} {% endmacro %} {# Use this macro to render the badge. green if true , reds if false. @param {satring} value: Value to be placed as a badge. #} {% macro booleanBadge(value) %} {% if value %} Active {% else %} Inactive {% endif %} {% endmacro %} {# Use this macro to render a `Copy to Clipboard` btn. @param {string} data: Data to be copied. @param {satring} defaultBtnTxt: Default text that has the btn to copy to clipboard. #} {% macro copyToClipboardButton(data, defaultBtnTxt = null) %} {% endmacro %} {# Macro for building the button for copying a text on the clipboard. @param string id identifer of the notepad @param int rows Number of rows of the notepad textarea #} {% macro notepad(id, rows = 5) %}
{% endmacro %} {# Preview an image. @param {string} imgFilename: Filename of the image to render. @param {string} cssClass: Additional css classes applied to the image. #} {% macro imgPreview(imgFilename, cssClass) %}
{% endmacro %} {# Renders the pagination html component @param: {Object} pagination: Holds the pagination details. #} {% macro pagination(pagination) %}
{% endmacro %} {# Renders the filter indicator.This is a link that holds the name of the filter and its value, also a btn to remove it. @param: {string} name: Name of the filter @param: {string} value: Value of the filter @param: {string} url: URL to redirect after the filter is removed from the view. #} {% macro filterIndicator(name, value, url) %} {{ name }}: {{ value }} {% endmacro %} {# Renders the btn to navigate from an admin form to the respective page in production. @param: {string} url: The URL to redirect the user @param: {string} pageName: The name the page is named. e.g: https://o-cpg-frontend.vercel.app/about @param: {string} pageRoute: The absolute page route. e.g: /about. @param: {string} extraDescription: Additional description to render as helper information about the referenced form fields. #} {% macro goToLivePage(url, pageName, pageRoute, extraDescription = null) %}

The following content will be located on the route {{ pageRoute }} of Operation CPG website.

See live results on {{ pageName }} page {% if extraDescription %} {{ extraDescription }} {% endif %}
{% endmacro %} {# Renders the password security policy information to indicate via a helper text how the password should be created. #} {% macro passwordFormatHelper() %}
To ensure that the password is secure, the password must have the following format:
{% endmacro %}