<!-- 이 두줄이 멤버를 조회 -->
<div th:replace="fragments.html :: member-list(members=${study.managers},isManager=${true})"></div>
<div th:replace="fragments.html :: member-list(members=${study.members},isManager=${false})"></div>
불린 값으로 매니저인지 아닌지를 준다. 뱃지를 달아주느냐, 아니냐에 변화가 생김!
<div th:fragment="member-list (members, isManager)" class="row px-3 justify-content-center">
<ul class="list-unstyled col-10">
<li class="media mt-3" th:each="member: ${members}">
<svg th:if="${#strings.isEmpty(member?.profileImage)}" th:data-jdenticon-value="${member.nickname}" width="64" height="64" class="rounded border bg-light mr-3"></svg>
<img th:if="${!#strings.isEmpty(member?.profileImage)}" th:src="${member?.profileImage}" width="64" height="64" class="rounded border mr-3"/>
<div class="media-body">
<h5 class="mt-0 mb-1"><span th:text="${member.nickname}"></span> <span th:if="${isManager}" class="badge badge-primary">관리자</span></h5>
<span th:text="${member.bio}"></span>
</div>
</li>
</ul>
</div>
출처 : 인프런 백기선님의 스프링과 JPA 기반 웹 애플리케이션 개발