hledger/hledger-web/templates/register.hamlet
Simon Michael 95d33f20f6 imp:web: access control UX cleanups (fix #834)
Changes:

1. rename the sandstorm "manage" permission to "edit"
(old permission names: view, add, manage;
 new permission names: view, add, edit).

Rationale: "edit" best describes this permission's current powers, to users and to operators.
If we ever added more manager-type features we'd want that to be a new permission,
not a rename of the existing one (which would change the powers of existing users).

2. rename the sandstorm roles for consistency with permissions
(old role names: viewer, editor, manager;
 new role names: viewer, adder, editor)

Rationale: it's needed to avoid confusion.

3. add a new option: --allow=view|add|edit|sandstorm (default: add).
'sandstorm' sets permissions according to the X-Sandstorm-Permissions header.
Drop the --capabilities and --capabilities-header options.

Rationale: it's simpler and more intuitive.

4. replace "capability" with "permission" in ui/docs/code.

Rationale: consistent with the above, more familiar.
2023-10-24 13:37:36 +01:00

40 lines
1.5 KiB
Plaintext

<h2>
#{header}
<div .hidden-xs>
^{registerChartHtml qparam balancelabel $ accountTransactionsReportByCommodity items}
<div.table-responsive>
<table .table.table-striped.table-condensed>
<thead>
<tr>
<th style="text-align:left;">
Date
<span .glyphicon.glyphicon-chevron-up>
<th style="text-align:left;">Description
<th style="text-align:left;">To/From Account(s)
<th style="text-align:right; white-space:normal;">Amount Out/In
<th style="text-align:right; white-space:normal;">
#{balancelabel}
<tbody>
$forall (torig, tacct, split, _acct, amt, bal) <- items
<tr ##{tindex torig} title="#{showTransaction torig}" style="vertical-align:top;">
<td .date>
<a href="@?{(JournalR, [("q", T.unwords $ removeInacct qparam)])}##{transactionFrag torig}">
#{show (tdate tacct)}
<td>
#{textElideRight 30 (tdescription tacct)}
<td .account>
$forall (Posting { paccount = acc }, (summName,comma)) <- otherTransAccounts torig
<a href="@?{acctlink acc}##{tindex torig}" title="#{acc}">
#{summName}</a>#{comma}
<td .amount style="text-align:right; white-space:nowrap;">
$if not split || not (mixedAmountLooksZero amt)
^{mixedAmountAsHtml amt}
<td style="text-align:right;">
^{mixedAmountAsHtml bal}
$if elem AddPermission perms
^{addModal AddR j today}