templates\admin\display_user_survey\resume\renderField\resumeRenderValueTd.html.twig line 1

Open in your IDE?
  1. {% if survey and fieldname and stepCode and surveyMode %}
  2.     {% if survey.hasFieldByStepCode(fieldname,stepCode,surveyMode) %}
  3.         {% set answer = getUserAnswer(object, fieldname) %}
  4.         {% set text = getUserAnswerLabel(object, fieldname) %}
  5.         {% set textClass="" %}
  6.         {% set suffix = "" %}
  7.         {% if gettype(answer) == 'boolean' %}
  8.             {% if answer =='Oui' or answer =='1' %}
  9.                 {% set text = "Oui" %}
  10.                 {% set textClass="text-success" %}
  11.             {% else %}
  12.                 {% set text = "Non" %}
  13.                 {% set textClass="text-danger" %}
  14.             {% endif %}
  15.         {% endif %}
  16.         {% if type is defined %}
  17.             {% if type == "amountCHF" %}
  18.                 {% if text > 0 %}
  19.                     {% set suffix = ' CHF' %}
  20.                     {% set textClass = "text-success" %}
  21.                 {% endif %}
  22.             {% endif %}
  23.             {% if type == "amountEUR" %}
  24.                 {% if text > 0 %}
  25.                     {% set suffix = ' EUR' %}
  26.                     {% set textClass = "text-success" %}
  27.                 {% endif %}
  28.             {% endif %}
  29.             {% if type == "days" %}
  30.                 {% if text > 0 %}
  31.                     {% set suffix = ' jours' %}
  32.                     {% set textClass = "text-success" %}
  33.                 {% endif %}
  34.             {% endif %}
  35.             {% if type == "months" %}
  36.                 {% if text > 0 %}
  37.                     {% set suffix = ' mois' %}
  38.                     {% set textClass = "text-success" %}
  39.                 {% endif %}
  40.             {% endif %}
  41.             {% if type == "km" %}
  42.                 {% if text > 0 %}
  43.                     {% set suffix = ' km' %}
  44.                     {% set textClass = "text-success" %}
  45.                 {% endif %}
  46.             {% endif %}
  47.             {% if type == 'date' %}
  48.                 {% set text = text|date('d/m/Y') %}
  49.             {% endif %}
  50.             {% if type == 'percent' %}
  51.                 {% set suffix = ' %' %}
  52.                 {% set text = text|number_format(0,',','') %}
  53.             {% endif %}
  54.         {% endif %}
  55.         {% if label is defined %}
  56.             <td class="col-5"><b class="cut-text-300">{{ label }}</b> :</td>
  57.         {% endif %}
  58.         <td><span class="multiline {{ textClass }}">{{ text }}{{ suffix }}</span></td>
  59.     {% endif %}
  60. {% endif %}