forked from asicudl/sakaiudl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsynchronizationRow.html
122 lines (117 loc) · 6.91 KB
/
synchronizationRow.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<th:block th:fragment="siteRow(row)" th:with="df=#{date.format}">
<!-- Sakai Site Title -->
<div class="col-xs-2">
<th:block th:if="${row.groupSynchronizationsList?.size() > 0 && teamsMap[row.teamId] != null}">
<div role="button" th:title="#{site.id(${row.siteId})}" th:onclick="toggleGroupRow([[${row.id}]])" tabindex="0">
<i th:id="|toggleIcon_${row.id}|" class="fa fa-caret-right"></i>
<span th:text="${row?.site?.title} ?: '???'"></span>
</div>
</th:block>
<span th:if="${row.groupSynchronizationsList?.size() == 0 || teamsMap[row.teamId] == null}" class="site-title-margin" th:text="${row?.site?.title} ?: '???'"></span>
</div>
<!-- Microsoft Team Title -->
<div class="col-xs-2" th:title="#{team.id(${row.teamId})}">
<span th:if="${T(org.sakaiproject.microsoft.api.data.CreationStatus).KO != row.creationStatus && teamsMap[row.teamId] == null}" th:text="'???'"></span>
<div th:if="${teamsMap[row.teamId] != null || T(org.sakaiproject.microsoft.api.data.CreationStatus).KO == row.creationStatus}" >
<div th:switch="${row.creationStatus}" th:title="${row.creationStatus}">
<div th:case="${T(org.sakaiproject.microsoft.api.data.CreationStatus).KO}">
<span th:text="#{error.general_failure}"></span>
<i class="fa fa-solid fa-exclamation-triangle" style="color: #b53d3d;" th:title="#{error.general_failure}"></i>
</div>
<div th:case="${T(org.sakaiproject.microsoft.api.data.CreationStatus).PARTIAL_OK}">
<span th:text="${teamsMap[row.teamId]?.name}" ></span>
<i class="fa fa-solid fa-exclamation-triangle" style="color: #a89e03;" th:title="#{error.channel_number_limit_reached}"></i>
</div>
<div th:case="*"><span th:text="${teamsMap[row.teamId]?.name}"></span></div>
</div>
</div>
<a href='#'
th:if="${teamsMap[row.teamId]?.fullyCreated == false}"
th:title="#{team.id(${row.teamId})}"
th:attr="data-content=#{team.partially_created}"
class="my-info-class fa fa-info-circle"
data-trigger="focus"
data-toggle="popover"
data-placement="top"
>
<span class="sr-only" th:text="#{team.partially_created}"></span>
</a>
</div>
<!-- Start Date -->
<div class="col-xs-2">
<input type="date" th:value="${row.syncDateFrom.toLocalDate()}" data-name="from" onchange="changeDate(this)" th:aria-label="#{index.start_date}" />
</div>
<!-- End Date -->
<div class="col-xs-2">
<input type="date" th:value="${row.syncDateTo.toLocalDate()}" data-name="to" onchange="changeDate(this)" th:aria-label="#{index.end_date}" />
</div>
<!-- Status -->
<div class="col-xs-1 container-flex" th:switch="${row.status}" th:title="${row.status}">
<div style="color: green;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).OK}" th:text="#{status.OK}" />
<div style="color: orange;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).KO}" th:text="#{status.KO}" />
<div style="color: grey;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).NONE}" th:text="#{status.NONE}" />
<div style="color: red;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).ERROR}" th:text="#{status.ERROR}" />
<div style="color: red;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).ERROR_GUEST}" th:text="#{status.ERROR_GUEST}" />
<div style="color: grey;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).NOT_AVAILABLE}" th:text="#{status.NOT_AVAILABLE}" />
</div>
<!-- Forced -->
<div class="col-xs-1 text-center">
<input type="checkbox" th:checked="${row.forced}" onchange="changeForced(this)" th:aria-label="#{forced}" />
</div>
<!-- Actions (Run, Edit Groups) -->
<div class="col-xs-1 multi-button" th:if="${row.teamId != null && row.teamId != ''}">
<!-- Run -->
<a href="#" onclick="doRun(this)" class="run-button" th:classappend="(${today.isBefore(row.syncDateFrom)} or ${today.isAfter(row.syncDateTo)})? 'hidden'">
<i class="fa fa-play" tabindex="0" th:title="#{index.run}"></i>
</a>
<i class="run-button-disabled fa fa-play" th:classappend="(${today.isAfter(row.syncDateFrom)} and ${today.isBefore(row.syncDateTo)})? 'hidden'" th:title="#{index.run.disabled}"></i>
<!-- Edit Groups -->
<a th:href="@{/editGroupSynchronization/{id}(id=${row.id})}" th:title="#{index.edit_groups}">
<i class="fa fa-users"></i>
</a>
</div>
<div class="col-xs-1 multi-button" th:if="${row.teamId == null || row.teamId == ''}">
</div>
<!-- Select -->
<div class="col-xs-1 text-center">
<input name="selectedIds" class="col-xs-1" type="checkbox" th:value="${row.id}" th:aria-label="#{index.selected_id}" />
</div>
</th:block>
<th:block th:fragment="groupRows(siteRow)" th:with="df=#{date.format}">
<th:block th:if="${siteRow.groupSynchronizationsList?.size() > 0}">
<div class="group-table">
<div th:if="${ siteRow.creationStatus == T(org.sakaiproject.microsoft.api.data.CreationStatus).PARTIAL_OK}"
style="background-color: #ffffcc; color: #a89e03; border: 1px solid #a89e03; padding: 10px; border-radius: 5px; margin-bottom: 10px; align-items: center;"
class="yellow-box-alert">
<span th:text="#{group_synch.limit_reach}"></span>
<i class="fa fa-users"></i>
</div>
<div class="row table-space">
<div class="col-xs-4">
<span class="text-bold" th:text="#{group}"></span>
</div>
<div class="col-xs-4">
<span class="text-bold" th:text="#{channel}"></span>
</div>
<div class="col-xs-4">
<span class="text-bold" th:text="#{status}"></span>
</div>
</div>
<div th:each="grouprow : ${siteRow.groupSynchronizationsList}" class="group-row row table-space">
<div class="col-xs-4" th:text="${groupsMap[grouprow.groupId]?.title} ?: '???'" th:title="#{group.id(${grouprow.groupId})}"></div>
<div class="col-xs-4" th:text="${channelsMap[grouprow.channelId]?.name} ?: '???'" th:title="#{channel.id(${grouprow.channelId})}"></div>
<div class="col-xs-4"
th:switch="${grouprow.status}"
th:title="${grouprow.statusUpdatedAt != null} ? #{index.status_updated_at(${#calendars.format(grouprow.statusUpdatedAt, df)})} : #{index.status_not_date}"
>
<div style="color: green;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).OK}" th:text="#{status.OK}" />
<div style="color: orange;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).KO}" th:text="#{status.KO}" />
<div style="color: grey;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).NONE}" th:text="#{status.NONE}" />
<div style="color: red;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).ERROR}" th:text="#{status.ERROR}" />
<div style="color: red;" th:case="${T(org.sakaiproject.microsoft.api.data.SynchronizationStatus).ERROR_GUEST}" th:text="#{status.ERROR_GUEST}" />
</div>
</div>
</div>
</th:block>
<div th:if="${siteRow.groupSynchronizationsList == null || siteRow.groupSynchronizationsList.size() == 0}" th:text="#{empty_table}"></div>
</th:block>