Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

More consistent UI and project structure #533

Merged
merged 6 commits into from
Sep 11, 2020
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
63 changes: 28 additions & 35 deletions cmd/server/assets/admin/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<html lang="en">
<head>
{{template "head" .}}
{{template "floatingform" .}}
</head>

<body>
<body class="bg-light">
{{template "navbar" .}}

<main role="main" class="container">
Expand All @@ -19,28 +20,29 @@ <h1>New realm</h1>
Use the form below to create a new realm.
</p>

<div class="card mb-3">
<div class="card mb-3 shadow-sm">
<div class="card-header">Details</div>
<div class="card-body">
<form method="POST" action="/admin/realms/create">
{{ .csrfField }}

<div class="form-group row">
<label for="name" class="col-sm-3">Name:</label>
<div class="col-sm-9">
<input type="text" id="name" name="name" class="form-control{{if $realm.ErrorsFor "name"}} is-invalid{{end}}" value="{{$realm.Name}}" />
<div class="form-label-group">
<input type="text" id="name" name="name" class="form-control{{if $realm.ErrorsFor "name"}} is-invalid{{end}}" value="{{$realm.Name}}" placeholder="Realm name" />
<label for="name">Realm name</label>
{{if $realm.ErrorsFor "name"}}
<div class="invalid-feedback">
{{joinStrings ($realm.ErrorsFor "name") ", "}}
</div>
{{end}}
</div>
<small class="form-text text-muted">
The realm name should be descriptive. It must also be globally
unique.
</small>
</div>

<div class="form-group row">
<label for="name" class="col-sm-3">Region code:</label>
<div class="col-sm-9">
<input type="text" id="regionCode" name="regionCode" class="form-control{{if $realm.ErrorsFor "regionCode"}} is-invalid{{end}}" value="{{$realm.RegionCode}}" />
<div class="form-label-group">
<input type="text" id="regionCode" name="regionCode" class="form-control{{if $realm.ErrorsFor "regionCode"}} is-invalid{{end}}" value="{{$realm.RegionCode}}" placeholder="Region code" />
<label for="name">Region code</label>
{{if $realm.ErrorsFor "regionCode"}}
<div class="invalid-feedback">
{{joinStrings ($realm.ErrorsFor "regionCode") ", "}}
Expand All @@ -52,14 +54,11 @@ <h1>New realm</h1>
For example, Washington State would be <code>US-WA</code>.
</small>
</div>
</div>

{{if .supportsPerRealmSigning}}
<div class="form-group row">
<label for="type" class="col-sm-3">Certificate signing keys:</label>
<div class="col-sm-9">
<div class="form-group">
<select class="form-control{{if $realm.ErrorsFor "UseRealmCertificateKey"}} is-invalid{{end}}" name="useRealmCertificateKey" id="useRealmCertificateKey">
<option value="true" {{if $realm.UseRealmCertificateKey}}selected{{end}}>Create realm specific signing key</option>
<option value="true" {{if $realm.UseRealmCertificateKey}}selected{{end}}>Create realm-specific signing key</option>
<option value="false" {{if not $realm.UseRealmCertificateKey}}selected{{end}}>Use system signing key</option>
</select>
{{if $realm.ErrorsFor "UseRealmCertificateKey"}}
Expand All @@ -68,49 +67,43 @@ <h1>New realm</h1>
</div>
{{end}}
<small class="form-text text-muted">
It is recommended that you create a realm specific signing key when creating a new realm. However, it
It is recommended that you create a realm-specific signing key when creating a new realm. However, it
is important to note that this once a realm is created, you cannot switch back to using the system
signing key.
</small>
</div>
</div>

<div class="form-group row">
<label for="name" class="col-sm-3">Issuer (iss):</label>
<div class="col-sm-9">
<input type="text" id="certificateIssuer" name="certificateIssuer" class="form-control{{if $realm.ErrorsFor "certificateIssuer"}} is-invalid{{end}}" value="{{$realm.CertificateIssuer}}" />
<div class="form-label-group">
<input type="text" id="certificateIssuer" name="certificateIssuer" class="form-control{{if $realm.ErrorsFor "certificateIssuer"}} is-invalid{{end}}" value="{{$realm.CertificateIssuer}}" placeholder="Issuer (iss)" />
<label for="name">Issuer (iss)</label>
{{if $realm.ErrorsFor "certificateIssuer"}}
<div class="invalid-feedback">
{{joinStrings ($realm.ErrorsFor "certificateIssuer") ", "}}
</div>
{{end}}
<small class="form-text text-muted">
This value is specific to the health authority.<br/>After created using realm specific keys, this field cannot be changed.
This value is specific to the health authority. After created
using realm-specific keys, this field cannot be changed.
</small>
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-3">Audience (aud):</label>
<div class="col-sm-9">
<input type="text" id="certificateAudiance" name="certificateAudiance" class="form-control{{if $realm.ErrorsFor "certificateAudience"}} is-invalid{{end}}" value="{{$realm.CertificateAudience}}" />

