Commit ce67abc0 authored by Dorian's avatar Dorian
Browse files

redo margin localisation system

parent a1795585
......@@ -165,12 +165,14 @@ ul.attachments .date{
/* indicator of the end of an incident */
.potelet > footer{
margin-top: 0.5em;
text-align: right;
/* text-align: right; */
height: 0;
position: relative;
}
.potelet > footer::after{
content: "";
display: inline-block;
position: absolute;
top: 0.5em; right: 0;
width: 1em;
height: 1em;
background: transparent;
......
......@@ -10,6 +10,7 @@
@top-right{
content: "p. " counter(page);
align-items: flex-end;
}
}
......@@ -23,23 +24,25 @@
}
} */
/* @page incident{
@page:blank {
@top-right { content: none; }
}
@page incident{
@bottom-left {
content: "⬤\00A0" string(potelet-id) "\00A0\2014\2014\2014\2014\00A0n°" counter(potelet) "\00A0in\00A0";
/* content: string(potelet-symbol) string(potelet-id) "\00A0\2014\00A0(" counter(potelet) "/" target-counter(string(potelet-lastin), potelet) ")\00A0➤\00A0" "cluster " counter(cluster) "\00A0➤\00A0" string(postal); */
content: string(potelet-id) "\00A0\2014\00A0(" counter(potelet) "/" target-counter(string(potelet-lastin), potelet) ")";
text-transform: lowercase;
}
@bottom-center {
content: "cluster " counter(cluster);
border-radius: 50%;
border: 1pt solid black;
margin: 0.5cm 0;
width: 3.6cm;
}
@bottom-right {
content: "\00A0\00A0\2014\2014\2014\2014\2014\2014\2014\00A0\00A0of\00A0\00A0\2014\2014\2014\2014\2014\2014\2014\2014\00A0\00A0" string(postal);
content: string(postal);
}
}
/*
@page cluster{
@bottom-center {
content: "cluster " counter(cluster);
......@@ -70,15 +73,25 @@
}
/* .fake-margin-bottom{
position: absolute;
bottom: 0;
left: 1.6cm;
right: 1.6cm;
height: 2.4cm;
display: grid;
grid-template-columns: 1fr 1fr 3.6cm 1fr 1fr;
} */
.pagedjs_margin-bottom-left.hasContent,
.pagedjs_margin-bottom-center.hasContent,
.pagedjs_margin-bottom-right.hasContent{
border-top: 1pt solid lightgrey;
}
.pagedjs_margin-bottom-left::before{
content: string(potelet-symbol);
font-weight: bold;
/* color: white;
background: black;
border-radius: 50%; */
padding-right: 0.5em;
}
.pagedjs_margin-bottom-left::after{
content: "➤";
}
.pagedjs_margin-bottom-right::before{
content: "➤";
}
/* ---------- */
......@@ -163,7 +176,7 @@ need a wrapper anymore*/
/* POTELETS CONTAINER */
.cluster > .main-wrapper{
height: calc(var(--pagedjs-pagebox-height) - calc(var(--pagedjs-margin-top) + var(--pagedjs-margin-bottom)));
height: calc(calc(var(--pagedjs-pagebox-height) - calc(var(--pagedjs-margin-top) + var(--pagedjs-margin-bottom))));
display: flex;
flex-direction: column;
}
......@@ -186,13 +199,33 @@ need a wrapper anymore*/
.potelet{
page: incident;
position: relative;
/* not working... */
/* string-set: potelet-symbol attr(data-symbol); */
/* string-set: potelet-lastin attr(data-lastincluster); */
}
.potelet > header .lastincluster::before{
/* not working */
/* content: target-counter(attr(href url), potelet); */
}
.potelet > header{
break-inside: avoid-column;
}
.potelet > header > h2{
.potelet > header .symbol{
display: none;
string-set: potelet-symbol content(text);
}
.potelet > header .lastincluster{
display: none;
string-set: potelet-lastin content(text);
}
/* .potelet::before{
content: attr(data-symbol);
} */
.potelet > header h2{
string-set: potelet-id content(text);
}
.potelet > footer{
counter-increment: potelet;
}
......
This diff is collapsed.
......@@ -151,19 +151,22 @@
{% for potelet in cluster.incidents %}
<!-- ajouter un id si le dernier du cluster (on peut pas juste css selector?)
ensuite on target-counter(#id) ???
-->
<div id="{{ potelet.id }}" class="potelet {{ potelet.subcat }} {{ potelet.img_or_txt }}">
<div id="p{{ potelet.id }}" class="potelet {{ potelet.subcat }} {{ potelet.img_or_txt }}"
data-lastincluster="#p{{ potelet.last_in_cluster }}">
<header>
<!-- <div class="onelineflex">
<h2>Incident {{ potelet.id }} </h2>
<span>&nbsp;- Public furniture / Bollard / {{ potelet.subcat }} </span>
<a target="_blank" href="{{ potelet.url }}">↗</a>
</div> -->
<a class="lastincluster" href="#p{{ potelet.last_in_cluster }}">
</a>
<div class="symbol">
{% if potelet.subcat == 'damaged' %}
!
{% elif potelet.subcat == 'missing' %}
?
{% endif %}
</div>
<div class="onelineflex">
<h2>Incident {{ potelet.id }} </h2>
<a target="_blank" href="{{ potelet.url }}"></a>
......
......@@ -42,7 +42,7 @@ MUNICIPALITIES = {
}
CLUSTER_THRESHOLD = 4
CODE = 1050
CODE = 1160
DB_PATH = '../data/potelets.db'
GEOJSON_PATH = '../data/potelets_clustered.geojson'
......
......@@ -131,7 +131,6 @@ def formatingPotelet(potelet):
# when it changes either of day or of actor
detect_first_after_initial(potelet)
return potelet
def formatingCluster(cluster):
......@@ -151,6 +150,9 @@ def formatingCluster(cluster):
for p in cluster["incidents"]:
date = format_date(p["creationDate"])
cluster["dates"].append(date)
p["last_in_cluster"] = cluster["incidents"][-1]["id"]
# add a class to the last one of every cluster
# cluster["incidents"][-1]["last_in_cluster"] = "last-in-cluster"
return cluster
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment