diff options
Diffstat (limited to 'src/main/resources')
5 files changed, 40 insertions, 6 deletions
diff --git a/src/main/resources/db/migration/mariadb/V0_5_0__SubmissionType.sql b/src/main/resources/db/migration/mariadb/V0_5_0__SubmissionType.sql new file mode 100644 index 0000000..79f89d8 --- /dev/null +++ b/src/main/resources/db/migration/mariadb/V0_5_0__SubmissionType.sql @@ -0,0 +1,2 @@ +ALTER TABLE request ADD COLUMN submission_type varchar(16) not null default 'UNKNOWN'; +ALTER TABLE request ADD COLUMN submission_accepted boolean not null default false;
\ No newline at end of file diff --git a/src/main/resources/db/migration/postgresql/V0_5_0__SubmissionType.sql b/src/main/resources/db/migration/postgresql/V0_5_0__SubmissionType.sql new file mode 100644 index 0000000..79f89d8 --- /dev/null +++ b/src/main/resources/db/migration/postgresql/V0_5_0__SubmissionType.sql @@ -0,0 +1,2 @@ +ALTER TABLE request ADD COLUMN submission_type varchar(16) not null default 'UNKNOWN'; +ALTER TABLE request ADD COLUMN submission_accepted boolean not null default false;
\ No newline at end of file diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index 83d98c3..33e5d20 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -360,7 +360,7 @@ form.samplecode-input input:focus-visible { } .border { - padding: 1.5rem; + padding: 1rem; border: 1px solid var(--table-border); border-radius: .5rem; background: white; @@ -382,7 +382,7 @@ table { } table.config-table td:first-child { - width: 24rem; + width: 26rem; min-width: fit-content; } @@ -451,10 +451,13 @@ th { } td { - font-family: monospace; border-bottom: 1px solid var(--bg-gray-op); } +td, td > a { + font-family: monospace; +} + tr:last-of-type > td { border-bottom: none; } @@ -465,10 +468,9 @@ td > small { } td.patient-id { - width: 32rem; + min-width: 20rem; text-overflow: ellipsis; overflow: hidden; - display: block; } td.bg-blue, th.bg-blue, @@ -571,6 +573,11 @@ td.clipboard.clipped { color: white; } +.btn.btn-green { + background: var(--bg-green); + color: white; +} + .btn.btn-blue { background: var(--bg-blue); color: white; diff --git a/src/main/resources/templates/fragments.html b/src/main/resources/templates/fragments.html index f3d95c9..8ecd507 100644 --- a/src/main/resources/templates/fragments.html +++ b/src/main/resources/templates/fragments.html @@ -35,6 +35,20 @@ </ul> </nav> </div> + <th:block th:fragment="accept-initial" sec:authorize="hasRole('USER') or hasRole('ADMIN')"> + <button class="btn" hx-swap="outerHTML" th:hx-delete="@{/submission/{requestId}/accepted(requestId=${request.uuid})}" th:if="${ + request.submissionType.value == 'initial' + and (request.status.value == 'success' or request.status.value == 'warning') + and request.submissionAccepted == true}" title="Keine Meldebestätigung - blockieren"> + 🔒 + </button> + <button class="btn" hx-swap="outerHTML" th:hx-put="@{/submission/{requestId}/accepted(requestId=${request.uuid})}" th:if="${ + request.submissionType.value == 'initial' + and (request.status.value == 'success' or request.status.value == 'warning') + and request.submissionAccepted == false}" title="Meldebestätigung vorhanden - nicht weiter blockieren"> + 🔓 + </button> + </th:block> <footer th:fragment="footer"> <div class="container"> <div> diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 5021bc4..a732fa2 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -42,6 +42,7 @@ <tr> <th>Status</th> <th>Typ</th> + <th sec:authorize="hasRole('USER') or hasRole('ADMIN')" th:if="${postInitialSubmissionBlock}">Aktion</th> <th>ID</th> <th>Datum</th> <th>Patienten-ID</th> @@ -56,7 +57,14 @@ <td th:if="${request.status.value == 'unknown' and request.isPendingUnknown()}" class="bg-yellow"><small>⏰ [[ ${request.status} ]] ⏰</small></td> <td th:if="${request.status.value == 'duplication'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td> <td th:if="${request.status.value == 'no-consent'}" class="bg-blue"><small>[[ ${request.status} ]]</small></td> - <td th:style="${request.type.value == 'delete'} ? 'color: red;'"><small>[[ ${request.type} ]]</small></td> + <td th:if="${request.status.value == 'blocked-initial'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td> + <td th:style="${request.type.value == 'delete'} ? 'color: red;'"> + <small> + [[ ${request.type} ]] + <th:block th:if="${request.submissionType.value != 'unknown'}">([[ ${request.submissionType} ]])</th:block> + </small> + </td> + <td th:insert="~{fragments :: accept-initial}" sec:authorize="hasRole('USER') or hasRole('ADMIN')" th:if="${postInitialSubmissionBlock}"></td> <td th:if="not ${request.report}">[[ ${request.uuid} ]]</td> <td th:if="${request.report}"> <a th:href="@{/report/{id}(id=${request.uuid})}" sec:authorize="hasRole('USER') or hasRole('ADMIN')">[[ ${request.uuid} ]]</a> @@ -78,6 +86,7 @@ </main> <footer th:replace="~{fragments.html :: footer}"></footer> <script th:src="@{/scripts.js}"></script> + <script th:src="@{/webjars/htmx.org/dist/htmx.min.js}"></script> <script> window.addEventListener('load', () => { let keyBindings = { |
