Remove axama completely

This commit is contained in:
Joscha 2024-05-12 13:33:23 +02:00
parent aed7498b29
commit a2c2546c9d
5 changed files with 0 additions and 149 deletions

75
Cargo.lock generated
View file

@ -112,61 +112,6 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]]
name = "askama"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28"
dependencies = [
"askama_derive",
"askama_escape",
"humansize",
"num-traits",
"percent-encoding",
]
[[package]]
name = "askama_axum"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41603f7cdbf5ac4af60760f17253eb6adf6ec5b6f14a7ed830cf687d375f163"
dependencies = [
"askama",
"axum-core",
"http",
]
[[package]]
name = "askama_derive"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a0fc7dcf8bd4ead96b1d36b41df47c14beedf7b0301fc543d8f2384e66a2ec0"
dependencies = [
"askama_parser",
"basic-toml",
"mime",
"mime_guess",
"proc-macro2",
"quote",
"serde",
"syn 2.0.62",
]
[[package]]
name = "askama_escape"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341"
[[package]]
name = "askama_parser"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c268a96e01a4c47c8c5c2472aaa570707e006a875ea63e819f75474ceedaf7b4"
dependencies = [
"nom",
]
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.74" version = "0.1.74"
@ -321,15 +266,6 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]]
name = "basic-toml"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.2" version = "1.3.2"
@ -1743,15 +1679,6 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "016b02deb8b0c415d8d56a6f0ab265e50c22df61194e37f9be75ed3a722de8a6" checksum = "016b02deb8b0c415d8d56a6f0ab265e50c22df61194e37f9be75ed3a722de8a6"
[[package]]
name = "humansize"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7"
dependencies = [
"libm",
]
[[package]] [[package]]
name = "humantime" name = "humantime"
version = "2.1.0" version = "2.1.0"
@ -3198,8 +3125,6 @@ name = "tablejohn"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"askama",
"askama_axum",
"axum", "axum",
"axum-extra", "axum-extra",
"bytes", "bytes",

View file

@ -5,8 +5,6 @@ edition = "2021"
[dependencies] [dependencies]
anyhow = "1.0.83" anyhow = "1.0.83"
askama = { version = "0.12.1", features = ["with-axum"] }
askama_axum = "0.4.0"
axum = { version = "0.7.5", features = ["macros"] } axum = { version = "0.7.5", features = ["macros"] }
axum-extra = { version = "0.9.3", features = ["query", "typed-routing", "typed-header"] } axum-extra = { version = "0.9.3", features = ["query", "typed-routing", "typed-header"] }
bytes = "1.6.0" bytes = "1.6.0"

View file

@ -1,4 +1,3 @@
use askama::Template;
use maud::{html, Markup}; use maud::{html, Markup};
use time::OffsetDateTime; use time::OffsetDateTime;
@ -9,18 +8,6 @@ use super::{
paths::{PathCommitByHash, PathRunById, PathWorkerByName}, paths::{PathCommitByHash, PathRunById, PathWorkerByName},
}; };
#[derive(Template)]
#[template(
ext = "html",
source = "\
{% import \"util.html\" as util %}
<a href=\"{{ link }}\" \
class=\"{% call util::commit_class(reachable) %}\" \
title=\"{% call util::commit_title(reachable) %}\">
{{ short|truncate(80) }}
</a>
"
)]
pub struct LinkCommit { pub struct LinkCommit {
link: Link, link: Link,
short: String, short: String,
@ -65,11 +52,6 @@ impl LinkCommit {
} }
} }
#[derive(Template)]
#[template(
ext = "html",
source = "<a href=\"{{ link }}\">Run of {{ short|truncate(80) }}</a>"
)]
pub struct LinkRunShort { pub struct LinkRunShort {
link: Link, link: Link,
short: String, short: String,
@ -90,11 +72,6 @@ impl LinkRunShort {
} }
} }
#[derive(Template)]
#[template(
ext = "html",
source = "<a href=\"{{ link }}\">Run from {{ date }}</a>"
)]
pub struct LinkRunDate { pub struct LinkRunDate {
link: Link, link: Link,
date: String, // TODO base.date(...)? date: String, // TODO base.date(...)?
@ -115,8 +92,6 @@ impl LinkRunDate {
} }
} }
#[derive(Template)]
#[template(ext = "html", source = "<a href=\"{{ link }}\">{{ name }}</a>")]
pub struct LinkWorker { pub struct LinkWorker {
link: Link, link: Link,
name: String, name: String,

View file

@ -1,28 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>{% block title %}{% endblock %} - {{ base.repo_name }}</title>
<link rel="icon" href="{{ base.link_logo_svg }}">
<link rel="stylesheet" href="{{ base.link_base_css }}" />
{% block head %}{% endblock %}
</head>
<body>
<nav>
<a href="{{ base.link_index }}" {% if base.tab=="index" %} class="current" {% endif %}>
<img src="{{ base.link_logo_svg }}" alt="">{{ base.repo_name }}
</a>
<a href="{{ base.link_graph }}" {% if base.tab=="graph" %} class="current" {% endif %}>
graph
</a>
<a href="{{ base.link_queue }}" {% if base.tab=="queue" %} class="current" {% endif %}>
queue
</a>
</nav>
{% block body %}{% endblock %}
</body>
</html>

View file

@ -1,19 +0,0 @@
{% macro commit_class(reachable) %}
{%- if reachable == 0 -%}
commit-orphaned
{%- else if reachable == 1 -%}
commit-reachable
{%- else -%}
commit-tracked
{%- endif -%}
{% endmacro %}
{% macro commit_title(reachable) %}
{%- if reachable == 0 -%}
This commit is orphaned. It can't be reached from any ref.
{%- else if reachable == 1 -%}
This commit can only be reached from untracked refs.
{%- else -%}
This commit can be reached from a tracked ref.
{%- endif -%}
{% endmacro %}