Add links to the nodes in the thread graph
Currently it's just the nodes themselves which are kind of tiny and hard to hit. Probably should add some invisible overlay.
This commit is contained in:
parent
15c70e6836
commit
8e1337bc8f
14
mbox2web
14
mbox2web
|
@ -1053,7 +1053,7 @@ class Thread:
|
|||
if y == 0:
|
||||
# first message in thread
|
||||
# Just add a node
|
||||
nodes.append((x, y))
|
||||
nodes.append((x, y, m.encmsgid))
|
||||
m.x = x
|
||||
m.y = y
|
||||
else:
|
||||
|
@ -1064,7 +1064,7 @@ class Thread:
|
|||
# or Thread-Index)
|
||||
# Just start a new column to get out of the way
|
||||
x += 1
|
||||
nodes.append((x, y))
|
||||
nodes.append((x, y, m.encmsgid))
|
||||
m.x = x
|
||||
m.y = y
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ class Thread:
|
|||
# Just put the new kid directly below the parent
|
||||
m.x = p.x
|
||||
m.y = y
|
||||
nodes.append((m.x, m.y))
|
||||
nodes.append((m.x, m.y, m.encmsgid))
|
||||
edges.append((p.x, p.y, m.x, m.y))
|
||||
p.kids = True
|
||||
else:
|
||||
|
@ -1096,7 +1096,7 @@ class Thread:
|
|||
x += 1
|
||||
m.x = x
|
||||
m.y = y
|
||||
nodes.append((m.x, m.y))
|
||||
nodes.append((m.x, m.y, m.encmsgid))
|
||||
for r in m.in_reply_to:
|
||||
p = self.messages[r]
|
||||
edges.append((p.x, p.y, m.x, m.y))
|
||||
|
@ -1120,19 +1120,21 @@ class Thread:
|
|||
yc = e[1] + 1
|
||||
s += f"<path d='M {e[0] * fx + fx/2} {e[1] * fy + fy/2} Q {e[2] * fx + fx/2} {yc * fy + fy/2} {e[2] * fx + fx/2} {e[3] * fy + fy/2}' stroke='black' fill='none' />"
|
||||
for n in nodes:
|
||||
s += f"<a xlink:href='../../msg/{n[2]}/' >"
|
||||
s += f"<circle cx={n[0] * fx + fx/2} cy={n[1] * fy + fy/2} r={r} />"
|
||||
s += f"</a>"
|
||||
s += "</svg>"
|
||||
s += "</td>"
|
||||
|
||||
# XXX - escape!
|
||||
s += f"<td class='date'><a href='/msg/{lines[0][3]}/'>{lines[0][0]}</a></td>"
|
||||
s += f"<td class='date'><a href='../../msg/{lines[0][3]}/'>{lines[0][0]}</a></td>"
|
||||
s += f"<td class='from'>{html.escape(lines[0][1])}</td>"
|
||||
s += f"<td class='subject'>{html.escape(lines[0][2])}</td>"
|
||||
s += "</tr>"
|
||||
|
||||
for ln in lines[1:]:
|
||||
s += "<tr>"
|
||||
s += f"<td class='date'><a href='/msg/{ln[3]}/'>{ln[0]}</a></td>"
|
||||
s += f"<td class='date'><a href='../../msg/{ln[3]}/'>{ln[0]}</a></td>"
|
||||
s += f"<td class='from'>{html.escape(ln[1])}</td>"
|
||||
s += f"<td class='subject'>{html.escape(ln[2])}</td>"
|
||||
s += "</tr>"
|
||||
|
|
Loading…
Reference in New Issue