Fix root_url, admin ad selection
This commit is contained in:
parent
6816f2f9fe
commit
017a64b18b
|
@ -43,6 +43,14 @@ pub async fn start_server(
|
||||||
handle_post_index(req, config.clone(), templates.clone(), dbs.clone())
|
handle_post_index(req, config.clone(), templates.clone(), dbs.clone())
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
app.at(&format!("{}ad/:ad", config.root_url)).post({
|
||||||
|
let config = config.clone();
|
||||||
|
let templates = templates.clone();
|
||||||
|
let dbs = dbs.clone();
|
||||||
|
move |req: tide::Request<()>| {
|
||||||
|
handle_post_index(req, config.clone(), templates.clone(), dbs.clone())
|
||||||
|
}
|
||||||
|
});
|
||||||
app.at(&format!("{}ad/:ad", config.root_url)).get({
|
app.at(&format!("{}ad/:ad", config.root_url)).get({
|
||||||
let config = config.clone();
|
let config = config.clone();
|
||||||
let templates = templates.clone();
|
let templates = templates.clone();
|
||||||
|
@ -66,8 +74,24 @@ pub async fn start_server(
|
||||||
handle_admin(req, config.clone(), templates.clone(), dbs.clone())
|
handle_admin(req, config.clone(), templates.clone(), dbs.clone())
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
app.at(&format!("{}admin/ad/:ad", config.root_url)).get({
|
||||||
|
let config = config.clone();
|
||||||
|
let templates = templates.clone();
|
||||||
|
let dbs = dbs.clone();
|
||||||
|
move |req: tide::Request<()>| {
|
||||||
|
handle_admin(req, config.clone(), templates.clone(), dbs.clone())
|
||||||
|
}
|
||||||
|
});
|
||||||
app.at(&format!("{}admin", config.root_url)).post({
|
app.at(&format!("{}admin", config.root_url)).post({
|
||||||
let config = config.clone();
|
let config = config.clone();
|
||||||
|
let templates = templates.clone();
|
||||||
|
let dbs = dbs.clone();
|
||||||
|
move |req: tide::Request<()>| {
|
||||||
|
handle_post_admin(req, config.clone(), templates.clone(), dbs.clone())
|
||||||
|
}
|
||||||
|
});
|
||||||
|
app.at(&format!("{}admin/ad/:ad", config.root_url)).post({
|
||||||
|
let config = config.clone();
|
||||||
move |req: tide::Request<()>| {
|
move |req: tide::Request<()>| {
|
||||||
handle_post_admin(req, config.clone(), templates.clone(), dbs.clone())
|
handle_post_admin(req, config.clone(), templates.clone(), dbs.clone())
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,11 +38,11 @@
|
||||||
{{#each ads}}
|
{{#each ads}}
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="radio" name="ad" value="{{this.id}}" aria-label="Sélectionner l'annonce" required/></td>
|
<td><input type="radio" name="ad" value="{{this.id}}" aria-label="Sélectionner l'annonce" required/></td>
|
||||||
<td onclick="ad_detail(event,'{{this.id}}')" title="Afficher le détail"><a href="{{root_url}}admin/ad/{{this.id}}">{{this.ad.title}}</a></td>
|
<td onclick="ad_detail(event,'{{this.id}}')" title="Afficher le détail"><a href="{{../root_url}}admin/ad/{{this.id}}">{{this.ad.title}}</a></td>
|
||||||
<td>{{this.ad.quantity}}</td>
|
<td>{{this.ad.quantity}}</td>
|
||||||
<td>{{this.ad.author}}</td>
|
<td>{{this.ad.author}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="ad-detail-{{this.id}}" class="ad-detail ad-detail-no">
|
<tr id="ad-detail-{{this.id}}" class="ad-detail{{#unless this.selected}} ad-detail-no{{/unless}}">
|
||||||
<td colspan="4"><p>
|
<td colspan="4"><p>
|
||||||
{{#if this.ad.pubkey}}Clé publique : {{this.ad.pubkey}}<br/>{{/if}}
|
{{#if this.ad.pubkey}}Clé publique : {{this.ad.pubkey}}<br/>{{/if}}
|
||||||
Prix : {{this.ad.price}}
|
Prix : {{this.ad.price}}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
{{#each ads}}
|
{{#each ads}}
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="radio" name="ad" value="{{this.id}}" aria-label="Sélectionner l'annonce" required/></td>
|
<td><input type="radio" name="ad" value="{{this.id}}" aria-label="Sélectionner l'annonce" required/></td>
|
||||||
<td onclick="ad_detail(event,'{{this.id}}')" title="Afficher le détail"><a href="{{root_url}}ad/{{this.id}}">{{this.ad.title}}</a></td>
|
<td onclick="ad_detail(event,'{{this.id}}')" title="Afficher le détail"><a href="{{../root_url}}ad/{{this.id}}">{{this.ad.title}}</a></td>
|
||||||
<td>{{this.ad.quantity}}</td>
|
<td>{{this.ad.quantity}}</td>
|
||||||
<td>{{this.ad.author}}</td>
|
<td>{{this.ad.author}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue