Mark the current message in the thread

This commit is contained in:
Peter J. Holzer 2020-04-17 01:00:36 +02:00
parent 8e1337bc8f
commit 17e68334ca
3 changed files with 17 additions and 0 deletions

View File

@ -962,10 +962,14 @@ class Message:
"date": msg["Date"], "date": msg["Date"],
"bodyhtml": bodyhtml, "bodyhtml": bodyhtml,
"threadhtml": self.thread.as_html(), "threadhtml": self.thread.as_html(),
"threadindex": self.threadindex(),
} }
msghtml = msgtmpl.render(context) msghtml = msgtmpl.render(context)
hfd.write(msghtml) hfd.write(msghtml)
def threadindex(self):
return self.thread.index(self)
# For each message-id, record the thread it belongs to. # For each message-id, record the thread it belongs to.
# This should probably be an instance variable of Archive instead of global, # This should probably be an instance variable of Archive instead of global,

View File

@ -115,6 +115,7 @@ header {
grid-column: 1; grid-column: 1;
grid-row: 3; grid-row: 3;
overflow: hidden; overflow: hidden;
position: relative; /* to establish formatting context */
} }
article { article {
@ -340,3 +341,12 @@ pre {
font-size: 1rem; font-size: 1rem;
font-size-adjust: 0.5625; font-size-adjust: 0.5625;
} }
.month {
text-align: right;
}
.threadmarker {
width: 1000px; height: 32px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
}

View File

@ -13,9 +13,12 @@
<h1>{{subject}}</h1> <h1>{{subject}}</h1>
</header> </header>
<nav> <nav>
<div class="threadmarker" style="position: absolute; top: {{threadindex * 32}}px">
</div>
{{threadhtml}} {{threadhtml}}
</nav> </nav>
<article class="email"> <article class="email">
Message #{{threadindex}}
<table> <table>
<tr> <th>Message-Id </th> <td>{{message_id}} </td> </tr> <tr> <th>Message-Id </th> <td>{{message_id}} </td> </tr>
<tr> <th>From </th> <td>{{from}} </td> </tr> <tr> <th>From </th> <td>{{from}} </td> </tr>