alt text!
This commit is contained in:
parent
5720d7da31
commit
2edbb43b59
3 changed files with 8 additions and 6 deletions
|
@ -30,7 +30,7 @@ Weitere Treffen finden nach Bedarf meist sonntags statt. Tagesordnungen, Protoko
|
|||
|
||||
- Freifunk durch unsere Partnercommunity Freifunk Backnang
|
||||
|
||||
<a href="https://hacknang.de/freifunk/" target="_blank"><img alt="Logo von Freifunk Stuttgart" src="/img/ffs-bk-paths.svg" class="small"></a>
|
||||
<a href="https://hacknang.de/freifunk/" target="_blank"><img alt="Logo von Freifunk Backnang" src="/img/ffs-bk-paths.svg" class="small"></a>
|
||||
|
||||
- Getränke und Snacks der Bar (auch Mate!)
|
||||
- Sofas
|
||||
|
|
|
@ -6,7 +6,8 @@ function checkSpace() {
|
|||
const icon = document.getElementById("space-image");
|
||||
const stateItem = document.getElementById("space-text");
|
||||
let stateText = "",
|
||||
stateLastUpdate = "";
|
||||
stateLastUpdate = "",
|
||||
imageAlt = "";
|
||||
fetch("https://spaceapi.ctbk.de/")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
|
@ -24,16 +25,17 @@ function checkSpace() {
|
|||
dateStyle: "medium",
|
||||
})
|
||||
: "unbekannt";
|
||||
imageAlt = `Space ${openText} seit ${lastchangeString}`;
|
||||
stateText = `Space <strong>${openText}</strong> seit ${lastchangeString}`;
|
||||
stateLastUpdate = `Letzte Statusänderung: ${lastchangeString}`;
|
||||
})
|
||||
.catch((error) => {
|
||||
icon.src = "/img/unknown.png";
|
||||
stateText = "Spacestatus unbekannt";
|
||||
imageAlt = stateText = "Spacestatus unbekannt";
|
||||
console.error("Error on space state retrieval:", error);
|
||||
})
|
||||
.then(() => {
|
||||
icon.alt = stateText;
|
||||
icon.alt = imageAlt;
|
||||
icon.text = stateLastUpdate;
|
||||
stateItem.innerHTML = stateText;
|
||||
});
|
||||
|
|
|
@ -72,13 +72,13 @@ truncate(length=150) %} {% else %} {% set description = "" %} {% endif %}
|
|||
<a href="{{ get_url(path='/verein') }}">Verein</a>
|
||||
<a href="https://fsck.ctbk.de/">FSCK</a>
|
||||
</nav>
|
||||
<p id="space-text"></p>
|
||||
<p id="space-text">Spacestatus unbekannt</p>
|
||||
<!-- TODO: explainer page for the spaceapi and how we implement it -->
|
||||
<a class="image-container" id="space-image-container" href=""
|
||||
><img
|
||||
id="space-image"
|
||||
src="{{ get_url(path='/img/unknown.png') }}"
|
||||
alt="Space Icon"
|
||||
alt="Spacestatus unbekannt"
|
||||
/></a>
|
||||
</header>
|
||||
<main id="main-content">
|
||||
|
|
Loading…
Add table
Reference in a new issue