Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Filter for outdated centers
Browse files Browse the repository at this point in the history
  • Loading branch information
dreske committed Oct 10, 2022
1 parent d11071a commit 47aafe8
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 20 deletions.
13 changes: 12 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ const searchParams: {
appointment: AppointmentType | null,
kind: TestKind | null,
dcc: boolean | null,
includeOutdated: boolean | null
} = {
appointment: null,
kind: null,
dcc: null
dcc: null,
includeOutdated: false
};

(window as any).initMap = initMap;
Expand Down Expand Up @@ -198,6 +200,14 @@ function initializeFilterOptions() {
searchByMapBounds(0);
};
}

const outdatedCheckbox = document.getElementById('includeOutdated-checkbox') as HTMLInputElement;
if (outdatedCheckbox != null) {
outdatedCheckbox.onclick = () => {
searchParams.includeOutdated = outdatedCheckbox.checked;
searchByMapBounds(0);
};
}
}

/**
Expand Down Expand Up @@ -277,6 +287,7 @@ function prepareSearchParams(params: { [id: string]: string | number | boolean |
params['dcc'] = searchParams.dcc;
params['kind'] = searchParams.kind;
params['appointment'] = searchParams.appointment;
params['includeOutdated'] = searchParams.includeOutdated;

return Object.keys(params)
.filter(k => params[k] != null)
Expand Down
70 changes: 51 additions & 19 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CWA - Schnellteststellensuche</title>

<link rel="apple-touch-icon" sizes="180x180" href="https://www.coronawarn.app/assets/img/icons/favicon-180x180.png">
<link rel="apple-touch-icon" sizes="180x180"
href="https://www.coronawarn.app/assets/img/icons/favicon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32"
href="https://www.coronawarn.app/assets/img/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16"
Expand All @@ -29,12 +30,15 @@
<div class="d-flex align-items-center justify-content-center">
<a href="/">
<div class="logo">
<img alt="Corona-Warn-App Logo" src="https://www.coronawarn.app/assets/img/icons/favicon-32x32.png">
<img alt="Corona-Warn-App Logo"
src="https://www.coronawarn.app/assets/img/icons/favicon-32x32.png">
</div>
</a>
<a href="/" title="Startseite">
<div class="title text-light cwa-heading">Corona-Warn-App - Schnellteststellensuche</div>
<div class="title text-light cwa-subheading">Für die Richtigkeit der Teststellendaten sind die Testanbieter
<div class="title text-light cwa-heading">Corona-Warn-App - Schnellteststellensuche
</div>
<div class="title text-light cwa-subheading">Für die Richtigkeit der Teststellendaten
sind die Testanbieter
verantwortlich
</div>
</a>
Expand All @@ -54,7 +58,8 @@
onclick="requestCurrentLocation()">
<i class="fas fa-map-marker-alt"></i>
</button>
<input type="text" id="searchInput" class="form-control" placeholder="Postleitzahl"/>
<input type="text" id="searchInput" class="form-control"
placeholder="Postleitzahl"/>
<button
type="button" class="btn" title="Suchen" onclick="searchCenters()">
<i class="fas fa-search"></i>
Expand All @@ -73,10 +78,12 @@
<div class="filter-items d-flex flex-column flex-xl-row">
<div class="filter-item d-flex justify-content-between my-1 align-items-center">
<div class="searchLabel mx-1">
<span class="text-dark"><i class="fas fa-calendar-alt fa-fw"></i></span>Termin:
<span class="text-dark"><i
class="fas fa-calendar-alt fa-fw"></i></span>Termin:
</div>
<div class="dropdown searchDropdown terminDropdown">
<button class="btn dropdown-toggle py-1" type="button" id="appointment-dropdown-button"
<button class="btn dropdown-toggle py-1" type="button"
id="appointment-dropdown-button"
data-bs-toggle="dropdown" aria-expanded="false">
<!-- populated dynamically--></button>
<ul id="appointment-dropdown" class="dropdown-menu"
Expand All @@ -89,10 +96,12 @@

<div class="filter-item d-flex justify-content-between my-1 align-items-center">
<div class="searchLabel mx-1">
<span class="text-dark"><i class="fas fa-prescription-bottle-alt fa-fw"></i></span>Test-Art:
<span class="text-dark"><i
class="fas fa-prescription-bottle-alt fa-fw"></i></span>Test-Art:
</div>
<div class="dropdown searchDropdown testArtDropdown">
<button class="btn dropdown-toggle py-1" type="button" id="testKind-dropdown-button"
<button class="btn dropdown-toggle py-1" type="button"
id="testKind-dropdown-button"
data-bs-toggle="dropdown" aria-expanded="false">
<!-- populated dynamically--> </button>
<ul id="testKind-dropdown" class="dropdown-menu"
Expand All @@ -112,9 +121,22 @@
Digital Covid Certificate:
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="dcc-checkbox"/>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
id="dcc-checkbox"/>
</div>
</div>

<div class="filter-item d-flex justify-content-between my-1 align-items-center">
<div class="searchLabel d-flex align-items-center">
<label class="form-check-label mx-1" for="includeOutdated-checkbox">
Auch veraltete anzeigen:
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
id="includeOutdated-checkbox"/>
</div>
</div>

</div>
Expand Down Expand Up @@ -160,7 +182,8 @@ <h3 id="name" class="center-name flex-grow-1 px-1">Muster</h3>
<img id="dccLogo"
title="Digital Covid Pass verfügbar" class="dccLogo me-1" src="/img/dcc.png"
alt="Digital Covid Pass verfügbar"/>
<i class="far fa-window-close close-button align-self-baseline me-1" onclick="clearSelection()"></i>
<i class="far fa-window-close close-button align-self-baseline me-1"
onclick="clearSelection()"></i>
</div>
</div>
<div class="card-body pt-1">
Expand Down Expand Up @@ -190,15 +213,17 @@ <h3 id="name" class="center-name flex-grow-1 px-1">Muster</h3>
<div class="d-flex flex-row mt-1">
<span class="text-dark"><i class="fas fa-clock"></i></span>
<p class="card-text ms-2">
<a id="openinghours-button" href="#openinghours-panel" data-bs-toggle="collapse"
<a id="openinghours-button" href="#openinghours-panel"
data-bs-toggle="collapse"
class="text-main collapse-button link">
Öffnungszeiten</a>
<span id="no-openinghours">Keine Öffnungszeiten angegeben</span>
</p>
</div>
<div id="openinghours-panel" class="collapse">
<!-- List with details about time -->
<div class="card card-body" style="background-color: transparent;padding: 0.5rem">
<div class="card card-body"
style="background-color: transparent;padding: 0.5rem">
<ul id="openinghours-list" style="margin-bottom: 0.5rem">
</ul>
</div>
Expand Down Expand Up @@ -257,9 +282,15 @@ <h3 id="name" class="center-name flex-grow-1 px-1">Muster</h3>
<option value="Öffnungszeiten falsch">Öffnungszeiten falsch</option>
<option value="Teststelle geschlossen">Teststelle geschlossen</option>
<option value="Falsche Angaben">Falsche Angaben</option>
<option value="Testergebnis kommt nicht an">Testergebnis kommt nicht an</option>
<option value="Testzertifikat kommt nicht an">Testzertifikat kommt nicht an</option>
<option value="Angaben zu Testmöglichkeiten fehlerhaft">Angaben zu Testmöglichkeiten fehlerhaft</option>
<option value="Testergebnis kommt nicht an">Testergebnis kommt nicht
an
</option>
<option value="Testzertifikat kommt nicht an">Testzertifikat kommt nicht
an
</option>
<option value="Angaben zu Testmöglichkeiten fehlerhaft">Angaben zu
Testmöglichkeiten fehlerhaft
</option>
<option value="Sonstiges">Sonstiges</option>
</select>
</div>
Expand All @@ -273,7 +304,8 @@ <h3 id="name" class="center-name flex-grow-1 px-1">Muster</h3>
<a id="submitReport" class="btn btn-sm btn-secondary" target="_blank"
onclick="submitReport();"><i class="fas fa-save"></i> Abschicken</a>
<a id="closeReport" class="btn btn-sm btn-secondary" target="_blank"
onclick="toggleReportPanel(true);"><i class="fas fa-window-close"></i> Abbrechen</a>
onclick="toggleReportPanel(true);"><i class="fas fa-window-close"></i>
Abbrechen</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 47aafe8

Please sign in to comment.