card.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {% removeemptylines %}
  2. {% assign link = include.link | default: false %}
  3. <{% if link %}a href="#"{% else %}div{% endif %} class="card{% if include.active %} card-active{% endif %}{% if include.inactive %} card-inactive{% endif %}{% if include.class %} {{ include.class }}{% endif %}">
  4. {% if include['empty'] %}
  5. {% include ui/empty.html illustration=true %}
  6. {% else %}
  7. {% if include.img-top %}
  8. {% include ui/photo.html id=img-id class="card-img-top" ratio="21x9" id=7 %}
  9. {% endif %}
  10. {% if include.status-top %}
  11. <div class="card-status-top bg-{{ include.status-top | default: 'blue' }}"></div>
  12. {% elsif include.status-bottom %}
  13. <div class="card-status-bottom bg-{{ include.status-bottom | default: 'blue' }}"></div>
  14. {% elsif include.status-left %}
  15. <div class="card-status-start bg-{{ include.status-left | default: 'blue' }}"></div>
  16. {% endif %}
  17. {% if include.header or include.header-title or include.header-tabs or include.header-pills %}
  18. <div class="card-header">
  19. {% if include.header-tabs or include.header-pills %}
  20. {% include ui/nav.html header=true pills=include.header-pills tabs=include.header-tabs %}
  21. {% else %}
  22. <h3 class="card-title">{{ include.header-title | default: 'Header title' }}</h3>
  23. {% endif %}
  24. </div>
  25. {% endif %}
  26. {% if include.alert %}
  27. <div class="card-alert alert alert-{{ include.alert-type | default: 'success' }} mb-0">
  28. {{ include.alert }}
  29. </div>
  30. {% endif %}
  31. <div class="card-body">
  32. {% if include.title %}
  33. <h3 class="card-title">{{ include.title }}</h3>
  34. {% endif %}
  35. {% if include.subtitle %}
  36. <div class="card-subtitle">Card subtitle</div>
  37. {% endif %}
  38. {% if include.body %}
  39. <p class="text-secondary">{{ include.body }}</p>
  40. {% else %}
  41. <p class="text-secondary">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam deleniti fugit incidunt, iste, itaque minima
  42. neque pariatur perferendis sed suscipit velit vitae voluptatem.</p>
  43. {% endif %}
  44. {% if include.button %}
  45. <div class="card-text">
  46. <a href="#" class="btn btn-primary">Go somewhere</a>
  47. </div>
  48. {% endif %}
  49. </div>
  50. {% if include.footer or include.footer-button or include.footer-buttons or include.footer-elements %}
  51. <!-- Card footer -->
  52. <div class="card-footer">
  53. {% if include.footer-elements %}
  54. <div class="row align-items-center">
  55. {% assign elements = include.footer-elements | split: "," %}
  56. {% for element in elements %}
  57. {% assign el = element %}
  58. {% assign first_letter = el | slice: 0 %}
  59. {% if first_letter == ">" %}
  60. {% assign right = true %}
  61. {% assign el = element | slice: 1, element.size %}
  62. {% endif %}
  63. <div class="col-auto{% if right %} ms-auto{% endif %}">
  64. {% case el %}
  65. {% when "switch" %}
  66. {% include ui/form/check.html switch=true empty=true checked=true class="m-0" %}
  67. {% when "check" %}
  68. {% include ui/form/check.html empty=true checked=true class="m-0" %}
  69. {% when "avatars" %}
  70. {% include ui/avatar-list.html stacked=true text="+3" %}
  71. {% when "more" %}
  72. <a href="#">More information</a>
  73. {% endcase %}
  74. </div>
  75. {% endfor %}
  76. </div>
  77. {% elsif include.footer-button %}
  78. <a href="#" class="btn btn-primary">Go somewhere</a>
  79. {% elsif include.footer-buttons %}
  80. <div class="d-flex">
  81. <a href="#" class="btn btn-link">Cancel</a>
  82. <a href="#" class="btn btn-primary ms-auto">Go somewhere</a>
  83. </div>
  84. {% else %}
  85. This is standard card footer
  86. {% endif %}
  87. </div>
  88. {% endif %}
  89. {% if include.img-bottom %}
  90. {% include ui/photo.html id=img-id class="card-img-bottom" ratio="21x9" id=11 %}
  91. {% endif %}
  92. {% if include.progress %}
  93. {% include ui/progress.html class="progress-sm card-progress" %}
  94. {% endif %}
  95. {% endif %}
  96. </{% if link %}a{% else %}div{% endif %}>
  97. {% endremoveemptylines %}