tawny/app/templates_src/root.lisp

119 lines
5.1 KiB
Common Lisp
Raw Normal View History

2025-08-24 17:58:39 -04:00
(text "{%- import \"components.lisp\" as components -%}")
2025-08-20 16:19:08 +00:00
(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"))
2025-08-23 22:07:14 -04:00
(link ("rel" "stylesheet") ("href" "https://repodelivery.tetratto.com/tetratto/crates/app/src/public/css/utility.css"))
2025-08-20 16:19:08 +00:00
(link ("rel" "stylesheet") ("href" "/public/style.css?v={{ build_code }}"))
(meta ("name" "theme-color") ("content" "{{ theme_color }}"))
(meta ("property" "og:type") ("content" "website"))
2025-09-01 20:17:32 -04:00
(meta ("property" "og:site_name") ("content" "{{ config.name }}"))
2025-08-20 16:19:08 +00:00
2025-09-01 20:17:32 -04:00
(meta ("property" "og:title") ("content" "{{ config.name }}"))
(meta ("property" "twitter:title") ("content" "{{ config.name }}"))
2025-08-24 17:04:27 -04:00
(link ("rel" "icon") ("href" "/public/favicon.svg"))
2025-08-20 16:19:08 +00:00
(script ("src" "/public/app.js?v={{ build_code }}") ("defer"))
2025-08-24 17:04:27 -04:00
(script ("src" "/public/tokens.js?v={{ build_code }}") ("defer"))
2025-08-20 16:19:08 +00:00
(text "{% block head %}{% endblock %}"))
(body
2025-09-01 20:17:32 -04:00
("class" "{% if user and user.settings.use_system_font -%} use_system_font {%- endif %}")
(text "{% if user and use_user_theme -%} {{ components::theme(user=user, theme_preference=user.settings.theme_preference) }} {%- endif %}")
2025-08-20 16:19:08 +00:00
; nav
(nav
2025-08-26 00:24:12 -04:00
("class" "flex w_full justify_between gap_2")
2025-08-20 16:19:08 +00:00
(div
("class" "flex side")
(div
("class" "dropdown")
(button
("onclick" "open_dropdown(event)")
("exclude" "dropdown")
2025-08-24 17:58:39 -04:00
("class" "button camo")
(text "{% if user -%}")
(text "{{ components::avatar(id=user.id) }}")
(text "{%- else -%}")
(text "{{ icon \"menu\" }}")
(text "{%- endif %}"))
2025-08-20 16:19:08 +00:00
(div
("class" "inner left")
(a
("class" "button")
2025-09-01 20:17:32 -04:00
("href" "{% if user -%} /chats {%- else -%} / {%- endif %}")
2025-08-20 16:19:08 +00:00
(text "home"))
(a
("class" "button")
2025-08-26 21:27:11 -04:00
("href" "https://trisua.com/t/tawny")
2025-08-20 16:19:08 +00:00
(text "source"))
2025-08-24 17:04:27 -04:00
(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" "/@{{ user.username }}")
(text "my profile"))
2025-08-24 17:04:27 -04:00
(a
("class" "button")
("href" "{{ config.service_hosts.tetratto }}/settings")
(text "settings"))
(button
("class" "button red")
("onclick" "user_logout()")
(text "logout"))
(text "{%- endif %}")
2025-09-01 20:17:32 -04:00
(text "{% block dropdown %}{% endblock %}")))
(text "{% if user -%}")
(a
("href" "{{ config.service_hosts.tetratto }}/notifs")
("class" "button camo fade")
(text "{% if user.notification_count > 0 -%}")
(span ("class" "red") (text "{{ icon \"bell-dot\" }}"))
(text "{% else %}")
(text "{{ icon \"bell\" }}")
(text "{%- endif %}"))
(text "{%- endif %}"))
2025-08-20 16:19:08 +00:00
(div
("class" "side flex")
(text "{% block nav_extras %}{% endblock %}")
; theme switches
(button
2025-08-24 17:04:27 -04:00
("class" "button camo fade filled")
2025-08-20 16:19:08 +00:00
("id" "switch_light")
("title" "Switch theme")
("onclick" "set_theme('Dark')")
(text "{{ icon \"sun\" }}"))
(button
2025-08-24 17:04:27 -04:00
("class" "button camo fade filled hidden")
2025-08-20 16:19:08 +00:00
("id" "switch_dark")
("title" "Switch theme")
("onclick" "set_theme('Light')")
(text "{{ icon \"moon\" }}"))))
; page
(article
("class" "content_container flex flex_col")
("id" "page")
2025-09-07 16:19:40 -04:00
(ul ("class" "hidden") ("id" "messages"))
(text "{% block body %}{% endblock %}"))
2025-08-20 16:19:08 +00:00
(script (text "setTimeout(() => init_dropdowns(document.body), 150);"))))