Fonts, quantity, table style

This commit is contained in:
Pascal Engélibert 2020-11-02 18:12:50 +01:00
parent 4f23d6c860
commit bb0ce10c16
6 changed files with 47 additions and 4 deletions

View File

@ -96,6 +96,7 @@ pub async fn start_server(
password: hasher.finalize()[..].try_into().unwrap(),
price: query.price,
pubkey: (!query.pubkey.is_empty()).then_some(query.pubkey),
quantity: query.quantity,
time: 0,
title: query.title,
})
@ -204,6 +205,7 @@ struct NewAdQuery {
price: String,
psw: String,
pubkey: String,
quantity: String,
title: String,
}
@ -228,6 +230,7 @@ struct Ad {
password: PasswordHash,
price: String,
pubkey: Option<String>,
quantity: String,
time: u64,
title: String,
}

View File

@ -6,6 +6,8 @@ static STATIC_FILES: &'static [(&str, &[u8])] = &[
("standgm.png", include_bytes!("../static/standgm.png")),
("banner.jpg", include_bytes!("../static/banner.jpg")),
("icon.png", include_bytes!("../static/icon.png")),
("Karma-Bold.otf", include_bytes!("../static/Karma-Bold.otf")),
("LinBiolinum_R.otf", include_bytes!("../static/LinBiolinum_R.otf")),
];
pub fn init_static_files(dir: &Path) {

BIN
static/Karma-Bold.otf Normal file

Binary file not shown.

BIN
static/LinBiolinum_R.otf Normal file

Binary file not shown.

View File

@ -1,7 +1,24 @@
@font-face {
font-family: "Karma";
src: url("/static/Karma-Bold.otf");
font-weight: bold;
}
@font-face {
font-family: "LinBiolinum";
src: url("/static/LinBiolinum_R.otf");
}
html, body {
width: 100%;
margin: 0;
padding: 0;
font-family: "LinBiolinum";
font-size: 110%;
}
h1, h2, h3, h4 {
font-family: "Karma";
}
#banner {
@ -22,6 +39,10 @@ html, body {
color: #800000;
}
#ads {
width: 100%;
}
.center {
padding: 4px;
}
@ -32,3 +53,12 @@ html, body {
margin: auto;
}
}
table {
border-collapse: collapse;
}
td {
padding: 2px;
border: 1px solid #666;
}

View File

@ -28,21 +28,23 @@
<p>&#9888; <strong>Merci de ne pas encore utiliser ce site pour de vrais événements&#8239;!</strong></p>
<form method="post">
<table border="1">
<table id="ads">
<thead>
<tr><td></td><td>Annonce</td><td>Prix</td><td>Vendeur</td></tr>
<tr><td></td><td>Annonce</td><td>Quantité</td><td>Prix</td><td>Vendeur</td></tr>
</thead>
<tbody>
{{#each ads}}
<tr>
<td><input type="radio" name="ad" value="{{this.id}}"/></td>
<td><input type="radio" name="ad" value="{{this.id}}" required/></td>
<td>{{this.ad.title}}</td>
<td>{{this.ad.quantity}}</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}}
</tbody>
</table>
<br/>
<input type="hidden" name="a" value="rm_ad" autocomplete="off"/>
<fieldset>
@ -52,6 +54,7 @@
<input type="submit" value="Supprimer"/>
</fieldset>
</form>
<br/>
<img id="stand" alt="Marché" src="/static/standgm.png"/>
@ -61,6 +64,8 @@
<legend>Nouvelle annonce</legend>
<label for="f_new_title">Titre&nbsp;:</label>
<input type="text" id="f_new_title" name="title" placeholder="Carottes" required/><br/>
<label for="f_new_quantity">Quantité&nbsp;:</label>
<input type="text" id="f_new_quantity" name="quantity" placeholder="10 kg" required/><br/>
<label for="f_new_price">Prix&nbsp;:</label>
<input type="text" id="f_new_price" name="price" placeholder="42 DU/kg" required/><br/>
<label for="f_new_author">Votre nom&nbsp;:</label>
@ -68,13 +73,16 @@
<label for="f_new_pubkey">Clé publique&nbsp;:</label>
<input type="text" id="f_new_pubkey" name="pubkey"/><br/>
<label for="f_new_psw">Mot de passe&nbsp;:</label>
<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="text" id="f_new_psw" name="psw"/><br/>
<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;"/>
<p><a href="https://forum.duniter.org">Toutes les questions techniques ont leur place sur le forum.</a></p>
<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>. &#129408; Écrit en <a href="https://www.rust-lang.org">Rust</a>. Images de Attilax.<br/>
CopyLeft 2020 Pascal Engélibert</p>
</div>