<div class="form-label-group">
<input type="text" id="certificateAudiance" name="certificateAudiance" class="form-control{{if $realm.ErrorsFor "certificateAudience"}} is-invalid{{end}}" value="{{$realm.CertificateAudience}}" placeholder="Audience (aud)" />
<label for="name">Audience (aud)</label>
{{if $realm.ErrorsFor "certificateAudience"}}
<div class="invalid-feedback">
{{joinStrings ($realm.ErrorsFor "certificateAudience") ", "}}
</div>
{{end}}
<small class="form-text text-muted">
The audience (<tt>aud</tt>) value is provided the <em>key server</em> operator.<br/>
After upgrading to use realm specific keys, this field cannot be changed.
The audience (<code>aud</code>) value is provided the <em>key
server</em> operator. After upgrading to use realm-specific keys,
this field cannot be changed.
</small>
</div>
</div>
{{end}}

<div class="form-group row">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-primary btn-block">Create realm</button>
</div>
</div>
</form>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/assets/admin/realms.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{template "head" .}}
</head>

<body>
<body class="bg-light">
{{template "navbar" .}}

<main role="main" class="container">
Expand All @@ -19,7 +19,7 @@ <h1>Realms</h1>

{{if .realms}}
<div class="table-responsive">
<table class="table table-bordered table-striped">
<table class="table table-bordered table-striped bg-white">
<thead>
<tr>
<th scope="col">Name</th>
Expand Down
23 changes: 8 additions & 15 deletions cmd/server/assets/apikeys/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<html lang="en">
<head>
{{template "head" .}}
{{template "floatingform" .}}
</head>

<body>
<body class="bg-light">
{{template "navbar" .}}

<main role="main" class="container">
Expand All @@ -19,27 +20,24 @@ <h1>Edit API key</h1>
Use the form below to edit the API key.
</p>

<div class="card mb-3">
<div class="card mb-3 shadow-sm">
<div class="card-header">Details</div>
<div class="card-body">
<form method="POST" action="/apikeys/{{$authApp.ID}}">
<input type="hidden" name="_method" value="PATCH">
{{ .csrfField }}

<div class="form-group row">
<label for="name" class="col-sm-3">App name:</label>
<div class="col-sm-9">
<input type="text" id="name" name="name" class="form-control{{if $authApp.ErrorsFor "name"}} is-invalid{{end}}" value="{{$authApp.Name}}">
<div class="form-label-group">
<input type="text" id="name" name="name" class="form-control{{if $authApp.ErrorsFor "name"}} is-invalid{{end}}" value="{{$authApp.Name}}" placeholder="Application name" autofocus>
<label for="name">Application name</label>
{{if $authApp.ErrorsFor "name"}}
<div class="invalid-feedback">
{{joinStrings ($authApp.ErrorsFor "name") ", "}}
</div>
{{end}}
</div>
</div>
<div class="form-group row">
<label for="type" class="col-sm-3">Type:</label>
<div class="col-sm-9">

<div class="form-group">
<select class="form-control" name="type" id="type" disabled>
<option selected>
{{if (eq $authApp.APIKeyType 0)}}
Expand All @@ -52,13 +50,8 @@ <h1>Edit API key</h1>
</option>
</select>
</div>
</div>

<div class="form-group row">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-primary btn-block">Update API key</button>
</div>
</div>
</form>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/assets/apikeys/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{template "head" .}}
</head>

<body>
<body class="bg-light">
{{template "navbar" .}}

<main role="main" class="container">
Expand All @@ -22,7 +22,7 @@ <h1>API keys</h1>

{{if .apps}}
<div class="table-responsive">
<table class="table table-bordered table-striped">
<table class="table table-bordered table-striped bg-white">
<thead>
<tr>
<th scope="col">App</th>
Expand Down
24 changes: 8 additions & 16 deletions cmd/server/assets/apikeys/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<html lang="en">
<head>
{{template "head" .}}
{{template "floatingform" .}}
</head>

<body>
<body class="bg-light">
{{template "navbar" .}}

