fix #494: add delete impact confirmations
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
</div>
|
||||
|
||||
<div class="alert alert-success" th:if="${message}" th:text="${message}"></div>
|
||||
<div class="alert alert-danger" th:if="${error}" th:text="${error}"></div>
|
||||
|
||||
<section class="content-band">
|
||||
<h2>그룹 추가</h2>
|
||||
@@ -41,28 +42,44 @@
|
||||
<th>코드</th>
|
||||
<th>그룹명</th>
|
||||
<th>설명</th>
|
||||
<th>비활성 영향</th>
|
||||
<th>상태</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="group : ${groups}">
|
||||
<tr th:each="group : ${groups}" th:with="impact=${groupImpactByGroupId[group.groupId()]}">
|
||||
<td th:text="${group.groupId()}">1</td>
|
||||
<td><code th:text="${group.groupCode()}">SALES_TEAM</code></td>
|
||||
<td th:text="${group.groupName()}">영업팀</td>
|
||||
<td th:text="${group.description()}">설명</td>
|
||||
<td class="delete-impact">
|
||||
<div>
|
||||
<span>사용자</span>
|
||||
<strong th:text="${impact == null || #lists.isEmpty(impact.users()) ? '0명' : #lists.size(impact.users()) + '명'}">0명</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>역할</span>
|
||||
<strong th:text="${impact == null || #lists.isEmpty(impact.roles()) ? '0개' : #lists.size(impact.roles()) + '개'}">0개</strong>
|
||||
</div>
|
||||
<small th:text="${impact == null || #lists.isEmpty(impact.objectNames()) ? '상속 권한 없음' : #strings.listJoin(impact.objectNames(), ', ')}">상속 권한 없음</small>
|
||||
</td>
|
||||
<td><span class="badge" th:classappend="${group.active()} ? ' text-bg-success' : ' text-bg-secondary'" th:text="${group.activeYn()}">Y</span></td>
|
||||
<td>
|
||||
<form method="post" action="/groups/active" class="inline-form">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
|
||||
<input type="hidden" name="groupId" th:value="${group.groupId()}">
|
||||
<input type="hidden" name="active" th:value="${!group.active()}">
|
||||
<label class="delete-confirm" th:if="${group.active()}">
|
||||
<input type="checkbox" name="confirmImpact" value="true" required>
|
||||
영향 확인
|
||||
</label>
|
||||
<button class="btn btn-sm btn-outline-secondary" type="submit" th:text="${group.active()} ? '비활성화' : '활성화'">변경</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr th:if="${#lists.isEmpty(groups)}">
|
||||
<td colspan="6" class="text-muted">등록된 그룹이 없습니다.</td>
|
||||
<td colspan="7" class="text-muted">등록된 그룹이 없습니다.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -95,24 +112,33 @@
|
||||
<tr>
|
||||
<th>그룹</th>
|
||||
<th>사용자</th>
|
||||
<th>해제 영향</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="mapping : ${groupUsers}" th:attr="data-group-id=${mapping.groupId()}">
|
||||
<tr th:each="mapping : ${groupUsers}" th:attr="data-group-id=${mapping.groupId()}" th:with="impact=${groupImpactByGroupId[mapping.groupId()]}">
|
||||
<td><code th:text="${mapping.groupCode()}">SALES_TEAM</code></td>
|
||||
<td th:text="${mapping.username()}">agent_sales</td>
|
||||
<td class="delete-impact">
|
||||
<span>이 사용자는 그룹 역할을 더 이상 상속하지 않습니다.</span>
|
||||
<strong th:text="${impact == null || #lists.isEmpty(impact.roles()) ? '그룹 역할 없음' : #strings.listJoin(impact.roles(), ', ')}">그룹 역할 없음</strong>
|
||||
</td>
|
||||
<td>
|
||||
<form method="post" action="/groups/users/delete" class="inline-form">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
|
||||
<input type="hidden" name="groupId" th:value="${mapping.groupId()}">
|
||||
<input type="hidden" name="userId" th:value="${mapping.userId()}">
|
||||
<label class="delete-confirm">
|
||||
<input type="checkbox" name="confirmImpact" value="true" required>
|
||||
영향 확인
|
||||
</label>
|
||||
<button class="btn btn-sm btn-outline-danger" type="submit">해제</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr th:if="${#lists.isEmpty(groupUsers)}">
|
||||
<td colspan="3" class="text-muted">등록된 그룹 사용자가 없습니다.</td>
|
||||
<td colspan="4" class="text-muted">등록된 그룹 사용자가 없습니다.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -145,24 +171,35 @@
|
||||
<tr>
|
||||
<th>그룹</th>
|
||||
<th>역할</th>
|
||||
<th>해제 영향</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="mapping : ${groupRoles}" th:attr="data-group-id=${mapping.groupId()}">
|
||||
<tr th:each="mapping : ${groupRoles}" th:attr="data-group-id=${mapping.groupId()}"
|
||||
th:with="groupImpact=${groupImpactByGroupId[mapping.groupId()]},roleImpact=${roleImpactByRoleId[mapping.roleId()]}">
|
||||
<td><code th:text="${mapping.groupCode()}">SALES_TEAM</code></td>
|
||||
<td th:text="${mapping.roleName()}">SALES_ROLE</td>
|
||||
<td class="delete-impact">
|
||||
<span>그룹 사용자가 이 역할 권한을 잃습니다.</span>
|
||||
<strong th:text="${groupImpact == null || #lists.isEmpty(groupImpact.users()) ? '영향 사용자 없음' : #strings.listJoin(groupImpact.users(), ', ')}">영향 사용자 없음</strong>
|
||||
<small th:text="${roleImpact == null || #lists.isEmpty(roleImpact.objectNames()) ? '권한 객체 없음' : #strings.listJoin(roleImpact.objectNames(), ', ')}">권한 객체 없음</small>
|
||||
</td>
|
||||
<td>
|
||||
<form method="post" action="/groups/roles/delete" class="inline-form">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
|
||||
<input type="hidden" name="groupId" th:value="${mapping.groupId()}">
|
||||
<input type="hidden" name="roleId" th:value="${mapping.roleId()}">
|
||||
<label class="delete-confirm">
|
||||
<input type="checkbox" name="confirmImpact" value="true" required>
|
||||
영향 확인
|
||||
</label>
|
||||
<button class="btn btn-sm btn-outline-danger" type="submit">해제</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr th:if="${#lists.isEmpty(groupRoles)}">
|
||||
<td colspan="3" class="text-muted">등록된 그룹 역할이 없습니다.</td>
|
||||
<td colspan="4" class="text-muted">등록된 그룹 역할이 없습니다.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user