You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.2KB

  1. {% macro startCard(col, zone = "default", card ='primary', fullWidth = false ) %}
  2. {% if col > 0 %}
  3. <div class="col-{{ col }}">{% endif %}
  4. <div class="card card-{{ card }}">
  5. <div class="card-header">
  6. <h3 class="card-title">
  7. {% set label = "group."~zone %}
  8. {{ label|trans({}, 'lcshop')|raw }}
  9. </h3>
  10. </div>
  11. <div class="card-body {{ fullWidth == true ? 'p-0' : 'row' }}">
  12. {% endmacro %}
  13. {% macro endCard(noCol = false) %}
  14. </div>
  15. </div>
  16. {% if noCol == false %}</div>{% endif %}
  17. {% endmacro %}
  18. {% macro productField(colspan, field, fieldName, fieldDisplay = false, displaySuffix="",attr="") %}
  19. {% if fieldDisplay == false %}{% set fieldDisplay = fieldName %}{% endif %}
  20. <td {{ attr|raw }} colspan="{{ colspan }}" class="{{ fieldName }}" >
  21. <div class="value" v-show="{{ fieldName }}Inherited == false" v-on:click="{{ fieldName }}Inherited = true">
  22. <div v-if="{{ fieldName }}">
  23. {% verbatim %}{{ {% endverbatim %}{{ fieldDisplay }} {% verbatim %}}}{% endverbatim %}{{ displaySuffix }}
  24. </div>
  25. <div v-else class="inherited">
  26. {% verbatim %}{{ productFamily.{% endverbatim %}{{ fieldDisplay }} {% verbatim %}}}{% endverbatim %}{{ displaySuffix }}
  27. </div>
  28. </div>
  29. <div v-show="{{ fieldName }}Inherited == true">
  30. {{ form_widget(field, {'attr' : {'v-model' : fieldName , 'v-on:focusout': fieldName~'Inherited = false', '@change' : fieldName~'Updated'}}) }}
  31. </div>
  32. <button v-show="{{ fieldName }}" v-on:click="{{ fieldName }} = null; {{ fieldName }}Inherited = false; " class="btn btn-empty-field" type="button"> <i class="fa fa-undo"></i> </button>
  33. </td>
  34. {% endmacro %}
  35. {% macro priceField(field, fieldTax, fieldName, behaviorPriceValue) %}
  36. <div class="form-group field-price col-12" v-show="behaviorPrice == '{{ behaviorPriceValue }}'">
  37. <div class="row">
  38. <div class="col-12">
  39. {{ form_label(field) }}
  40. </div>
  41. <div class="col-6">
  42. <div class="form-widget">
  43. <div class="input-group">
  44. {{ form_widget(field, {'attr' : {'v-model': fieldName, '@change' : fieldName~'Updated'}}) }}
  45. <div class="input-group-append">
  46. <span class="input-group-text">€ HT
  47. {% if behaviorPriceValue == 'by-reference-unit' %}/ ${ unitReference }{% endif %}
  48. </span>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="col-6">
  54. <div class="input-group">
  55. {{ form_widget(fieldTax, {'attr' : {'v-model': fieldName ~ 'WithTax', '@change' : fieldName~'WithTaxUpdated'}}) }}
  56. <div class="input-group-append">
  57. <span class="input-group-text">€ TTC
  58. {% if behaviorPriceValue == 'by-reference-unit' %}/ ${ unitReference }{% endif %}
  59. </span>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. {% endmacro %}