<main role="main" class="container">
Expand All @@ -19,29 +20,25 @@ <h1>New API key</h1>
Use the form below to create a new API key.
</p>

<div class="card mb-3">
<div class="card mb-3 shadow-sm">
<div class="card-header">Details</div>
<div class="card-body">
<form method="POST" action="/apikeys">
{{ .csrfField }}

<div class="form-group row">
<label for="name" class="col-sm-3">App name:</label>
<div class="col-sm-9">
<input type="text" id="name" name="name" class="form-control{{if $authApp.ErrorsFor "name"}} is-invalid{{end}}" value="{{$authApp.Name}}">
<div class="form-label-group">
<input type="text" id="name" name="name" class="form-control{{if $authApp.ErrorsFor "name"}} is-invalid{{end}}" value="{{$authApp.Name}}" placeholder="Application name" autofocus>
<label for="name">Application name</label>
{{if $authApp.ErrorsFor "name"}}
<div class="invalid-feedback">
{{joinStrings ($authApp.ErrorsFor "name") ", "}}
</div>
{{end}}
</div>
</div>

<div class="form-group row">
<label for="type" class="col-sm-3">Type:</label>
<div class="col-sm-9">
<div class="form-group">
<select class="form-control{{if $authApp.ErrorsFor "type"}} is-invalid{{end}}" name="type" id="type">
<option value="-1" {{if (eq $authApp.APIKeyType -1)}}selected{{else}}disabled{{end}}>Select...</option>
<option value="-1" {{if (eq $authApp.APIKeyType -1)}}selected{{else}}disabled{{end}}>Select type...</option>
<option value="{{.typeDevice}}" {{if (eq $authApp.APIKeyType .typeDevice)}}selected{{end}}>Device (can verify codes)</option>
<option value="{{.typeAdmin}}" {{if (eq $authApp.APIKeyType .typeAdmin)}}selected{{end}}>Admin (can issue codes)</option>
</select>
Expand All @@ -51,13 +48,8 @@ <h1>New API key</h1>
</div>
{{end}}
</div>
</div>

<div class="form-group row">
<div class="offset-sm-3 col-sm-9">
<button type="submit" class="btn btn-primary btn-block">Create API key</button>
</div>
</div>
</form>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions cmd/server/assets/apikeys/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{template "head" .}}
</head>

<body>
<body class="bg-light">
{{template "navbar" .}}

<main role="main" class="container">
Expand All @@ -26,7 +26,7 @@ <h1>{{$authApp.Name}} API key</h1>
</p>

{{if $apiKey}}
<div class="card mb-3">
<div class="card mb-3 shadow-sm">
<div class="card-header">API key</div>
<div class="card-body">
<div class="alert alert-danger" role="alert">
Expand All @@ -39,7 +39,7 @@ <h1>{{$authApp.Name}} API key</h1>
</div>
{{end}}

<div class="card mb-3">
<div class="card mb-3 shadow-sm">
<div class="card-header">Details</div>
<div class="card-body">
<strong>App name</strong>
Expand All @@ -60,7 +60,7 @@ <h1>{{$authApp.Name}} API key</h1>
</div>
</div>

<div class="card mb-3">
<div class="card mb-3 shadow-sm">
<div class="card-header">Statistics</div>
<div class="card-body table-responsive">
{{if $stats}}
Expand Down
8 changes: 2 additions & 6 deletions cmd/server/assets/codestatus/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1>Verification code status</h1>
Use an identifier to check the status of a code previously shared with your patient.
</p>

<div class="card mb-3">
<div class="card mb-3 shadow-sm">
<div class="card-header">Code status</div>
<div class="card-body">
<form method="POST" action="show" class="floating-form">
Expand All @@ -30,7 +30,7 @@ <h1>Verification code status</h1>
<div class="form-label-group ">
<input type="text" id="uuid" name="uuid"
class='form-control text-monospace{{if $code.ErrorsFor "uuid"}} is-invalid{{end}}'
value="{{$code.UUID}}" placeholder="UUID" autocomplete="off">
value="{{$code.UUID}}" placeholder="UUID" autocomplete="off" required autofocus>
<label for="uuid">UUID</label>
{{if $code.ErrorsFor "uuid"}}
<div class="invalid-feedback">
Expand All @@ -43,11 +43,7 @@ <h1>Verification code status</h1>
</div>
</div>

<div class="row form-group">
<div class="col-sm-9">
<button id="submit" class="btn btn-primary btn-block">Check status</button>
</div>
</div>
</form>
</div>
</div>
Expand Down
Loading