Improved the post page

This commit is contained in:
Justine Pelletreau 2023-07-03 18:55:33 +02:00
parent d64e020abb
commit f638047508
6 changed files with 9 additions and 6 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
/Files/posts.json

View File

@ -14,7 +14,8 @@
padding-top: 50px;
}
h1 {
h1,
h2{
color: orange;
}

View File

@ -125,10 +125,10 @@
<div id="form-container">
<form action="/" method="post" enctype="application/x-www-form-urlencoded">
<label for="name">Name (optionnal):</label>
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<label for="content">Content:</label>
<label for="content">Content</label>
<textarea type="input" id="content" name="content" rows="30" cols="55" placeholder="Put your content here. It will be encrypted via DES-256 and stored." required></textarea>
<input type="submit" value="submit">

View File

@ -0,0 +1 @@
{"name":"qzdqzd","crypt":"EFOUHjEiFhRorSgOQAgOgA==","date":"03/07/2023@18:45:45","id":11295522918797061807}

BIN
sqpad

Binary file not shown.

View File

@ -123,9 +123,9 @@ async fn show_post(path: web::Path<(u64, String)>, req: HttpRequest) -> impl Res
}
let _ = &mut ret_text.push_str(&format!("\n\
<b>This is the link to your post. Don't lose it !\
It can also be accessed raw using Curl or Wget.</b><br>\n\
><i>{} @{}</i><br><br>\n<pre>\n", post.name, post.date));
<b>Save the link to this page ! We will not store it anywhere.</b><br><br><i>\
This page can be also be accessed using curl or wget.</i><hr>\n\
<h2>{}</h2>\n<i>{}</i><br><br>\n<pre>\n", post.name, post.date));
let _ = match decrypt(post.crypt, &password) {
Ok(v) => {