aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-11-06 20:28:27 +0100
committermetamuffin <metamuffin@disroot.org>2023-11-06 20:30:25 +0100
commit546a9cd375383fba9ee2fb6050935ca247e770f6 (patch)
tree73da81d815b403b91e3a62a26b0edce0b24d965f
parent556bbf51d928b0eb774b81e43b20c78bea191f7f (diff)
downloadfastbangs-546a9cd375383fba9ee2fb6050935ca247e770f6.tar
fastbangs-546a9cd375383fba9ee2fb6050935ca247e770f6.tar.bz2
fastbangs-546a9cd375383fba9ee2fb6050935ca247e770f6.tar.zst
insert hyperlink to source
-rw-r--r--fastbangs.cabal2
-rw-r--r--frontend/helper.ts6
-rw-r--r--frontend/style.sass3
-rw-r--r--frontend/ui.ts10
4 files changed, 15 insertions, 6 deletions
diff --git a/fastbangs.cabal b/fastbangs.cabal
index 6b6e5a9..c9bedfa 100644
--- a/fastbangs.cabal
+++ b/fastbangs.cabal
@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: fastbangs
-version: 0.1.0.1
+version: 0.1.0.2
category: Web
homepage: https://codeberg.org/lialenck/fastbangs
author: Lia Lenckowski
diff --git a/frontend/helper.ts b/frontend/helper.ts
index 827a204..c511b59 100644
--- a/frontend/helper.ts
+++ b/frontend/helper.ts
@@ -34,10 +34,8 @@ function apply_opts<E extends HTMLElement>(e: E, o: Opts<E>) {
export function e<K extends keyof HTMLElementTagNameMap>(name: K, opts: Opts<HTMLElementTagNameMap[K]>, ...children: (HTMLElement | string)[]): HTMLElementTagNameMap[K] {
const el = document.createElement(name)
apply_opts(el, opts)
- for (const c of children) {
- if (typeof c == "string") el.textContent += c
- else el.append(c)
- }
+ for (const c of children)
+ el.append(c)
return el
}
diff --git a/frontend/style.sass b/frontend/style.sass
index 1b0173c..e0039bb 100644
--- a/frontend/style.sass
+++ b/frontend/style.sass
@@ -31,6 +31,9 @@ h1
&.level-warn
color: $warn
+footer
+ margin: 5em
+
section.info
margin: 5em
diff --git a/frontend/ui.ts b/frontend/ui.ts
index f0146c5..eb0be63 100644
--- a/frontend/ui.ts
+++ b/frontend/ui.ts
@@ -1,3 +1,4 @@
+import { e } from "./helper.ts";
import { section_info_search, section_search } from "./search.ts";
import { section_engine_select, section_info_start, section_admin_btn } from "./start.ts";
import { section_submit } from "./submit.ts";
@@ -7,7 +8,7 @@ export function add_page_content(engine?: string) {
for (const e of [...document.getElementsByTagName("section")]) e.remove()
if (engine == "~submit") document.body.append(section_submit())
else if (engine) document.body.append(section_search(engine), section_info_search())
- else document.body.append(section_info_start(), section_engine_select(), section_admin_btn())
+ else document.body.append(section_info_start(), section_engine_select(), footer(), section_admin_btn())
}
let status_el: HTMLElement
@@ -20,3 +21,10 @@ export function status(level: "error" | "info" | "success" | "warn", text: strin
status_el.classList.value = ""
status_el.classList.add("status", `level-${level}`)
}
+
+export function footer() {
+ return e("footer", {},
+ e("p", {}, "Fastbangs is free software (AGPL-3.0-only)! Find the source code on ",
+ e("a", { href: "https://codeberg.org/lialenck/fastbangs" }, "Codeberg"), ".")
+ )
+}