Make the template a bit more proper
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
db32d8b07e
commit
bf76580950
3 changed files with 18 additions and 17 deletions
|
@ -10,7 +10,7 @@ struct Template {
|
||||||
async fn paste_render(data: Data<Template>) -> impl Responder {
|
async fn paste_render(data: Data<Template>) -> impl Responder {
|
||||||
let my_data = data.get_ref();
|
let my_data = data.get_ref();
|
||||||
let mut context = Context::new();
|
let mut context = Context::new();
|
||||||
context.insert("paste_id", "owo");
|
context.insert("paste_content", "owo");
|
||||||
let rendered = my_data.paste.render("paste.html", &context);
|
let rendered = my_data.paste.render("paste.html", &context);
|
||||||
HttpResponse::Ok().body(rendered.unwrap())
|
HttpResponse::Ok().body(rendered.unwrap())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Actix Web</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{% block content %}
|
|
||||||
{% endblock content %}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,5 +1,17 @@
|
||||||
{% extends "base.html" %}
|
<!doctype html>
|
||||||
|
<html>
|
||||||
{% block content %}
|
<head>
|
||||||
<h1>This is {{paste_id}}</h1>
|
<meta charset="UTF-8">
|
||||||
{% endblock content %}
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<body>
|
||||||
|
<h2 class="text-3xl font-bold">
|
||||||
|
Obsolute Paste - baalajimaestro
|
||||||
|
</h2>
|
||||||
|
{% block content %}
|
||||||
|
<textarea readonly>
|
||||||
|
{{paste_content}}
|
||||||
|
</textarea>
|
||||||
|
{% endblock content %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue