Skip to content

Commit d4ef963

Browse files
committed
feat(web): add comment link for transaction
1 parent a9ce1af commit d4ef963

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

ledger/cmd/templates/template.common.html

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@
111111
init_color_scheme_css(localStorage.colorMode);
112112

113113
});
114-
</script>
114+
115+
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
116+
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
117+
</script>
115118
{{end}}
116119
{{define "payee-transaction-table"}}
117120
<div id="tableprogress" class="text-center">
@@ -147,8 +150,30 @@
147150
{{if or (eq $accName "All") (substr $trAcc.Name $accName)}}
148151
<tr>
149152
<td>{{$trans.Date.Format "2006-01-02"}}</td>
150-
<td class="d-none d-sm-block">{{$trans.Payee}}</td>
151-
<td class="d-block d-sm-none">{{printf "%.16s" $trans.Payee}}</td>
153+
<td class="d-none d-sm-block">
154+
{{$trans.Payee}}
155+
{{if $trans.PayeeComment}}
156+
<button type="button" class="btn btn-primary"
157+
data-bs-container="body"
158+
data-bs-toggle="popover"
159+
data-bs-placement="top"
160+
data-bs-content="{{$trans.PayeeComment}}">
161+
C
162+
</button>
163+
{{end}}
164+
</td>
165+
<td class="d-block d-sm-none">
166+
{{printf "%.16s" $trans.Payee}}
167+
{{if $trans.PayeeComment}}
168+
<button type="button" class="btn btn-primary"
169+
data-bs-container="body"
170+
data-bs-toggle="popover"
171+
data-bs-placement="top"
172+
data-bs-content="{{$trans.PayeeComment}}">
173+
C
174+
</button>
175+
{{end}}
176+
</td>
152177
<td class="text-end">{{$trAcc.Balance.StringFixedBank}}</td>
153178
</tr>
154179
{{end}}

0 commit comments

Comments
 (0)