Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 0 additions & 78 deletions cmd/server/assets/codes/_codescripts.html

This file was deleted.

92 changes: 38 additions & 54 deletions cmd/server/assets/codes/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
</div>
{{end}}

<h1>{{t $.locale "header.create-verification-code"}}</h1>
<h1>{{t $.locale "codes.issue.header"}}</h1>
<p>
Complete the following form to issue a single-use token to verify a
patient. Do not submit this form until you are prepared to relay
the code to the patient.
{{t $.locale "codes.issue.instructions"}}
</p>

{{/* Calculate the column width based on the number of expected choices */}}
Expand All @@ -53,17 +51,17 @@ <h1>{{t $.locale "header.create-verification-code"}}</h1>
<form id="issue" action="#">
<div id="form-area">
<div class="card mb-3 shadow-sm">
<div class="card-header">{{t $.locale "header.diagnosis"}}</div>
<div class="card-header">{{t $.locale "codes.issue.diagnosis-header"}}</div>
<div class="card-body">
<div class="form-row">
{{if $currentRealm.ValidTestType "confirmed"}}
<div class="form-group col-md-{{$colWidth}}">
<div class="form-check">
<input class="form-check-input" type="radio" name="testType" id="testType1" value="confirmed" checked />
<label class="form-check-label" for="testType1">
<strong>Positive</strong> test
{{t $.locale "codes.issue.confirmed-test"}}
<small class="form-text text-muted">
Confirmed positive test result from an official testing source
{{t $.locale "codes.issue.confirmed-test-details"}}
</small>
</label>
</div>
Expand All @@ -75,9 +73,9 @@ <h1>{{t $.locale "header.create-verification-code"}}</h1>
<div class="form-check">
<input class="form-check-input" type="radio" name="testType" id="testType2" value="likely" />
<label class="form-check-label" for="testType2">
Likely diagnosis
{{t $.locale "codes.issue.likely-test"}}
<small class="form-text text-muted">
Clinical diagnosis without a test
{{t $.locale "codes.issue.likely-test-details"}}
</small>
</label>
</div>
Expand All @@ -89,9 +87,9 @@ <h1>{{t $.locale "header.create-verification-code"}}</h1>
<div class="form-check">
<input class="form-check-input" type="radio" name="testType" id="testType3" value="negative" />
<label class="form-check-label" for="testType3">
<strong>Negative</strong> test
{{t $.locale "codes.issue.negative-test"}}
<small class="form-text text-muted">
Confirmed negative test result from an official testing source
{{t $.locale "codes.issue.negative-test-details"}}
</small>
</label>
</div>
Expand All @@ -102,49 +100,36 @@ <h1>{{t $.locale "header.create-verification-code"}}</h1>
</div>

<div class="card mb-3 shadow-sm">
<div class="card-header">{{t $.locale "header.dates"}}</div>
<div class="card-header">{{t $.locale "codes.issue.dates-header"}}</div>
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-6">
<label for="testDate">Testing date (local time)</label>
<label for="testDate">{{t $.locale "codes.issue.testing-date-label"}}</label>
<input type="date" id="test-date" name="testDate" min="{{.minDate}}" max="{{.maxDate}}" class="form-control" {{if $currentRealm.RequireDate}}required{{end}} />
</div>

<div class="form-group col-md-6">
<label for="symptomDate">Symptoms onset (local time)</label>
<label for="symptomDate">{{t $.locale "codes.issue.symptoms-date-label"}}</label>
<div class="input-group">
<input type="date" id="symptom-date" name="symptomDate" min="{{.minDate}}" max="{{.maxDate}}" class="form-control" {{if $currentRealm.RequireDate}}required{{end}} />
</div>
</div>
</div>

{{if $currentRealm.RequireDate}}
<div class="form-row">
<div class="col">
<small class="form-text text-muted">
{{$currentRealm.Name}} requires at least one date to be
provided.
</small>
</div>
</div>
{{end}}
</div>
</div>

{{ if $hasSMSConfig }}
<div class="card mb-3 shadow-sm">
<div class="card-header">Notification</div>
<div class="card-header">{{t $.locale "codes.issue.sms-text-message-header"}}</div>
<div class="card-body">
<div class="row form-group">
<label for="symptomDate" class="col-sm-3">Patient phone</label>
<div class="col-sm-9">
<label for="symptomDate" class="col-sm-6 col-md-4 col-lg-3">{{t $.locale "codes.issue.sms-text-message-label"}}</label>
<div class="col-sm-6 col-md-8 col-lg-9">
<div class="input-group">
<input type="tel" id="phone" name="phone" class="form-control" autocomplete="off" class="w-100" />
</div>
<small class="form-text text-muted">
If provided, the system will send text containing the code to the
patient. This must be a phone number capable of receiving SMS text
messages.
{{t $.locale "codes.issue.sms-text-message-detail"}}
</small>
</div>
</div>
Expand All @@ -154,40 +139,41 @@ <h1>{{t $.locale "header.create-verification-code"}}</h1>

