users-list.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {% assign limit = include.limit | default: 8 %}
  2. {% assign offset = include.offset | default: 0 %}
  3. {% assign hoverable = include.hoverable | default: false %}
  4. {% assign checked-ids = include.checked-ids | default: '' | extract: ',' %}
  5. <div class="card{% if include.class %} {{ include.class }}{% endif %}">
  6. <div class="card-header">
  7. <h3 class="card-title">{{ include.title | default: 'Last commits' }}</h3>
  8. </div>
  9. <div class="list-group list-group-flush{% if hoverable %} list-group-hoverable{% endif %}">
  10. {% assign colors = 'green,red,yellow,x,x' | split: ',' %}
  11. {% for person in site.data.people limit: limit offset: offset %}
  12. {% assign color = forloop.index | plus: 5 | random_item: colors %}
  13. <div class="list-group-item{% if checked-ids contains forloop.index %} active{% endif %}">
  14. <div class="row align-items-center">
  15. {% if include.checkbox %}
  16. <div class="col-auto"><input type="checkbox" class="form-check-input"{% if checked-ids contains forloop.index %} checked{% endif %}></div>
  17. {% else %}
  18. <div class="col-auto"><span class="badge{% if color != 'x' %} bg-{{ color }}{% endif %}"></span></div>
  19. {% endif %}
  20. <div class="col-auto">
  21. <a href="#">
  22. {% include ui/avatar.html person=person %}
  23. </a>
  24. </div>
  25. <div class="col text-truncate">
  26. <a href="#" class="text-reset d-block">{{ person.full_name }}</a>
  27. {% assign i = forloop.index | plus: offset %}
  28. <div class="d-block text-secondary text-truncate mt-n1">{{ site.data.commits[i].description }}</div>
  29. </div>
  30. {% if hoverable %}
  31. {% if checked-ids contains forloop.index %}
  32. {% assign star-color = 'text-yellow' %}
  33. {% else %}
  34. {% assign star-color = 'text-secondary' %}
  35. {% endif %}
  36. <div class="col-auto">
  37. <a href="#" class="list-group-item-actions{% if checked-ids contains forloop.index %} show{% endif %}">{% include ui/icon.html icon="star" class=star-color %}</a>
  38. </div>
  39. {% endif %}
  40. </div>
  41. </div>
  42. {% endfor %}
  43. </div>
  44. </div>