Price
This commit is contained in:
parent
1e98a6306c
commit
4f23d6c860
|
@ -94,6 +94,7 @@ pub async fn start_server(
|
||||||
bincode::serialize(&Ad {
|
bincode::serialize(&Ad {
|
||||||
author: query.author,
|
author: query.author,
|
||||||
password: hasher.finalize()[..].try_into().unwrap(),
|
password: hasher.finalize()[..].try_into().unwrap(),
|
||||||
|
price: query.price,
|
||||||
pubkey: (!query.pubkey.is_empty()).then_some(query.pubkey),
|
pubkey: (!query.pubkey.is_empty()).then_some(query.pubkey),
|
||||||
time: 0,
|
time: 0,
|
||||||
title: query.title,
|
title: query.title,
|
||||||
|
@ -200,6 +201,7 @@ struct ErrorTemplate<'a> {
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
struct NewAdQuery {
|
struct NewAdQuery {
|
||||||
author: String,
|
author: String,
|
||||||
|
price: String,
|
||||||
psw: String,
|
psw: String,
|
||||||
pubkey: String,
|
pubkey: String,
|
||||||
title: String,
|
title: String,
|
||||||
|
@ -224,6 +226,7 @@ enum Query {
|
||||||
struct Ad {
|
struct Ad {
|
||||||
author: String,
|
author: String,
|
||||||
password: PasswordHash,
|
password: PasswordHash,
|
||||||
|
price: String,
|
||||||
pubkey: Option<String>,
|
pubkey: Option<String>,
|
||||||
time: u64,
|
time: u64,
|
||||||
title: String,
|
title: String,
|
||||||
|
|
|
@ -25,16 +25,19 @@
|
||||||
|
|
||||||
<p>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. ;)</p>
|
<p>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. ;)</p>
|
||||||
|
|
||||||
|
<p>⚠ <strong>Merci de ne pas encore utiliser ce site pour de vrais événements !</strong></p>
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<table border="1">
|
<table border="1">
|
||||||
<thead>
|
<thead>
|
||||||
<tr><td></td><td>Annonce</td><td>Vendeur</td></tr>
|
<tr><td></td><td>Annonce</td><td>Prix</td><td>Vendeur</td></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each ads}}
|
{{#each ads}}
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="radio" name="ad" value="{{this.id}}"/></td>
|
<td><input type="radio" name="ad" value="{{this.id}}"/></td>
|
||||||
<td>{{this.ad.title}}</td>
|
<td>{{this.ad.title}}</td>
|
||||||
|
<td>{{this.ad.price}}</td>
|
||||||
<td>{{#if this.ad.pubkey}}<details><summary>{{this.ad.author}}</summary><br/>{{this.ad.pubkey}}</details>{{else}}{{this.ad.author}}{{/if}}</td>
|
<td>{{#if this.ad.pubkey}}<details><summary>{{this.ad.author}}</summary><br/>{{this.ad.pubkey}}</details>{{else}}{{this.ad.author}}{{/if}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
@ -57,18 +60,20 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Nouvelle annonce</legend>
|
<legend>Nouvelle annonce</legend>
|
||||||
<label for="f_new_title">Titre :</label>
|
<label for="f_new_title">Titre :</label>
|
||||||
<input type="text" id="f_new_title" name="title"/><br />
|
<input type="text" id="f_new_title" name="title" placeholder="Carottes" required/><br/>
|
||||||
|
<label for="f_new_price">Prix :</label>
|
||||||
|
<input type="text" id="f_new_price" name="price" placeholder="42 DU/kg" required/><br/>
|
||||||
<label for="f_new_author">Votre nom :</label>
|
<label for="f_new_author">Votre nom :</label>
|
||||||
<input type="text" id="f_new_author" name="author"/><br />
|
<input type="text" id="f_new_author" name="author" placeholder="Toto" required/><br/>
|
||||||
<label for="f_new_pubkey">Clé publique :</label>
|
<label for="f_new_pubkey">Clé publique :</label>
|
||||||
<input type="text" id="f_new_pubkey" name="pubkey"/><br />
|
<input type="text" id="f_new_pubkey" name="pubkey"/><br/>
|
||||||
<label for="f_new_psw">Mot de passe :</label>
|
<label for="f_new_psw">Mot de passe :</label>
|
||||||
<input type="text" id="f_new_psw" name="psw"/><br />
|
<input type="text" id="f_new_psw" name="psw"/><span>Le mot de passe sera demandé pour modifier ou supprimer l'annonce.</span><br/>
|
||||||
<input type="submit" value="Publier"/>
|
<input type="submit" value="Publier"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<hr style="clear: both;" />
|
<hr style="clear: both;"/>
|
||||||
|
|
||||||
<p><a href="https://git.p2p.legal/tuxmain/gmarche-rs">Code source</a> sous licence <a href="https://www.gnu.org/licenses/licenses.html#AGPL">GNU AGPL v3</a>. 🦀 Écrit en <a href="https://www.rust-lang.org">Rust</a>. Images de Attilax.<br/>
|
<p><a href="https://git.p2p.legal/tuxmain/gmarche-rs">Code source</a> sous licence <a href="https://www.gnu.org/licenses/licenses.html#AGPL">GNU AGPL v3</a>. 🦀 Écrit en <a href="https://www.rust-lang.org">Rust</a>. Images de Attilax.<br/>
|
||||||
CopyLeft 2020 Pascal Engélibert</p>
|
CopyLeft 2020 Pascal Engélibert</p>
|
||||||
|
|
Loading…
Reference in New Issue