<div class="row mb-3">
<div class="col">
<button id="submit" type="submit" class="btn btn-primary btn-block">Create verification code</button>
<button id="submit" type="submit" class="btn btn-primary btn-block">{{t $.locale "codes.issue.create-code-button"}}</button>
</div>
</div>
</div>
</form>

<div id="long-code-confirm" class="card d-none mb-3 shadow-sm">
<div class="card-header">
SMS verification link
<span id="long-code-expires-at" class="sm float-right text-danger"></span>
{{t $.locale "codes.issue.sms-verification-link-header"}}
<span id="long-code-expires-at" class="sm float-right text-danger"
data-countdown-prefix="{{t $.locale "codes.issue.countdown-expires-in"}}"
data-countdown-expired="{{t $.locale "codes.issue.countdown-expired"}}"></span>
</div>
<div class="card-body">
<div class="d-flex">
<span class="oi oi-circle-check text-success mr-2 mt-1" aria-hidden="true"></span>
<span>
Successfully sent SMS to <strong id="long-code-phone"></strong>.
Instruct the patient to check their text messages on their mobile
phone where Exposure Notifications is enabled.
{{t $.locale "codes.issue.sms-verification-detail" "<strong id=\"long-code-phone\"></strong>" | safeHTML}}
</span>
</div>
</div>
</div>

<div id="backup-code-confirm" class="card d-none mb-3 shadow-sm">
<div class="card-header">
Backup short code
<span id="backup-code-expires-at" class="sm float-right text-danger"></span>
{{t $.locale "codes.issue.backup-short-code-header"}}
<span id="backup-code-expires-at" class="sm float-right text-danger"
data-countdown-prefix="{{t $.locale "codes.issue.countdown-expires-in"}}"
data-countdown-expired="{{t $.locale "codes.issue.countdown-expired"}}"></span>
</div>
<div class="card-body">
<div class="d-flex">
<span class="oi oi-warning text-warning mr-2 mt-1" aria-hidden="true"></span>
<span>
Share this code with the patient if they did <strong>not</strong>
receive the SMS text message on their mobile phone.
{{t $.locale "codes.issue.backup-short-code-detail"}}
</span>
</div>

Expand All @@ -197,14 +183,16 @@ <h1>{{t $.locale "header.create-verification-code"}}</h1>

<div id="short-code-confirm" class="card d-none mb-3 shadow-sm">
<div class="card-header">
Generated short code
<span id="short-code-expires-at" class="sm float-right text-danger"></span>
{{t $.locale "codes.issue.generated-short-code-header"}}
<span id="short-code-expires-at" class="sm float-right text-danger"
data-countdown-prefix="{{t $.locale "codes.issue.countdown-expires-in"}}"
data-countdown-expired="{{t $.locale "codes.issue.countdown-expired"}}"></span>
</div>
<div class="card-body">
<div class="d-flex">
<span class="oi oi-circle-check text-success mr-2 mt-1" aria-hidden="true"></span>
<span>
Share this code with the patient immediately.
{{t $.locale "codes.issue.generated-short-code-detail"}}
</span>
</div>

Expand All @@ -213,35 +201,31 @@ <h1>{{t $.locale "header.create-verification-code"}}</h1>
</div>

<div id="uuid-confirm" class="card d-none mb-3 shadow-sm">
<div class="card-header">Unique identifier</div>
<div class="card-header">
{{t $.locale "codes.issue.uuid-header"}}
</div>
<div class="card-body">
<p>
<span class="oi oi-info text-info pr-1" aria-hidden="true"></span>
Use this to see if the verification code has been redeemed.
{{t $.locale "codes.issue.uuid-detail"}}
</p>

<div class="form-group row">
<div class="input-group col-sm-8 offset-sm-2">
<input type="text" id="uuid" class="form-control text-monospace">
<div class="input-group-append">
<a class="input-group-text" data-toggle="tooltip" title="Copy to clipboard" data-copy data-copy-target="uuid">
<span class="oi oi-clipboard" aria-hidden="true"></span>
</a>
</div>
{{template "clippy" "uuid"}}
</div>
</div>
</div>
</div>

