Нет описания

modal_attributes_tabs.html 5.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {% if attributes and attributes|length > 0 %}
  2. {% for ca in attributes %}
  3. {% set outer_loop = loop %}
  4. <div class="tab-pane {%if is_case_page %}{% if outer_loop.index == 1 %}{{"active"}}{% endif %}{% endif %}"
  5. id="{% if is_case_page %}itab_{% endif %}{{ ca.lower() | replace(' ', '_' ) }}_{{page_uid}}{{ outer_loop.index }}"
  6. aria-labelledby="{% if is_case_page %}itab_{% endif %}{{ ca.lower() | replace(' ', '_' ) }}_{{page_uid}}{{ outer_loop.index }}-tab">
  7. {% for cle in attributes[ca] %}
  8. {% set tag_id = cle.lower() | replace(' ', '_' ) %}
  9. <div class="form-group row">
  10. <div class="col-12">
  11. {% if attributes[ca][cle]["type"] == "input_string" %}
  12. <div class="form-input">
  13. <label for="{{ cle }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}
  14. </label>
  15. <input type="text" id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
  16. data-attr-for="{{cle}}" data-ref-tab="{{ca}}" class="form-control col-md-12"
  17. {% if attributes[ca][cle]['value'] %} value="{{ attributes[ca][cle]['value'] }}" {% endif %}
  18. {% if attributes[ca][cle]['mandatory'] %} required {% endif %}
  19. />
  20. </div>
  21. {% elif attributes[ca][cle]["type"] == "input_checkbox" %}
  22. <div class="form-check">
  23. <label class="form-check-label">
  24. <input type="checkbox" id="inpchk_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
  25. data-attr-for="{{cle}}" data-ref-tab="{{ca}}" class="form-control col-md-12"
  26. {% if attributes[ca][cle]['value'] == True %} checked {% endif %}
  27. {% if attributes[ca][cle]['mandatory'] %} required {% endif %}
  28. />
  29. <span class="form-check-sign"> {{ cle }}{% if attributes[ca][cle]['mandatory'] %} * {% endif %}
  30. </span>
  31. </label>
  32. </div>
  33. {% elif attributes[ca][cle]["type"] == "input_textfield" %}
  34. <div class="form-input">
  35. <label for="{{ cle }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}
  36. </label>
  37. <textarea class="form-control" id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
  38. data-attr-for="{{cle}}" data-ref-tab="{{ca}}"
  39. rows="12" style="height:100%;"
  40. {% if attributes[ca][cle]['mandatory'] %} required {% endif %}
  41. >{{ attributes[ca][cle]['value'] }}</textarea>
  42. </div>
  43. {% elif attributes[ca][cle]["type"] == "input_select" %}
  44. <div class="form-inline">
  45. <label class="my-1 mr-2" for="inpselect_{{page_uid}}{{ loop.index }}_{{ tag_id }}">{{ cle }}</label>
  46. <select class="custom-select my-1 mr-sm-2" id="inpselect_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
  47. data-attr-for="{{cle}}" data-ref-tab="{{ca}}">
  48. {% for opt in attributes[ca][cle]['options'] %}
  49. <option {% if opt == attributes[ca][cle]['value'] %} selected {% endif %}>{{ opt }}</option>
  50. {% endfor %}
  51. </select>
  52. </div>
  53. {% elif attributes[ca][cle]["type"] == "input_date" %}
  54. <div class="form-input">
  55. <label class="my-1 mr-2" for="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}</label>
  56. <input type="date" data-attr-for="{{cle}}" data-ref-tab="{{ca}}"
  57. id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}" value="{{ attributes[ca][cle]['value'] }}"
  58. {% if attributes[ca][cle]['mandatory'] %} required {% endif %} >
  59. </div>
  60. {% elif attributes[ca][cle]["type"] == "input_datetime" %}
  61. <div class="form-input">
  62. <label class="my-1 mr-2" for="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}</label>
  63. <input type="datetime-local" data-attr-for="{{cle}}" data-ref-tab="{{ca}}"
  64. id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}" value="{{ attributes[ca][cle]['value'] }}"
  65. {% if attributes[ca][cle]['mandatory'] %} required {% endif %}
  66. >
  67. </div>
  68. {% elif attributes[ca][cle]["type"] == "raw" %}
  69. <p>{{ cle }}</p>
  70. {% elif attributes[ca][cle]["type"] == "html" %}
  71. {{ attributes[ca][cle]['value']| safe }}
  72. {% endif %}
  73. </div>
  74. </div>
  75. {% endfor %}
  76. </div>
  77. {% endfor %}
  78. {% endif %}