chore: clean up repo
This commit is contained in:
parent
7d93dffaed
commit
92bc424361
11 changed files with 7 additions and 900 deletions
|
@ -1,39 +0,0 @@
|
|||
(text "{% extends \"root.lisp\" %} {% block head %}")
|
||||
(title
|
||||
(text "Create reclaim for \"{{ entry.slug }}\" - {{ name }}"))
|
||||
(link ("rel" "icon") ("href" "/public/favicon.svg"))
|
||||
(text "{% endblock %} {% block body %}")
|
||||
(div
|
||||
("class" "card container")
|
||||
(h1 (text "{{ entry.slug }}"))
|
||||
(p (text "Custom slug reclaims are handled through ") (b (text "{{ tetratto }}")) (text ". You'll need to have an account there to submit a claim request."))
|
||||
(p (text "Please note that you are unlikely to receive a response unless your claim is accepted. Please do not submit additional requests for the same slug."))
|
||||
|
||||
(text "{% if metadata.tetratto_owner_username -%}")
|
||||
; contact owner text
|
||||
(p (text "Since this entry is connected to a user, it is encouraged that you directly contact the owner of the entry instead. If that doesn't work, you can create a regular request."))
|
||||
(text "{%- endif %}")
|
||||
|
||||
(p (text "Once you're ready, you can submit a claim using the button below."))
|
||||
(hr)
|
||||
(ul
|
||||
(li (b (text "Requsted slug: ")) (text "{{ entry.slug }}"))
|
||||
(li (b (text "Last updated: ")) (text "{{ entry.edited / 1000|int|date(format=\"%Y-%m-%d %H:%M\", timezone=\"Etc/UTC\") }} UTC")))
|
||||
(hr)
|
||||
(text "{% if claimable -%}")
|
||||
(text "{% if metadata.tetratto_owner_username -%}")
|
||||
; contact owner button
|
||||
(a
|
||||
("href" "{{ tetratto }}/mail/compose?receivers={{ tetratto_owner_username }}&subject=Reclaim%20for%20%22{{ entry.slug }}%22")
|
||||
("class" "button surface no_fill")
|
||||
(text "{{ icon \"external-link\" }} Contact owner"))
|
||||
(text "{%- endif %}")
|
||||
|
||||
(a
|
||||
("href" "{{ tetratto }}/mail/compose?receivers={{ tetratto_handler_account_username }}&subject=Reclaim%20for%20%22{{ entry.slug }}%22")
|
||||
("class" "button surface no_fill")
|
||||
(text "{{ icon \"external-link\" }} Submit request"))
|
||||
(text "{% else %}")
|
||||
(span (text "This slug is currently not claimable as it was edited too recently. ") (a ("href" "/{{ entry.slug }}") ("class" "red") (text "Go back")))
|
||||
(text "{%- endif %}"))
|
||||
(text "{% endblock %}")
|
|
@ -1,13 +0,0 @@
|
|||
(text "{% extends \"root.lisp\" %} {% block head %}")
|
||||
(title
|
||||
(text "{{ file_name }} - {{ name }}"))
|
||||
(link ("rel" "icon") ("href" "/public/favicon.svg"))
|
||||
(text "{% endblock %} {% block body %}")
|
||||
(div
|
||||
("class" "card container")
|
||||
(p (text "{{ text|markdown|safe }}")))
|
||||
|
||||
(link ("rel" "stylesheet") ("href" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css"))
|
||||
(script ("src" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"))
|
||||
(script (text "hljs.highlightAll();"))
|
||||
(text "{% endblock %}")
|
|
@ -1,209 +0,0 @@
|
|||
(text "{% extends \"root.lisp\" %} {% block head %}")
|
||||
(title
|
||||
(text "{{ entry.slug }}"))
|
||||
(link ("rel" "icon") ("href" "/public/favicon.svg"))
|
||||
(text "{% endblock %} {% block body %}")
|
||||
(div
|
||||
("class" "flex items_center bar")
|
||||
(button
|
||||
("class" "button tab_button")
|
||||
("id" "editor_tab_button")
|
||||
("onclick" "tab_editor()")
|
||||
(text "Edit"))
|
||||
(button
|
||||
("class" "button camo tab_button")
|
||||
("id" "preview_tab_button")
|
||||
("onclick" "tab_preview()")
|
||||
(text "Preview"))
|
||||
(button
|
||||
("class" "button camo tab_button")
|
||||
("id" "metadata_tab_button")
|
||||
("onclick" "tab_metadata()")
|
||||
(text "Metadata")
|
||||
(a
|
||||
("class" "button simple surface")
|
||||
("href" "/docs/metadata")
|
||||
("target" "_blank")
|
||||
("title" "Info")
|
||||
(text "i"))))
|
||||
(div
|
||||
("class" "flex justify_center tab")
|
||||
(div
|
||||
("class" "card tab tabs container w_full")
|
||||
("id" "tabs_group")
|
||||
(div
|
||||
("id" "editor_tab")
|
||||
("class" "tab fadein w_full"))
|
||||
(div
|
||||
("id" "preview_tab")
|
||||
("class" "tab fadein hidden w_full"))
|
||||
(div
|
||||
("id" "metadata_tab")
|
||||
("class" "tab fadein hidden w_full"))))
|
||||
(form
|
||||
("class" "w_full flex flex_col gap_2")
|
||||
("style" "margin-top: var(--pad-2)")
|
||||
("onsubmit" "edit_entry(event)")
|
||||
(div
|
||||
("class" "w_full flex gap_2")
|
||||
(input
|
||||
("class" "w_full")
|
||||
("type" "text")
|
||||
("minlength" "2")
|
||||
("name" "edit_code")
|
||||
("required" "")
|
||||
("placeholder" "Enter edit code"))
|
||||
(input ("class" "w_full") ("style" "visibility: hidden") ("aria-hidden" "true") ("disabled" "true"))
|
||||
(input ("class" "w_full") ("style" "visibility: hidden") ("aria-hidden" "true") ("disabled" "true")))
|
||||
(div
|
||||
("class" "flex gap_2")
|
||||
(input
|
||||
("class" "w_full")
|
||||
("type" "text")
|
||||
("minlength" "2")
|
||||
("name" "new_edit_code")
|
||||
("placeholder" "New edit code"))
|
||||
(input
|
||||
("class" "w_full")
|
||||
("type" "text")
|
||||
("minlength" "2")
|
||||
("name" "new_modify_code")
|
||||
("placeholder" "New modify code"))
|
||||
(input
|
||||
("class" "w_full")
|
||||
("type" "text")
|
||||
("minlength" "2")
|
||||
("name" "new_slug")
|
||||
("oninput" "check_exists_input(event)")
|
||||
("placeholder" "New url")))
|
||||
(div
|
||||
("class" "w_full flex justify_between gap_2")
|
||||
(div
|
||||
("class" "flex gap_2")
|
||||
(button
|
||||
("class" "button green")
|
||||
(span ("ui_ident" "text") (text "Save"))
|
||||
(span ("class" "hidden loader no_fill") ("ui_ident" "loader") (text "{{ icon \"loader-circle\" }}")))
|
||||
(a
|
||||
("href" "/{{ entry.slug }}")
|
||||
("class" "button")
|
||||
(text "Back")))
|
||||
|
||||
(button
|
||||
("class" "button red")
|
||||
("type" "button")
|
||||
("onclick" "document.getElementById('delete_modal').showModal()")
|
||||
("id" "fake_delete_button")
|
||||
(span ("ui_ident" "text") (text "Delete"))
|
||||
(span ("class" "hidden loader no_fill") ("ui_ident" "loader") (text "{{ icon \"loader-circle\" }}")))
|
||||
|
||||
(dialog
|
||||
("id" "delete_modal")
|
||||
(div
|
||||
("class" "inner")
|
||||
(h2 ("class" "text_center w_full") (text "Delete {{ entry.slug }}?"))
|
||||
(p (text "Deleting this entry will make its custom slug claimable by anyone."))
|
||||
(p (text "Please ensure that you understand the consequences of deleting this entry before continuing."))
|
||||
(hr ("class" "margin"))
|
||||
(div
|
||||
("class" "w_full flex gap_2 justify_between")
|
||||
(button
|
||||
("class" "button")
|
||||
("type" "button")
|
||||
("onclick" "document.getElementById('delete_modal').close()")
|
||||
(text "Cancel"))
|
||||
(button
|
||||
("class" "button red")
|
||||
("ui_ident" "delete")
|
||||
("onclick" "document.getElementById('delete_modal').close()")
|
||||
(text "Delete")))))))
|
||||
|
||||
; editor
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/lib/codemirror.js"))
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/mode/markdown/markdown.js"))
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/mode/toml/toml.js"))
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/addon/display/placeholder.js"))
|
||||
(link ("rel" "stylesheet") ("href" "https://unpkg.com/codemirror@5.39.2/lib/codemirror.css"))
|
||||
(script ("src" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"))
|
||||
(link ("rel" "stylesheet") ("href" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css"))
|
||||
|
||||
(script ("id" "editor_content") ("type" "text/markdown") (text "{{ entry.content|remove_script_tags|safe }}"))
|
||||
(script ("id" "editor_metadata_content") ("type" "text/markdown") (text "{{ entry.metadata|remove_script_tags|safe }}"))
|
||||
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
globalThis.init_editor();
|
||||
globalThis.init_editor(\"metadata_editor\", \"toml\", \"metadata_tab\", \"editor_metadata_content\");
|
||||
}, 150);
|
||||
|
||||
globalThis.edit_entry = (e) => {
|
||||
e.preventDefault();
|
||||
const rm = e.submitter.getAttribute(\"ui_ident\") === \"delete\";
|
||||
|
||||
const { load, failed } = submitter_load(rm ? document.getElementById(\"fake_delete_button\") : e.submitter);
|
||||
load();
|
||||
|
||||
fetch(\"/api/v1/entries/{{ entry.id }}\", {
|
||||
method: \"POST\",
|
||||
headers: {
|
||||
\"Content-Type\": \"application/json\",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
content: globalThis.editor.getValue(),
|
||||
edit_code: e.target.edit_code.value,
|
||||
new_slug: e.target.new_slug.value || undefined,
|
||||
new_edit_code: e.target.new_edit_code.value || undefined,
|
||||
new_modify_code: e.target.new_modify_code.value || undefined,
|
||||
metadata: globalThis.metadata_editor.getValue(),
|
||||
\"delete\": rm,
|
||||
}),
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then((res) => {
|
||||
if (res.ok) {
|
||||
globalThis.ALLOW_LEAVE = true;
|
||||
|
||||
if (!rm) {
|
||||
document.cookie = `Atto-Message=\"Entry updated\"; path=/`;
|
||||
document.cookie = \"Atto-Message-Good=true; path=/\";
|
||||
window.location.href = `/${res.payload}`;
|
||||
} else {
|
||||
document.cookie = `Atto-Message=\"Entry deleted\"; path=/`;
|
||||
document.cookie = \"Atto-Message-Good=true; path=/\";
|
||||
window.location.href = \"/\";
|
||||
}
|
||||
} else {
|
||||
show_message(res.message, false);
|
||||
failed();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
globalThis.download = (content, type, name) => {
|
||||
const blob = new Blob([content], { type });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const anchor = document.createElement(\"a\");
|
||||
|
||||
anchor.setAttribute(\"download\", name);
|
||||
anchor.href = url;
|
||||
anchor.click();
|
||||
anchor.remove();
|
||||
}"))
|
||||
(text "{% endblock %}")
|
||||
|
||||
(text "{% block dropdown %}")
|
||||
(hr)
|
||||
(span ("class" "title") (text "export"))
|
||||
(button
|
||||
("class" "button")
|
||||
("onclick" "download(globalThis.editor.getValue(), 'text/markdown', '{{ entry.slug }}.md')")
|
||||
(text "markdown"))
|
||||
(button
|
||||
("class" "button")
|
||||
("onclick" "download(globalThis.metadata_editor.getValue(), 'application/toml', '{{ entry.slug }}.toml')")
|
||||
(text "metadata"))
|
||||
(button
|
||||
("class" "button")
|
||||
("onclick" "(async () => { download(await get_preview(), 'text/html', '{{ entry.slug }}.html') })();")
|
||||
(text "html"))
|
||||
(text "{%- endblock %}")
|
|
@ -6,112 +6,5 @@
|
|||
(meta ("property" "twitter:title") ("content" "{{ name }}"))
|
||||
(link ("rel" "icon") ("href" "/public/favicon.svg"))
|
||||
(text "{% endblock %} {% block body %}")
|
||||
(div
|
||||
("class" "flex items_center bar")
|
||||
(button
|
||||
("class" "button tab_button")
|
||||
("id" "editor_tab_button")
|
||||
("onclick" "tab_editor()")
|
||||
(text "Edit"))
|
||||
(button
|
||||
("class" "button camo tab_button")
|
||||
("id" "preview_tab_button")
|
||||
("onclick" "tab_preview()")
|
||||
(text "Preview"))
|
||||
(button
|
||||
("class" "button camo tab_button")
|
||||
("id" "metadata_tab_button")
|
||||
("onclick" "tab_metadata()")
|
||||
(text "Metadata")
|
||||
(a
|
||||
("class" "button simple surface")
|
||||
("href" "/docs/metadata")
|
||||
("target" "_blank")
|
||||
("title" "Info")
|
||||
(text "i"))))
|
||||
(div
|
||||
("class" "flex justify_center tab")
|
||||
(div
|
||||
("class" "card tab tabs container w_full")
|
||||
("id" "tabs_group")
|
||||
(div
|
||||
("id" "editor_tab")
|
||||
("class" "tab fadein w_full"))
|
||||
(div
|
||||
("id" "preview_tab")
|
||||
("class" "tab fadein hidden w_full"))
|
||||
(div
|
||||
("id" "metadata_tab")
|
||||
("class" "tab fadein hidden w_full"))))
|
||||
(form
|
||||
("class" "w_full flex justify_between gap_2 flex_collapse_rev")
|
||||
("style" "margin-top: var(--pad-2)")
|
||||
("onsubmit" "create_entry(event)")
|
||||
(button
|
||||
("class" "button")
|
||||
(span ("ui_ident" "text") (text "Go"))
|
||||
(span ("class" "hidden loader no_fill") ("ui_ident" "loader") (text "{{ icon \"loader-circle\" }}")))
|
||||
(div
|
||||
("class" "flex gap_2")
|
||||
(input
|
||||
("class" "w_full")
|
||||
("type" "text")
|
||||
("minlength" "2")
|
||||
("name" "edit_code")
|
||||
("placeholder" "Custom edit code"))
|
||||
(input
|
||||
("class" "w_full")
|
||||
("type" "text")
|
||||
("minlength" "2")
|
||||
("maxlength" "32")
|
||||
("name" "slug")
|
||||
("oninput" "check_exists_input(event)")
|
||||
("placeholder" "Custom url"))))
|
||||
|
||||
; editor
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/lib/codemirror.js"))
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/mode/markdown/markdown.js"))
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/mode/toml/toml.js"))
|
||||
(script ("src" "https://unpkg.com/codemirror@5.39.2/addon/display/placeholder.js"))
|
||||
(link ("rel" "stylesheet") ("href" "https://unpkg.com/codemirror@5.39.2/lib/codemirror.css"))
|
||||
(script ("src" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"))
|
||||
(link ("rel" "stylesheet") ("href" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css"))
|
||||
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
globalThis.init_editor();
|
||||
globalThis.init_editor(\"metadata_editor\", \"toml\", \"metadata_tab\");
|
||||
}, 150);
|
||||
|
||||
globalThis.create_entry = (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const { load, failed } = submitter_load(e.submitter);
|
||||
load();
|
||||
|
||||
fetch(\"/api/v1/entries\", {
|
||||
method: \"POST\",
|
||||
headers: {
|
||||
\"Content-Type\": \"application/json\",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
content: globalThis.editor.getValue(),
|
||||
slug: e.target.slug.value || undefined,
|
||||
edit_code: e.target.edit_code.value || undefined,
|
||||
metadata: globalThis.metadata_editor.getValue(),
|
||||
}),
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then((res) => {
|
||||
if (res.ok) {
|
||||
globalThis.ALLOW_LEAVE = true;
|
||||
document.cookie = `Atto-Message=\"Entry created! Your edit code: <code>${res.payload[1]}</code>.\"; path=/`;
|
||||
document.cookie = \"Atto-Message-Good=true; path=/\";
|
||||
window.location.href = `/${res.payload[0]}`;
|
||||
} else {
|
||||
show_message(res.message, false);
|
||||
failed();
|
||||
}
|
||||
})
|
||||
}"))
|
||||
(h1 (text "{{ name }}"))
|
||||
(text "{% endblock %}")
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
(text "{% extends \"root.lisp\" %} {% block head %}")
|
||||
(title
|
||||
(text "{{ entry.slug }}"))
|
||||
(link ("rel" "icon") ("href" "/public/favicon.svg"))
|
||||
(text "{% endblock %} {% block body %}")
|
||||
(main
|
||||
("class" "card_nest")
|
||||
(div
|
||||
("class" "card flex items_center gap_2 no_fill")
|
||||
(text "{{ icon \"lock\" }}")
|
||||
(b (text "Password required")))
|
||||
(form
|
||||
("class" "card flex flex_col gap_2")
|
||||
("onsubmit" "use_password(event)")
|
||||
(div
|
||||
("class" "flex flex_collapse gap_2")
|
||||
(input
|
||||
("class" "surface")
|
||||
("required" "")
|
||||
("placeholder" "Password")
|
||||
("name" "password"))
|
||||
(button
|
||||
("class" "button surface")
|
||||
(text "Go")))))
|
||||
(script
|
||||
(text "async function use_password(event) {
|
||||
event.preventDefault();
|
||||
const hash = Array.from(new Uint8Array(await window.crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(event.target.password.value))));
|
||||
const hex_hash = hash.map((b) => b.toString(16).padStart(2, \"0\")).join(\"\");
|
||||
window.location.href = `?key=h:${hex_hash}`;
|
||||
}"))
|
||||
(text "{% endblock %}")
|
|
@ -6,7 +6,7 @@
|
|||
(meta ("name" "viewport") ("content" "width=device-width, initial-scale=1.0"))
|
||||
(meta ("http-equiv" "X-UA-Compatible") ("content" "ie=edge"))
|
||||
|
||||
(link ("rel" "stylesheet") ("href" "{{ tetratto }}/css/utility.css?v={{ build_code }}"))
|
||||
(link ("rel" "stylesheet") ("href" "https://repodelivery.trisua.com/tetratto/crates/app/src/public/css/utility.css"))
|
||||
(link ("rel" "stylesheet") ("href" "/public/style.css?v={{ build_code }}"))
|
||||
|
||||
(style (text ":root { --color-primary: {{ theme_color }}; }"))
|
||||
|
@ -37,22 +37,13 @@
|
|||
(a
|
||||
("class" "button")
|
||||
("href" "/")
|
||||
(text "new"))
|
||||
(a
|
||||
("class" "button")
|
||||
("href" "/{{ what_page_slug }}")
|
||||
(text "what"))
|
||||
(text "home"))
|
||||
(a
|
||||
("class" "button")
|
||||
("href" "https://trisua.com/t/malachite")
|
||||
(text "source"))
|
||||
(text "{% block dropdown %}{% endblock %}")))
|
||||
|
||||
(a
|
||||
("class" "button camo fade")
|
||||
("href" "/")
|
||||
("title" "new")
|
||||
(text "{{ icon \"plus\" }}")))
|
||||
(a ("href" "/") (b (text "{{ name }}"))))
|
||||
|
||||
(div
|
||||
("class" "side flex")
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
(text "{% extends \"root.lisp\" %} {% block head %}")
|
||||
(text "{% if not metadata.page_title -%}")
|
||||
(title
|
||||
(text "{{ entry.slug }}"))
|
||||
(text "{%- endif %} {{ metadata_head|safe }}")
|
||||
|
||||
(text "{% if not metadata.share_title -%}")
|
||||
(meta ("property" "og:title") ("content" "{{ entry.slug }}"))
|
||||
(meta ("property" "twitter:title") ("content" "{{ entry.slug }}"))
|
||||
(text "{%- endif %}")
|
||||
|
||||
(text "{% if metadata.page_icon|length == 0 -%}")
|
||||
(link ("rel" "icon") ("href" "/public/favicon.svg"))
|
||||
(text "{%- endif %}")
|
||||
(text "{% endblock %} {% block body %}")
|
||||
(div
|
||||
("class" "flex flex_col gap_2")
|
||||
(div
|
||||
("class" "card container")
|
||||
("id" "content_rect")
|
||||
("style" "min-height: 15rem")
|
||||
(text "{{ entry.content|markdown|safe }}"))
|
||||
(div
|
||||
("class" "w_full flex justify_between gap_2")
|
||||
(a
|
||||
("class" "button")
|
||||
("href" "/{{ entry.slug }}/edit{% if password -%} ?key={{ password }} {%- endif %}")
|
||||
(text "Edit"))
|
||||
|
||||
(div
|
||||
("class" "flex flex_col gap-1 items-end fade")
|
||||
; dates
|
||||
(span (text "Pub: {{ entry.created / 1000|int|date(format=\"%Y-%m-%d %H:%M\", timezone=\"Etc/UTC\") }} UTC"))
|
||||
(span (text "Edit: {{ entry.edited / 1000|int|date(format=\"%Y-%m-%d %H:%M\", timezone=\"Etc/UTC\") }} UTC"))
|
||||
|
||||
; auto theme
|
||||
(text "{% if metadata.access_recommended_theme != 'None' -%}")
|
||||
(span ("id" "auto_theme") (text "Auto theme: {{ metadata.access_recommended_theme }}"))
|
||||
(script ("defer" "true") (text "setTimeout(() => { temporary_set_theme('{{ metadata.access_recommended_theme }}') }, 150);"))
|
||||
(text "{%- endif %}")
|
||||
|
||||
; owner
|
||||
(text "{% if metadata.tetratto_owner_username|length > 0 -%}")
|
||||
(span
|
||||
("class" "flex items_center gap_2")
|
||||
(text "Owner:")
|
||||
(a
|
||||
("class" "flex items_center gap_2")
|
||||
("href" "{{ tetratto }}/@{{ metadata.tetratto_owner_username }}")
|
||||
(img
|
||||
("class" "avatar")
|
||||
("src" "{{ tetratto }}/api/v1/auth/user/{{ metadata.tetratto_owner_username }}/avatar?selector_type=username"))
|
||||
(text "{{ metadata.tetratto_owner_username }}")))
|
||||
(text "{%- endif %}")
|
||||
|
||||
; views
|
||||
(text "{% if not metadata.option_disable_views -%}")
|
||||
(span (text "Views: {{ entry.views }}"))
|
||||
(text "{%- endif %}")
|
||||
|
||||
; easy-to-read
|
||||
(text "{% if metadata.access_easy_read|length > 0 -%}")
|
||||
(a ("class" "button small") ("href" "/{{ metadata.access_easy_read }}") (b (text "E2R")))
|
||||
(text "{%- endif %}"))))
|
||||
|
||||
(div ("style" "display: none") ("id" "metadata_css") (text "{{ metadata_css|safe }}"))
|
||||
|
||||
(link ("rel" "stylesheet") ("href" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css"))
|
||||
(script ("src" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"))
|
||||
(script (text "hljs.highlightAll();"))
|
||||
(text "{% endblock %}")
|
||||
(text "{% block nav_extras %}")
|
||||
(button
|
||||
("class" "button camo fade no_fill")
|
||||
("title" "Toggle high-contrast")
|
||||
("id" "toggle_high_contrast_button")
|
||||
("onclick" "toggle_metadata_css(event)")
|
||||
(text "{{ icon \"contrast\" }}"))
|
||||
|
||||
(text "{% if \"EntryHighContrast\" in flags -%}")
|
||||
(script
|
||||
(text "setTimeout(() => {
|
||||
toggle_metadata_css({ target: document.getElementById(\"toggle_high_contrast_button\") });
|
||||
}, 150);"))
|
||||
(text "{%- endif %}")
|
||||
(text "{% endblock %}")
|
||||
|
||||
(text "{% block dropdown %}")
|
||||
(hr)
|
||||
(a
|
||||
("class" "button")
|
||||
("href" "/{{ entry.slug }}/claim")
|
||||
(text "claim"))
|
||||
(text "{%- endblock %}")
|
|
@ -1,54 +0,0 @@
|
|||
(text "{% extends \"root.lisp\" %} {% block head %}")
|
||||
(text "{% if not metadata.page_title -%}")
|
||||
(title
|
||||
(text "{{ entry.slug }}"))
|
||||
(text "{%- endif %} {{ metadata_head|safe }}")
|
||||
|
||||
(text "{% if not metadata.share_title -%}")
|
||||
(meta ("property" "og:title") ("content" "{{ entry.slug }}"))
|
||||
(meta ("property" "twitter:title") ("content" "{{ entry.slug }}"))
|
||||
(text "{%- endif %}")
|
||||
|
||||
(text "{% if metadata.page_icon|length == 0 -%}")
|
||||
(link ("rel" "icon") ("href" "/public/favicon.svg"))
|
||||
(text "{%- endif %}")
|
||||
|
||||
(text "{% endblock %} {% block body %}")
|
||||
(div
|
||||
("class" "card container flex flex_col gap-1")
|
||||
("id" "content_rect")
|
||||
(p ("class" "fade") (text "Content warning:"))
|
||||
(div (text "{{ metadata.safety_content_warning|markdown|safe }}"))
|
||||
(hr)
|
||||
(div
|
||||
("class" "flex flex_col gap_4")
|
||||
(label
|
||||
("class" "flex flex-row gap_2 items_center")
|
||||
("for" "open_in_high_contrast")
|
||||
(input
|
||||
("type" "checkbox")
|
||||
("id" "open_in_high_contrast")
|
||||
("name" "open_in_high_contrast"))
|
||||
(span (text "Open in high contrast")))
|
||||
(div
|
||||
("class" "flex gap_2")
|
||||
(button
|
||||
("class" "button surface green")
|
||||
("onclick" "accept()")
|
||||
(text "Continue"))
|
||||
(button
|
||||
("class" "button surface red")
|
||||
("onclick" "window.history.back()")
|
||||
(text "Cancel")))))
|
||||
|
||||
(script
|
||||
(text "const QFLAGS = [\"AcceptWarning\"];
|
||||
function accept() {
|
||||
if (document.getElementById(\"open_in_high_contrast\").checked) {
|
||||
QFLAGS.push(\"EntryHighContrast\");
|
||||
}
|
||||
|
||||
document.cookie = `Atto-QFlags=\"${JSON.stringify(QFLAGS)}\"; path=/`;
|
||||
window.location.reload();
|
||||
}"))
|
||||
(text "{% endblock %}")
|
Loading…
Add table
Add a link
Reference in a new issue