<div class="row mb-3">
<div class="col">
<button id="reset" class="d-none btn btn-secondary btn-block">Reset and go back</button>
<button id="reset" class="d-none btn btn-secondary btn-block">{{t $.locale "codes.issue.reset-code-button"}}</button>
</div>
</div>
</main>

{{template "codescripts" .}}

<script type="text/javascript">
let $form;
let $inputTestDate;
Expand Down
10 changes: 6 additions & 4 deletions cmd/server/assets/codes/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ <h5 class="mb-1">Status</h5>
{{if not .code.Claimed}}
<div class="list-group-item">
<h5 class="mb-1">Short code expiry</h5>
<span id="code-expires-at" class="sm text-danger">&nbsp;</span>
<span id="code-expires-at" class="sm text-danger"
data-countdown-prefix="{{t $.locale "codes.issue.countdown-expires-in"}}"
data-countdown-expired="{{t $.locale "codes.issue.countdown-expired"}}">&nbsp;</span>
</div>
{{if .code.HasLongExpires}}
<div class="list-group-item">
<h5 class="mb-1">SMS link expiry</h5>
<span id="long-code-expires-at" class="sm text-danger">&nbsp;</span>
<span id="long-code-expires-at" class="sm text-danger"
data-countdown-prefix="{{t $.locale "codes.issue.countdown-expires-in"}}"
data-countdown-expired="{{t $.locale "codes.issue.countdown-expired"}}">&nbsp;</span>
</div>
{{end}}
{{end}}
Expand All @@ -64,8 +68,6 @@ <h5 class="mb-1">SMS link expiry</h5>
<a href="/codes/status" class="card-link">&larr; Enter another code</a>
</main>

{{template "codescripts" .}}

{{if not .code.Claimed}}
<script type="text/javascript">
let $buttonInvalidate = $('button#invalidate');
Expand Down
21 changes: 11 additions & 10 deletions cmd/server/assets/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@
{{.currentUser.Name}}
</a>

<div class="dropdown-menu" aria-labelledby="profile-menu">
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="profile-menu">
{{if .currentRealm }}
{{if .currentUser.CanAdminRealm .currentRealm.ID}}
<h6 class="dropdown-header">Manage realm</h6>
<a class="dropdown-item {{if .currentPath.IsDir "/realm/apikeys"}}active{{end}}" href="/realm/apikeys">{{t $.locale "nav.api-keys"}}</a>
<a class="dropdown-item {{if .currentPath.IsDir "/realm/mobile-apps"}}active{{end}}" href="/realm/mobile-apps">{{t $.locale "nav.mobile-apps"}}</a>
<a class="dropdown-item {{if .currentPath.IsDir "/realm/events"}}active{{end}}" href="/realm/events">{{t $.locale "nav.event-log"}}</a>
Expand All @@ -112,18 +111,20 @@ <h6 class="dropdown-header">Manage realm</h6>
{{end}}
{{end}}

{{if .currentUser.SystemAdmin}}
<h6 class="dropdown-header">System admin</h6>
<a class="dropdown-item {{if .currentPath.IsDir "/admin"}}active{{end}}" href="/admin/realms">System admin</a>
{{if gt (len .currentUser.Realms) 1}}
<a class="dropdown-item {{if .currentPath.IsDir "/login/select-realm"}}active{{end}}" href="/login/select-realm">
{{if .currentRealm}}{{t $.locale "nav.change-realm"}}{{else}}{{t $.locale "nav.select-realm"}}{{end}}
</a>
<div class="dropdown-divider"></div>
{{end}}

<h6 class="dropdown-header">Actions</h6>
{{if gt (len .currentUser.Realms) 1}}
<a class="dropdown-item {{if .currentPath.IsDir "/login/select-realm"}}active{{end}}" href="/login/select-realm">{{if .currentRealm}}Change realm{{else}}Select realm{{end}}</a>
{{if .currentUser.SystemAdmin}}
<a class="dropdown-item {{if .currentPath.IsDir "/admin"}}active{{end}}" href="/admin/realms">{{t $.locale "nav.system-admin"}}</a>
<div class="dropdown-divider"></div>
{{end}}
<a class="dropdown-item {{if .currentPath.IsDir "/account"}}active{{end}}" href="/account">My account</a>
<a class="dropdown-item" href="/signout">Sign out</a>

<a class="dropdown-item {{if .currentPath.IsDir "/account"}}active{{end}}" href="/account">{{t $.locale "nav.my-account"}}</a>
<a class="dropdown-item" href="/signout">{{t $.locale "nav.sign-out"}}</a>
</div>
</li>
{{else}}
Expand Down
Loading