Price
This commit is contained in:
parent
1e98a6306c
commit
4f23d6c860
|
@ -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<String>,
|
||||
time: u64,
|
||||
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>⚠ <strong>Merci de ne pas encore utiliser ce site pour de vrais événements !</strong></p>
|
||||
|
||||
<form method="post">
|
||||
<table border="1">
|
||||
<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>
|
||||
<tbody>
|
||||
{{#each ads}}
|
||||
<tr>
|
||||
<td><input type="radio" name="ad" value="{{this.id}}"/></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>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
@ -57,18 +60,20 @@
|
|||
<fieldset>
|
||||
<legend>Nouvelle annonce</legend>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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"/>
|
||||
</fieldset>
|
||||
</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/>
|
||||
CopyLeft 2020 Pascal Engélibert</p>
|
||||
|
|
Loading…
Reference in New Issue