Clickable inbox entries

This commit is contained in:
2020-04-28 09:57:04 +02:00
parent 827ed10427
commit 7ca21ca524
4 changed files with 48 additions and 13 deletions

View File

@ -0,0 +1,7 @@
import { Controller } from "stimulus"
export default class extends Controller {
onClick() {
window.location = this.data.get('link');
}
}

View File

@ -1,6 +1,12 @@
.inbox {
table-layout: fixed;
tbody {
tr {
cursor: pointer;
}
}
td {
overflow: hidden;
text-overflow: ellipsis;

View File

@ -25,7 +25,9 @@
</thead>
<tbody>
{{range .Emails}}
<tr>
<tr data-controller="inbox-entry"
data-action="click->inbox-entry#onClick"
data-inbox-entry-link="./emails/{{ .ID }}">
<td class="email-subject"><div>{{ .Subject }}</div></td>
<td class="email-from">
{{range .From}}