tawny/app/templates_src/root.lisp
2025-08-26 21:27:11 -04:00

106 lines
4.3 KiB
Common Lisp

(text "{%- import \"components.lisp\" as components -%}")
(text "<!doctype html>")
(html
("lang" "en")
(head
(meta ("charset" "UTF-8"))
(meta ("name" "viewport") ("content" "width=device-width, initial-scale=1.0"))
(meta ("http-equiv" "X-UA-Compatible") ("content" "ie=edge"))
(link ("rel" "stylesheet") ("href" "https://repodelivery.tetratto.com/tetratto/crates/app/src/public/css/utility.css"))
(link ("rel" "stylesheet") ("href" "/public/style.css?v={{ build_code }}"))
(meta ("name" "theme-color") ("content" "{{ theme_color }}"))
(meta ("property" "og:type") ("content" "website"))
(meta ("property" "og:site_name") ("content" "{{ name }}"))
(meta ("property" "og:title") ("content" "{{ name }}"))
(meta ("property" "twitter:title") ("content" "{{ name }}"))
(link ("rel" "icon") ("href" "/public/favicon.svg"))
(script ("src" "/public/app.js?v={{ build_code }}") ("defer"))
(script ("src" "/public/tokens.js?v={{ build_code }}") ("defer"))
(text "{% block head %}{% endblock %}"))
(body
; nav
(nav
("class" "flex w_full justify_between gap_2")
(div
("class" "flex side")
(div
("class" "dropdown")
(button
("onclick" "open_dropdown(event)")
("exclude" "dropdown")
("class" "button camo")
(text "{% if user -%}")
(text "{{ components::avatar(id=user.id) }}")
(text "{%- else -%}")
(text "{{ icon \"menu\" }}")
(text "{%- endif %}"))
(div
("class" "inner left")
(a
("class" "button")
("href" "/")
(text "home"))
(a
("class" "button")
("href" "https://trisua.com/t/tawny")
(text "source"))
(hr)
(text "{% if not user -%}")
(a
("class" "button")
("href" "/login")
(text "login"))
(a
("class" "button")
("href" "{{ config.service_hosts.tetratto }}/auth/register")
(text "sign up"))
(text "{%- else -%}")
(a
("class" "button")
("href" "/chats")
(text "my chats"))
(a
("class" "button")
("href" "{{ config.service_hosts.tetratto }}/settings")
(text "settings"))
(button
("class" "button red")
("onclick" "user_logout()")
(text "logout"))
(text "{%- endif %}")
(text "{% block dropdown %}{% endblock %}"))))
(div
("class" "side flex")
(text "{% block nav_extras %}{% endblock %}")
; theme switches
(button
("class" "button camo fade filled")
("id" "switch_light")
("title" "Switch theme")
("onclick" "set_theme('Dark')")
(text "{{ icon \"sun\" }}"))
(button
("class" "button camo fade filled hidden")
("id" "switch_dark")
("title" "Switch theme")
("onclick" "set_theme('Light')")
(text "{{ icon \"moon\" }}"))))
; page
(article
("class" "content_container flex flex_col")
("id" "page")
(ul ("id" "messages"))
(text "{% block body %}{% endblock %}")
(div ("style" "min-height: 32px")))
(script (text "setTimeout(() => init_dropdowns(document.body), 150);"))))