diff --git a/src/components/Ausweis/Ausweisart.svelte b/src/components/Ausweis/Ausweisart.svelte
index b3aabc93..f2252659 100644
--- a/src/components/Ausweis/Ausweisart.svelte
+++ b/src/components/Ausweis/Ausweisart.svelte
@@ -2,9 +2,16 @@
import { Verbrauchsausweis } from "src/lib/Ausweis/Verbrauchsausweis";
import { Gebaeude } from "src/lib/Gebaeude";
import HelpLabel from "~/components/HelpLabel.svelte";
+ import { auditHeizungGebaeudeBaujahr } from "../Verbrauchsausweis/audits/HeizungGebaeudeBaujahr";
+ import { addNotification, deleteNotification } from "../Notifications/shared";
+ import TagInput from "../TagInput.svelte";
+ import { writable } from "svelte/store";
export let gebaeude: Gebaeude;
+ // TODO: Das ist scheise
+ let tags = writable([]);
+
$: ausweis = gebaeude.ausweis || new Verbrauchsausweis();
@@ -71,11 +78,27 @@
/>z.B. 1994-2001.
- {
+ addNotification({
+ message: "Info",
+ subtext: "Wussten sie, dass sie mehrere Jahre angeben können in denen z.B. Renovierungen an ihrer Heizung durchgeführt wurden. Drücken sie dafür einfach Enter oder Space nach jedem Jahr.",
+ dismissable: true,
+ uid: "HEIZUNG_BAUJAHR",
+ timeout: 0,
+ type: "info"
+ });
+ }}
+ onFocusOut={() => {
+ deleteNotification("HEIZUNG_BAUJAHR")
+ }}
+ className="{auditHeizungGebaeudeBaujahr(gebaeude) ? "linked" : ""}"
required
- bind:value={ausweis.baujahr_anlage}
+ autocomplete="off"
+ bind:tags
/>
@@ -92,12 +115,27 @@
-saniert- angeben.
- {
+ addNotification({
+ message: "Info",
+ subtext: "Wussten sie, dass sie mehrere Jahre angeben können in denen z.B. Renovierungen an ihrem Gebäude durchgeführt wurden. Drücken sie dafür einfach Enter oder Space nach jedem Jahr.",
+ dismissable: true,
+ uid: "GEBAEUDE_BAUJAHR",
+ timeout: 0,
+ type: "info"
+ });
+ }}
+ onFocusOut={() => {
+ deleteNotification("GEBAEUDE_BAUJAHR")
+ }}
+ className="{auditHeizungGebaeudeBaujahr(gebaeude) ? "linked" : ""}"
required
autocomplete="off"
- bind:value={gebaeude.baujahr}
+ bind:tags
/>
diff --git a/src/components/Ausweis/Verbrauch.svelte b/src/components/Ausweis/Verbrauch.svelte
index 87d4eda3..0141cbf1 100644
--- a/src/components/Ausweis/Verbrauch.svelte
+++ b/src/components/Ausweis/Verbrauch.svelte
@@ -4,11 +4,11 @@
import Label from "../Label.svelte";
import fuelList from "./fuelList";
import { Verbrauchsausweis } from "src/lib/Ausweis/Verbrauchsausweis";
- import { VerbrauchsausweisGewerbe } from "src/lib/Ausweis/VerbrauchsausweisGewerbe";
- import { Bedarfsausweis } from "src/lib/Ausweis/Bedarfsausweis";
+ import { Gebaeude } from "src/lib/Gebaeude";
+ import { auditVerbrauchAbweichung } from "../Verbrauchsausweis/audits/VerbrauchAbweichung";
let availableYears = [
- 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
+ 2018, 2019,
];
let availableMonths = [
"Januar",
@@ -25,7 +25,7 @@
"Dezember",
];
- export let ausweis: Verbrauchsausweis |VerbrauchsausweisGewerbe | Bedarfsausweis;
+ export let gebaeude: Gebaeude;
const fuelMap: Record = {};
for (const fuel of fuelList) {
@@ -37,11 +37,15 @@
let month: string = "01";
let year: string = "2018";
+ $: ausweis = gebaeude.ausweis || new Verbrauchsausweis();
+
$: {
if (month && year) {
- ausweis.energieverbrauch_zeitraum = moment(`${month}.01.${year}`);
+ ausweis.kennwerte.zeitraum = moment(`${month}.01.${year}`);
}
}
+
+ $: abweichung = auditVerbrauchAbweichung(gebaeude);
@@ -56,7 +60,7 @@
@@ -88,7 +92,7 @@
Koks: Stark kohlenstoffhaltiger Brennstoff.
+
\ No newline at end of file
diff --git a/src/components/Notifications/NotificationWrapper.svelte b/src/components/Notifications/NotificationWrapper.svelte
new file mode 100644
index 00000000..fda211bc
--- /dev/null
+++ b/src/components/Notifications/NotificationWrapper.svelte
@@ -0,0 +1,12 @@
+
+
+
+ {#each Object.entries($notifications) as [uid, notification] (uid)}
+
+ {/each}
+
\ No newline at end of file
diff --git a/src/components/Notifications/RawNotification.svelte b/src/components/Notifications/RawNotification.svelte
new file mode 100644
index 00000000..f156b583
--- /dev/null
+++ b/src/components/Notifications/RawNotification.svelte
@@ -0,0 +1,44 @@
+
+
+
+
+
{@html notification.message}
+
+
+ {#if notification.dismissable}
+
+ {/if}
+
+
+
\ No newline at end of file
diff --git a/src/components/Notifications/RawNotificationWrapper.svelte b/src/components/Notifications/RawNotificationWrapper.svelte
new file mode 100644
index 00000000..4a77163c
--- /dev/null
+++ b/src/components/Notifications/RawNotificationWrapper.svelte
@@ -0,0 +1,3 @@
+