gmarche-rs/templates/index.html

112 lines
4.5 KiB
HTML
Raw Normal View History

2020-10-26 23:43:18 +01:00
<!doctype html>
<html lang="{{lang}}">
<head>
<meta charset="utf-8"/>
2020-12-17 23:08:31 +01:00
<title>{{title}}</title>
2020-12-17 17:13:11 +01:00
<link rel="stylesheet" href="{{root_url}}static/style1.css"/>
<link rel="shortcut icon" href="{{root_url}}static/icon.png"/>
<script type="text/javascript" src="{{root_url}}static/script1.js"></script>
2020-10-26 23:43:18 +01:00
</head>
<body>
2020-12-08 18:16:05 +01:00
<div class="center page">
2020-12-09 23:01:07 +01:00
<header>
2020-12-17 23:08:31 +01:00
<a href="{{root_url}}"><img id="banner" alt="Bannière {{title}}" src="{{root_url}}static/banner.jpg"/></a>
2020-12-09 23:01:07 +01:00
</header>
2020-10-27 11:15:46 +01:00
2020-12-09 23:01:07 +01:00
<main>
2020-12-17 23:08:31 +01:00
<h1>{{title}}</h1>
2020-12-09 23:01:07 +01:00
{{#if errors}}
<div id="errors">
<span>Oups, il y a un problème&nbsp;:</span>
<ul>
{{#each errors}}
<li>{{this.text}}</li>
{{/each}}
2020-12-09 23:01:07 +01:00
</ul>
</div>
{{/if}}
2020-12-17 23:08:31 +01:00
<p>Ceci est une démo du nouveau site ĞMarché en développement.</p>
2020-12-09 23:01:07 +01:00
2022-02-25 15:41:50 +01:00
{{#each groups}}
<a href="{{root_url}}g/{{this.name}}">{{this.title}}</a><br/>
{{/each}}
{{#if ads}}
<span>Cliquez sur une annonce pour afficher le détail.</span>
2020-12-09 23:01:07 +01:00
<form method="post">
<table id="ads">
<thead>
<tr><td></td><th>Annonce</th><th>Quantité</th><th>Vendeur</th></tr>
2020-12-09 23:01:07 +01:00
</thead>
<tbody>
{{#each ads}}
<tr>
<td><input type="radio" name="ad" value="{{this.id}}" aria-label="Sélectionner l'annonce" required/></td>
2020-12-17 17:52:07 +01:00
<td onclick="ad_detail(event,'{{this.id}}')" title="Afficher le détail"><a href="{{../root_url}}ad/{{this.id}}">{{this.ad.title}}</a></td>
2020-12-09 23:01:07 +01:00
<td>{{this.ad.quantity}}</td>
<td>{{this.ad.author}}</td>
</tr>
2020-12-17 10:05:26 +01:00
<tr id="ad-detail-{{this.id}}" class="ad-detail{{#unless this.selected}} ad-detail-no{{/unless}}">
<td colspan="4"><p>
{{#if this.ad.pubkey}}Clé publique&nbsp;: {{this.ad.pubkey}}<br/>{{/if}}
Prix&nbsp;: {{this.ad.price}}
</p></td>
2020-12-09 23:01:07 +01:00
</tr>
{{/each}}
</tbody>
</table>
<br/>
<fieldset>
<legend>Supprimer l'annonce sélectionnée</legend>
<label for="f_rm_psw">Mot de passe&nbsp;:</label>
<input type="password" id="f_rm_psw" name="psw"/><br/>
<button type="submit" name="a" value="rm_ad">Supprimer</button>
</fieldset>
</form>
2020-11-02 18:12:50 +01:00
<br/>
{{else}}
<p>Il n'y a pas encore d'annonce ici.</p>
{{/if}}
2020-12-09 20:03:53 +01:00
2020-12-17 17:13:11 +01:00
<img id="stand" alt="Marché" src="{{root_url}}static/standgm.png"/>
2020-12-09 23:01:07 +01:00
<form method="post">
<input type="hidden" name="a" value="new_ad" autocomplete="off"/>
<fieldset>
<legend>Nouvelle annonce</legend>
<label for="f_new_title">Titre&nbsp;:</label>
<input type="text" id="f_new_title" name="title" placeholder="Carottes"{{#if new_ad_form_refill}} value="{{new_ad_form_refill.title}}"{{/if}} required/><br/>
<label for="f_new_quantity">Quantité&nbsp;:</label>
<input type="text" id="f_new_quantity" name="quantity" placeholder="10 kg"{{#if new_ad_form_refill}} value="{{new_ad_form_refill.quantity}}"{{/if}}/><br/>
2020-12-09 23:01:07 +01:00
<label for="f_new_price">Prix&nbsp;:</label>
<input type="text" id="f_new_price" name="price" placeholder="42 DU/kg"{{#if new_ad_form_refill}} value="{{new_ad_form_refill.price}}"{{/if}}/><br/>
2020-12-09 23:01:07 +01:00
<label for="f_new_author">Votre nom&nbsp;:</label>
<input type="text" id="f_new_author" name="author" placeholder="Toto"{{#if new_ad_form_refill}} value="{{new_ad_form_refill.author}}"{{/if}} required/><br/>
<label for="f_new_pubkey">Clé publique&nbsp;:</label>
<input type="text" id="f_new_pubkey" name="pubkey"{{#if new_ad_form_refill}} value="{{new_ad_form_refill.pubkey}}"{{/if}}/><br/>
<label for="f_new_psw">Mot de passe&nbsp;:</label>
<input type="text" id="f_new_psw" name="psw"{{#if new_ad_form_refill}} value="{{new_ad_form_refill.psw}}"{{/if}}/><br/>
<span>Le mot de passe sera demandé pour modifier ou supprimer l'annonce.</span><br/>
<input type="submit" value="Publier"/>
</fieldset>
</form>
</main>
2020-11-06 15:23:17 +01:00
2020-12-09 23:01:07 +01:00
<footer>
<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/>
2022-02-25 15:41:50 +01:00
CopyLeft 2020-2022 Pascal Engélibert<br/>
2020-12-09 23:01:07 +01:00
Image de fond&nbsp;: Claudia Peters, FreeImages.com</p>
2020-12-17 17:13:11 +01:00
<p><a href="{{root_url}}admin">Administration</a></p>
2020-12-09 23:01:07 +01:00
</footer>
2020-10-27 11:15:46 +01:00
</div>
2020-10-26 23:43:18 +01:00
</body>
</html>