diff --git a/src/server.rs b/src/server.rs index daa92bb..b32a360 100644 --- a/src/server.rs +++ b/src/server.rs @@ -94,6 +94,7 @@ pub async fn start_server( bincode::serialize(&Ad { author: query.author, password: hasher.finalize()[..].try_into().unwrap(), + price: query.price, pubkey: (!query.pubkey.is_empty()).then_some(query.pubkey), time: 0, title: query.title, @@ -200,6 +201,7 @@ struct ErrorTemplate<'a> { #[derive(Clone, Debug, Deserialize)] struct NewAdQuery { author: String, + price: String, psw: String, pubkey: String, title: String, @@ -224,6 +226,7 @@ enum Query { struct Ad { author: String, password: PasswordHash, + price: String, pubkey: Option, time: u64, title: String, diff --git a/templates/index.html b/templates/index.html index 2b1fd8c..8de3fe5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -25,16 +25,19 @@

Ceci est une démo du nouveau site ĞMarché en développement. C'est très moche et il n'y a pas tellement de fonctionnalités mais ça avance. ;)

+

Merci de ne pas encore utiliser ce site pour de vrais événements !

+
- + {{#each ads}} + {{/each}} @@ -57,18 +60,20 @@
Nouvelle annonce -
+
+ +
-
+
-
+
-
+ Le mot de passe sera demandé pour modifier ou supprimer l'annonce.
-
+

Code source sous licence GNU AGPL v3. 🦀 Écrit en Rust. Images de Attilax.
CopyLeft 2020 Pascal Engélibert

AnnonceVendeur
AnnoncePrixVendeur
{{this.ad.title}}{{this.ad.price}} {{#if this.ad.pubkey}}
{{this.ad.author}}
{{this.ad.pubkey}}
{{else}}{{this.ad.author}}{{/if}}