album/templates/details.rs.html

35 lines
1.6 KiB
HTML
Raw Normal View History

2016-09-26 01:45:13 +03:00
@use ::{Coord, Link};
2016-09-23 23:03:04 +03:00
@use rphotos::models::{Photo, Person, Place, Tag, Camera};
2016-09-26 01:45:13 +03:00
@use templates::page_base;
2016-09-23 23:03:04 +03:00
@(lpath: Vec<Link>, user: Option<String>, people: Vec<Person>, places: Vec<Place>, tags: Vec<Tag>, position: Option<Coord>, camera: Option<Camera>, time: String, photo: Photo)
2016-09-26 01:45:13 +03:00
@:page_base("Photo details", lpath, user, {
2016-09-23 23:03:04 +03:00
<p><a href="/img/@photo.id/l">@photo.path</a></p>
<p><img src="/img/@photo.id/m"></p>
2016-09-26 01:45:13 +03:00
@if let Some(ref pos) = position {
2016-09-23 23:03:04 +03:00
<div id="map"></div>
<link href="https://rasmus.krats.se/static/leaflet077c/leaflet.css" rel="stylesheet"/>
<script language="javascript" src="https://rasmus.krats.se/static/leaflet077c/leaflet.js" type="text/javascript">
</script>
<script language="javascript" type="text/javascript">
var pos = [@pos.x, @pos.y];
var map = document.getElementById('map');
map.style.height = 3 * map.clientWidth / 4 + "px";
var map = L.map('map').setView(pos, 16);
L.tileLayer('//@{s@}.tile.openstreetmap.org/@{z@}/@{x@}/@{y@}.png', @{
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
@}).addTo(map);
L.marker(pos).addTo(map);
</script>
}
@if let Some(g) = photo.grade {<p>Betyg: @g</p>}
<p>Tid: @time</p>
<p>People: @for p in people{<a href="/person/@p.slug">@p.person_name</a>, }</p>
<p>Places: @for p in places{<a href="/place/@p.slug">@p.place_name</a>, }</p>
<p>Tags: @for t in tags{<a href="/tag/@t.slug">@t.tag_name</a>, }</p>
2016-09-26 01:45:13 +03:00
@if let Some(ref pos) = position {<p>Position: @pos.x @pos.y</p>}
@if let Some(ref c) = camera{<p>Camera: @c.model (@c.manufacturer)</p>}
})